diff mbox

[U-Boot,RFC,2/3] move the beaglebones over to the generic configs

Message ID 1392659798-1665-3-git-send-email-dennis@ausil.us
State RFC
Delegated to: Tom Rini
Headers show

Commit Message

Dennis Gilmore Feb. 17, 2014, 5:56 p.m. UTC
Signed-off-by: Dennis Gilmore <dennis@ausil.us>
---
 include/configs/am335x_evm.h      | 109 ++++----------------------------------
 include/configs/ti_armv7_common.h |  28 ++--------
 2 files changed, 16 insertions(+), 121 deletions(-)

Comments

Tom Rini Feb. 19, 2014, 1:52 p.m. UTC | #1
On Mon, Feb 17, 2014 at 11:56:37AM -0600, Dennis Gilmore wrote:

[snip]
> -		"nand read ${fdtaddr} u-boot-spl-os; " \
> +		"nand read ${fdt_addr} u-boot-spl-os; " \
>  		"nand read ${loadaddr} kernel; " \
> -		"bootz ${loadaddr} - ${fdtaddr}\0"
> +		"bootz ${loadaddr} - ${fdt_addr}\0"

In all of these conversions you should switch loadaddr to kernel_addr_r
too.

[snip]
> -	"fdtfile=undefined\0" \

That's a problem.  Need this for 'findfdt' to work.

> -	"rootpath=/export/rootfs\0" \
> -	"nfsopts=nolock\0" \
> -	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
> -		"::off\0" \
[snip]
> -	"spiroot=/dev/mtdblock4 rw\0" \
> -	"spirootfstype=jffs2\0" \
> -	"spisrcaddr=0xe0000\0" \
> -	"spiimgsize=0x362000\0" \
> -	"spibusno=0\0" \
> -	"spiargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${spiroot} " \
> -		"rootfstype=${spirootfstype}\0" \
> -	"netargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=/dev/nfs " \
> -		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
> -		"ip=dhcp\0" \
[snip]
> -	"spiboot=echo Booting from spi ...; " \
> -		"run spiargs; " \
> -		"sf probe ${spibusno}:0; " \
> -		"sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
> -		"bootz ${loadaddr}\0" \
> -	"netboot=echo Booting from network ...; " \
> -		"setenv autoload no; " \
> -		"dhcp; " \
> -		"tftp ${loadaddr} ${bootfile}; " \
> -		"tftp ${fdtaddr} ${fdtfile}; " \
> -		"run netargs; " \
> -		"bootz ${loadaddr} - ${fdtaddr}\0" \
> -	"ramboot=echo Booting from ramdisk ...; " \
> -		"run ramargs; " \
> -		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \

And this is functionality I don't see in the generic distro config that
we still need.

[snip]
>  /*
> - * Common filesystems support.  When we have removable storage we
> - * enabled a number of useful commands and support.
> + * Include the generic config options and boot environment when not
> + * building our SPL
>   */
> -#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
> -#define CONFIG_DOS_PARTITION
> -#define CONFIG_CMD_FAT
> -#define CONFIG_FAT_WRITE
> -#define CONFIG_CMD_EXT2
> -#define CONFIG_CMD_EXT4
> -#define CONFIG_CMD_FS_GENERIC
> +#ifndef CONFIG_SPL_BUILD
> +#include <config_distro_defaults.h>
> +#include <config_distro_bootcmd.h>
>  #endif

This is fine, for now, but I'll have to shuffle things around later as
some of the good feedback I'd gotten off-list about ti_armv7_common.h is
that it's not as useful for non-Linux targets, so I need to adjust the
contents a bit more.
Stephen Warren Feb. 19, 2014, 5:46 p.m. UTC | #2
On 02/17/2014 10:56 AM, Dennis Gilmore wrote:
> Signed-off-by: Dennis Gilmore <dennis@ausil.us>

Patch description?

> diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h

>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"loadaddr=0x80200000\0" \
> -	"fdtaddr=0x80F80000\0" \
> +	"fdt_addr=0x80F80000\0" \
> +	"fdt_addr_r=0x80F80000\0" \

Why set both? Surely only fdt_addr_r is required/useful?

> -	"mmcroot=/dev/mmcblk0p2 ro\0" \

That implies that rootpart=1 in config_distro_bootcmd.h isn't correct
for this board?

> -	"rootpath=/export/rootfs\0" \
> -	"nfsopts=nolock\0" \
> -	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
> -		"::off\0" \
> -	"ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
> -	"ramrootfstype=ext2\0" \
> -	"mmcargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${mmcroot} " \
> -		"rootfstype=${mmcrootfstype}\0" \
> -	"spiroot=/dev/mtdblock4 rw\0" \
> -	"spirootfstype=jffs2\0" \
> -	"spisrcaddr=0xe0000\0" \
> -	"spiimgsize=0x362000\0" \
> -	"spibusno=0\0" \
> -	"spiargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${spiroot} " \
> -		"rootfstype=${spirootfstype}\0" \
> -	"netargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=/dev/nfs " \
> -		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
> -		"ip=dhcp\0" \

I'm not at all familiar with this board, but this seems to be removing
NFS and SPI boot capabilities, maybe others too?
Dan Murphy Feb. 19, 2014, 7:57 p.m. UTC | #3
On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
> Signed-off-by: Dennis Gilmore <dennis@ausil.us>
> ---
>  include/configs/am335x_evm.h      | 109 ++++----------------------------------
>  include/configs/ti_armv7_common.h |  28 ++--------
>  2 files changed, 16 insertions(+), 121 deletions(-)
>
> diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
> index 73a9adb..b7dcb42 100644
> --- a/include/configs/am335x_evm.h
> +++ b/include/configs/am335x_evm.h
> @@ -43,9 +43,9 @@
>  	"nandrootfstype=ubifs rootwait=1\0" \
>  	"nandboot=echo Booting from nand ...; " \
>  		"run nandargs; " \
> -		"nand read ${fdtaddr} u-boot-spl-os; " \
> +		"nand read ${fdt_addr} u-boot-spl-os; " \
>  		"nand read ${loadaddr} kernel; " \
> -		"bootz ${loadaddr} - ${fdtaddr}\0"
> +		"bootz ${loadaddr} - ${fdt_addr}\0"
>  #else
>  #define NANDARGS ""
>  #endif
> @@ -55,98 +55,13 @@
>  #ifndef CONFIG_SPL_BUILD
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"loadaddr=0x80200000\0" \
> -	"fdtaddr=0x80F80000\0" \
> +	"fdt_addr=0x80F80000\0" \
> +	"fdt_addr_r=0x80F80000\0" \
>  	"fdt_high=0xffffffff\0" \
> -	"boot_fdt=try\0" \
> -	"rdaddr=0x81000000\0" \
> -	"bootpart=0:2\0" \
> -	"bootdir=/boot\0" \
> -	"bootfile=zImage\0" \
> -	"fdtfile=undefined\0" \
> -	"console=ttyO0,115200n8\0" \
> -	"optargs=\0" \
> -	"mmcdev=0\0" \
> -	"mmcroot=/dev/mmcblk0p2 ro\0" \
> -	"mmcrootfstype=ext4 rootwait\0" \
> -	"rootpath=/export/rootfs\0" \
> -	"nfsopts=nolock\0" \
> -	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
> -		"::off\0" \
> -	"ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
> -	"ramrootfstype=ext2\0" \
> -	"mmcargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${mmcroot} " \
> -		"rootfstype=${mmcrootfstype}\0" \
> -	"spiroot=/dev/mtdblock4 rw\0" \
> -	"spirootfstype=jffs2\0" \
> -	"spisrcaddr=0xe0000\0" \
> -	"spiimgsize=0x362000\0" \
> -	"spibusno=0\0" \
> -	"spiargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${spiroot} " \
> -		"rootfstype=${spirootfstype}\0" \
> -	"netargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=/dev/nfs " \
> -		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
> -		"ip=dhcp\0" \
> -	"bootenv=uEnv.txt\0" \
> -	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
> -	"importbootenv=echo Importing environment from mmc ...; " \
> -		"env import -t $loadaddr $filesize\0" \
> -	"ramargs=setenv bootargs console=${console} " \
> -		"${optargs} " \
> -		"root=${ramroot} " \
> -		"rootfstype=${ramrootfstype}\0" \
> -	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
> -	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
> -	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
> -	"mmcloados=run mmcargs; " \
> -		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
> -			"if run loadfdt; then " \
> -				"bootz ${loadaddr} - ${fdtaddr}; " \
> -			"else " \
> -				"if test ${boot_fdt} = try; then " \
> -					"bootz; " \
> -				"else " \
> -					"echo WARN: Cannot load the DT; " \
> -				"fi; " \
> -			"fi; " \
> -		"else " \
> -			"bootz; " \
> -		"fi;\0" \
> -	"mmcboot=mmc dev ${mmcdev}; " \
> -		"if mmc rescan; then " \
> -			"echo SD/MMC found on device ${mmcdev};" \
> -			"if run loadbootenv; then " \
> -				"echo Loaded environment from ${bootenv};" \
> -				"run importbootenv;" \
> -			"fi;" \
> -			"if test -n $uenvcmd; then " \
> -				"echo Running uenvcmd ...;" \
> -				"run uenvcmd;" \
> -			"fi;" \
> -			"if run loadimage; then " \
> -				"run mmcloados;" \
> -			"fi;" \
> -		"fi;\0" \
> -	"spiboot=echo Booting from spi ...; " \
> -		"run spiargs; " \
> -		"sf probe ${spibusno}:0; " \
> -		"sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
> -		"bootz ${loadaddr}\0" \
> -	"netboot=echo Booting from network ...; " \
> -		"setenv autoload no; " \
> -		"dhcp; " \
> -		"tftp ${loadaddr} ${bootfile}; " \
> -		"tftp ${fdtaddr} ${fdtfile}; " \
> -		"run netargs; " \
> -		"bootz ${loadaddr} - ${fdtaddr}\0" \
> -	"ramboot=echo Booting from ramdisk ...; " \
> -		"run ramargs; " \
> -		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
> +	"ramdisk_addr_r=0x81000000\0" \
> +	"kernel_addr_r=0x80200000\0" \
> +	"pxe_addr_r=0x80000000\0" \
> +	"scriptaddr=0x80000000\0" \
>  	"findfdt="\
>  		"if test $board_name = A335BONE; then " \
>  			"setenv fdtfile am335x-bone.dtb; fi; " \
> @@ -159,15 +74,13 @@
>  		"if test $fdtfile = undefined; then " \
>  			"echo WARNING: Could not determine device tree to use; fi; \0" \
>  	NANDARGS \
> -	DFUARGS
> +	DFUARGS \
> +	BOOTCMDS_COMMON
>  #endif
>  
>  #define CONFIG_BOOTCOMMAND \
>  	"run findfdt; " \
> -	"run mmcboot;" \
> -	"setenv mmcdev 1; " \
> -	"setenv bootpart 1:2; " \
> -	"run mmcboot;" \
> +	"for target in ${boot_targets}; do run bootcmd_${target}; done" \
>  	"run nandboot;"
>  
>  /* NS16550 Configuration */
> diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
> index 99b60fc..016966a 100644
> --- a/include/configs/ti_armv7_common.h
> +++ b/include/configs/ti_armv7_common.h
> @@ -28,7 +28,6 @@
>  #define CONFIG_SYS_NO_FLASH
>  
>  /* Support both device trees and ATAGs. */
> -#define CONFIG_OF_LIBFDT
>  #define CONFIG_CMDLINE_TAG
>  #define CONFIG_SETUP_MEMORY_TAGS
>  #define CONFIG_INITRD_TAG
> @@ -40,11 +39,6 @@
>  #define CONFIG_SYS_LOAD_ADDR		0x80000000
>  
>  /*
> - * Default to a quick boot delay.
> - */
> -#define CONFIG_BOOTDELAY		1
> -
> -/*
>   * DDR information.  We say (for simplicity) that we have 1 bank,
>   * always, even when we have more.  We always start at 0x80000000,
>   * and we place the initial stack pointer in our SRAM.
> @@ -101,19 +95,12 @@
>   * console baudrate of 115200 and use the default baud rate table.
>   */
>  #define CONFIG_SYS_MALLOC_LEN		(1024 << 10)
> -#define CONFIG_SYS_HUSH_PARSER
>  #define CONFIG_SYS_PROMPT		"U-Boot# "
>  #define CONFIG_SYS_CONSOLE_INFO_QUIET
>  #define CONFIG_BAUDRATE			115200
>  #define CONFIG_ENV_VARS_UBOOT_CONFIG	/* Strongly encouraged */
>  #define CONFIG_ENV_OVERWRITE		/* Overwrite ethaddr / serial# */
>  
> -/* As stated above, the following choices are optional. */
> -#define CONFIG_SYS_LONGHELP
> -#define CONFIG_AUTO_COMPLETE
> -#define CONFIG_CMDLINE_EDITING
> -#define CONFIG_VERSION_VARIABLE
> -
>  /* We set the max number of command args high to avoid HUSH bugs. */
>  #define CONFIG_SYS_MAXARGS		64
>  
> @@ -146,19 +133,14 @@
>  #include <config_cmd_default.h>
>  #define CONFIG_CMD_ASKENV
>  #define CONFIG_CMD_ECHO
> -#define CONFIG_CMD_BOOTZ
>  
>  /*
> - * Common filesystems support.  When we have removable storage we
> - * enabled a number of useful commands and support.
> + * Include the generic config options and boot environment when not
> + * building our SPL
>   */
> -#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
> -#define CONFIG_DOS_PARTITION
> -#define CONFIG_CMD_FAT
> -#define CONFIG_FAT_WRITE
> -#define CONFIG_CMD_EXT2
> -#define CONFIG_CMD_EXT4
> -#define CONFIG_CMD_FS_GENERIC
> +#ifndef CONFIG_SPL_BUILD
> +#include <config_distro_defaults.h>

I did not see the patchset for this.

Should this header and the removal the extra configs be a different patch?
Or be part of the series that introduces the distro defaults

> +#include <config_distro_bootcmd.h>
>  #endif
>  
>  /*
Dan Murphy Feb. 19, 2014, 7:58 p.m. UTC | #4
On 02/19/2014 01:57 PM, Dan Murphy wrote:
> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
Missing commit log as well

>> Signed-off-by: Dennis Gilmore <dennis@ausil.us>
>> ---
>>  include/configs/am335x_evm.h      | 109 ++++----------------------------------
>>  include/configs/ti_armv7_common.h |  28 ++--------
>>  2 files changed, 16 insertions(+), 121 deletions(-)
>>
<snip>
Stephen Warren Feb. 19, 2014, 8:05 p.m. UTC | #5
On 02/19/2014 12:57 PM, Dan Murphy wrote:
> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
...
>> +#ifndef CONFIG_SPL_BUILD
>> +#include <config_distro_defaults.h>
> 
> I did not see the patchset for this.
> 
> Should this header and the removal the extra configs be a different patch?
> Or be part of the series that introduces the distro defaults

The following is already in u-boot/master:
13a49c3a739b config: add config_distro_defaults.h

I've sent patches to convert Tegra and RPi to use it, although they
aren't applied yet.
Dan Murphy Feb. 19, 2014, 8:20 p.m. UTC | #6
On 02/19/2014 02:05 PM, Stephen Warren wrote:
> On 02/19/2014 12:57 PM, Dan Murphy wrote:
>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
> ...
>>> +#ifndef CONFIG_SPL_BUILD
>>> +#include <config_distro_defaults.h>
>> I did not see the patchset for this.
>>
>> Should this header and the removal the extra configs be a different patch?
>> Or be part of the series that introduces the distro defaults
> The following is already in u-boot/master:
> 13a49c3a739b config: add config_distro_defaults.h
>
> I've sent patches to convert Tegra and RPi to use it, although they
> aren't applied yet.

Great! So why did this change come in as part of the RFC and not a patch for review and merge?

Dan
Stephen Warren Feb. 19, 2014, 8:22 p.m. UTC | #7
On 02/19/2014 01:20 PM, Dan Murphy wrote:
> On 02/19/2014 02:05 PM, Stephen Warren wrote:
>> On 02/19/2014 12:57 PM, Dan Murphy wrote:
>>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
>> ...
>>>> +#ifndef CONFIG_SPL_BUILD
>>>> +#include <config_distro_defaults.h>
>>> I did not see the patchset for this.
>>>
>>> Should this header and the removal the extra configs be a different patch?
>>> Or be part of the series that introduces the distro defaults
>> The following is already in u-boot/master:
>> 13a49c3a739b config: add config_distro_defaults.h
>>
>> I've sent patches to convert Tegra and RPi to use it, although they
>> aren't applied yet.
> 
> Great! So why did this change come in as part of the RFC and not a patch for review and merge?

Because it needed discussion/comments from the owners of the affected
files perhaps?
Dan Murphy Feb. 19, 2014, 8:31 p.m. UTC | #8
On 02/19/2014 02:22 PM, Stephen Warren wrote:
> On 02/19/2014 01:20 PM, Dan Murphy wrote:
>> On 02/19/2014 02:05 PM, Stephen Warren wrote:
>>> On 02/19/2014 12:57 PM, Dan Murphy wrote:
>>>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
>>> ...
>>>>> +#ifndef CONFIG_SPL_BUILD
>>>>> +#include <config_distro_defaults.h>
>>>> I did not see the patchset for this.
>>>>
>>>> Should this header and the removal the extra configs be a different patch?
>>>> Or be part of the series that introduces the distro defaults
>>> The following is already in u-boot/master:
>>> 13a49c3a739b config: add config_distro_defaults.h
>>>
>>> I've sent patches to convert Tegra and RPi to use it, although they
>>> aren't applied yet.
>> Great! So why did this change come in as part of the RFC and not a patch for review and merge?
> Because it needed discussion/comments from the owners of the affected
> files perhaps?

Agreed to the discussion/comments.  But this change is not relevant to converting to a common boot right?
And it is kinda buried in this patch and might be over looked.
I guess the same can be said for the wandboard patch.

IMHO These changes should be broken out, reviewed then they can be merged quicker if not part of this RFC.

Dan
Stephen Warren Feb. 19, 2014, 8:38 p.m. UTC | #9
On 02/19/2014 01:31 PM, Dan Murphy wrote:
> On 02/19/2014 02:22 PM, Stephen Warren wrote:
>> On 02/19/2014 01:20 PM, Dan Murphy wrote:
>>> On 02/19/2014 02:05 PM, Stephen Warren wrote:
>>>> On 02/19/2014 12:57 PM, Dan Murphy wrote:
>>>>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
>>>> ...
>>>>>> +#ifndef CONFIG_SPL_BUILD
>>>>>> +#include <config_distro_defaults.h>
>>>>> I did not see the patchset for this.
>>>>>
>>>>> Should this header and the removal the extra configs be a different patch?
>>>>> Or be part of the series that introduces the distro defaults
>>>> The following is already in u-boot/master:
>>>> 13a49c3a739b config: add config_distro_defaults.h
>>>>
>>>> I've sent patches to convert Tegra and RPi to use it, although they
>>>> aren't applied yet.
>>> Great! So why did this change come in as part of the RFC and not a patch for review and merge?
>> Because it needed discussion/comments from the owners of the affected
>> files perhaps?
> 
> Agreed to the discussion/comments.  But this change is not relevant to converting to a common boot right?
> And it is kinda buried in this patch and might be over looked.
> I guess the same can be said for the wandboard patch.
> 
> IMHO These changes should be broken out, reviewed then they can be merged quicker if not part of this RFC.

??? The whole point of this series is to convert the 2 boards to use the
two headers that define a standardized set of U-Boot options (the header
for which has already been merged) and a standardized set of U-Boot
scripts (the header for which is part of this patch series). Splitting
them up makes no sense at all.
Dan Murphy Feb. 19, 2014, 8:58 p.m. UTC | #10
On 02/19/2014 02:38 PM, Stephen Warren wrote:
> On 02/19/2014 01:31 PM, Dan Murphy wrote:
>> On 02/19/2014 02:22 PM, Stephen Warren wrote:
>>> On 02/19/2014 01:20 PM, Dan Murphy wrote:
>>>> On 02/19/2014 02:05 PM, Stephen Warren wrote:
>>>>> On 02/19/2014 12:57 PM, Dan Murphy wrote:
>>>>>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
>>>>> ...
>>>>>>> +#ifndef CONFIG_SPL_BUILD
>>>>>>> +#include <config_distro_defaults.h>
>>>>>> I did not see the patchset for this.
>>>>>>
>>>>>> Should this header and the removal the extra configs be a different patch?
>>>>>> Or be part of the series that introduces the distro defaults
>>>>> The following is already in u-boot/master:
>>>>> 13a49c3a739b config: add config_distro_defaults.h
>>>>>
>>>>> I've sent patches to convert Tegra and RPi to use it, although they
>>>>> aren't applied yet.
>>>> Great! So why did this change come in as part of the RFC and not a patch for review and merge?
>>> Because it needed discussion/comments from the owners of the affected
>>> files perhaps?
>> Agreed to the discussion/comments.  But this change is not relevant to converting to a common boot right?
>> And it is kinda buried in this patch and might be over looked.
>> I guess the same can be said for the wandboard patch.
>>
>> IMHO These changes should be broken out, reviewed then they can be merged quicker if not part of this RFC.
> ??? The whole point of this series is to convert the 2 boards to use the
> two headers that define a standardized set of U-Boot options (the header
> for which has already been merged) and a standardized set of U-Boot
> scripts (the header for which is part of this patch series). Splitting
> them up makes no sense at all.

Hey it was just my opinion. (I just like functional changes broken out for bissectability when debugging issues)

But that is ultimately up to the maintainer to decide in the end.
I will attempt to review it when it comes in as an official patchset.


Dan
Dennis Gilmore Feb. 19, 2014, 9:07 p.m. UTC | #11
On Wed, 19 Feb 2014 14:31:42 -0600
Dan Murphy <dmurphy@ti.com> wrote:

> On 02/19/2014 02:22 PM, Stephen Warren wrote:
> > On 02/19/2014 01:20 PM, Dan Murphy wrote:
> >> On 02/19/2014 02:05 PM, Stephen Warren wrote:
> >>> On 02/19/2014 12:57 PM, Dan Murphy wrote:
> >>>> On 02/17/2014 11:56 AM, Dennis Gilmore wrote:
> >>> ...
> >>>>> +#ifndef CONFIG_SPL_BUILD
> >>>>> +#include <config_distro_defaults.h>
> >>>> I did not see the patchset for this.
> >>>>
> >>>> Should this header and the removal the extra configs be a
> >>>> different patch? Or be part of the series that introduces the
> >>>> distro defaults
> >>> The following is already in u-boot/master:
> >>> 13a49c3a739b config: add config_distro_defaults.h
> >>>
> >>> I've sent patches to convert Tegra and RPi to use it, although
> >>> they aren't applied yet.
> >> Great! So why did this change come in as part of the RFC and not a
> >> patch for review and merge?
> > Because it needed discussion/comments from the owners of the
> > affected files perhaps?
> 
> Agreed to the discussion/comments.  But this change is not relevant
> to converting to a common boot right? And it is kinda buried in this
> patch and might be over looked. I guess the same can be said for the
> wandboard patch.
> 
> IMHO These changes should be broken out, reviewed then they can be
> merged quicker if not part of this RFC.

The main point of them and why I sent them as a RFC is that I felt they
provided a solid basis and example of how we can share configs and boot
logic across soc families. there is a lot of room for improvement
still, putting soc family memory locations into their own files for
example. I wanted to judge the acceptance of the idea, There was a
thread looking to unify i.MX last week. I would like tegra to drop
some of the logic carried in configs/tegra-common-post.h and include
config_distro_bootcmd.h instead. I chose these two boards because I
have and can test them, I would like for all boards that would like a
generic distro to run on them to support a standard environment where
adding support for a new board is a much simpler process. 

I really like Stephen's idea of making boot ordering being bios like in
being able to re-order, enable disable, chose a one off boot target. I
would like to get to the point that the pxe/extlinux option shows a menu
where you select a kernel with up/down keys and can even edit the boot
args on the fly, rather than todays choose 1, 2, or 3, etc to pick the
kernel to boot.

Right now I am just trying to take small steps to make things simpler
for everyone. I would like to think that the chosen settings will work
for everyone, but if you're making a specialised product then you can
implement only the bits you need in order to make the boot more
streamlined.

Dennis
diff mbox

Patch

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 73a9adb..b7dcb42 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -43,9 +43,9 @@ 
 	"nandrootfstype=ubifs rootwait=1\0" \
 	"nandboot=echo Booting from nand ...; " \
 		"run nandargs; " \
-		"nand read ${fdtaddr} u-boot-spl-os; " \
+		"nand read ${fdt_addr} u-boot-spl-os; " \
 		"nand read ${loadaddr} kernel; " \
-		"bootz ${loadaddr} - ${fdtaddr}\0"
+		"bootz ${loadaddr} - ${fdt_addr}\0"
 #else
 #define NANDARGS ""
 #endif
@@ -55,98 +55,13 @@ 
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"loadaddr=0x80200000\0" \
-	"fdtaddr=0x80F80000\0" \
+	"fdt_addr=0x80F80000\0" \
+	"fdt_addr_r=0x80F80000\0" \
 	"fdt_high=0xffffffff\0" \
-	"boot_fdt=try\0" \
-	"rdaddr=0x81000000\0" \
-	"bootpart=0:2\0" \
-	"bootdir=/boot\0" \
-	"bootfile=zImage\0" \
-	"fdtfile=undefined\0" \
-	"console=ttyO0,115200n8\0" \
-	"optargs=\0" \
-	"mmcdev=0\0" \
-	"mmcroot=/dev/mmcblk0p2 ro\0" \
-	"mmcrootfstype=ext4 rootwait\0" \
-	"rootpath=/export/rootfs\0" \
-	"nfsopts=nolock\0" \
-	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
-		"::off\0" \
-	"ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
-	"ramrootfstype=ext2\0" \
-	"mmcargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=${mmcroot} " \
-		"rootfstype=${mmcrootfstype}\0" \
-	"spiroot=/dev/mtdblock4 rw\0" \
-	"spirootfstype=jffs2\0" \
-	"spisrcaddr=0xe0000\0" \
-	"spiimgsize=0x362000\0" \
-	"spibusno=0\0" \
-	"spiargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=${spiroot} " \
-		"rootfstype=${spirootfstype}\0" \
-	"netargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=/dev/nfs " \
-		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
-		"ip=dhcp\0" \
-	"bootenv=uEnv.txt\0" \
-	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
-	"importbootenv=echo Importing environment from mmc ...; " \
-		"env import -t $loadaddr $filesize\0" \
-	"ramargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=${ramroot} " \
-		"rootfstype=${ramrootfstype}\0" \
-	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-	"mmcloados=run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootz ${loadaddr} - ${fdtaddr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"fi;\0" \
-	"mmcboot=mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"echo SD/MMC found on device ${mmcdev};" \
-			"if run loadbootenv; then " \
-				"echo Loaded environment from ${bootenv};" \
-				"run importbootenv;" \
-			"fi;" \
-			"if test -n $uenvcmd; then " \
-				"echo Running uenvcmd ...;" \
-				"run uenvcmd;" \
-			"fi;" \
-			"if run loadimage; then " \
-				"run mmcloados;" \
-			"fi;" \
-		"fi;\0" \
-	"spiboot=echo Booting from spi ...; " \
-		"run spiargs; " \
-		"sf probe ${spibusno}:0; " \
-		"sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
-		"bootz ${loadaddr}\0" \
-	"netboot=echo Booting from network ...; " \
-		"setenv autoload no; " \
-		"dhcp; " \
-		"tftp ${loadaddr} ${bootfile}; " \
-		"tftp ${fdtaddr} ${fdtfile}; " \
-		"run netargs; " \
-		"bootz ${loadaddr} - ${fdtaddr}\0" \
-	"ramboot=echo Booting from ramdisk ...; " \
-		"run ramargs; " \
-		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
+	"ramdisk_addr_r=0x81000000\0" \
+	"kernel_addr_r=0x80200000\0" \
+	"pxe_addr_r=0x80000000\0" \
+	"scriptaddr=0x80000000\0" \
 	"findfdt="\
 		"if test $board_name = A335BONE; then " \
 			"setenv fdtfile am335x-bone.dtb; fi; " \
@@ -159,15 +74,13 @@ 
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
 	NANDARGS \
-	DFUARGS
+	DFUARGS \
+	BOOTCMDS_COMMON
 #endif
 
 #define CONFIG_BOOTCOMMAND \
 	"run findfdt; " \
-	"run mmcboot;" \
-	"setenv mmcdev 1; " \
-	"setenv bootpart 1:2; " \
-	"run mmcboot;" \
+	"for target in ${boot_targets}; do run bootcmd_${target}; done" \
 	"run nandboot;"
 
 /* NS16550 Configuration */
diff --git a/include/configs/ti_armv7_common.h b/include/configs/ti_armv7_common.h
index 99b60fc..016966a 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -28,7 +28,6 @@ 
 #define CONFIG_SYS_NO_FLASH
 
 /* Support both device trees and ATAGs. */
-#define CONFIG_OF_LIBFDT
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_INITRD_TAG
@@ -40,11 +39,6 @@ 
 #define CONFIG_SYS_LOAD_ADDR		0x80000000
 
 /*
- * Default to a quick boot delay.
- */
-#define CONFIG_BOOTDELAY		1
-
-/*
  * DDR information.  We say (for simplicity) that we have 1 bank,
  * always, even when we have more.  We always start at 0x80000000,
  * and we place the initial stack pointer in our SRAM.
@@ -101,19 +95,12 @@ 
  * console baudrate of 115200 and use the default baud rate table.
  */
 #define CONFIG_SYS_MALLOC_LEN		(1024 << 10)
-#define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT		"U-Boot# "
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_BAUDRATE			115200
 #define CONFIG_ENV_VARS_UBOOT_CONFIG	/* Strongly encouraged */
 #define CONFIG_ENV_OVERWRITE		/* Overwrite ethaddr / serial# */
 
-/* As stated above, the following choices are optional. */
-#define CONFIG_SYS_LONGHELP
-#define CONFIG_AUTO_COMPLETE
-#define CONFIG_CMDLINE_EDITING
-#define CONFIG_VERSION_VARIABLE
-
 /* We set the max number of command args high to avoid HUSH bugs. */
 #define CONFIG_SYS_MAXARGS		64
 
@@ -146,19 +133,14 @@ 
 #include <config_cmd_default.h>
 #define CONFIG_CMD_ASKENV
 #define CONFIG_CMD_ECHO
-#define CONFIG_CMD_BOOTZ
 
 /*
- * Common filesystems support.  When we have removable storage we
- * enabled a number of useful commands and support.
+ * Include the generic config options and boot environment when not
+ * building our SPL
  */
-#if defined(CONFIG_MMC) || defined(CONFIG_USB_STORAGE)
-#define CONFIG_DOS_PARTITION
-#define CONFIG_CMD_FAT
-#define CONFIG_FAT_WRITE
-#define CONFIG_CMD_EXT2
-#define CONFIG_CMD_EXT4
-#define CONFIG_CMD_FS_GENERIC
+#ifndef CONFIG_SPL_BUILD
+#include <config_distro_defaults.h>
+#include <config_distro_bootcmd.h>
 #endif
 
 /*