Skip to contentSkip to conversation

lsxl: use 64bit for LBA48 to support 4 TB drives

PATCH Superseded Michael Walle 2 participants 6 messages Mar 12, 2014 – Mar 14, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lsxl: use 64bit for LBA48 to support 4 TB drives

Cc Prafulla Wadaskar <[email protected]>
---
 include/configs/lsxl.h |    1 +
 1 file changed, 1 insertion(+)
include/configs/lsxl.h +1 -0
index 92865df..cc7a6ab 100644
@@ -160,6 +160,7 @@
 #undef CONFIG_SYS_IDE_MAXDEVICE
 #define CONFIG_SYS_IDE_MAXDEVICE	1
 #define CONFIG_SYS_ATA_IDE0_OFFSET	MV_SATA_PORT0_OFFSET
+#define CONFIG_SYS_64BIT_LBA
 #endif
 
 #endif /* _CONFIG_LSXL_H */
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 lsxl: rework boot scripts

Move addresses for kernel, ramdisk and fdt blob to own variables. Add dtb blob loading to all existing boot scripts, dtb filenames were taken from vanilla kernel. Introduce new boot script bootcmd_legacy, which only loads a kernel and a ramdisk. Make this the default boot script. This should also restore the behaviour of the original bootloader.

Cc Prafulla Wadaskar <[email protected]>
---
 include/configs/lsxl.h |   43 +++++++++++++++++++++++++++++++++----------
 1 file changed, 33 insertions(+), 10 deletions(-)
include/configs/lsxl.h +33 -10
index cc7a6ab..8f4f382 100644
@@ -108,20 +108,43 @@
 #define CONFIG_LOADADDR		0x00800000
 #define CONFIG_BOOTCOMMAND	"run bootcmd_${bootsource}"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 root=/dev/sda2"
+
+#if defined(CONFIG_LSXHL)
+#define CONFIG_FDTFILE "kirkwood-lsxhl.dtb"
+#elif defined(CONFIG_LSCHLV2)
+#define CONFIG_FDTFILE "kirkwood-lschlv2.dtb"
+#else
+#error "Unsupported board"
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS					\
-	"bootsource=hdd\0"						\
+	"bootsource=legacy\0"						\
 	"hdpart=0:1\0"							\
-	"bootcmd_net=bootp 0x00100000 uImage "				\
-		"&& tftpboot 0x00800000 uInitrd "			\
-		"&& bootm 0x00100000 0x00800000\0"			\
+	"kernel_addr=0x00100000\0"					\
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\
+	"bootcmd_legacy=ide reset "					\
+		"&& ext2load ide ${hdpart} ${kernel_addr} "		\
+			"/uImage.buffalo "				\
+		"&& ext2load ide ${hdpart} ${ramdisk_addr} "		\
+			"/initrd.buffalo "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr}\0"		\
+	"bootcmd_net=bootp ${kernel_addr} uImage "			\
+		"&& tftpboot ${ramdisk_addr} uInitrd "			\
+		"&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " "		\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_hdd=ide reset "					\
-		"&& ext2load ide ${hdpart} 0x00100000 /uImage "		\
-		"&& ext2load ide ${hdpart} 0x00800000 /uInitrd "	\
-		"&& bootm 0x00100000 0x00800000\0"			\
+		"&& ext2load ide ${hdpart} ${kernel_addr} /uImage "	\
+		"&& ext2load ide ${hdpart} ${ramdisk_addr} /uInitrd "	\
+		"&& ext2load ide ${hdpart} ${fdt_addr} "		\
+			"/" CONFIG_FDTFILE " "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_usb=usb start "					\
-		"&& fatload usb 0:1 0x00100000 /uImage "		\
-		"&& fatload usb 0:1 0x00800000 /uInitrd "		\
-		"&& bootm 0x00100000 0x00800000\0"			\
+		"&& fatload usb 0:1 ${kernel_addr} /uImage "		\
+		"&& fatload usb 0:1 ${ramdisk_addr} /uInitrd "		\
+		"&& fatload usb 0:1 ${fdt_addr} "			\
+			"/" CONFIG_FDTFILE " "				\
+		"&& bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"	\
 	"bootcmd_rescue=run config_nc_dhcp; run nc\0"			\
 	"eraseenv=sf probe 0 "						\
 		"&& sf erase " __stringify(CONFIG_ENV_OFFSET)		\
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/2 lsxl: rework boot scripts

Quoted 5 lines · Michael Walle

Move addresses for kernel, ramdisk and fdt blob to own variables. Add dtb blob loading to all existing boot scripts, dtb filenames were taken from vanilla kernel. Introduce new boot script bootcmd_legacy, which only loads a kernel and a ramdisk. Make this the default boot script. This should also restore the behaviour of the original bootloader.

How much memory do these platforms have? Having just spent a bunch of time issues about where to load what on TI platforms, I'm a little worried about some of the locations:

include/configs/lsxl.h line 123

Quoted 1 line
include/configs/lsxl.h +1 -0
+	"kernel_addr=0x00100000\0"					\

Below 32MB which isn't optimal.

include/configs/lsxl.h line 125

Quoted 2 lines
include/configs/lsxl.h +2 -0
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\

This doesn't leave a whole lot of space for the kernel before overwriting either of these.

include/configs/lsxl.h line 127

Quoted 2 lines
include/configs/lsxl.h +2 -0
+	"bootcmd_legacy=ide reset "					\
+		"&& ext2load ide ${hdpart} ${kernel_addr} "		\

Add CONFIG_CMD_FS_GENERIC and just 'load' here and elsewhere (incl fatload).

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140312/bb444222/attachment.pgp>
#3 lore raw

PATCH 2/2 lsxl: rework boot scripts

Hi Tom,

Am 2014-03-12 22:32, schrieb Tom Rini:

Quoted 12 lines · Michael Walle
Quoted 10 lines

Move addresses for kernel, ramdisk and fdt blob to own variables. Add dtb
blob loading to all existing boot scripts, dtb filenames were taken from
vanilla kernel. Introduce new boot script bootcmd_legacy, which only loads
a kernel and a ramdisk. Make this the default boot script. This should also
restore the behaviour of the original bootloader.

Quoted 1 line

How much memory do these platforms have?

LS-CHLv2 has 64MB and LS-XHL has 256MB. The kernel_addr and ramdisk_addr are the value which was also used in the original bootloader.

Quoted 7 lines

Having just spent a bunch of
time issues about where to load what on TI platforms, I'm a little worried about some of the locations:

include/configs/lsxl.h line 123

Quoted 1 line
include/configs/lsxl.h +1 -0
+	"kernel_addr=0x00100000\0"					\

Below 32MB which isn't optimal.

why is that? iirc the kernel is unpacked to 0x8000, isn't it? ok there might be some problems unpacking the kernel.

Quoted 6 lines

include/configs/lsxl.h line 125

Quoted 3 lines
include/configs/lsxl.h +2 -0
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\

This doesn't leave a whole lot of space for the kernel before overwriting either of these.

I must admit i've never worried about where to put these. Any suggestions? initrd at the end of the ram? although i'd like to keep both platforms the same, eg. i'd take 64MB as the end of ram.

Quoted 6 lines

include/configs/lsxl.h line 127

Quoted 3 lines
include/configs/lsxl.h +2 -0
+	"bootcmd_legacy=ide reset "					\
+		"&& ext2load ide ${hdpart} ${kernel_addr} "		\

Add CONFIG_CMD_FS_GENERIC and just 'load' here and elsewhere (incl fatload).

i'll have a look at it.

thanks for the suggestions,

-michael

#4 lore raw

PATCH 2/2 lsxl: rework boot scripts

Quoted 15 lines · Michael Walle

Hi Tom,

Am 2014-03-12 22:32, schrieb Tom Rini:

Quoted 12 lines · Michael Walle
Quoted 10 lines

Move addresses for kernel, ramdisk and fdt blob to own variables. Add dtb
blob loading to all existing boot scripts, dtb filenames were taken from
vanilla kernel. Introduce new boot script bootcmd_legacy, which only loads
a kernel and a ramdisk. Make this the default boot script. This should also
restore the behaviour of the original bootloader.

Quoted 5 lines
Quoted 1 line

How much memory do these platforms have?

LS-CHLv2 has 64MB and LS-XHL has 256MB. The kernel_addr and ramdisk_addr are the value which was also used in the original bootloader.

OK, so we don't have to worry about relocation to bad places...

Quoted 10 lines
Quoted 7 lines

Having just spent a bunch of
time issues about where to load what on TI platforms, I'm a little worried about some of the locations:

include/configs/lsxl.h line 123

Quoted 1 line
include/configs/lsxl.h +1 -0
+	"kernel_addr=0x00100000\0"					\

Below 32MB which isn't optimal.

why is that? iirc the kernel is unpacked to 0x8000, isn't it? ok there might be some problems unpacking the kernel.

Documentation/arm/Booting in the kernel suggests above 32MB to avoid relocation.

Quoted 9 lines
Quoted 5 lines

include/configs/lsxl.h line 125

Quoted 2 lines
include/configs/lsxl.h +2 -0
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\

This doesn't leave a whole lot of space for the kernel before overwriting either of these.

I must admit i've never worried about where to put these. Any suggestions? initrd at the end of the ram? although i'd like to keep both platforms the same, eg. i'd take 64MB as the end of ram.

Well, I guess it comes down to how much you worry about things like Fedora or SuSE running on the system. I'd suggest moving the above to 32MB/just below 32MB to allow a fairly bigish kernel to still work as that's one of the thing that will bite commodity distro kernels.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140312/08a9e6b2/attachment.pgp>
#5 lore raw

PATCH 2/2 lsxl: rework boot scripts

Am Donnerstag, 13. M?rz 2014, 00:42:49 schrieb Tom Rini:

Quoted 28 lines
Quoted 5 lines
Quoted 1 line

How much memory do these platforms have?

LS-CHLv2 has 64MB and LS-XHL has 256MB. The kernel_addr and ramdisk_addr are the value which was also used in the original bootloader.

OK, so we don't have to worry about relocation to bad places...

Quoted 10 lines
Quoted 7 lines

Having just spent a bunch of
time issues about where to load what on TI platforms, I'm a little

worried about some of the locations:

include/configs/lsxl.h line 123

Quoted 1 line
include/configs/lsxl.h +1 -0
+	"kernel_addr=0x00100000\0"					\

Below 32MB which isn't optimal.

why is that? iirc the kernel is unpacked to 0x8000, isn't it? ok there might be some problems unpacking the kernel.

Documentation/arm/Booting in the kernel suggests above 32MB to avoid relocation.

Quoted 6 lines
Quoted 5 lines

include/configs/lsxl.h line 125

Quoted 2 lines
include/configs/lsxl.h +2 -0
+	"ramdisk_addr=0x00800000\0"					\
+	"fdt_addr=0x007f0000\0"						\

This doesn't leave a whole lot of space for the kernel before overwriting either of these.

Quoted 8 lines
Quoted 3 lines

I must admit i've never worried about where to put these. Any suggestions? initrd at the end of the ram? although i'd like to keep both platforms the same, eg. i'd take 64MB as the end of ram.

Well, I guess it comes down to how much you worry about things like Fedora or SuSE running on the system. I'd suggest moving the above to 32MB/just below 32MB to allow a fairly bigish kernel to still work as that's one of the thing that will bite commodity distro kernels.

I've just looked at the load addresses. First, in case of the lsxl, neither initrd_high nor fdt_high is set to 0xffffffff. Therefore, the ramdisk and the fdt blob are relocated to the top of the ram. The kernel itself is relocated to whatever the uimage loadaddr is set to. In case of debian and the original uImage this is 0x8000 and both are zImages. So i can't do anything to avoid relocating in the decompressor again.

So the only restrictions should be:
- 0x00800000 - 0x00100000 = 7 MB for the kernel
- 64 kB for the fdt

Hope i get everything right :) I'll post an updated patch with the {fat,ext2}load replaced with load in the near future.

-michael