Browse Source

at91: add uboot environments

add uboot environments to sdcard image

Signed-off-by: Sandeep Sheriker M <[email protected]>
Sandeep Sheriker M 6 years ago
parent
commit
575950e376
2 changed files with 24 additions and 1 deletions
  1. 10 1
      target/linux/at91/image/sama5.mk
  2. 14 0
      target/linux/at91/image/uboot-env.txt

+ 10 - 1
target/linux/at91/image/sama5.mk

@@ -27,6 +27,15 @@ define Build/at91-sdcard
           $(BIN_DIR)/at91bootstrap-$(DEVICE_NAME:at91-%=%)sd_uboot/at91bootstrap.bin \
           ::BOOT.bin)
 
+  $(CP) uboot-env.txt [email protected]
+  sed -i '2d;3d' [email protected]
+  sed -i '2i board='"$(DEVICE_NAME:at91-%=%)"'' [email protected]
+  sed -i '3i board_name='"$(DEVICE_NAME:at91-%=%)"'' [email protected]
+
+  mkenvimage -s 0x4000 -o [email protected] [email protected]
+
+  mcopy -i [email protected] [email protected] ::uboot.env
+
   ./gen_at91_sdcard_img.sh \
       [email protected] \
       [email protected] \
@@ -36,7 +45,7 @@ define Build/at91-sdcard
 
   gzip -nc9 [email protected] > $@
 
-  rm -f [email protected] [email protected] )
+  rm -f [email protected] [email protected] [email protected] [email protected])
 endef
 
 define Device/at91-sama5d2_xplained

+ 14 - 0
target/linux/at91/image/uboot-env.txt

@@ -0,0 +1,14 @@
+/* Do Not remove First 2 lines, Makefile will modify these lines with proper board names */
+board=at91sam9x25ek
+board_name=at91sam9x25ek
+bootargs=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4
+bootargsd2=console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p2 rw rootwait rootfstype=ext4
+bootargsxx=console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4
+bootcmd=run setbootargs; run fatload_mmc; bootm 0x21000000
+bootdelay=1
+fatload_mmc=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then fatload mmc 1:1 0x21000000 ${board_name}-fit.itb; else fatload mmc 0:1 0x21000000 ${board_name}-fit.itb; fi
+setbootargs=if test ${board_name} = sama5d2_xplained || test ${board_name} = sama5d27_som1_ek; then setenv bootargs ${bootargsd2}; else setenv bootargs ${bootargsxx}; fi
+ethact=gmac0
+stderr=serial
+stdin=serial
+stdout=serial