5 #include <ppc_asm.tmpl>
11 #include <galileo/gt64260R.h>
14 /* Galileo specific asm code for initializing ECC */
15 .globl board_relocate_rom
18 /* update the location of the GT registers */
19 lis r11, CONFIG_SYS_GT_REGS@h
20 /* if we're using ECC, we must use the DMA engine to copy ourselves */
21 bl start_idma_transfer_0
31 /* NOTE: r10 still contains the location we've been relocated to
32 * which happens to be TOP_OF_RAM - CONFIG_SYS_MONITOR_LEN */
34 /* now that we're running from ram, init the rest of main memory
36 lis r8, CONFIG_SYS_MONITOR_LEN@h
37 ori r8, r8, CONFIG_SYS_MONITOR_LEN@l
41 /* set up the counter, and init the starting address */
45 /* bytes per transfer */
50 bl start_idma_transfer_0
65 start_idma_transfer_0:
66 /* set the byte count, including the OWN bit */
68 ori r6, r6, CHANNEL0_DMA_BYTE_COUNT
71 /* set the source address */
73 ori r6, r6, CHANNEL0_DMA_SOURCE_ADDRESS
76 /* set the dest address */
78 ori r6, r6, CHANNEL0_DMA_DESTINATION_ADDRESS
81 /* set the next record pointer */
84 ori r6, r6, CHANNEL0NEXT_RECORD_POINTER
87 /* set the low control register */
88 /* bit 9 is NON chained mode, bit 31 is new style descriptors.
89 bit 12 is channel enable */
90 ori r5, r5, (1 << 12) | (1 << 12) | (1 << 11)
91 /* 15 shifted by 16 (oris) == bit 31 */
92 oris r5, r5, (1 << 15)
94 ori r6, r6, CHANNEL0CONTROL
99 /* this waits for the bytecount to return to zero, indicating
100 * that the trasfer is complete */
105 ori r5, r5, CHANNEL0_DMA_BYTE_COUNT
112 /* this turns off channel 0 of the idma engine */
114 /* shut off the DMA engine */
117 ori r6, r6, CHANNEL0CONTROL
123 #ifdef CONFIG_SYS_BOARD_ASM_INIT
124 /* NOTE: trashes r3-r7 */
125 .globl board_asm_init
127 /* just move the GT registers to where they belong */
128 lis r3, CONFIG_SYS_DFL_GT_REGS@h
129 ori r3, r3, CONFIG_SYS_DFL_GT_REGS@l
130 lis r4, CONFIG_SYS_GT_REGS@h
131 ori r4, r4, CONFIG_SYS_GT_REGS@l
132 li r5, INTERNAL_SPACE_DECODE
134 /* test to see if we've already moved */
137 rlwinm r7, r4, 12, 16, 31
141 /* nope, have to move the registers */
143 andis. r6, r6, 0xffff
147 /* now, poll for the change */
156 /* For use of the debug LEDs */