summaryrefslogtreecommitdiffstats
path: root/src/lib/gpe_pba_pgas.pS
blob: 346234d0d08089d34f6d31adcbd4d366743b1c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// $Id: gpe_pba_pgas.pS,v 1.1.1.1 2013/12/11 20:49:20 bcbrock Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/lib/gpe_pba_pgas.pS,v $
//-----------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2013
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//-----------------------------------------------------------------------------
        
/// \file gpe_pba.pS
/// \brief PBA subroutines for PORE-GPE procedures

        .nolist
#include "ssx.h"
#include "pgas.h"
#include "pgp_config.h"
#include "gpe.h"
#include "gpe_pba.h"
        .list

        .oci

        .text.pore

        // Reset a PBA slave from a GpePbaParms structure.  A setup sequence
        // looks like
        //
        //     gpe_pba_reset
        //     gpe_pba_setup
        //
        // The subroutine gpe_pba_reset can also be called by itself to insure
        // that all write data has been flushed to mainstore.  
        //
        // Note that any PORE program that reads or writes Centaur will need
        // to execute its code from SRAM since it is not possible to set up
        // the slave for reading from Centaur while executing from main memory.
        //
        // Slave reset for PBA is a complex issue, especially in cases like
        // this where the entity requesting the reset may be executing from
        // main memory - i.e., continuing to read from the slave being
        // reset.  To work around potential issues the code that polls for
        // reset is PowerBus cache-line aligned, and we re-hit the reset
        // button each time we get an unsuccessful poll for the reset being
        // done.  This should guarantee that the slave will go to reset
        // status as soon as any PowerBus blockages (if any) clear.  For
        // details see HW228485.
        //
        // At entry :   
        //
        // A0 :  The (constant) address of the GpePbaParms structure
        //
        // Clobbered:   
        //
        // D0 :  scratched
        // D1 :  scratched
        // A1 :  Holds PBA_SLVRST

        .global gpe_pba_reset

        .balign 128
gpe_pba_reset:  
        la      A1, PBA_SLVRST
        ld      D0, GPEPBAPARMS_SLVRST, A0
        std     D0, 0, A1

        ld      D0, GPEPBAPARMS_SLVRST_IN_PROGRESS, A0
        ld      D1, 0, A1
        and     D0, D0, D1
        branz   D0, gpe_pba_reset
        
        ret

        .epilogue gpe_pba_reset
        

        // Set up a PBA slave from a GpePbaParms structure.  A setup sequence
        // looks like
        //
        //     gpe_pba_reset
        //     gpe_pba_setup
        //
        // At entry :   
        //
        // A0 :  The (constant) address of the GpePbaParms structure
        //
        // Clobbered:   
        //
        // D0 :  scratch
        // A1 :  Holds PBA_SLVCTL address for the indicated slave


        .global gpe_pba_setup
gpe_pba_setup:  
        
        // Write the new SLVCTL value under MASK
        
        ld      D0, GPEPBAPARMS_SLVCTL_ADDRESS, A0
        mr      A1, D0

        ld      D0, 0, A1
        ld      D1, GPEPBAPARMS_MASK, A0
        and     D0, D0, D1

        ld      D1, GPEPBAPARMS_SLVCTL, A0
        or      D0, D0, D1
        
        std     D0, 0, A1

        ret

        .epilogue gpe_pba_setup
OpenPOWER on IntegriCloud