From 481956d0efc3e99668377d7620202ac875f9ab03 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Fri, 22 Feb 2019 14:57:54 +0900 Subject: [PATCH] config: tizen_rpi: move env values from boot script to tizen_rpi.h Some environment values are used with same value. It can be moved to tizen_rpi header. Change-Id: I679491fc03e0381df94025044e80e476f0953db2 Signed-off-by: Jaehoon Chung --- board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr | 62 ++++++--------------------- board/raspberrypi/rpi/tizen-boot-rpi3.scr | 62 ++++++--------------------- include/samsung/tizen_rpi.h | 31 ++++++++++++++ 3 files changed, 56 insertions(+), 99 deletions(-) diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr index dff417b..b3e6bb0 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr @@ -1,57 +1,19 @@ -# U-boot script for tizen -boardname=rpi3 -mmcbootdev=0 -mmcbootpart=1 -mmcrootdev=0 -mmcrootpart=2 -mmcinformpart=9 - -# -# Tizen kernel image is over than 16MB, it will be overlapped with other address. -# To avoid this behaivor, change to 0x02d00000 from 0x01000000 -# -# NOTE: booti command will move kernel image to 0x80000 (text offset), and -# ramdisk is loaded to $ramdisk_addr_r (0x02100000), so kernel should be equal -# or less than 32.5MB to load ramdisk properly. -# -tizen_kernel_addr_r=0x02d00000 - -dummy=0x24000000 -rebootparamfile=reboot-param.bin -# use the ram address of ramdisk before loading ramdisk image -rebootparam_addr=0x3a62b000 -# 0x72677075 is ascii code for representing string "upgr" -upgrade_val=72677075 -# 0x72766372 is ascii code for representing string "rcvr" -recovery_val=72766372 -# 0x6665646e is ascii code for representing string "ndef" -nodef_val=6665646e -# 0x6c6e7764 is ascii code for representing string "dwnl" -download_val=6c6e7764 - -# Normal ramdisk : partition 7 -# Ramdisk Recovery : Partition 8 -ramdiskpart=7 -ramdisksize=800000 -bootmode=ramdisk - -# Device that included the image. -bootdev=mmc +# U-boot script for tizen RPI3 32B if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; if itest.l *${rebootparam_addr} == ${upgrade_val}; then; - ramdiskpart=8 - ramdisksize=c00000 + setenv ramdiskpart 8 + setenv ramdisksize c00000 bootmode=fota elif itest.l *${rebootparam_addr} == ${recovery_val}; then; - ramdiskpart=8 - ramdisksize=c00000 - bootmode=recovery + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode recovery elif itest.l *${rebootparam_addr} == ${download_val}; then; - ramdiskpart=8 - ramdisksize=c00000 - bootmode=flash + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode flash elif itest.l *${rebootparam_addr} == ${nodef_val}; then; echo "This reboot parameter is not supported..."; fi @@ -59,10 +21,10 @@ fi # boot from ram0 if there is sbin if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then; -rootdev=ram0 + setenv rootdev ram0 else -rootdev=mmcblk${mmcrootdev}p${mmcrootpart} -bootmode=normal + setenv rootdev mmcblk${mmcrootdev}p${mmcrootpart} + setenv bootmode normal fi # setting console device if noting is set diff --git a/board/raspberrypi/rpi/tizen-boot-rpi3.scr b/board/raspberrypi/rpi/tizen-boot-rpi3.scr index c5d73c8..e21fc8e 100644 --- a/board/raspberrypi/rpi/tizen-boot-rpi3.scr +++ b/board/raspberrypi/rpi/tizen-boot-rpi3.scr @@ -1,57 +1,21 @@ -# U-boot script for tizen -boardname=rpi3 -mmcbootdev=0 -mmcbootpart=1 -mmcrootdev=0 -mmcrootpart=2 -mmcinformpart=9 - -# -# Tizen kernel image is over than 16MB, it will be overlapped with other address. -# To avoid this behaivor, change to 0x02d00000 from 0x01000000 -# -# NOTE: booti command will move kernel image to 0x80000 (text offset), and -# ramdisk is loaded to $ramdisk_addr_r (0x02100000), so kernel should be equal -# or less than 32.5MB to load ramdisk properly. -# -tizen_kernel_addr_r=0x02d00000 - -dummy=0x24000000 -rebootparamfile=reboot-param.bin -# use the ram address of ramdisk before loading ramdisk image -rebootparam_addr=0x3a62b000 -# 0x72677075 is ascii code for representing string "upgr" -upgrade_val=72677075 -# 0x72766372 is ascii code for representing string "rcvr" -recovery_val=72766372 -# 0x6665646e is ascii code for representing string "ndef" -nodef_val=6665646e -# 0x6c6e7764 is ascii code for representing string "dwnl" -download_val=6c6e7764 - -# Normal ramdisk : partition 7 -# Ramdisk Recovery : Partition 8 -ramdiskpart=7 -ramdisksize=800000 -bootmode=ramdisk +# U-boot script for tizen RPI3 # Device that included the image. -bootdev=mmc if test -e $bootdev $mmcbootdev:$mmcinformpart $rebootparamfile; then; ext4load $bootdev $mmcbootdev:$mmcinformpart $rebootparam_addr $rebootparamfile; if itest.l *${rebootparam_addr} == ${upgrade_val}; then; - ramdiskpart=8 - ramdisksize=c00000 - bootmode=fota + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode fota elif itest.l *${rebootparam_addr} == ${recovery_val}; then; - ramdiskpart=8 - ramdisksize=c00000 - bootmode=recovery + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode recovery elif itest.l *${rebootparam_addr} == ${download_val}; then; - ramdiskpart=8 - ramdisksize=c00000 - bootmode=flash + setenv ramdiskpart 8 + setenv ramdisksize c00000 + setenv bootmode flash elif itest.l *${rebootparam_addr} == ${nodef_val}; then; echo "This reboot parameter is not supported..."; fi @@ -65,10 +29,10 @@ fi # boot from ram0 if there is sbin if test -e $bootdev $mmcrootdev:$ramdiskpart sbin/init; then; -rootdev=ram0 + setenv rootdev ram0 else -rootdev=mmcblk${mmcrootdev}p${mmcrootpart} -bootmode=normal + setenv rootdev=mmcblk${mmcrootdev}p${mmcrootpart} + setenv bootmode normal fi # setting console device if noting is set diff --git a/include/samsung/tizen_rpi.h b/include/samsung/tizen_rpi.h index 9cf8d28..41a9942 100644 --- a/include/samsung/tizen_rpi.h +++ b/include/samsung/tizen_rpi.h @@ -47,7 +47,38 @@ #define CONFIG_IP_DEFRAG #define CONFIG_NFS_READ_SIZE 65536 +/* +# Tizen kernel image is over than 16MB, it will be overlapped with other address. +# To avoid this behaivor, change to 0x02d00000 from 0x01000000 +# +# NOTE: booti command will move kernel image to 0x80000 (text offset), and +# ramdisk is loaded to $ramdisk_addr_r (0x02100000), so kernel should be equal +# or less than 32.5MB to load ramdisk properly. +*/ +/* +# use the ram address of ramdisk before loading ramdisk image +# 0x72677075 is ascii code for representing string "upgr" +# 0x72766372 is ascii code for representing string "rcvr" +# 0x6665646e is ascii code for representing string "ndef" +# 0x6c6e7764 is ascii code for representing string "dwnl" +*/ #define TIZEN_ENV_SETTING \ + "tizen_kernel_addr_r=0x02d00000\0" \ + "mmcbootdev=0\0" \ + "mmcbootpart=1\0" \ + "mmcrootdev=0\0" \ + "mmcrootpart=2\0" \ + "mmcinformpart=9\0" \ + "rebootparamfile=reboot-param.bin\0" \ + "rebootparam_addr=0x3a62b000\0" \ + "upgrade_val=72677075\0" \ + "recovery_val=72766372\0" \ + "nodef_val=6665646e\0" \ + "download_val=6c6e7764\0" \ + "ramdiskpart=7\0" \ + "ramdisksize=800000\0" \ + "bootmode=ramdisk\0" \ + "bootdev=mmc\0" \ "opts=loglevel=7\0" #endif /* __CONFIG_TIZEN_RPI_H */ -- 2.7.4