1*4882a593SmuzhiyunOverview 2*4882a593Smuzhiyun-------------- 3*4882a593Smuzhiyun 4*4882a593Smuzhiyunmx35pdk (known als as mx35_3stack) is a development board by Freescale. 5*4882a593SmuzhiyunIt consists of three pluggable board: 6*4882a593Smuzhiyun - CPU module, with CPU, RAM, flash 7*4882a593Smuzhiyun - Personality board, with most interfaces (USB, Network,..) 8*4882a593Smuzhiyun - Debug board with JTAG header. 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunThe board is usually delivered with redboot. This howto explains how to boot 11*4882a593Smuzhiyuna linux kernel and how to replace the original bootloader with U-Boot. 12*4882a593Smuzhiyun 13*4882a593SmuzhiyunThe board is delivered with Redboot on the NAND flash. It is possible to 14*4882a593Smuzhiyunswitch the boot device with the switches SW1-SW2 on the Personality board, 15*4882a593Smuzhiyunand with SW5-SW10 on the Debug board. 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunDelivered Redboot script to start the kernel 18*4882a593Smuzhiyun--------------------------------------------------- 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunIn redboot the following script is stored: 21*4882a593Smuzhiyun 22*4882a593Smuzhiyunfis load kernel 23*4882a593Smuzhiyunexec -c "noinitrd console=ttymxc0,115200 root=/dev/mtdblock8 rw rootfstype=jffs2 ip=dhcp fec_mac=00:04:9F:00:E7:76" 24*4882a593Smuzhiyun 25*4882a593SmuzhiyunKernel is taken from flash. The image is in zImage format. 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunBooting from NET, rootfs on NFS: 28*4882a593Smuzhiyun----------------------------------- 29*4882a593Smuzhiyun 30*4882a593SmuzhiyunTo change the script in redboot: 31*4882a593Smuzhiyun 32*4882a593Smuzhiyunload -r -b 0x100000 <path_to_zImage> 33*4882a593Smuzhiyunexec -c "noinitrd console=ttymxc0,115200 root=/dev/nfsroot rootfstype=nfsroot nfsroot=192.168.1.1:/opt/eldk-4.2-arm/armVFP rw ip=dhcp" 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunIf the ip address is not set, you can set it with : 36*4882a593Smuzhiyun 37*4882a593Smuzhiyunip_address -l <board_ip/netmask> -h <server_ip> 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunLinux partitions: 40*4882a593Smuzhiyun--------------------------- 41*4882a593Smuzhiyun 42*4882a593SmuzhiyunAs default, the board is shipped with these partition tables for NAND 43*4882a593Smuzhiyunand for NOR: 44*4882a593Smuzhiyun 45*4882a593SmuzhiyunCreating 5 MTD partitions on "NAND 2GiB 3,3V 8-bit": 46*4882a593Smuzhiyun0x00000000-0x00100000 : "nand.bootloader" 47*4882a593Smuzhiyun0x00100000-0x00600000 : "nand.kernel" 48*4882a593Smuzhiyun0x00600000-0x06600000 : "nand.rootfs" 49*4882a593Smuzhiyun0x06600000-0x06e00000 : "nand.configure" 50*4882a593Smuzhiyun0x06e00000-0x80000000 : "nand.userfs" 51*4882a593Smuzhiyun 52*4882a593SmuzhiyunCreating 6 MTD partitions on "mxc_nor_flash.0": 53*4882a593Smuzhiyun0x00000000-0x00080000 : "Bootloader" 54*4882a593Smuzhiyun0x00080000-0x00480000 : "nor.Kernel" 55*4882a593Smuzhiyun0x00480000-0x02280000 : "nor.userfs" 56*4882a593Smuzhiyun0x02280000-0x03e80000 : "nor.rootfs" 57*4882a593Smuzhiyun0x01fe0000-0x01fe3000 : "FIS directory" 58*4882a593Smuzhiyun0x01fff000-0x04000000 : "Redboot config" 59*4882a593Smuzhiyun 60*4882a593SmuzhiyunNAND partitions can be recognized enabling in kernel CONFIG_MTD_REDBOOT_PARTS. 61*4882a593SmuzhiyunFor this board, CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK should be set to 2. 62*4882a593Smuzhiyun 63*4882a593SmuzhiyunHowever, the setup in redboot is not correct and does not use the whole flash. 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunBetter solution is to use the kernel parameter mtdparts. 66*4882a593SmuzhiyunHere the resulting script to be defined in RedBoot with fconfig: 67*4882a593Smuzhiyun 68*4882a593Smuzhiyunload -r -b 0x100000 sbabic/mx35pdk/zImage.2.6.37 69*4882a593Smuzhiyunexec -c "noinitrd console=ttymxc0,115200 root=/dev/nfsroot rootfstype=nfsroot nfsroot=192.168.1.1:/opt/eldk-4.2-arm/arm rw ip=dhcp mtdparts=mxc_nand:1m(boot),5m(linux),96m(root),8m(cfg),1938m(user);physmap-flash.0:512k(b),4m(k),30m(u),28m(r)" 70*4882a593Smuzhiyun 71*4882a593SmuzhiyunFlashing U-Boot 72*4882a593Smuzhiyun-------------------------------- 73*4882a593Smuzhiyun 74*4882a593SmuzhiyunU-Boot should be stored on the NOR flash. 75*4882a593Smuzhiyun 76*4882a593SmuzhiyunThe boot storage can be select using the switches on the personality board 77*4882a593Smuzhiyun(SW1-SW2) and on the DEBUG board (SW4-SW10). 78*4882a593Smuzhiyun 79*4882a593SmuzhiyunIf something goes wrong flashing the bootloader, it is always possible to 80*4882a593Smuzhiyunrecover the board booting from the other device. 81*4882a593Smuzhiyun 82*4882a593SmuzhiyunSaving U-Boot in the NOR flash 83*4882a593Smuzhiyun--------------------------------- 84*4882a593Smuzhiyun 85*4882a593SmuzhiyunCheck the partition for boot in the NOR flash. Setting the mtdparts as reported, 86*4882a593Smuzhiyunthe boot partition should be /dev/mtd0. 87*4882a593Smuzhiyun 88*4882a593SmuzhiyunCreating 6 MTD partitions on "mxc_nor_flash.0": 89*4882a593Smuzhiyun0x00000000-0x00080000 : "Bootloader" 90*4882a593Smuzhiyun0x00080000-0x00480000 : "nor.Kernel" 91*4882a593Smuzhiyun0x00480000-0x02280000 : "nor.userfs" 92*4882a593Smuzhiyun0x02280000-0x03e80000 : "nor.rootfs" 93*4882a593Smuzhiyun0x01fe0000-0x01fe3000 : "FIS directory" 94*4882a593Smuzhiyun0x01fff000-0x04000000 : "Redboot config" 95*4882a593Smuzhiyun 96*4882a593SmuzhiyunTo erase the whole partition: 97*4882a593Smuzhiyun$ flash_eraseall /dev/mtd0 98*4882a593Smuzhiyun 99*4882a593SmuzhiyunWriting U-Boot: 100*4882a593Smuzhiyundd if=u-boot.bin of=/dev/mtd0 101*4882a593Smuzhiyun 102*4882a593SmuzhiyunTo boot from NOR, you have to select the switches as follows: 103*4882a593Smuzhiyun 104*4882a593SmuzhiyunPersonality board 105*4882a593Smuzhiyun SW2 all off 106*4882a593Smuzhiyun SW1 all off 107*4882a593Smuzhiyun 108*4882a593SmuzhiyunDebug Board: 109*4882a593Smuzhiyun SW5 0 110*4882a593Smuzhiyun SW6 0 111*4882a593Smuzhiyun SW7 0 112*4882a593Smuzhiyun SW8 1 113*4882a593Smuzhiyun SW9 1 114*4882a593Smuzhiyun SW10 0 115