Skip to contentSkip to conversation

spl:falcon:trats Update Trats default board configuration file to support FALCON MODE

PATCH New Lukasz Majewski 2 participants 4 messages Dec 6, 2012 – Jan 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl:falcon:trats Update Trats default board configuration file to support FALCON MODE

Support for a new command (defined at envs) - spl_export generates the ATAGS image necessary for fast boot. Afterwards, it is stored at ext4 partition.

Generated image format:
CRC [4B] SIZE [4B] PAYLOAD(ATAGS/DT) [SIZE]

Remarks:
- CRC is calculated only for PAYLOAD
- SIZE is the size of PAYLOAD

It is important to adjust ${splsize} when large image is generated. It is defined as hex, since ext4 related commands expect it.

The ${spladdr} environment variable corresponds to CONFIG_SYS_SPL_ARGS_ADDR

Additionally definitions for DFU have been refactored and support for EFI has been added as well.

---
 board/samsung/trats/trats.c |    2 +-
 include/configs/trats.h     |   45 +++++++++++++++++++++++++++++++++---------
 2 files changed, 36 insertions(+), 11 deletions(-)
board/samsung/trats/trats.c +1 -1
index e540190..4738043 100644
@@ -66,7 +66,7 @@ struct s3c_plat_otg_data s5pc210_otg_data;
 
 int board_init(void)
 {
-	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+	gd->bd->bi_boot_params = CONFIG_SYS_SPL_ARGS_ADDR;
 
 	check_hw_revision();
 	printf("HW Revision:\t0x%x\n", board_rev);
include/configs/trats.h +35 -10

93 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 spl:falcon:trats Update Trats default board configuration file to support FALCON MODE

Hi Minkyu,

Quoted 11 lines

Support for a new command (defined at envs) - spl_export generates the ATAGS image necessary for fast boot. Afterwards, it is stored at ext4 partition.

Generated image format:
CRC [4B] SIZE [4B] PAYLOAD(ATAGS/DT) [SIZE]

Remarks:
- CRC is calculated only for PAYLOAD
- SIZE is the size of PAYLOAD

Quoted 9 lines

It is important to adjust ${splsize} when large image is generated. It is defined as hex, since ext4 related commands expect it.

The ${spladdr} environment variable corresponds to CONFIG_SYS_SPL_ARGS_ADDR

Additionally definitions for DFU have been refactored and support for EFI has been added as well.

Could this patch be added to u-boot-samsung tree? It brings many updates for trats configuration and it would be nice to bring it to 2013.01 u-boot release.

Quoted 130 lines
---
 board/samsung/trats/trats.c |    2 +-
 include/configs/trats.h     |   45

+++++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 11 deletions(-)

board/samsung/trats/trats.c +1 -1
index e540190..4738043 100644
@@ -66,7 +66,7 @@ struct s3c_plat_otg_data s5pc210_otg_data;
 
 int board_init(void)
 {
-	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+	gd->bd->bi_boot_params = CONFIG_SYS_SPL_ARGS_ADDR;
 
 	check_hw_revision();
 	printf("HW Revision:\t0x%x\n", board_rev);
include/configs/trats.h +5 -5
index 355029e..52fe77d 100644
@@ -98,6 +98,7 @@
 #undef CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_DFU
+#define CONFIG_CMD_SETEXPR
 
 /* FAT */
 #define CONFIG_CMD_FAT
@@ -123,9 +124,8 @@
 #define CONFIG_ENV_COMMON_BOOT		"${console} ${meminfo}"
 
 #define CONFIG_DFU_ALT \
-	"dfu_alt_info=" \
 	"u-boot mmc 80 400;" \
-	"uImage fat 0 2\0" \
+	"uImage ext4 0 2\0" \
 
 #define CONFIG_ENV_OVERWRITE
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
@@ -144,20 +144,20 @@
 		"mmc read 0 0x42100000 0x80 0x200; run
 updatebackup\0" \ "lpj=lpj=3981312\0" \
 	"nfsboot=" \
-		"set bootargs root=/dev/nfs rw " \
+		"setenv bootargs root=/dev/nfs rw " \
 		"nfsroot=${nfsroot},nolock,tcp " \
 		"ip=${ipaddr}:${serverip}:${gatewayip}:" \
 		"${netmask}:generic:usb0:off "
 CONFIG_ENV_COMMON_BOOT \ "; run bootk\0" \
 	"ramfsboot=" \
-		"set bootargs root=/dev/ram0 rw rootfstype=ext2 " \
+		"setenv bootargs root=/dev/ram0 rw rootfstype=ext2 "
 \ "${console} ${meminfo} " \
 		"initrd=0x43000000,8M ramdisk=8192\0" \
 	"mmcboot=" \
-		"set bootargs
 root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
+		"setenv bootargs

root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ "run loaduimage; bootm 0x40007FC0\0" \

include/configs/trats.h +1 -1
-	"bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
+	"bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0"

\ "boottrace=setenv opts initcall_debug; run bootcmd\0" \
"mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000
0x400\0" \ "verify=n\0" \

include/configs/trats.h +13 -3
@@ -166,12 +166,30 @@
 	"meminfo=crashkernel=32M at 0x50000000\0" \
 	"nfsroot=/nfsroot/arm\0" \
 	"bootblock=" CONFIG_BOOTBLOCK "\0" \
-	"loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x40007FC0
 uImage\0" \
+	"loaduimage=ext4load mmc ${mmcdev}:${mmcbootpart} 0x40007FC0
 uImage\0" \ "mmcdev=0\0" \
 	"mmcbootpart=2\0" \
-	"mmcrootpart=3\0" \
+	"mmcrootpart=5\0" \
 	"opts=always_resume=1\0" \
-	CONFIG_DFU_ALT
+	"dfu_alt_info=" CONFIG_DFU_ALT \
+	"spladdr=0x40000100\0" \
+	"splsize=0x200\0" \
+	"splfile=falcon.bin\0" \
+	"spl_export=" \
+		   "setexpr spl_imgsize ${splsize} + 8 ;" \
+		   "setexpr spl_imgaddr ${spladdr} - 8 ;" \
+		   "setexpr spl_addr_tmp ${spladdr} - 4 ;" \
+		   "mw.b ${spl_imgaddr} 0x00 ${spl_imgsize};run
 loaduimage;" \
+		   "setenv bootargs
 root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
+		   "${lpj} rootwait ${console} ${meminfo} ${opts}

${lcdinfo};" \

include/configs/trats.h +8 -0
+		   "spl export atags 0x40007FC0;" \
+		   "crc32 ${spladdr} ${splsize} ${spl_imgaddr};" \
+		   "mw.l ${spl_addr_tmp} ${splsize};" \
+		   "ext4write mmc ${mmcdev}:${mmcbootpart}" \
+		   " /${splfile} ${spl_imgaddr} ${spl_imgsize};" \
+		   "setenv spl_imgsize;" \
+		   "setenv spl_imgaddr;" \
+		   "setenv spl_addr_tmp;\0"
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP		/* undef to save memory */
@@ -207,11 +225,18 @@
 #define CONFIG_ENV_OFFSET		((32 - 4) << 10) /* 32KiB -

4KiB */
#define CONFIG_DOS_PARTITION

include/configs/trats.h +8 -0
+#define CONFIG_EFI_PARTITION
+
+/* EXT4 */
+#define CONFIG_CMD_EXT4
+#define CONFIG_CMD_EXT4_WRITE
+/* Falcon mode definitions */
+#define CONFIG_CMD_SPL
+#define CONFIG_SYS_SPL_ARGS_ADDR        PHYS_SDRAM_1 + 0x100
 
 #define CONFIG_SYS_INIT_SP_ADDR	(CONFIG_SYS_LOAD_ADDR -

GENERATED_GBL_DATA_SIZE) #define CONFIG_SYS_CACHELINE_SIZE 32

-
#define CONFIG_SOFT_I2C
#define CONFIG_SOFT_I2C_READ_REPEATED_START
#define CONFIG_SYS_I2C_INIT_BOARD

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group
#2 lore raw

PATCH v2 1/1 spl:falcon:trats Update Trats default board configuration file to support FALCON MODE

In reply to Lukasz Majewski

Support for a new command (defined at envs) - spl_export generates the ATAGS image necessary for fast boot. Afterwards, it is stored at ext4 partition.

Generated image format:
CRC [4B] SIZE [4B] PAYLOAD(ATAGS/DT) [SIZE]

Remarks:
- CRC is calculated only for PAYLOAD
- SIZE is the size of PAYLOAD

It is important to adjust ${splsize} when large image is generated. It is defined as hex, since ext4 related commands expect it.

The ${spladdr} environment variable corresponds to CONFIG_SYS_SPL_ARGS_ADDR

Additionally definitions for DFU have been refactored and support for EFI has been added as well.

---
Changes for v2:
- Rebase the code on the newest master branch

---
 board/samsung/trats/trats.c |    2 +-
 include/configs/trats.h     |   45 +++++++++++++++++++++++++++++++++---------
 2 files changed, 36 insertions(+), 11 deletions(-)
board/samsung/trats/trats.c +1 -1
index 4724029..88d193d 100644
@@ -67,7 +67,7 @@ struct s3c_plat_otg_data s5pc210_otg_data;
 
 int board_init(void)
 {
-	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
+	gd->bd->bi_boot_params = CONFIG_SYS_SPL_ARGS_ADDR;
 
 	check_hw_revision();
 	printf("HW Revision:\t0x%x\n", board_rev);
include/configs/trats.h +35 -10

96 lines not on this page · raw message

Signature · 1 line
1.7.2.3
#3 lore raw

PATCH v2 1/1 spl:falcon:trats Update Trats default board configuration file to support FALCON MODE

Quoted 23 lines · Lukasz Majewski

Support for a new command (defined at envs) - spl_export generates the ATAGS image necessary for fast boot. Afterwards, it is stored at ext4 partition.

Generated image format:
CRC [4B] SIZE [4B] PAYLOAD(ATAGS/DT) [SIZE]

Remarks:
- CRC is calculated only for PAYLOAD
- SIZE is the size of PAYLOAD

It is important to adjust ${splsize} when large image is generated. It is defined as hex, since ext4 related commands expect it.

The ${spladdr} environment variable corresponds to CONFIG_SYS_SPL_ARGS_ADDR

Additionally definitions for DFU have been refactored and support for EFI has been added as well.

Quoted 8 lines

---
Changes for v2:
- Rebase the code on the newest master branch

---
 board/samsung/trats/trats.c |    2 +-
 include/configs/trats.h     |   45 +++++++++++++++++++++++++++++++++---------
 2 files changed, 36 insertions(+), 11 deletions(-)

applied to u-boot-samsung/master

Thanks,
Minkyu Kang.