diff mbox

[U-Boot,3/3] omap4_panda: Convert to config_distro_bootcmd.h

Message ID 1449783963-20622-3-git-send-email-trini@konsulko.com
State Accepted
Commit 2a1a29c5e7a785d3efce2c74f0b27aca274ef482
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini Dec. 10, 2015, 9:46 p.m. UTC
Based on the am335x_evm conversion, switch to config_distro_bootcmd for
mmc and pxe.  Tested with Fedora 23.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 24 deletions(-)

Comments

Robert Nelson Dec. 10, 2015, 10:58 p.m. UTC | #1
On Thu, Dec 10, 2015 at 3:46 PM, Tom Rini <trini@konsulko.com> wrote:
> Based on the am335x_evm conversion, switch to config_distro_bootcmd for
> mmc and pxe.  Tested with Fedora 23.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
>  1 file changed, 27 insertions(+), 24 deletions(-)
>
> diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
> index 08130eb..8b6c065 100644
> --- a/include/configs/ti_omap4_common.h
> +++ b/include/configs/ti_omap4_common.h
> @@ -82,6 +82,32 @@
>  /*
>   * Environment setup
>   */
> +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
> +       "bootcmd_" #devtypel #instance "=" \
> +       "setenv mmcdev " #instance"; "\
> +       "setenv bootpart " #instance":2 ; "\
> +       "run mmcboot\0"
> +
> +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
> +       #devtypel #instance " "
> +
> +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
> +       #devtypel #instance " "
> +
> +#define BOOT_TARGET_DEVICES(func) \
> +       func(MMC, mmc, 0) \
> +       func(LEGACY_MMC, legacy_mmc, 0) \
> +       func(MMC, mmc, 1) \
> +       func(LEGACY_MMC, legacy_mmc, 1) \

I don't remember the panda having a 2nd mmc card slot, are there other
omap4's with this feature?

Regards,
Robert Nelson Dec. 10, 2015, 11:01 p.m. UTC | #2
On Thu, Dec 10, 2015 at 4:58 PM, Robert Nelson <robertcnelson@gmail.com> wrote:
> On Thu, Dec 10, 2015 at 3:46 PM, Tom Rini <trini@konsulko.com> wrote:
>> Based on the am335x_evm conversion, switch to config_distro_bootcmd for
>> mmc and pxe.  Tested with Fedora 23.
>>
>> Signed-off-by: Tom Rini <trini@konsulko.com>
>> ---
>>  include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
>>  1 file changed, 27 insertions(+), 24 deletions(-)
>>
>> diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
>> index 08130eb..8b6c065 100644
>> --- a/include/configs/ti_omap4_common.h
>> +++ b/include/configs/ti_omap4_common.h
>> @@ -82,6 +82,32 @@
>>  /*
>>   * Environment setup
>>   */
>> +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
>> +       "bootcmd_" #devtypel #instance "=" \
>> +       "setenv mmcdev " #instance"; "\
>> +       "setenv bootpart " #instance":2 ; "\
>> +       "run mmcboot\0"
>> +
>> +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
>> +       #devtypel #instance " "
>> +
>> +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
>> +       #devtypel #instance " "
>> +
>> +#define BOOT_TARGET_DEVICES(func) \
>> +       func(MMC, mmc, 0) \
>> +       func(LEGACY_MMC, legacy_mmc, 0) \
>> +       func(MMC, mmc, 1) \
>> +       func(LEGACY_MMC, legacy_mmc, 1) \
>
> I don't remember the panda having a 2nd mmc card slot, are there other
> omap4's with this feature?

ahh the omap4-sdp did, since this is ti_omap4_common.h that's fine..

Regards,
Tom Rini Dec. 11, 2015, 9:52 p.m. UTC | #3
On Thu, Dec 10, 2015 at 04:58:17PM -0600, Robert Nelson wrote:
> On Thu, Dec 10, 2015 at 3:46 PM, Tom Rini <trini@konsulko.com> wrote:
> > Based on the am335x_evm conversion, switch to config_distro_bootcmd for
> > mmc and pxe.  Tested with Fedora 23.
> >
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> >  include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
> >  1 file changed, 27 insertions(+), 24 deletions(-)
> >
> > diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
> > index 08130eb..8b6c065 100644
> > --- a/include/configs/ti_omap4_common.h
> > +++ b/include/configs/ti_omap4_common.h
> > @@ -82,6 +82,32 @@
> >  /*
> >   * Environment setup
> >   */
> > +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
> > +       "bootcmd_" #devtypel #instance "=" \
> > +       "setenv mmcdev " #instance"; "\
> > +       "setenv bootpart " #instance":2 ; "\
> > +       "run mmcboot\0"
> > +
> > +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
> > +       #devtypel #instance " "
> > +
> > +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
> > +       #devtypel #instance " "
> > +
> > +#define BOOT_TARGET_DEVICES(func) \
> > +       func(MMC, mmc, 0) \
> > +       func(LEGACY_MMC, legacy_mmc, 0) \
> > +       func(MMC, mmc, 1) \
> > +       func(LEGACY_MMC, legacy_mmc, 1) \
> 
> I don't remember the panda having a 2nd mmc card slot, are there other
> omap4's with this feature?

Ah, good spotting, oops, will fix in v2.
Tom Rini Dec. 11, 2015, 9:53 p.m. UTC | #4
On Thu, Dec 10, 2015 at 05:01:25PM -0600, Robert Nelson wrote:
> On Thu, Dec 10, 2015 at 4:58 PM, Robert Nelson <robertcnelson@gmail.com> wrote:
> > On Thu, Dec 10, 2015 at 3:46 PM, Tom Rini <trini@konsulko.com> wrote:
> >> Based on the am335x_evm conversion, switch to config_distro_bootcmd for
> >> mmc and pxe.  Tested with Fedora 23.
> >>
> >> Signed-off-by: Tom Rini <trini@konsulko.com>
> >> ---
> >>  include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
> >>  1 file changed, 27 insertions(+), 24 deletions(-)
> >>
> >> diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
> >> index 08130eb..8b6c065 100644
> >> --- a/include/configs/ti_omap4_common.h
> >> +++ b/include/configs/ti_omap4_common.h
> >> @@ -82,6 +82,32 @@
> >>  /*
> >>   * Environment setup
> >>   */
> >> +#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
> >> +       "bootcmd_" #devtypel #instance "=" \
> >> +       "setenv mmcdev " #instance"; "\
> >> +       "setenv bootpart " #instance":2 ; "\
> >> +       "run mmcboot\0"
> >> +
> >> +#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
> >> +       #devtypel #instance " "
> >> +
> >> +#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
> >> +       #devtypel #instance " "
> >> +
> >> +#define BOOT_TARGET_DEVICES(func) \
> >> +       func(MMC, mmc, 0) \
> >> +       func(LEGACY_MMC, legacy_mmc, 0) \
> >> +       func(MMC, mmc, 1) \
> >> +       func(LEGACY_MMC, legacy_mmc, 1) \
> >
> > I don't remember the panda having a 2nd mmc card slot, are there other
> > omap4's with this feature?
> 
> ahh the omap4-sdp did, since this is ti_omap4_common.h that's fine..

Even better, we'll pretend I did it right to start with :)
Tom Rini Jan. 14, 2016, 1:21 p.m. UTC | #5
On Thu, Dec 10, 2015 at 04:46:03PM -0500, Tom Rini wrote:

> Based on the am335x_evm conversion, switch to config_distro_bootcmd for
> mmc and pxe.  Tested with Fedora 23.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
Peter Korsgaard March 15, 2016, 9:22 p.m. UTC | #6
On Thu, Dec 10, 2015 at 10:46 PM, Tom Rini <trini@konsulko.com> wrote:
> Based on the am335x_evm conversion, switch to config_distro_bootcmd for
> mmc and pxe.  Tested with Fedora 23.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  include/configs/ti_omap4_common.h |   51 ++++++++++++++++++++-----------------
>  1 file changed, 27 insertions(+), 24 deletions(-)
>
> diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h

[snip]

> -#define CONFIG_BOOTCOMMAND \
> -       "run findfdt; " \
> -       "mmc dev ${mmcdev}; if mmc rescan; then " \
> -               "echo SD/MMC found on device ${mmcdev};" \
> -               "if run loadbootscript; then " \
> -                       "run bootscript; " \
> -               "else " \
> -                       "if run loadbootenv; then " \
> -                               "run importbootenv; " \
> -                       "fi;" \
> -                       "if test -n ${uenvcmd}; then " \
> -                               "echo Running uenvcmd ...;" \
> -                               "run uenvcmd;" \
> -                       "fi;" \
> -               "fi;" \
> -               "if run loadimage; then " \
> -                       "run loadfdt;" \
> -                       "run mmcboot; " \
> -               "fi; " \

This breaks legacy boot on pandaboard here. In Buildroot we have the
kernel + dtb in partition 0:2 and no custom boot script, which used to
be handled by the loadimage stuff, but that is no longer called.
diff mbox

Patch

diff --git a/include/configs/ti_omap4_common.h b/include/configs/ti_omap4_common.h
index 08130eb..8b6c065 100644
--- a/include/configs/ti_omap4_common.h
+++ b/include/configs/ti_omap4_common.h
@@ -82,6 +82,32 @@ 
 /*
  * Environment setup
  */
+#define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
+	"bootcmd_" #devtypel #instance "=" \
+	"setenv mmcdev " #instance"; "\
+	"setenv bootpart " #instance":2 ; "\
+	"run mmcboot\0"
+
+#define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
+	#devtypel #instance " "
+
+#define BOOT_TARGET_DEVICES(func) \
+	func(MMC, mmc, 0) \
+	func(LEGACY_MMC, legacy_mmc, 0) \
+	func(MMC, mmc, 1) \
+	func(LEGACY_MMC, legacy_mmc, 1) \
+	func(PXE, pxe, na) \
+	func(DHCP, dhcp, na)
+
+#define CONFIG_BOOTCOMMAND \
+	"run findfdt; " \
+	"run distro_bootcmd"
+
+#include <config_distro_bootcmd.h>
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
 	DEFAULT_MMC_TI_ARGS \
@@ -120,30 +146,7 @@ 
 		"if test $fdtfile = undefined; then " \
 			"echo WARNING: Could not determine device tree to use; fi; \0" \
 	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-
-#define CONFIG_BOOTCOMMAND \
-	"run findfdt; " \
-	"mmc dev ${mmcdev}; if mmc rescan; then " \
-		"echo SD/MMC found on device ${mmcdev};" \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
-		"else " \
-			"if run loadbootenv; then " \
-				"run importbootenv; " \
-			"fi;" \
-			"if test -n ${uenvcmd}; then " \
-				"echo Running uenvcmd ...;" \
-				"run uenvcmd;" \
-			"fi;" \
-		"fi;" \
-		"if run loadimage; then " \
-			"run loadfdt;" \
-			"run mmcboot; " \
-		"fi; " \
-		"if run loaduimage; then " \
-			"run uimageboot;" \
-		"fi; " \
-	"fi"
+	BOOTENV
 
 /*
  * Defines for SPL