1*702e6014SWolfgang DenkOverview: 2*702e6014SWolfgang Denk========= 3*702e6014SWolfgang Denk 4*702e6014SWolfgang DenkThe MPC8536E integrates a PowerPC processor core with system logic 5*702e6014SWolfgang Denkrequired for imaging, networking, and communications applications. 6*702e6014SWolfgang Denk 7*702e6014SWolfgang DenkBoot from NAND: 8*702e6014SWolfgang Denk=============== 9*702e6014SWolfgang Denk 10*702e6014SWolfgang DenkThe MPC8536E is capable of booting from NAND flash which uses the image 11*702e6014SWolfgang Denku-boot-nand.bin. This image contains two parts: a first stage image(also 12*702e6014SWolfgang Denkcall 4K NAND loader and a second stage image. The former is appended to 13*702e6014SWolfgang Denkthe latter to produce u-boot-nand.bin. 14*702e6014SWolfgang Denk 15*702e6014SWolfgang DenkThe bootup process can be divided into two stages: the first stage will 16*702e6014SWolfgang Denkconfigure the L2SRAM, then copy the second stage image to L2SRAM and jump 17*702e6014SWolfgang Denkto it. The second stage image is to configure all the hardware and boot up 18*702e6014SWolfgang Denkto U-Boot command line. 19*702e6014SWolfgang Denk 20*702e6014SWolfgang DenkThe 4K NAND loader's code comes from the corresponding nand_spl directory, 21*702e6014SWolfgang Denkalong with the code twisted by CONFIG_NAND_SPL. The macro CONFIG_NAND_SPL 22*702e6014SWolfgang Denkis mainly used to shrink the code size to the 4K size limitation. 23*702e6014SWolfgang Denk 24*702e6014SWolfgang DenkThe macro CONFIG_SYS_RAMBOOT is used to control the code to produce the 25*702e6014SWolfgang Denksecond stage image. It's set in the board config file when boot from NAND 26*702e6014SWolfgang Denkis selected. 27*702e6014SWolfgang Denk 28*702e6014SWolfgang DenkBuild and boot steps 29*702e6014SWolfgang Denk-------------------- 30*702e6014SWolfgang Denk 31*702e6014SWolfgang Denk1. Building image 32*702e6014SWolfgang Denk make MPC8536DS_NAND_config 33*702e6014SWolfgang Denk make CROSS_COMPILE=powerpc-none-linux-gnuspe- all 34*702e6014SWolfgang Denk 35*702e6014SWolfgang Denk2. Change dip-switch 36*702e6014SWolfgang Denk SW2[5-8] = 1011 37*702e6014SWolfgang Denk SW9[1-3] = 101 38*702e6014SWolfgang Denk Note: 1 stands for 'on', 0 stands for 'off' 39*702e6014SWolfgang Denk 40*702e6014SWolfgang Denk3. Flash image 41*702e6014SWolfgang Denk tftp 1000000 u-boot-nand.bin 42*702e6014SWolfgang Denk nand erase 0 a0000 43*702e6014SWolfgang Denk nand write 1000000 0 a0000 44*702e6014SWolfgang Denk 45*702e6014SWolfgang DenkBoot from On-chip ROM: 46*702e6014SWolfgang Denk====================== 47*702e6014SWolfgang Denk 48*702e6014SWolfgang DenkThe MPC8536E is capable of booting from the on-chip ROM - boot from eSDHC 49*702e6014SWolfgang Denkand boot from eSPI. When power on, the porcessor excutes the ROM code to 50*702e6014SWolfgang Denkinitialize the eSPI/eSDHC controller, and loads the mian U-Boot image from 51*702e6014SWolfgang Denkthe memory device that interfaced to the controller, such as the SDCard or 52*702e6014SWolfgang DenkSPI EEPROM, to the target memory, e.g. SDRAM or L2SRAM, then boot from it. 53*702e6014SWolfgang Denk 54*702e6014SWolfgang DenkThe memory device should contain a specific data structure with control word 55*702e6014SWolfgang Denkand config word at the fixed address. The config word direct the process how 56*702e6014SWolfgang Denkto config the memory device, and the control word direct the processor where 57*702e6014SWolfgang Denkto find the image on the memory device, or where copy the main image to. The 58*702e6014SWolfgang Denkuser can use any method to store the data structure to the memory device, only 59*702e6014SWolfgang Denkif store it on the assigned address. 60*702e6014SWolfgang Denk 61*702e6014SWolfgang DenkBuild and boot steps 62*702e6014SWolfgang Denk-------------------- 63*702e6014SWolfgang Denk 64*702e6014SWolfgang DenkFor boot from eSDHC: 65*702e6014SWolfgang Denk1. Build image 66*702e6014SWolfgang Denk make MPC8536DS_SDCARD_config 67*702e6014SWolfgang Denk make CROSS_COMPILE=powerpc-none-linux-gnuspe- all 68*702e6014SWolfgang Denk 69*702e6014SWolfgang Denk2. Change dip-switch 70*702e6014SWolfgang Denk SW2[5-8] = 0111 71*702e6014SWolfgang Denk SW3[1] = 0 72*702e6014SWolfgang Denk SW8[7] = 0 - The on-board SD/MMC slot is active 73*702e6014SWolfgang Denk SW8[7] = 1 - The externel SD/MMC slot is active 74*702e6014SWolfgang Denk 75*702e6014SWolfgang Denk3. Put image to SDCard 76*702e6014SWolfgang Denk Put the follwing info at the assigned address on the SDCard: 77*702e6014SWolfgang Denk 78*702e6014SWolfgang Denk Offset | Data | Description 79*702e6014SWolfgang Denk -------------------------------------------------------- 80*702e6014SWolfgang Denk | 0x40-0x43 | 0x424F4F54 | BOOT signature | 81*702e6014SWolfgang Denk -------------------------------------------------------- 82*702e6014SWolfgang Denk | 0x48-0x4B | 0x00080000 | u-boot.bin's size | 83*702e6014SWolfgang Denk -------------------------------------------------------- 84*702e6014SWolfgang Denk | 0x50-0x53 | 0x???????? | u-boot.bin's Addr on SDCard | 85*702e6014SWolfgang Denk -------------------------------------------------------- 86*702e6014SWolfgang Denk | 0x58-0x5B | 0xF8F80000 | Target Address | 87*702e6014SWolfgang Denk ------------------------------------------------------- 88*702e6014SWolfgang Denk | 0x60-0x63 | 0xF8FFF000 | Execution Starting Address | 89*702e6014SWolfgang Denk -------------------------------------------------------- 90*702e6014SWolfgang Denk | 0x68-0x6B | 0x6 | Number of Config Addr/Data | 91*702e6014SWolfgang Denk -------------------------------------------------------- 92*702e6014SWolfgang Denk | 0x80-0x83 | 0xFF720100 | Config Addr 1 | 93*702e6014SWolfgang Denk | 0x84-0x87 | 0xF8F80000 | Config Data 1 | 94*702e6014SWolfgang Denk -------------------------------------------------------- 95*702e6014SWolfgang Denk | 0x88-0x8b | 0xFF720e44 | Config Addr 2 | 96*702e6014SWolfgang Denk | 0x8c-0x8f | 0x0000000C | Config Data 2 | 97*702e6014SWolfgang Denk -------------------------------------------------------- 98*702e6014SWolfgang Denk | 0x90-0x93 | 0xFF720000 | Config Addr 3 | 99*702e6014SWolfgang Denk | 0x94-0x97 | 0x80010000 | Config Data 3 | 100*702e6014SWolfgang Denk -------------------------------------------------------- 101*702e6014SWolfgang Denk | 0x98-0x9b | 0xFF72e40c | Config Addr 4 | 102*702e6014SWolfgang Denk | 0x9c-0x9f | 0x00000040 | Config Data 4 | 103*702e6014SWolfgang Denk -------------------------------------------------------- 104*702e6014SWolfgang Denk | 0xa0-0xa3 | 0x40000001 | Config Addr 5 | 105*702e6014SWolfgang Denk | 0xa4-0xa7 | 0x00000100 | Config Data 5 | 106*702e6014SWolfgang Denk -------------------------------------------------------- 107*702e6014SWolfgang Denk | 0xa8-0xab | 0x80000001 | Config Addr 6 | 108*702e6014SWolfgang Denk | 0xac-0xaf | 0x80000001 | Config Data 6 | 109*702e6014SWolfgang Denk -------------------------------------------------------- 110*702e6014SWolfgang Denk | ...... | 111*702e6014SWolfgang Denk -------------------------------------------------------- 112*702e6014SWolfgang Denk | 0x???????? | u-boot.bin | 113*702e6014SWolfgang Denk -------------------------------------------------------- 114*702e6014SWolfgang Denk 115*702e6014SWolfgang Denk then insert the SDCard to the active slot to boot up. 116*702e6014SWolfgang Denk 117*702e6014SWolfgang DenkFor boot from eSPI: 118*702e6014SWolfgang Denk1. Build image 119*702e6014SWolfgang Denk make MPC8536DS_SPIFLASH_config 120*702e6014SWolfgang Denk make CROSS_COMPILE=powerpc-none-linux-gnuspe- all 121*702e6014SWolfgang Denk 122*702e6014SWolfgang Denk2. Change dip-switch 123*702e6014SWolfgang Denk SW2[5-8] = 0110 124*702e6014SWolfgang Denk 125*702e6014SWolfgang Denk3. Put image to SPI flash 126*702e6014SWolfgang Denk Put the info in the above table onto the SPI flash, then 127*702e6014SWolfgang Denk boot up. 128