xref: /rk3399_rockchip-uboot/board/davinci/da8xxevm/README.da850 (revision 4aac44be11a44b72a87de2ee751aa1fcd4960fef)
195a372b8STom RiniSummary
295a372b8STom Rini=======
395a372b8STom RiniThe README is for the boot procedure used for various DA850 (or compatible
495a372b8STom Riniparts such as the AM1808) based boards.
595a372b8STom Rini
695a372b8STom RiniIn the context of U-Boot, the board is booted in three stages. The initial
795a372b8STom Rinibootloader which executes upon reset is the ROM Boot Loader (RBL) and sits
895a372b8STom Riniin the internal ROM. The RBL initializes the internal memory and then
995a372b8STom Rinidepending on the exact board and pin configurations will initialize another
1095a372b8STom Rinicontroller (such as SPI or NAND) to continue the boot process by loading
1195a372b8STom Rinithe secondary program loader (SPL).  The SPL will initialize the system
1295a372b8STom Rinifurther (some clocks, SDRAM) and then load the full u-boot from a
1395a372b8STom Rinipredefined location in persistent storage to DDR and jumps to the u-boot
1495a372b8STom Rinientry point.
1595a372b8STom Rini
1695a372b8STom RiniAIS is an image format defined by TI for the images that are to be loaded
1795a372b8STom Rinito memory by the RBL. The image is divided into a series of sections and
1895a372b8STom Rinithe image's entry point is specified. Each section comes with meta data
1995a372b8STom Rinilike the target address the section is to be copied to and the size of the
2095a372b8STom Rinisection, which is used by the RBL to load the image. At the end of the
2195a372b8STom Riniimage the RBL jumps to the image entry point.  The AIS format allows for
2295a372b8STom Riniother things such as programming the clocks and SDRAM if the header is
2395a372b8STom Riniprogrammed for it.  We do not take advantage of this and instead use SPL as
2495a372b8STom Riniit allows for additional flexibility (run-time detect of board revision,
2595a372b8STom Riniloading the next image from a different media, etc).
2695a372b8STom Rini
2795a372b8STom Rini
2895a372b8STom RiniCompilation
2995a372b8STom Rini===========
3095a372b8STom RiniThe exact build target you need will depend on the board you have.  For
3195a372b8STom RiniLogic PD boards, or other boards which store the ethernet MAC address at
3295a372b8STom Rinithe end of SPI flash, run 'make da850evm'.  For boards which store the
3395a372b8STom Riniethernet MAC address in the i2c EEPROM located at 0x50, run
3495a372b8STom Rini'make da850_am18xxevm'.  Once this build completes you will have a
3595a372b8STom Riniu-boot.ais file that needs to be written to the correct persistent
3695a372b8STom Rinistorage.
3795a372b8STom Rini
3895a372b8STom Rini
3995a372b8STom RiniFlashing the images to SPI
4095a372b8STom Rini==========================
4195a372b8STom RiniThe AIS image can be written to SPI flash using the following commands.
4295a372b8STom RiniAssuming that the network is configured and enabled and the u-boot.ais file
4395a372b8STom Riniis tftp'able.
4495a372b8STom Rini
4595a372b8STom RiniU-Boot > sf probe 0
4695a372b8STom RiniU-Boot > sf erase 0 +320000
4795a372b8STom RiniU-Boot > tftp u-boot.ais
4895a372b8STom RiniU-Boot > sf write c0700000 0 $filesize
4995a372b8STom Rini
50*4aac44beSahaslam@baylibre.comFlashing the images to MMC
51*4aac44beSahaslam@baylibre.com==========================
52*4aac44beSahaslam@baylibre.comIf the boot pins are set to boot from mmc, the RBL will try to load the
53*4aac44beSahaslam@baylibre.comnext boot stage form the first couple of sectors of an external mmc card.
54*4aac44beSahaslam@baylibre.comAs sector 0 is usually used for storing the partition information, the
55*4aac44beSahaslam@baylibre.comAIS image should be written at least after the first sector, but before the
56*4aac44beSahaslam@baylibre.comfirst partition begins. (e.g: make sure to leave at least 500KB of unallocated
57*4aac44beSahaslam@baylibre.comspace at the start of the mmc when creating the partitions)
58*4aac44beSahaslam@baylibre.com
59*4aac44beSahaslam@baylibre.comCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is used by SPL, and should
60*4aac44beSahaslam@baylibre.compoint to the sector were the u-boot image is located. (eg. After SPL)
61*4aac44beSahaslam@baylibre.com
62*4aac44beSahaslam@baylibre.comThere are 2 ways to copy the AIS image to the mmc card:
63*4aac44beSahaslam@baylibre.com
64*4aac44beSahaslam@baylibre.com 1 - Using the TI tool "uflash"
65*4aac44beSahaslam@baylibre.com	$ uflash -d /dev/mmcblk0  -b ./u-boot.ais -p OMAPL138  -vv
66*4aac44beSahaslam@baylibre.com
67*4aac44beSahaslam@baylibre.com 2 - using the "dd" command
68*4aac44beSahaslam@baylibre.com	$ dd if=u-boot.ais of=/dev/mmcblk0 seek=117 bs=512 conv=fsync
69*4aac44beSahaslam@baylibre.com
70*4aac44beSahaslam@baylibre.comuflash writes the AIS image at offset 117. For compatibility with uflash,
71*4aac44beSahaslam@baylibre.comCONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR is set to take into account this
72*4aac44beSahaslam@baylibre.comoffset, and the dd command is adjusted accordingly.
7395a372b8STom Rini
7495a372b8STom RiniRecovery
7595a372b8STom Rini========
7695a372b8STom Rini
7795a372b8STom RiniIn the case of a "bricked" board, you need to use the TI tools found
7895a372b8STom Rinihere[1] to write the u-boot.ais file.  An example of recovering to the SPI
7995a372b8STom Riniflash of an AM1808 would be:
8095a372b8STom Rini
8195a372b8STom Rini$ mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 \
8295a372b8STom Rini	-flash_noubl /path/to/u-boot.ais
8395a372b8STom Rini
8495a372b8STom RiniFor other target types and flash locations:
8595a372b8STom Rini
8695a372b8STom Rini$ mono sfh_OMAP-L138.exe -h
8795a372b8STom Rini
8895a372b8STom RiniLinks
8995a372b8STom Rini=====
9095a372b8STom Rini[1]
9195a372b8STom Rini http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L138
92