Commit d845e3f8 authored by David Mondou's avatar David Mondou
Browse files

Merge branch 'emmc-boot' into 'master'

Emmc boot

See merge request !3
parents f3f62dc9 9dc285d6
......@@ -140,22 +140,25 @@
/*Configure kernel, device tree and rootfs to be used with dgua*/
#ifdef CONFIG_VESTA_100
#define BOARD_TYPE "vesta-100"
#define CONFIG_DEFAULT_FDT_FILE "zImage-vesta-100.dtb"
#define CONFIG_KERNEL_LOCATION "0x210000"
#define CONFIG_FDT_LOCATION "0x200000"
#define CONFIG_ALT_KERNEL_LOCATION "0xa10000"
#define CONFIG_ALT_FDT_LOCATION "0xa00000"
#define CONFIG_ROOT_FS "root=/dev/mmcblk1p2 rootwait rw"
#define CONFIG_ALT_ROOT_FS "root=/dev/mmcblk1p3 rootwait rw"
#define CONFIG_KERNEL_LOCATION "2"
#define CONFIG_FDT_LOCATION "2"
#define CONFIG_ALT_KERNEL_LOCATION "3"
#define CONFIG_ALT_FDT_LOCATION "3"
#define CONFIG_ROOT_FS "root=/dev/mmcblk1p5 rootwait rw"
#define CONFIG_ALT_ROOT_FS "root=/dev/mmcblk1p6 rootwait rw"
#elif CONFIG_VESTA_200
#define BOARD_TYPE "vesta-200"
#define CONFIG_DEFAULT_FDT_FILE "zImage-vesta-200.dtb"
#define CONFIG_KERNEL_LOCATION "0x210000"
#define CONFIG_FDT_LOCATION "0x200000"
#define CONFIG_ALT_KERNEL_LOCATION "0xa10000"
#define CONFIG_ALT_FDT_LOCATION "0xa00000"
#define CONFIG_ROOT_FS "root=/dev/mmcblk1p2 rootwait rw"
#define CONFIG_ALT_ROOT_FS "root=/dev/mmcblk1p3 rootwait rw"
#define CONFIG_KERNEL_LOCATION "2"
#define CONFIG_FDT_LOCATION "2"
#define CONFIG_ALT_KERNEL_LOCATION "3"
#define CONFIG_ALT_FDT_LOCATION "3"
#define CONFIG_ROOT_FS "root=/dev/mmcblk1p5 rootwait rw"
#define CONFIG_ALT_ROOT_FS "root=/dev/mmcblk1p6 rootwait rw"
#elif CONFIG_VESTA_300
#define BOARD_TYPE "vesta-300"
#define CONFIG_DEFAULT_FDT_FILE "zImage-vesta-300.dtb"
#define CONFIG_KERNEL_LOCATION "0x210000"
#define CONFIG_FDT_LOCATION "0x200000"
......@@ -164,6 +167,7 @@
#define CONFIG_ROOT_FS "root=/dev/mmcblk1p2 rootwait rw"
#define CONFIG_ALT_ROOT_FS "root=/dev/mmcblk1p3 rootwait rw"
#elif CONFIG_VESTA_64M_NOR
#define BOARD_TYPE "vesta-nor"
#define CONFIG_DEFAULT_FDT_FILE "zImage-vesta-64M-nor.dtb"
#define CONFIG_KERNEL_LOCATION "0x110000"
#define CONFIG_FDT_LOCATION "0x100000"
......@@ -187,7 +191,7 @@
#define CONFIG_LOADADDR 0x80800000
#define CONFIG_SYS_TEXT_BASE 0x87800000
#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
#define CONFIG_SYS_MMC_IMG_LOAD_PART 2
#ifdef CONFIG_SYS_BOOT_NAND
#define CONFIG_MFG_NAND_PARTITION "mtdparts=gpmi-nand:64m(boot),16m(kernel),16m(dtb),-(rootfs) "
#else
......@@ -245,32 +249,18 @@
"boot_fdt=try\0" \
"ip_dyn=no\0" \
"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
"mmcpart=" CONFIG_KERNEL_LOCATION "\0" \
"mmcautodetect=yes\0" \
"mmcargs=setenv bootargs console=${console},${baudrate} " \
"mmcargs=setenv bootargs console=${console},${baudrate} board_type=${board_type} panic=5" \
CONFIG_BOOTARGS_CMA_SIZE \
"root=${mmcroot}\0" \
"${rootfs}\0" \
"loadbootscript=" \
"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
"bootscript=echo Running bootscript from mmc ...; " \
"source\0" \
"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
"mmcboot=echo Booting from mmc ...; " \
"run mmcargs; " \
"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
"if run loadfdt; then " \
"bootz ${loadaddr} - ${fdt_addr}; " \
"else " \
"if test ${boot_fdt} = try; then " \
"bootz; " \
"else " \
"echo WARN: Cannot load the DT; " \
"fi; " \
"fi; " \
"else " \
"bootz; " \
"fi;\0" \
"mmcboot=echo Booting from mmc ...; run mmcargs; bootz ${loadaddr} - ${fdt_addr};\0" \
"netargs=setenv bootargs console=${console},${baudrate} " \
CONFIG_BOOTARGS_CMA_SIZE \
"root=/dev/nfs " \
......@@ -297,14 +287,8 @@
"bootz; " \
"fi;\0" \
"spiboot=run spi_load; run spi_args; bootz ${loadaddr} - ${fdt_addr};\0" \
"spi_args=setenv bootargs console=${console},${baudrate} ${rootfs} panic=5;\0" \
"spi_args=setenv bootargs console=${console},${baudrate} ${rootfs} board_type=${board_type} panic=5\0" \
"spi_load=sf read ${loadaddr} ${kernel_location} 0x700000; sf read ${fdt_addr} ${fdt_location} 0x10000;\0" \
"boot_counter=sf probe; sf read $loadaddr 0xe0000 1; if itest.b *$loadaddr -eq 0; then run boot_count_good; elif itest.b *$loadaddr -eq 99; then run boot_count_bad; else run boot_count_inc; fi\0" \
"boot_count_inc=if itest.b *$loadaddr -eq 3; then mw.b $loadaddr 99; elif itest.b *$loadaddr -eq 2; then mw.b $loadaddr 3; elif itest.b *$loadaddr -eq 1; then mw.b $loadaddr 2; fi; sf update $loadaddr 0xe0000 1; run boot_count_good\0" \
"boot_count_bad=sf read $loadaddr 0xf0002 2; run boot_chk_kernel; run boot_chk_fs\0" \
"boot_count_good=sf read $loadaddr 0xf0000 2; run boot_chk_kernel; run boot_chk_fs\0" \
"boot_chk_fs=if itest.b *$loadaddr_1 -eq 31; then setenv rootfs ${alt_rootfs}; fi\0" \
"boot_chk_kernel=if itest.b *$loadaddr -eq 31; then setenv fdt_location ${alt_fdt_location}; setenv kernel_location ${alt_kernel_location}; fi\0" \
"loadaddr_1=0x80800001\0" \
"kernel_location="CONFIG_KERNEL_LOCATION"\0" \
"fdt_location="CONFIG_FDT_LOCATION"\0" \
......@@ -312,13 +296,30 @@
"alt_fdt_location="CONFIG_ALT_FDT_LOCATION"\0" \
"rootfs="CONFIG_ROOT_FS"\0" \
"alt_rootfs="CONFIG_ALT_ROOT_FS"\0" \
"board_type="BOARD_TYPE"\0" \
#if defined CONFIG_VESTA_100 || CONFIG_VESTA_200
#define CONFIG_BOOTCOMMAND \
"run boot_counter; run loadimage; run mmcboot;"
"mmc dev 1 1; run boot_counter; run loadimage; run loadfdt; run mmcboot;\0" \
"loadaddr_2=0x80800002\0" \
"loadaddr_3=0x80800003\0" \
"boot_counter=mmc read $loadaddr 0x7fe 1; if itest.b *$loadaddr -eq 0; then run boot_count_good; elif itest.b *$loadaddr -eq 99; then run boot_count_bad; else run boot_count_inc; fi\0" \
"boot_count_inc=if itest.b *$loadaddr -eq 3; then mw.b $loadaddr 99; elif itest.b *$loadaddr -eq 2; then mw.b $loadaddr 3; elif itest.b *$loadaddr -eq 1; then mw.b $loadaddr 2; fi; mmc write $loadaddr 0x7fe 1; run boot_count_good\0" \
"boot_count_bad=mmc read $loadaddr 0x7ff 1; run boot_chk_kernel_prev; run boot_chk_fs_prev\0" \
"boot_count_good=mmc read $loadaddr 0x7ff 1; run boot_chk_kernel; run boot_chk_fs\0" \
"boot_chk_fs=if itest.b *$loadaddr_1 -eq 31; then setenv rootfs ${alt_rootfs}; fi\0" \
"boot_chk_kernel=if itest.b *$loadaddr -eq 31; then setenv mmcpart ${alt_kernel_location}; fi;\0" \
"boot_chk_fs_prev=if itest.b *$loadaddr_2 -eq 31; then setenv rootfs ${alt_rootfs}; fi\0" \
"boot_chk_kernel_prev=if itest.b *loadaddr_3 -eq 31; then setenv mmcpart ${alt_kernel_location}; fi;"
#else
#define CONFIG_BOOTCOMMAND \
"run boot_counter; run spiboot;"
"run boot_counter; run spiboot;\0" \
"boot_counter=sf probe; sf read $loadaddr 0xe0000 1; if itest.b *$loadaddr -eq 0; then run boot_count_good; elif itest.b *$loadaddr -eq 99; then run boot_count_bad; else run boot_count_inc; fi\0" \
"boot_count_inc=if itest.b *$loadaddr -eq 3; then mw.b $loadaddr 99; elif itest.b *$loadaddr -eq 2; then mw.b $loadaddr 3; elif itest.b *$loadaddr -eq 1; then mw.b $loadaddr 2; fi; sf update $loadaddr 0xe0000 1; run boot_count_good\0" \
"boot_count_bad=sf read $loadaddr 0xf0002 2; run boot_chk_kernel; run boot_chk_fs\0" \
"boot_count_good=sf read $loadaddr 0xf0000 2; run boot_chk_kernel; run boot_chk_fs\0" \
"boot_chk_fs=if itest.b *$loadaddr_1 -eq 31; then setenv rootfs ${alt_rootfs}; fi\0" \
"boot_chk_kernel=if itest.b *$loadaddr -eq 31; then setenv fdt_location ${alt_fdt_location}; setenv kernel_location ${alt_kernel_location}; fi;"
#endif
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment