1 /*----------------------------------------------------------------------+
3 * This source code has been made available to you by IBM on an AS-IS
4 * basis. Anyone receiving this source is licensed under IBM
5 * copyrights to use it in any way he or she deems fit, including
6 * copying it, modifying it, compiling it, and redistributing it either
7 * with or without modifications. No license under IBM patents or
8 * patent applications is to be implied by the copyright license.
10 * Any user of this software should understand that IBM cannot provide
11 * technical support for this software and will not be responsible for
12 * any consequences resulting from the use of this software.
14 * Any person who transfers this source code or any derivative work
15 * must include the IBM copyright notice, this paragraph, and the
16 * preceding two paragraphs in the transferred software.
18 * COPYRIGHT I B M CORPORATION 1995
19 * LICENSED MATERIAL - PROGRAM PROPERTY OF I B M
20 *-----------------------------------------------------------------------
27 #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
28 #define FPGA_BRDC 0xF0300004
30 #include <ppc_asm.tmpl>
33 #include <asm/cache.h>
38 /* IIC declarations (This is an extract from 405gp_i2c.h, which also contains some */
39 /* c-code declarations and consequently can't be included here). */
40 /* (Possibly to be solved somehow else). */
41 /*--------------------------------------------------------------------- */
42 #define I2C_REGISTERS_BASE_ADDRESS 0xEF600500
43 #define IIC_MDBUF (I2C_REGISTERS_BASE_ADDRESS+IICMDBUF)
44 #define IIC_SDBUF (I2C_REGISTERS_BASE_ADDRESS+IICSDBUF)
45 #define IIC_LMADR (I2C_REGISTERS_BASE_ADDRESS+IICLMADR)
46 #define IIC_HMADR (I2C_REGISTERS_BASE_ADDRESS+IICHMADR)
47 #define IIC_CNTL (I2C_REGISTERS_BASE_ADDRESS+IICCNTL)
48 #define IIC_MDCNTL (I2C_REGISTERS_BASE_ADDRESS+IICMDCNTL)
49 #define IIC_STS (I2C_REGISTERS_BASE_ADDRESS+IICSTS)
50 #define IIC_EXTSTS (I2C_REGISTERS_BASE_ADDRESS+IICEXTSTS)
51 #define IIC_LSADR (I2C_REGISTERS_BASE_ADDRESS+IICLSADR)
52 #define IIC_HSADR (I2C_REGISTERS_BASE_ADDRESS+IICHSADR)
53 #define IIC_CLKDIV (I2C_REGISTERS_BASE_ADDRESS+IICCLKDIV)
54 #define IIC_INTRMSK (I2C_REGISTERS_BASE_ADDRESS+IICINTRMSK)
55 #define IIC_XFRCNT (I2C_REGISTERS_BASE_ADDRESS+IICXFRCNT)
56 #define IIC_XTCNTLSS (I2C_REGISTERS_BASE_ADDRESS+IICXTCNTLSS)
57 #define IIC_DIRECTCNTL (I2C_REGISTERS_BASE_ADDRESS+IICDIRECTCNTL)
59 /* MDCNTL Register Bit definition */
60 #define IIC_MDCNTL_HSCL 0x01
61 #define IIC_MDCNTL_EUBS 0x02
62 #define IIC_MDCNTL_FMDB 0x40
63 #define IIC_MDCNTL_FSDB 0x80
65 /* CNTL Register Bit definition */
66 #define IIC_CNTL_PT 0x01
67 #define IIC_CNTL_READ 0x02
68 #define IIC_CNTL_CHT 0x04
70 /* STS Register Bit definition */
71 #define IIC_STS_PT 0X01
72 #define IIC_STS_ERR 0X04
73 #define IIC_STS_MDBS 0X20
75 /* EXTSTS Register Bit definition */
76 #define IIC_EXTSTS_XFRA 0X01
77 #define IIC_EXTSTS_ICT 0X02
78 #define IIC_EXTSTS_LA 0X04
80 /* LED codes used for inditing progress and errors during read of DIMM SPD. */
81 /*--------------------------------------------------------------------- */
82 #define LED_SDRAM_CODE_1 0xef
83 #define LED_SDRAM_CODE_2 0xee
84 #define LED_SDRAM_CODE_3 0xed
85 #define LED_SDRAM_CODE_4 0xec
86 #define LED_SDRAM_CODE_5 0xeb
87 #define LED_SDRAM_CODE_6 0xea
88 #define LED_SDRAM_CODE_7 0xe9
89 #define LED_SDRAM_CODE_8 0xe8
90 #define LED_SDRAM_CODE_9 0xe7
91 #define LED_SDRAM_CODE_10 0xe6
92 #define LED_SDRAM_CODE_11 0xe5
93 #define LED_SDRAM_CODE_12 0xe4
94 #define LED_SDRAM_CODE_13 0xe3
95 #define LED_SDRAM_CODE_14 0xe2
96 #define LED_SDRAM_CODE_15 0xe1
97 #define LED_SDRAM_CODE_16 0xe0
100 #define TIMEBASE_10PS (1000000000 / CONFIG_SYS_CLK_FREQ) * 100
102 #define FLASH_8bit_AP 0x9B015480
103 #define FLASH_8bit_CR 0xFFF18000 /* 1MB(min), 8bit, R/W */
105 #define FLASH_32bit_AP 0x9B015480
106 #define FLASH_32bit_CR 0xFFE3C000 /* 2MB, 32bit, R/W */
109 #define WDCR_EBC(reg,val) addi r4,0,reg;\
115 /*---------------------------------------------------------------------
116 * Function: ext_bus_cntlr_init
117 * Description: Initializes the External Bus Controller for the external
118 * peripherals. IMPORTANT: For pass1 this code must run from
119 * cache since you can not reliably change a peripheral banks
120 * timing register (pbxap) while running code from that bank.
121 * For ex., since we are running from ROM on bank 0, we can NOT
122 * execute the code that modifies bank 0 timings from ROM, so
123 * we run it from cache.
124 * Bank 0 - Boot flash
125 * Bank 1-4 - application flash
128 * Bank 7 - Heathrow chip
129 *---------------------------------------------------------------------
131 .globl ext_bus_cntlr_init
133 mflr r4 /* save link register */
136 mflr r3 /* get address of ..getAddr */
137 mtlr r4 /* restore link register */
138 addi r4,0,14 /* set ctr to 10; used to prefetch */
139 mtctr r4 /* 10 cache lines to fit this function */
140 /* in cache (gives us 8x10=80 instrctns) */
142 icbt r0,r3 /* prefetch cache line for addr in r3 */
143 addi r3,r3,32 /* move to next cache line */
144 bdnz ..ebcloop /* continue for 10 cache lines */
146 mflr r31 /* save link register */
148 /*-----------------------------------------------------------
149 * Delay to ensure all accesses to ROM are complete before changing
150 * bank 0 timings. 200usec should be enough.
151 * 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles
152 *-----------------------------------------------------------
156 ori r3,r3,0xA000 /* ensure 200usec have passed since reset */
159 bdnz ..spinlp /* spin loop */
161 /*---------------------------------------------------------------
162 * Memory Bank 0 (Boot Flash) initialization
163 *---------------------------------------------------------------
165 WDCR_EBC(pb0ap, FLASH_32bit_AP)
166 WDCR_EBC(pb0cr, 0xffe38000)
167 /*pnc WDCR_EBC(pb0cr, FLASH_32bit_CR) */
169 /*---------------------------------------------------------------
170 * Memory Bank 5 (CPLD) initialization
171 *---------------------------------------------------------------
173 WDCR_EBC(pb5ap, 0x01010040)
174 /*jsa recommendation: WDCR_EBC(pb5ap, 0x00010040) */
175 WDCR_EBC(pb5cr, 0x10038000)
177 /*--------------------------------------------------------------- */
178 /* Memory Bank 6 (not used) initialization */
179 /*--------------------------------------------------------------- */
180 WDCR_EBC(pb6cr, 0x00000000)
182 /* Read HW ID to determine whether old H2 board or new generic CPU board */
183 addis r3, 0, HW_ID_ADDR@h
184 ori r3, r3, HW_ID_ADDR@l
186 cmpi 0, r3, 1 /* if (HW_ID==1) */
187 beq setup_h2evalboard /* then jump */
188 cmpi 0, r3, 2 /* if (HW_ID==2) */
189 beq setup_genieboard /* then jump */
190 cmpi 0, r3, 3 /* if (HW_ID==3) */
191 beq setup_genieboard /* then jump */
194 /*--------------------------------------------------------------- */
195 /* Memory Bank 1 (Application Flash) initialization for generic CPU board */
196 /*--------------------------------------------------------------- */
197 /* WDCR_EBC(pb1ap, 0x7b015480) /###* T.B.M. */
198 /* WDCR_EBC(pb1ap, 0x7F8FFE80) /###* T.B.M. */
199 WDCR_EBC(pb1ap, 0x9b015480) /* hlb-20020207: burst 8 bit 6 cycles */
201 /* WDCR_EBC(pb1cr, 0x20098000) /###* 16 MB */
202 WDCR_EBC(pb1cr, 0x200B8000) /* 32 MB */
204 /*--------------------------------------------------------------- */
205 /* Memory Bank 4 (Onboard FPGA) initialization for generic CPU board */
206 /*--------------------------------------------------------------- */
207 WDCR_EBC(pb4ap, 0x01010000) /* */
208 WDCR_EBC(pb4cr, 0x1021c000) /* */
210 /*--------------------------------------------------------------- */
211 /* Memory Bank 7 (Heathrow chip on Reference board) initialization */
212 /*--------------------------------------------------------------- */
213 WDCR_EBC(pb7ap, 0x200ffe80) /* No Ready, many wait states (let reflections die out) */
214 WDCR_EBC(pb7cr, 0X4001A000)
220 /*--------------------------------------------------------------- */
221 /* Memory Bank 1 (Application Flash) initialization */
222 /*--------------------------------------------------------------- */
223 WDCR_EBC(pb1ap, 0x7b015480) /* T.B.M. */
224 /*3010 WDCR_EBC(pb1ap, 0x7F8FFE80) /###* T.B.M. */
225 WDCR_EBC(pb1cr, 0x20058000)
227 /*--------------------------------------------------------------- */
228 /* Memory Bank 2 (Application Flash) initialization */
229 /*--------------------------------------------------------------- */
230 WDCR_EBC(pb2ap, 0x7b015480) /* T.B.M. */
231 /*3010 WDCR_EBC(pb2ap, 0x7F8FFE80) /###* T.B.M. */
232 WDCR_EBC(pb2cr, 0x20458000)
234 /*--------------------------------------------------------------- */
235 /* Memory Bank 3 (Application Flash) initialization */
236 /*--------------------------------------------------------------- */
237 WDCR_EBC(pb3ap, 0x7b015480) /* T.B.M. */
238 /*3010 WDCR_EBC(pb3ap, 0x7F8FFE80) /###* T.B.M. */
239 WDCR_EBC(pb3cr, 0x20858000)
241 /*--------------------------------------------------------------- */
242 /* Memory Bank 4 (Application Flash) initialization */
243 /*--------------------------------------------------------------- */
244 WDCR_EBC(pb4ap, 0x7b015480) /* T.B.M. */
245 /*3010 WDCR_EBC(pb4ap, 0x7F8FFE80) /###* T.B.M. */
246 WDCR_EBC(pb4cr, 0x20C58000)
248 /*--------------------------------------------------------------- */
249 /* Memory Bank 7 (Heathrow chip) initialization */
250 /*--------------------------------------------------------------- */
251 WDCR_EBC(pb7ap, 0x02000280) /* No Ready, 4 wait states */
252 WDCR_EBC(pb7cr, 0X4001A000)
257 mtlr r31 /* restore lr */
258 nop /* pass2 DCR errata #8 */
261 /*--------------------------------------------------------------------- */
262 /* Function: sdram_init */
263 /* Description: Configures SDRAM memory banks. */
264 /*--------------------------------------------------------------------- */
268 #if CFG_MONITOR_BASE < CFG_FLASH_BASE
273 /* output SDRAM code on LEDs */
274 addi r4, 0, LED_SDRAM_CODE_1
280 /* Read contents of spd */
281 /*--------------------- */
284 /*----------------------------------------------------------- */
287 /* Update SDRAM timing register */
290 /*----------------------------------------------------------- */
292 /* Read PLL feedback divider and calculate clock period of local bus in */
293 /* granularity of 10 ps. Save clock period in r30 */
294 /*-------------------------------------------------------------- */
299 addis r5, 0, TIMEBASE_10PS@h
300 ori r5, r5, TIMEBASE_10PS@l
305 bl find_casl /* Returns CASL in r3 */
307 /* Calc trp_clocks = (trp * 100 + (clk - 1)) / clk */
308 /* (trp read from byte 27 in granularity of 1 ns) */
309 /*------------------------------------------------ */
316 /* Calc trcd_clocks = (trcd * 100 + (clk - 1) ) / clk */
317 /* (trcd read from byte 29 in granularity of 1 ns) */
318 /*--------------------------------------------------- */
325 /* Calc tras_clocks = (tras * 100 + (clk - 1) ) / clk */
326 /* (tras read from byte 30 in granularity of 1 ns) */
327 /*--------------------------------------------------- */
334 /* Calc trc_clocks = trp_clocks + tras_clocks */
335 /*------------------------------------------- */
343 /* PTA = trp_clocks - 1 */
344 /*--------------------- */
351 /* CTP = trc_clocks - trp_clocks - trcd_clocks - 1 */
352 /*------------------------------------------------ */
366 /* RFTA = trc_clocks - 4 */
367 /*---------------------- */
374 /* RCD = trcd_clocks - 1 */
375 /*---------------------- */
380 /*----------------------------------------------------------- */
382 /*----------------------------------------------------------- */
387 /*----------------------------------------------------------- */
390 /* Update memory bank 0-3 configuration registers */
393 /*----------------------------------------------------------- */
395 /* Build contents of configuration register for bank 0 into r6 */
396 /*------------------------------------------------------------ */
397 bl find_mode /* returns addressing mode in r3 */
398 addi r29, r3, 0 /* save mode temporarily in r29 */
399 bl find_size_code /* returns size code in r3 */
400 addi r9, 0, 17 /* bit offset of size code in configuration register */
402 addi r9, 0, 13 /* bit offset of addressing mode in configuration register */
403 slw r29, r29, r9 /* */
404 or r3, r29, r3 /* merge size code and addressing mode */
405 ori r6, r3, CFG_SDRAM_BASE + 1 /* insert base address and enable bank */
407 /* Calculate banksize r15 = (density << 22) / 2 */
408 /*--------------------------------------------- */
412 /* Set SDRAM bank 0 register and adjust r6 for next bank */
413 /*------------------------------------------------------ */
418 add r6, r6, r15 /* add bank size to base address for next bank */
420 /* If two rows/banks then set SDRAM bank 1 register and adjust r6 for next bank */
421 /*---------------------------------------------------------------------------- */
429 add r6, r6, r15 /* add bank size to base address for next bank */
431 /* Set SDRAM bank 2 register and adjust r6 for next bank */
432 /*------------------------------------------------------ */
433 b1skip: addi r7,0,mem_mb2cf
437 add r6, r6, r15 /* add bank size to base address for next bank */
439 /* If two rows/banks then set SDRAM bank 3 register */
440 /*------------------------------------------------ */
449 /*----------------------------------------------------------- */
451 /*----------------------------------------------------------- */
454 addis r7, 0, 0x05F0 /* RTR value for 100Mhz */
456 rtr_1: addis r7, 0, 0x03F8
457 rtr_2: addi r4,0,mem_rtr
461 /*----------------------------------------------------------- */
462 /* Delay to ensure 200usec have elapsed since reset. Assume worst */
463 /* case that the core is running 200Mhz: */
464 /* 200,000,000 (cycles/sec) X .000200 (sec) = 0x9C40 cycles */
465 /*----------------------------------------------------------- */
467 ori r3,r3,0xA000 /* ensure 200usec have passed since reset */
470 bdnz ..spinlp2 /* spin loop */
472 /*----------------------------------------------------------- */
473 /* Set memory controller options reg, MCOPT1. */
474 /* Set DC_EN to '1' and BRD_PRF to '01' for 16 byte PLB Burst */
476 /*----------------------------------------------------------- */
479 addis r4,0,0x80C0 /* set DC_EN=1 */
484 /*----------------------------------------------------------- */
485 /* Delay to ensure 10msec have elapsed since reset. This is */
486 /* required for the MPC952 to stabalize. Assume worst */
487 /* case that the core is running 200Mhz: */
488 /* 200,000,000 (cycles/sec) X .010 (sec) = 0x1E8480 cycles */
489 /* This delay should occur before accessing SDRAM. */
490 /*----------------------------------------------------------- */
492 ori r3,r3,0x8480 /* ensure 10msec have passed since reset */
495 bdnz ..spinlp3 /* spin loop */
497 /* output SDRAM code on LEDs */
498 addi r4, 0, LED_SDRAM_CODE_16
504 mtlr r31 /* restore lr */
507 /*--------------------------------------------------------------------- */
508 /* Function: read_spd */
509 /* Description: Reads contents of SPD and saves parameters to be used for */
510 /* configuration in dedicated registers (see code below). */
511 /*--------------------------------------------------------------------- */
513 #define WRITE_I2C(reg,val) \
515 addis r4, 0, 0xef60;\
516 ori r4, r4, 0x0500 + reg;\
520 #define READ_I2C(reg) \
521 addis r3, 0, 0xef60;\
522 ori r3, r3, 0x0500 + reg;\
532 WRITE_I2C(IICLMADR, 0x00) /* clear lo master address */
533 WRITE_I2C(IICHMADR, 0x00) /* clear hi master address */
534 WRITE_I2C(IICLSADR, 0x00) /* clear lo slave address */
535 WRITE_I2C(IICHSADR, 0x00) /* clear hi slave address */
536 WRITE_I2C(IICSTS, 0x08) /* update status register */
537 WRITE_I2C(IICEXTSTS, 0x8f)
538 WRITE_I2C(IICCLKDIV, 0x05)
539 WRITE_I2C(IICINTRMSK, 0x00) /* no interrupts */
540 WRITE_I2C(IICXFRCNT, 0x00) /* clear transfer count */
541 WRITE_I2C(IICXTCNTLSS, 0xf0) /* clear extended control & stat */
542 WRITE_I2C(IICMDCNTL, IIC_MDCNTL_FSDB | IIC_MDCNTL_FMDB) /* mode control */
544 ori r3, r3, IIC_MDCNTL_EUBS | IIC_MDCNTL_HSCL
545 WRITE_I2C(IICMDCNTL, r3) /* mode control */
546 WRITE_I2C(IICCNTL, 0x00) /* clear control reg */
548 /* Wait until initialization completed */
549 /*------------------------------------ */
550 bl wait_i2c_transfer_done
552 WRITE_I2C(IICHMADR, 0x00) /* 7-bit addressing */
553 WRITE_I2C(IICLMADR, SDRAM_SPD_WRITE_ADDRESS)
555 /* Write 0 into buffer(start address) */
556 /*----------------------------------- */
557 WRITE_I2C(IICMDBUF, 0x00);
566 /* Issue write command */
567 /*-------------------- */
568 WRITE_I2C(IICCNTL, IIC_CNTL_PT)
569 bl wait_i2c_transfer_done
573 addi r7, 0, 0 /* byte counter in r7 */
574 addi r8, 0, 0 /* checksum in r8 */
576 /* issue read command */
577 /*------------------- */
580 WRITE_I2C(IICCNTL, IIC_CNTL_READ | IIC_CNTL_PT)
582 rd01: WRITE_I2C(IICCNTL, IIC_CNTL_READ | IIC_CNTL_CHT | IIC_CNTL_PT)
583 rd02: bl wait_i2c_transfer_done
585 /* Fetch byte from buffer */
586 /*----------------------- */
589 /* Retrieve parameters that are going to be used during configuration. */
590 /* Save them in dedicated registers. */
591 /*------------------------------------------------------------ */
592 cmpi 0, r7, 3 /* Save byte 3 in r10 */
595 rd10: cmpi 0, r7, 4 /* Save byte 4 in r11 */
598 rd11: cmpi 0, r7, 5 /* Save byte 5 in r12 */
601 rd12: cmpi 0, r7, 17 /* Save byte 17 in r13 */
604 rd13: cmpi 0, r7, 18 /* Save byte 18 in r14 */
607 rd14: cmpi 0, r7, 31 /* Save byte 31 in r15 */
610 rd15: cmpi 0, r7, 27 /* Save byte 27 in r16 */
613 rd16: cmpi 0, r7, 29 /* Save byte 29 in r17 */
616 rd17: cmpi 0, r7, 30 /* Save byte 30 in r18 */
619 rd18: cmpi 0, r7, 9 /* Save byte 9 in r19 */
622 rd19: cmpi 0, r7, 23 /* Save byte 23 in r20 */
625 rd20: cmpi 0, r7, 25 /* Save byte 25 in r21 */
630 /* Calculate checksum of the first 63 bytes */
631 /*----------------------------------------- */
638 /* Verify checksum at byte 63 */
639 /*--------------------------- */
640 rd30: andi. r8, r8, 0xff /* use only 8 bits */
643 addi r4, 0, LED_SDRAM_CODE_8
652 /* Increment byte counter and check whether all bytes have been read. */
653 /*------------------------------------------------------------------- */
659 mtlr r5 /* restore lr */
662 wait_i2c_transfer_done:
664 wt01: READ_I2C(IICSTS)
665 andi. r4, r3, IIC_STS_PT
666 cmpi 0, r4, IIC_STS_PT
668 mtlr r6 /* restore lr */
671 /*--------------------------------------------------------------------- */
672 /* Function: find_mode */
673 /* Description: Determines addressing mode to be used dependent on */
674 /* number of rows (r10 = byte 3 from SPD), number of columns (r11 = */
675 /* byte 4 from SPD) and number of banks (r13 = byte 17 from SPD). */
676 /* mode is returned in r3. */
677 /* (It would be nicer having a table, pnc). */
678 /*--------------------------------------------------------------------- */
692 fm01: cmpi 0, r10, 11
701 fm02: cmpi 0, r10, 12
710 fm03: cmpi 0, r10, 12
719 fm04: cmpi 0, r10, 13
728 fm05: cmpi 0, r10, 13
737 fm06: cmpi 0, r10, 13
746 fm07: cmpi 0, r10, 12
755 fm08: cmpi 0, r10, 12
764 fm09: cmpi 0, r10, 11
773 fm10: cmpi 0, r10, 11
782 fm11: cmpi 0, r10, 13
791 fm12: cmpi 0, r10, 13
800 fm13: cmpi 0, r10, 13
809 fm14: cmpi 0, r10, 13
819 /* not found, error code to be issued on LEDs */
820 addi r7, 0, LED_SDRAM_CODE_2
827 fmfound:addi r6, 0, 1
830 mtlr r5 /* restore lr */
833 /*--------------------------------------------------------------------- */
834 /* Function: find_size_code */
835 /* Description: Determines size code to be used in configuring SDRAM controller */
836 /* dependent on density (r15 = byte 31 from SPD) */
837 /*--------------------------------------------------------------------- */
842 addi r3, r15, 0 /* density */
844 fs01: andi. r6, r3, 0x01
855 /* not found, error code to be issued on LEDs */
856 fs02: addi r4, 0, LED_SDRAM_CODE_3
869 mtlr r5 /* restore lr */
872 /*--------------------------------------------------------------------- */
873 /* Function: find_casl */
874 /* Description: Determines CAS latency */
875 /*--------------------------------------------------------------------- */
880 andi. r14, r14, 0x7f /* r14 holds supported CAS latencies */
881 addi r3, 0, 0xff /* preset determined CASL */
882 addi r4, 0, 6 /* Start at bit 6 of supported CAS latencies */
883 addi r2, 0, 0 /* Start finding highest CAS latency */
885 fc01: srw r6, r14, r4 /* */
886 andi. r6, r6, 0x01 /* */
887 cmpi 0, r6, 1 /* Check bit for current latency */
888 bne fc06 /* If not supported, go to next */
890 cmpi 0, r2, 2 /* Check if third-highest latency */
891 bge fc04 /* If so, go calculate with another format */
893 cmpi 0, r2, 0 /* Check if highest latency */
895 addi r7, r19, 0 /* SDRAM cycle time for highest CAS latenty */
899 addi r7, r20, 0 /* SDRAM cycle time for next-highest CAS latenty */
914 addi r7, r21, 0 /* SDRAM cycle time for third-highest CAS latenty */
928 fc05: addi r2, r2, 1 /* next latency */
938 mtlr r5 /* restore lr */
943 /* Peripheral Bank 1 Access Parameters */
944 /* 0 BME = 1 ; burstmode enabled */
945 /* " 1:8" TWT=00110110 ;Transfer wait (details below) */
946 /* 1:5 FWT=00110 ; first wait = 6 cycles */
947 /* 6:8 BWT=110 ; burst wait = 6 cycles */
948 /* 9:11 000 ; reserved */
949 /* 12:13 CSN=00 ; chip select on timing = 0 */
950 /* 14:15 OEN=01 ; output enable */
951 /* 16:17 WBN=01 ; write byte enable on timing 1 cycle */
952 /* 18:19 WBF=01 ; write byte enable off timing 1 cycle */
953 /* 20:22 TH=010 ; transfer hold = 2 cycles */
954 /* 23 RE=0 ; ready enable = disabled */
955 /* 24 SOR=1 ; sample on ready = same PerClk */
956 /* 25 BEM=0 ; byte enable mode = only for write cycles */
957 /* 26 PEN=0 ; parity enable = disable */
958 /* 27:31 00000 ;reserved */
960 /* 1 + 00110 + 110 + 000 + 00 + 01 + 01 + 01 + 010 + 0 + 1 + 0 + 0 + 00000 = 0x9b015480 */
963 /* Code for BDI probe: */
965 /* WDCR 18 0x00000011 ;Select PB1AP */
966 /* WDCR 19 0x1b015480 ;PB1AP: Flash */
968 /* Peripheral Bank 0 Access Parameters */
969 /* 0:11 BAS=0x200 ; base address select = 0x200 * 0x100000 (1MB) = */
970 /* 12:14 BS=100 ; bank size = 16MB (100) / 32MB (101) */
971 /* 15:16 BU=11 ; bank usage = read/write */
972 /* 17:18 BW=00 ; bus width = 8-bit */
973 /* 19:31 ; reserved */
975 /* 0x200 + 100 + 11 + 00 + 0 0000 0000 0000 = 0x20098000 */
976 /* WDCR 18 0x00000001 ;Select PB1CR */
977 /* WDCR 19 0x20098000 ;PB1CR: 1MB at 0x00100000, r/w, 8bit */
980 /* 0 + 00000 + 010 + 000 + 00 + 01 + 00 + 00 + 000 + 0 + 0 + 1 + 0 + 00000 */
981 /* WDCR_EBC(pb5ap, 0x01010040) */
982 /*jsa recommendation: WDCR_EBC(pb5ap, 0x00010040) */
983 /* WDCR_EBC(pb5cr, 0X10018000) */
986 /* 0x100 + 001 + 11 + 00 + 0 0000 0000 0000 = 0x10038000 */
987 /* Address : 0x10000000 */
989 /* Usage: read/write */
992 /* For Genie onboard fpga 32 bit interface */
993 /* 0 1 0 1 0 0 0 0 */
994 /* 0 + 00000 + 010 + 000 + 00 + 01 + 00 + 00 + 000 + 0 + 0 + 0 + 0 + 00000 */
998 /* 0x102 + 000 + 11 + 10 + 0 0000 0000 0000 = 0x1021c000 */
999 /* Address : 0x10200000 */
1001 /* Usage: read/write */
1004 /* Walnut fpga pb7ap */
1005 /* 0 1 8 1 5 2 8 0 */
1006 /* 0 + 00000 + 011 + 000 + 00 + 01 + 01 + 01 + 001 + 0 + 1 + 0 + 0 + 00000 */
1007 /* Walnut fpga pb7cr */