config: tizen_rpi: move env values from boot script to tizen_rpi.h
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 22 Feb 2019 05:57:54 +0000 (14:57 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 28 Oct 2024 11:27:54 +0000 (20:27 +0900)
Some environment values are used with same value.
It can be moved to tizen_rpi header.

Change-Id: I679491fc03e0381df94025044e80e476f0953db2
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
board/raspberrypi/rpi/tizen-boot-rpi3-32b.scr
board/raspberrypi/rpi/tizen-boot-rpi3.scr
include/samsung/tizen_rpi.h [new file with mode: 0644]

index dff417ba833aab158d85a8199fc539167cc120a5..b3e6bb0d2525327e7f6b561468e8c2a87a56e2e5 100644 (file)
@@ -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
index c5d73c820c0d40d0c60a0e077d2003e6ffea2b0a..e21fc8eedfe24bc3164478a44b5fd739f661ef13 100644 (file)
@@ -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
new file mode 100644 (file)
index 0000000..41a9942
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2019 Samsung Electronics
+ *
+ * Configuration settings for the Tizen RPI board.
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#ifndef __CONFIG_TIZEN_RPI_H
+#define __CONFIG_TIZEN_RPI_H
+
+/* SPL */
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_DRIVERS_MISC_SUPPORT
+#define CONFIG_SPL_BOARD_INIT
+#define CONFIG_SPL_TEXT_BASE           0x00008000
+#define CONFIG_SPL_MAX_SIZE            0x00030000
+#define CONFIG_SPL_BSS_START_ADDR      0x00380000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x00040000
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME        "u-boot.img"
+#endif
+
+/* DFU */
+#define CONFIG_DFU_ALT_SYSTEM                  \
+       "Image fat 0 1;"                        \
+       "bcm2710-rpi-3-b.dtb fat 0 1;"          \
+       "bcm2837-rpi-3-b.dtb fat 0 1;"          \
+       "bcm2710-rpi-3-b-plus.dtb fat 0 1;"     \
+       "u-boot.img fat 0 1;"                   \
+       "u-boot.env fat 0 1;"                   \
+       "optee.bin fat 0 1;"                    \
+       "boot.img part 0 1;"                    \
+       "rootfs part 0 2;"                      \
+       "system-data part 0 3;"                 \
+       "user part 0 5;"                        \
+       "module part 0 6;"                      \
+       "ramdisk.img part 0 7;"                 \
+       "ramdisk-recovery part 0 8\0"
+
+#define CONFIG_DFU_ALT_BOOT_EMMC       ""
+#define CONFIG_SET_DFU_ALT_INFO
+#define CONFIG_SET_DFU_ALT_BUF_LEN     (SZ_1K)
+
+/* NFSDOWN */
+#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 */