1 # Porting U-Boot onto RPXlite board
2 # Written by Yoo. Jonghoon
3 # E-Mail : yooth@ipone.co.kr
9 # Cross-compile tools : Montavista Hardhat
10 # Debugging tools : Windriver VisionProbe (PowerPC BDM)
11 # ppcboot ver. : ppcboot-0.8.1
13 ###############################################################
15 ###############################################################
17 1.1. Board, BDM settings
18 Install board, BDM, connect each other
20 1.2. Save Register value
21 Boot with board-on monitor program and save the
22 register values with BDM.
24 1.3. Configure flash programmer
25 Check flash memory area in the memory map.
26 0xFFC00000 - 0xFFFFFFFF
28 Boot monitor program is at
31 You can program on-board flash memory with VisionClick
32 flash programmer. Set the target flash device as:
36 (?) The flash memory device in the board *is* 29LV800B,
37 but I cannot program it with '29LV800B' option.
38 (in VisionClick flash programming tools)
41 1.4. Save boot monitor program *IMPORTANT*
42 Upload boot monitor program from board to file.
43 boot monitor program starts at 0xFFF00000
45 1.5. Test flash memory programming
46 Try to erase boot program in the flash memory,
48 *WARNING* YOU MUST SAVE BOOT PROGRAM TO FILE
51 ###############################################################
53 ###############################################################
55 2.1. Download U-Boot tarball at
57 (The latest version is ppcboot-0.8.1.tar.bz2)
59 To extract the archive use the following syntax :
60 > bzip2 -cd ppcboot-0.8.1.tar.bz2 | tar xf -
62 2.2. Add the following lines in '.profile'
63 export PATH=$PATH:/opt/hardhat/devkit/ppc/8xx/bin
65 2.3. Make board specific config, for example:
69 Now we can build ppcboot bin files.
70 After make all, you must see these files in your
71 ppcboot root directory.
78 2.4. Make your own board directory into the
80 and make your board-specific files here.
82 For exmanple, tqm8xx files are composed of
84 Makefile : To make config file
85 config.mk : Sets base address
86 flash.c : Flash memory control files
87 ppcboot.lds : linker(ld) script? (I don't know this yet)
88 tqm8xx.c : DRAM control and board check routines
90 And, add your board config lines in the
91 ppcboot-0.8.1/Makefile
93 Finally, add config_(your board).h file in the
94 ppcboot-0.8.1/include/
96 I've made board/rpxlite directory, and just copied
97 tqm8xx settings for now.
99 Rebuild ppcboot for rpxlite board:
100 > make rpxlite_config
103 ###############################################################
105 ###############################################################
107 3.1. My RPXlite files are based on tqm8xx board files.
109 > cp -r tqm8xx RPXLITE
111 > mv tqm8xx.c RPXLITE.c
113 > cp config_tqm8xx.h config_RPXLITE.h
115 3.2. Modified files are:
116 board/RPXLITE/RPXLITE.c /* DRAM-related routines */
117 board/RPXLITE/flash.c /* flash-related routines */
118 board/RPXLITE/config.mk /* set text base address */
119 cpu/mpc8xx/serial.c /* board specific register setting */
120 include/config_RPXLITE.h /* board specific registers */
122 See 'reg_config.txt' for register values in detail.
124 ###############################################################
126 ###############################################################
129 ###############################################################
131 ###############################################################
136 Flash memory device : AM29LV800BB (1Mx8Bit) x 4 device
137 manufacturer id : 01 (AMD)
138 device id : 5B (AM29LV800B)
144 number start addr. size
170 /*------------------------------------------------------------------- */
171 /*------------------------------------------------------------------- */
172 /* SIU (System Interface Unit) */
174 /*------------------------------------------------------------------- */
175 /*------------------------------------------------------------------- */
179 /*### Internal Memory Map Register */
180 /*### Chap. 11.4.1 */
182 ISB = 0xFA20 /* Set the Immap base = 0xFA20 0000 */
188 ---------------------------------------------------------------------
191 /*### SIU Module Configuration Register */
192 /*### Chap. 11.4.2 */
193 /*### Offset : 0x0000 0000 */
206 MLRC = 10 /* ~KR/~RETRY/~IRQ4/SPKROUT functions as ~KR/~TRTRY */
216 ---------------------------------------------------------------------
219 /*### System Protection Control Register */
220 /*### Chap. 11.4.3 */
221 /*### Offset : 0x0000 0004 */
223 SWTC = 0xFFFF /* SW watchdog timer count = 0xFFFF */
224 BMT = 0x06 /* BUS monitoring timing */
225 BME = 1 /* BUS monitor enable */
227 SWE = 0 /* SW watchdog disable */
233 ---------------------------------------------------------------------
236 /*### Transfer Error Status Register */
237 /*### Chap. 11.4.4 */
238 /*### Offset : 0x0000 0020 */
249 ---------------------------------------------------------------------
252 /*### SIU Interrupt Pending Register */
253 /*### Chap. 11.5.4.1 */
254 /*### Offset : 0x0000 0010 */
261 ---------------------------------------------------------------------
264 /*### SIU Interrupt Mask Register */
265 /*### Chap. 11.5.4.2 */
266 /*### Offset : 0x0000 0014 */
268 IRM0~IRM7 = 0 /* Mask all interrupts */
273 ---------------------------------------------------------------------
276 /*### SIU Interrupt Edge/Level Register */
277 /*### Chap. 11.5.4.3 */
278 /*### Offset : 0x0000 0018 */
280 ED0~ED7 = 0 /* Low level triggered */
281 WMn0~WMn7 = 0 /* Not allowed to exit from low-power mode */
285 ---------------------------------------------------------------------
288 /*### SIU Interrupt Vector Register */
289 /*### Chap. 11.5.4.4 */
290 /*### Offset : 0x0000 001C */
292 INTC = 3C /* The lowest interrupt is pending..(?) */
296 ---------------------------------------------------------------------
299 /*### Software Service Register */
300 /*### Chap. 11.7.1 */
301 /*### Offset : 0x0000 001E */
307 ---------------------------------------------------------------------
310 /*### SDMA Configuration Register */
311 /*### Chap. 20.2.1 */
312 /*### Offset : 0x0000 0032 */
315 RAID = 01 /* Priority level 5 (BR5) (normal operation) */
320 /*------------------------------------------------------------------- */
321 /*------------------------------------------------------------------- */
322 /* UPMA (User Programmable Machine A) */
324 /*------------------------------------------------------------------- */
325 /*------------------------------------------------------------------- */
327 /*### Chap. 16.6.4.1 */
328 /*### Offset = 0x0000 017c */
330 T0 = CFFF CC24 /* Single Read */
334 T4 = 3FBF CC27 /* last */
338 T8 = CFFF CC24 /* Burst Read */
342 T12 = 3FBF CC27 /* last */
354 T24 = CFFF CC24 /* Single Write */
358 T28 = 3FFF CC27 /* last */
362 T32 = CFFF CC24 /* Burst Write */
367 T37 = 33FF CC27 /* last */
378 T48 = C0FF CC24 /* Refresh */
382 T52 = 3FFF CC27 /* last */
390 T60 = FFFF CC25 /* Exception */
396 /*------------------------------------------------------------------- */
397 /*------------------------------------------------------------------- */
400 /*------------------------------------------------------------------- */
401 /*------------------------------------------------------------------- */
402 ---------------------------------------------------------------------
404 /*### Chap. 16.6.4.1 */
407 /*------------------------------------------------------------------- */
408 /*------------------------------------------------------------------- */
411 /*------------------------------------------------------------------- */
412 /*------------------------------------------------------------------- */
413 ---------------------------------------------------------------------
416 /*### Base Registers & Option Registers */
417 /*### Chap. 16.4.1 & 16.4.2 */
418 /*### Offset : BR0(0x0000 0100) & OR0(0x0000 0104) */
419 /*### Flash memory */
421 BA = 1111 1110 0000 0000 0 /* Base addr = 0xFE00 0000 */
431 AM = 1111 1110 0000 0000 0 /* 32MBytes */
435 BIH = 1 /* Burst inhibited */
436 SCY = 0100 /* cycle length = 4 */
444 /*### Base Registers & Option Registers */
445 /*### Chap. 16.4.1 & 16.4.2 */
446 /*### Offset : BR1(0x0000 0108) & OR1(0x0000 010C) */
449 BA = 0000 0000 0000 0000 0 /* Base addr = 0x0000 0000 */
459 AM = 1111 1110 0000 0000 /* 32MBytes */
464 SCY = 0000 /* cycle length = 0 */
472 /*### Base Registers & Option Registers */
473 /*### Chap. 16.4.1 & 16.4.2 */
474 /*### Offset : BR2(0x0000 0110) & OR2(0x0000 0114) */
476 BR2 & OR2 = 0x0000 0000 /* Not used */
479 /*### Base Registers & Option Registers */
480 /*### Chap. 16.4.1 & 16.4.2 */
481 /*### Offset : BR3(0x0000 0118) & OR3(0x0000 011C) */
484 BA = 1111 1010 0100 0000 0 /* Base addr = 0xFA40 0000 */
494 AM = 1111 1111 0111 1111 1 /* (?) */
498 BIH = 1 /* Burst inhibited */
499 SCY = 0001 /* cycle length = 1 */
506 /*### Base Registers & Option Registers */
507 /*### Chap. 16.4.1 & 16.4.2 */
508 /*### Offset : BR4(0x0000 0120) & OR4(0x0000 0124) */
509 /*### NVRAM & SRAM */
511 BA = 1111 1010 0000 0000 0 /* Base addr = 0xFA00 0000 */
521 AM = 1111 1111 1111 1000 0 /* 8MByte */
525 BIH = 1 /* Burst inhibited */
526 SCY = 0111 /* cycle length = 7 */
533 /*### Base Registers & Option Registers */
534 /*### Chap. 16.4.1 & 16.4.2 */
535 /*### Offset : BR2(0x0000 0128) & OR2(0x0000 012C) */
537 BR5 & OR5 = 0x0000 0000 /* Not used */
540 /*### Base Registers & Option Registers */
541 /*### Chap. 16.4.1 & 16.4.2 */
542 /*### Offset : BR2(0x0000 0130) & OR2(0x0000 0134) */
544 BR6 & OR6 = 0x0000 0000 /* Not used */
547 /*### Base Registers & Option Registers */
548 /*### Chap. 16.4.1 & 16.4.2 */
549 /*### Offset : BR7(0x0000 0138) & OR7(0x0000 013C) */
551 BR7 & OR7 = 0x0000 0000 /* Not used */
554 /*### Memory Address Register */
555 /*### Chap. 16.4.7 */
556 /*### Offset : 0x0000 0164 */
558 MA = External memory address
561 /*### Memory Command Register */
562 /*### Chap. 16.4.5 */
563 /*### Offset : 0x0000 0168 */
565 OP = xx /* Command op code */
566 UM = 1 /* Select UPMA */
567 MB = 001 /* Select CS1 */
568 MCLF = xxxx /* Loop times */
569 MAD = xx xxxx /* Memory array index */
572 /*### Machine A Mode Register */
573 /*### Chap. 16.4.4 */
574 /*### Offset : 0x0000 0170 */
577 PTAE = 1 /* Periodic timer A enabled */
589 /*### Machine B Mode Register */
590 /*### Chap. 16.4.4 */
591 /*### Offset : 0x0000 0174 */
594 PTAE = 0 /* Periodic timer B disabled */
606 /*### Memory Status Register */
607 /*### Chap. 16.4.3 */
608 /*### Offset : 0x0000 0178 */
610 PER0~PER7 = Parity error
611 WPER = Write protection error
616 /*### Memory Periodic Timer Prescaler Register */
617 /*### Chap. 16.4.8 */
618 /*### Offset : 0x0000 017A */
620 PTP = 0000 1000 /* Divide by 8 */
625 /*### Memory Data Register */
626 /*### Chap. 16.4.6 */
627 /*### Offset : 0x0000 017C */
629 MD = Memory data contains the RAM array word
632 /*------------------------------------------------------------------- */
633 /*------------------------------------------------------------------- */
636 /*------------------------------------------------------------------- */
637 /*------------------------------------------------------------------- */
638 ---------------------------------------------------------------------
641 /*### Timebase Reference Registers */
642 /*### Chap. 11.9.2 */
643 /*### Offset : TBREFF0(0x0000 0204)/TBREFF1(0x0000 0208) */
646 TBREFF0 = 0xFFFF FFFF
647 TBREFF1 = 0xFFFF FFFF
649 ---------------------------------------------------------------------
652 /*### Timebase Status and Control Registers */
653 /*### Chap. 11.9.3 */
654 /*### Offset : 0x0000 0200 */
660 REFE0 = 0 /* Reference interrupt disable */
663 TBE = 1 /* Timebase enable */
667 ---------------------------------------------------------------------
670 /*### Real-Time Clock Status and Control Registers */
671 /*### Chap. 11.10.1 */
672 /*### Offset : 0x0000 0220 */
678 38K = 0 /* PITRTCLK is driven by 32.768KHz */
682 RTE = 1 /* Real-Time clock enabled */
686 ---------------------------------------------------------------------
689 /*### Real-Time Clock Registers */
690 /*### Chap. 11.10.2 */
691 /*### Offset : 0x0000 0224 */
694 RTC = Real time clock measured in second
696 ---------------------------------------------------------------------
699 /*### Real-Time Clock Alarm Registers */
700 /*### Chap. 11.10.3 */
701 /*### Offset : 0x0000 022C */
706 ---------------------------------------------------------------------
709 /*### Real-Time Clock Alarm Second Registers */
710 /*### Chap. 11.10.4 */
711 /*### Offset : 0x0000 0228 */
714 COUNTER = Counter bits(fraction of a second)
716 ---------------------------------------------------------------------
719 /*### Periodic Interrupt Status and Control Register */
720 /*### Chap. 11.11.1 */
721 /*### Offset : 0x0000 0240 */
725 PS = 0 /* Write 1 to clear */
728 PTE = 0 /* PIT disabled */
730 ---------------------------------------------------------------------
733 /*### PIT Count Register */
734 /*### Chap. 11.11.2 */
735 /*### Offset : 0x0000 0244 */
740 ---------------------------------------------------------------------
743 /*### PIT Register */
744 /*### Chap. 11.11.3 */
745 /*### Offset : 0x0000 0248 */
748 PIT = PIT count /* Read only */
751 /*------------------------------------------------------------------- */
752 /*------------------------------------------------------------------- */
755 /*------------------------------------------------------------------- */
756 /*------------------------------------------------------------------- */
757 ---------------------------------------------------------------------
760 ---------------------------------------------------------------------
763 /*### System Clock and Reset Control Register */
764 /*### Chap. 15.6.1 */
765 /*### Offset : 0x0000 0280 */
768 COM = 11 /* Clock output disabled */
769 TBS = 1 /* Timebase frequency source is GCLK2 divided by 16 */
770 RTDIV = 0 /* The clock is divided by 4 */
771 RTSEL = 0 /* OSCM(Crystal oscillator) is selected */
774 EBDF = 00 /* CLKOUT is GCLK2 divided by 1 */
775 DFSYNC = 00 /* Divided by 1 (normal operation) */
776 DFBRG = 00 /* Divided by 1 (normal operation) */
782 ---------------------------------------------------------------------
785 /*### PLL, Low-Power, and Reset Control Register */
786 /*### Chap. 15.6.2 */
787 /*### Offset : 0x0000 0284 */
790 MF = 0x005 /* 48MHz (?) ( = 8MHz * (MF+1) ) */
794 CSRC = 0 /* The general system clock is generated by the DFNH field */
795 LPM = 00 /* Normal high/normal low mode */
802 ---------------------------------------------------------------------
805 /*### Reset Status Register */
807 /*### Offset : 0x0000 0288 */
810 EHRS = External hard reset
811 ESRS = External soft reset
812 LLRS = Loss-of-lock reset
813 SWRS = Software watchdog reset
814 CSRS = Check stop reset
815 DBHRS = Debug port hard reset
816 DBSRS = Debug port soft reset
820 /*------------------------------------------------------------------- */
821 /*------------------------------------------------------------------- */
824 /*------------------------------------------------------------------- */
825 /*------------------------------------------------------------------- */
826 ---------------------------------------------------------------------
829 /*### SDMA Status Register */
830 /*### Chap. 20.2.2 */
831 /*### Offset : 0x0000 0908 */
833 SBER = 0 /* SDMA channel bus error */
834 DSP2 = 0 /* DSP chain2 (Tx) interrupt */
835 DSP1 = 0 /* DSP chain1 (Rx) interrupt */
840 /*### SDMA Mask Register */
841 /*### Chap. 20.2.3 */
842 /*### Offset : 0x0000 090C */
846 DSP1 = 0 /* All interrupts are masked */
851 /*### SDMA Address Register */
852 /*### Chap. 20.2.4 */
853 /*### Offset : 0x0000 0904 */
855 AR = 0xxxxx xxxx /* current system address */
860 /*### IDMA Status Register */
861 /*### Chap. 20.3.3.2 */
862 /*### Offset : IDSR1(0x0000 0910) & IDSR2(0x0000 0918) */
871 /*### IDMA Mask Register */
872 /*### Chap. 20.3.3.3 */
873 /*### Offset : IDMR1(0x0000 0914) & IDMR2(0x0000 091C) */