|
| 1 | +## mem_startclocks: Start clocks on MBA/MCAs (13.6) |
| 2 | + |
| 3 | +> a) p9_mem_startclocks.C (proc chip) |
| 4 | +> - This step is a no-op on cumulus |
| 5 | +> - This step is a no-op if memory is running in synchronous mode since the MCAs are using the nest PLL, HWP detect |
| 6 | +> and exits |
| 7 | +> - Drop fences and tholds on MBA/MCAs to start the functional clocks |
| 8 | +
|
| 9 | +``` |
| 10 | +For each functional Proc: |
| 11 | +pg_vector = bitmap of ATTR_CHIP_UNIT_POS of functional Perv children of Proc, bit numbers come from Perl + XML |
| 12 | + - /src/import/chips/p9/procedures/hwp/perv/p9_sbe_common.C:692 |
| 13 | +> if(!ATTR_MC_SYNC_MODE) |
| 14 | + For each functional MC(BIST?): |
| 15 | + // Call p9_mem_startclocks_cplt_ctrl_action_function for Mc chiplets |
| 16 | + p9_mem_startclocks_cplt_ctrl_action_function(): |
| 17 | + // Drop partial good fences |
| 18 | + TP.TCMC01.MCSLOW.CPLT_CTRL1 (WO_CLEAR) // 0x07000021 |
| 19 | + [all] 0 |
| 20 | + [3] TC_VITL_REGION_FENCE = ~ATTR_PG[3] // TODO: where does ATTR_PG value come from? |
| 21 | + [4-14] TC_REGION{1-3}_FENCE, UNUSED_{8-14}B = ~ATTR_PG[4-14] |
| 22 | + // Reset abistclk_muxsel and syncclk_muxsel |
| 23 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_CLEAR) // 0x07000020 |
| 24 | + [all] 0 |
| 25 | + [0] CTRL_CC_ABSTCLK_MUXSEL_DC = 1 |
| 26 | + [1] TC_UNIT_SYNCCLK_MUXSEL_DC = 1 |
| 27 | +
|
| 28 | + // Call module align chiplets for Mc chiplets |
| 29 | + p9_sbe_common_align_chiplets(): |
| 30 | + // Exit flush |
| 31 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_OR) // 0x07000010 |
| 32 | + [all] 0 |
| 33 | + [2] CTRL_CC_FLUSHMODE_INH_DC = 1 |
| 34 | +
|
| 35 | + // Enable alignement |
| 36 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_OR) // 0x07000010 |
| 37 | + [all] 0 |
| 38 | + [3] CTRL_CC_FORCE_ALIGN_DC = 1 |
| 39 | +
|
| 40 | + // Clear chiplet is aligned |
| 41 | + TP.TCMC01.MCSLOW.SYNC_CONFIG // 0x07030000 |
| 42 | + [7] CLEAR_CHIPLET_IS_ALIGNED = 1 |
| 43 | +
|
| 44 | + // Unset Clear chiplet is aligned |
| 45 | + // No delay, but Hostboot does a second read, doesn't reuse previously written value |
| 46 | + TP.TCMC01.MCSLOW.SYNC_CONFIG // 0x07030000 |
| 47 | + [7] CLEAR_CHIPLET_IS_ALIGNED = 0 |
| 48 | +
|
| 49 | + delay(100us) |
| 50 | +
|
| 51 | + // Line below copied from Hostboot, but it mentions wrong bit |
| 52 | + // Poll OPCG done bit to check for run-N completeness |
| 53 | + timeout(10*100us): |
| 54 | + TP.TCMC01.MCSLOW.CPLT_STAT0 // 0x07000100 |
| 55 | + if (([9] CC_CTRL_CHIPLET_IS_ALIGNED_DC) == 1) break |
| 56 | + delay(100us) |
| 57 | +
|
| 58 | + // Disable alignment |
| 59 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_CLEAR) // 0x07000020 |
| 60 | + [all] 0 |
| 61 | + [3] CTRL_CC_FORCE_ALIGN_DC = 1 |
| 62 | +
|
| 63 | + // Call module clock start stop for MC01, MC23 |
| 64 | + p9_sbe_common_clock_start_stop(l_trgt_chplt, CLOCK_CMD = 1, |
| 65 | + DONT_STARTSLAVE = 0, DONT_STARTMASTER = 0, l_clock_regions, |
| 66 | + CLOCK_TYPES = 0x7): |
| 67 | + // Chiplet exit flush |
| 68 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_OR) // 0x07000010 |
| 69 | + [all] 0 |
| 70 | + [2] CTRL_CC_FLUSHMODE_INH_DC = 1 |
| 71 | +
|
| 72 | + // Clear Scan region type register |
| 73 | + TP.TCMC01.MCSLOW.SCAN_REGION_TYPE // 0x07030005 |
| 74 | + [all] 0 |
| 75 | +
|
| 76 | + // Setup all Clock Domains and Clock Types |
| 77 | + TP.TCMC01.MCSLOW.CLK_REGION // 0x07030006 |
| 78 | + [0-1] CLOCK_CMD = 1 // start |
| 79 | + [2] SLAVE_MODE = 0 |
| 80 | + [3] MASTER_MODE = 0 |
| 81 | + [4-14] CLOCK_REGION_* = ATTR_PG[4-14] |
| 82 | + [48] SEL_THOLD_SL = 1 |
| 83 | + [49] SEL_THOLD_NSL = 1 |
| 84 | + [50] SEL_THOLD_ARY = 1 |
| 85 | +
|
| 86 | + // Poll OPCG done bit to check for completeness |
| 87 | + timeout(10*100us): |
| 88 | + TP.TCMC01.MCSLOW.CPLT_STAT0 // 0x07000100 |
| 89 | + if (([8] CC_CTRL_OPCG_DONE_DC) == 1) break |
| 90 | + delay(100us) |
| 91 | +
|
| 92 | + // Here Hostboot calculates what is expected clock status, based on previous values and requested command. It is done |
| 93 | + // by generic functions, but because we know exactly which clocks were to be started, we can test just for those. |
| 94 | + TP.TCMC01.MCSLOW.CLOCK_STAT_SL // 0x07030008 |
| 95 | + TP.TCMC01.MCSLOW.CLOCK_STAT_NSL // 0x07030009 |
| 96 | + TP.TCMC01.MCSLOW.CLOCK_STAT_ARY // 0x0703000A |
| 97 | + assert(([4-14] & ATTR_PG[4-14]) == ATTR_PG[4-14]) |
| 98 | +
|
| 99 | + // Call p9_mem_startclocks_fence_setup_function for Mc chiplets |
| 100 | + p9_mem_startclocks_fence_setup_function(): |
| 101 | + // Hostboot does it based on pg_vector. I have no idea what exactly pg_vector represents. I also don't know if it is |
| 102 | + // possible to have a functional MCBIST for which we don't want to drop the fence (functional MCBIST with nonfunctional |
| 103 | + // PERV?). In any case, further code tries to configure all functional MCBISTs, so perhaps it is better to drop more |
| 104 | + // fences than necessary than to forget about one. |
| 105 | + > if ((MC.ATTR_CHIP_UNIT_POS == 0x07 && pg_vector[5]) || |
| 106 | + > (MC.ATTR_CHIP_UNIT_POS == 0x08 && pg_vector[3])) |
| 107 | + > { |
| 108 | + // Drop chiplet fence |
| 109 | + TP.TPCHIP.NET.PCBSLMC01.NET_CTRL0 (WAND) // 0x070F0041 |
| 110 | + [all] 1 |
| 111 | + [18] FENCE_EN = 0 |
| 112 | + > } |
| 113 | +
|
| 114 | + // Call p9_mem_startclocks_flushmode for Mc chiplets |
| 115 | + p9_mem_startclocks_flushmode(): |
| 116 | + // Clear flush_inhibit to go in to flush mode |
| 117 | + TP.TCMC01.MCSLOW.CPLT_CTRL0 (WO_CLEAR) // 0x07000020 |
| 118 | + [all] 0 |
| 119 | + [2] CTRL_CC_FLUSHMODE_INH_DC = 1 |
| 120 | +
|
| 121 | + // Call p9_sbe_common_configure_chiplet_FIR for MC chiplets |
| 122 | + p9_sbe_common_configure_chiplet_FIR(): |
| 123 | + // reset pervasive FIR |
| 124 | + TP.TCMC01.MCSLOW.LOCAL_FIR // 0x0704000A |
| 125 | + [all] 0 |
| 126 | +
|
| 127 | + // configure pervasive FIR action/mask |
| 128 | + TP.TCMC01.MCSLOW.LOCAL_FIR_ACTION0 // 0x07040010 |
| 129 | + [all] 0 |
| 130 | + TP.TCMC01.MCSLOW.LOCAL_FIR_ACTION1 // 0x07040011 |
| 131 | + [all] 0 |
| 132 | + [0-3] 0xF |
| 133 | + TP.TCMC01.MCSLOW.LOCAL_FIR_MASK // 0x0704000D |
| 134 | + // 0x0FFFFFFFFFC00000 |
| 135 | + [all] 0 |
| 136 | + [4-41] 0x3FFFFFFFFF |
| 137 | +
|
| 138 | + // reset XFIR |
| 139 | + TP.TCMC01.MCSLOW.XFIR // 0x07040000 |
| 140 | + [all] 0 |
| 141 | +
|
| 142 | + // configure XFIR mask |
| 143 | + TP.TCMC01.MCSLOW.FIR_MASK // 0x07040002 |
| 144 | + [all] 0 |
| 145 | +
|
| 146 | + // Reset FBC chiplet configuration |
| 147 | + TP.TCMC01.MCSLOW.CPLT_CONF0 // 0x07000008 |
| 148 | + [48-51] TC_UNIT_GROUP_ID_DC = ATTR_PROC_FABRIC_GROUP_ID // Where do these come from? |
| 149 | + [52-54] TC_UNIT_CHIP_ID_DC = ATTR_PROC_FABRIC_CHIP_ID |
| 150 | + [56-60] TC_UNIT_SYS_ID_DC = ATTR_PROC_FABRIC_SYSTEM_ID |
| 151 | +
|
| 152 | + // Add to Multicast Group |
| 153 | + // avoid setting if register is already set, i.e. != p9SbeChipletReset::MCGR_CNFG_SETTING_EMPTY |
| 154 | + TP.TPCHIP.NET.PCBSLMC01.MULTICAST_GROUP_1 // 0x070F0001 |
| 155 | + [3-5] MULTICAST1_GROUP: if 7 then set to 0 |
| 156 | + [16-23] (not described): if [3-5] == 7 then set to 0x1C // No clue why Hostboot modifies these bits |
| 157 | + TP.TPCHIP.NET.PCBSLMC01.MULTICAST_GROUP_2 // 0x070F0002 |
| 158 | + [3-5] MULTICAST1_GROUP: if 7 then set to 2 |
| 159 | + [16-23] (not described): if [3-5] == 7 then set to 0x1C |
| 160 | +``` |
0 commit comments