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 ###############################################################
136 ###############################################################
138 ###############################################################
143 Flash memory device : AM29LV800BB (1Mx8Bit) x 4 device
144 manufacturer id : 01 (AMD)
145 device id : 5B (AM29LV800B)
151 number start addr. size
177 /*------------------------------------------------------------------- */
178 /*------------------------------------------------------------------- */
179 /* SIU (System Interface Unit) */
181 /*------------------------------------------------------------------- */
182 /*------------------------------------------------------------------- */
186 /*### Internal Memory Map Register */
187 /*### Chap. 11.4.1 */
189 ISB = 0xFA20 /* Set the Immap base = 0xFA20 0000 */
195 ---------------------------------------------------------------------
198 /*### SIU Module Configuration Register */
199 /*### Chap. 11.4.2 */
200 /*### Offset : 0x0000 0000 */
213 MLRC = 10 /* ~KR/~RETRY/~IRQ4/SPKROUT functions as ~KR/~TRTRY */
223 ---------------------------------------------------------------------
226 /*### System Protection Control Register */
227 /*### Chap. 11.4.3 */
228 /*### Offset : 0x0000 0004 */
230 SWTC = 0xFFFF /* SW watchdog timer count = 0xFFFF */
231 BMT = 0x06 /* BUS monitoring timing */
232 BME = 1 /* BUS monitor enable */
234 SWE = 0 /* SW watchdog disable */
240 ---------------------------------------------------------------------
243 /*### Transfer Error Status Register */
244 /*### Chap. 11.4.4 */
245 /*### Offset : 0x0000 0020 */
256 ---------------------------------------------------------------------
259 /*### SIU Interrupt Pending Register */
260 /*### Chap. 11.5.4.1 */
261 /*### Offset : 0x0000 0010 */
268 ---------------------------------------------------------------------
271 /*### SIU Interrupt Mask Register */
272 /*### Chap. 11.5.4.2 */
273 /*### Offset : 0x0000 0014 */
275 IRM0~IRM7 = 0 /* Mask all interrupts */
280 ---------------------------------------------------------------------
283 /*### SIU Interrupt Edge/Level Register */
284 /*### Chap. 11.5.4.3 */
285 /*### Offset : 0x0000 0018 */
287 ED0~ED7 = 0 /* Low level triggered */
288 WMn0~WMn7 = 0 /* Not allowed to exit from low-power mode */
292 ---------------------------------------------------------------------
295 /*### SIU Interrupt Vector Register */
296 /*### Chap. 11.5.4.4 */
297 /*### Offset : 0x0000 001C */
299 INTC = 3C /* The lowest interrupt is pending..(?) */
303 ---------------------------------------------------------------------
306 /*### Software Service Register */
307 /*### Chap. 11.7.1 */
308 /*### Offset : 0x0000 001E */
314 ---------------------------------------------------------------------
317 /*### SDMA Configuration Register */
318 /*### Chap. 20.2.1 */
319 /*### Offset : 0x0000 0032 */
322 RAID = 01 /* Priority level 5 (BR5) (normal operation) */
327 /*------------------------------------------------------------------- */
328 /*------------------------------------------------------------------- */
329 /* UPMA (User Programmable Machine A) */
331 /*------------------------------------------------------------------- */
332 /*------------------------------------------------------------------- */
334 /*### Chap. 16.6.4.1 */
335 /*### Offset = 0x0000 017c */
337 T0 = CFFF CC24 /* Single Read */
341 T4 = 3FBF CC27 /* last */
345 T8 = CFFF CC24 /* Burst Read */
349 T12 = 3FBF CC27 /* last */
361 T24 = CFFF CC24 /* Single Write */
365 T28 = 3FFF CC27 /* last */
369 T32 = CFFF CC24 /* Burst Write */
374 T37 = 33FF CC27 /* last */
385 T48 = C0FF CC24 /* Refresh */
389 T52 = 3FFF CC27 /* last */
397 T60 = FFFF CC25 /* Exception */
403 /*------------------------------------------------------------------- */
404 /*------------------------------------------------------------------- */
407 /*------------------------------------------------------------------- */
408 /*------------------------------------------------------------------- */
409 ---------------------------------------------------------------------
411 /*### Chap. 16.6.4.1 */
414 /*------------------------------------------------------------------- */
415 /*------------------------------------------------------------------- */
418 /*------------------------------------------------------------------- */
419 /*------------------------------------------------------------------- */
420 ---------------------------------------------------------------------
423 /*### Base Registers & Option Registers */
424 /*### Chap. 16.4.1 & 16.4.2 */
425 /*### Offset : BR0(0x0000 0100) & OR0(0x0000 0104) */
426 /*### Flash memory */
428 BA = 1111 1110 0000 0000 0 /* Base addr = 0xFE00 0000 */
438 AM = 1111 1110 0000 0000 0 /* 32MBytes */
442 BIH = 1 /* Burst inhibited */
443 SCY = 0100 /* cycle length = 4 */
451 /*### Base Registers & Option Registers */
452 /*### Chap. 16.4.1 & 16.4.2 */
453 /*### Offset : BR1(0x0000 0108) & OR1(0x0000 010C) */
456 BA = 0000 0000 0000 0000 0 /* Base addr = 0x0000 0000 */
466 AM = 1111 1110 0000 0000 /* 32MBytes */
471 SCY = 0000 /* cycle length = 0 */
479 /*### Base Registers & Option Registers */
480 /*### Chap. 16.4.1 & 16.4.2 */
481 /*### Offset : BR2(0x0000 0110) & OR2(0x0000 0114) */
483 BR2 & OR2 = 0x0000 0000 /* Not used */
486 /*### Base Registers & Option Registers */
487 /*### Chap. 16.4.1 & 16.4.2 */
488 /*### Offset : BR3(0x0000 0118) & OR3(0x0000 011C) */
491 BA = 1111 1010 0100 0000 0 /* Base addr = 0xFA40 0000 */
501 AM = 1111 1111 0111 1111 1 /* (?) */
505 BIH = 1 /* Burst inhibited */
506 SCY = 0001 /* cycle length = 1 */
513 /*### Base Registers & Option Registers */
514 /*### Chap. 16.4.1 & 16.4.2 */
515 /*### Offset : BR4(0x0000 0120) & OR4(0x0000 0124) */
516 /*### NVRAM & SRAM */
518 BA = 1111 1010 0000 0000 0 /* Base addr = 0xFA00 0000 */
528 AM = 1111 1111 1111 1000 0 /* 8MByte */
532 BIH = 1 /* Burst inhibited */
533 SCY = 0111 /* cycle length = 7 */
540 /*### Base Registers & Option Registers */
541 /*### Chap. 16.4.1 & 16.4.2 */
542 /*### Offset : BR2(0x0000 0128) & OR2(0x0000 012C) */
544 BR5 & OR5 = 0x0000 0000 /* Not used */
547 /*### Base Registers & Option Registers */
548 /*### Chap. 16.4.1 & 16.4.2 */
549 /*### Offset : BR2(0x0000 0130) & OR2(0x0000 0134) */
551 BR6 & OR6 = 0x0000 0000 /* Not used */
554 /*### Base Registers & Option Registers */
555 /*### Chap. 16.4.1 & 16.4.2 */
556 /*### Offset : BR7(0x0000 0138) & OR7(0x0000 013C) */
558 BR7 & OR7 = 0x0000 0000 /* Not used */
561 /*### Memory Address Register */
562 /*### Chap. 16.4.7 */
563 /*### Offset : 0x0000 0164 */
565 MA = External memory address
568 /*### Memory Command Register */
569 /*### Chap. 16.4.5 */
570 /*### Offset : 0x0000 0168 */
572 OP = xx /* Command op code */
573 UM = 1 /* Select UPMA */
574 MB = 001 /* Select CS1 */
575 MCLF = xxxx /* Loop times */
576 MAD = xx xxxx /* Memory array index */
579 /*### Machine A Mode Register */
580 /*### Chap. 16.4.4 */
581 /*### Offset : 0x0000 0170 */
584 PTAE = 1 /* Periodic timer A enabled */
596 /*### Machine B Mode Register */
597 /*### Chap. 16.4.4 */
598 /*### Offset : 0x0000 0174 */
601 PTAE = 0 /* Periodic timer B disabled */
613 /*### Memory Status Register */
614 /*### Chap. 16.4.3 */
615 /*### Offset : 0x0000 0178 */
617 PER0~PER7 = Parity error
618 WPER = Write protection error
623 /*### Memory Periodic Timer Prescaler Register */
624 /*### Chap. 16.4.8 */
625 /*### Offset : 0x0000 017A */
627 PTP = 0000 1000 /* Divide by 8 */
632 /*### Memory Data Register */
633 /*### Chap. 16.4.6 */
634 /*### Offset : 0x0000 017C */
636 MD = Memory data contains the RAM array word
639 /*------------------------------------------------------------------- */
640 /*------------------------------------------------------------------- */
643 /*------------------------------------------------------------------- */
644 /*------------------------------------------------------------------- */
645 ---------------------------------------------------------------------
648 /*### Timebase Reference Registers */
649 /*### Chap. 11.9.2 */
650 /*### Offset : TBREFF0(0x0000 0204)/TBREFF1(0x0000 0208) */
653 TBREFF0 = 0xFFFF FFFF
654 TBREFF1 = 0xFFFF FFFF
656 ---------------------------------------------------------------------
659 /*### Timebase Status and Control Registers */
660 /*### Chap. 11.9.3 */
661 /*### Offset : 0x0000 0200 */
667 REFE0 = 0 /* Reference interrupt disable */
670 TBE = 1 /* Timebase enable */
674 ---------------------------------------------------------------------
677 /*### Real-Time Clock Status and Control Registers */
678 /*### Chap. 11.10.1 */
679 /*### Offset : 0x0000 0220 */
685 38K = 0 /* PITRTCLK is driven by 32.768KHz */
689 RTE = 1 /* Real-Time clock enabled */
693 ---------------------------------------------------------------------
696 /*### Real-Time Clock Registers */
697 /*### Chap. 11.10.2 */
698 /*### Offset : 0x0000 0224 */
701 RTC = Real time clock measured in second
703 ---------------------------------------------------------------------
706 /*### Real-Time Clock Alarm Registers */
707 /*### Chap. 11.10.3 */
708 /*### Offset : 0x0000 022C */
713 ---------------------------------------------------------------------
716 /*### Real-Time Clock Alarm Second Registers */
717 /*### Chap. 11.10.4 */
718 /*### Offset : 0x0000 0228 */
721 COUNTER = Counter bits(fraction of a second)
723 ---------------------------------------------------------------------
726 /*### Periodic Interrupt Status and Control Register */
727 /*### Chap. 11.11.1 */
728 /*### Offset : 0x0000 0240 */
732 PS = 0 /* Write 1 to clear */
735 PTE = 0 /* PIT disabled */
737 ---------------------------------------------------------------------
740 /*### PIT Count Register */
741 /*### Chap. 11.11.2 */
742 /*### Offset : 0x0000 0244 */
747 ---------------------------------------------------------------------
750 /*### PIT Register */
751 /*### Chap. 11.11.3 */
752 /*### Offset : 0x0000 0248 */
755 PIT = PIT count /* Read only */
759 /*------------------------------------------------------------------- */
760 /*------------------------------------------------------------------- */
763 /*------------------------------------------------------------------- */
764 /*------------------------------------------------------------------- */
765 ---------------------------------------------------------------------
768 ---------------------------------------------------------------------
771 /*### System Clock and Reset Control Register */
772 /*### Chap. 15.6.1 */
773 /*### Offset : 0x0000 0280 */
776 COM = 11 /* Clock output disabled */
777 TBS = 1 /* Timebase frequency source is GCLK2 divided by 16 */
778 RTDIV = 0 /* The clock is divided by 4 */
779 RTSEL = 0 /* OSCM(Crystal oscillator) is selected */
782 EBDF = 00 /* CLKOUT is GCLK2 divided by 1 */
783 DFSYNC = 00 /* Divided by 1 (normal operation) */
784 DFBRG = 00 /* Divided by 1 (normal operation) */
790 ---------------------------------------------------------------------
793 /*### PLL, Low-Power, and Reset Control Register */
794 /*### Chap. 15.6.2 */
795 /*### Offset : 0x0000 0284 */
798 MF = 0x005 /* 48MHz (?) ( = 8MHz * (MF+1) ) */
802 CSRC = 0 /* The general system clock is generated by the DFNH field */
803 LPM = 00 /* Normal high/normal low mode */
810 ---------------------------------------------------------------------
813 /*### Reset Status Register */
815 /*### Offset : 0x0000 0288 */
818 EHRS = External hard reset
819 ESRS = External soft reset
820 LLRS = Loss-of-lock reset
821 SWRS = Software watchdog reset
822 CSRS = Check stop reset
823 DBHRS = Debug port hard reset
824 DBSRS = Debug port soft reset
829 /*------------------------------------------------------------------- */
830 /*------------------------------------------------------------------- */
833 /*------------------------------------------------------------------- */
834 /*------------------------------------------------------------------- */
835 ---------------------------------------------------------------------
838 /*### SDMA Status Register */
839 /*### Chap. 20.2.2 */
840 /*### Offset : 0x0000 0908 */
842 SBER = 0 /* SDMA channel bus error */
843 DSP2 = 0 /* DSP chain2 (Tx) interrupt */
844 DSP1 = 0 /* DSP chain1 (Rx) interrupt */
849 /*### SDMA Mask Register */
850 /*### Chap. 20.2.3 */
851 /*### Offset : 0x0000 090C */
855 DSP1 = 0 /* All interrupts are masked */
860 /*### SDMA Address Register */
861 /*### Chap. 20.2.4 */
862 /*### Offset : 0x0000 0904 */
864 AR = 0xxxxx xxxx /* current system address */
869 /*### IDMA Status Register */
870 /*### Chap. 20.3.3.2 */
871 /*### Offset : IDSR1(0x0000 0910) & IDSR2(0x0000 0918) */
880 /*### IDMA Mask Register */
881 /*### Chap. 20.3.3.3 */
882 /*### Offset : IDMR1(0x0000 0914) & IDMR2(0x0000 091C) */