mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/4] common: boot: don't return too early in bootscript dryrun
@ 2021-06-13 22:26 Marc Reilly
  2021-06-13 22:26 ` [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW Marc Reilly
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Marc Reilly @ 2021-06-13 22:26 UTC (permalink / raw)
  To: barebox

A dryrun boot will now run the boot script and a then a
dryrun of the bootm.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
---
 common/boot.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/common/boot.c b/common/boot.c
index 07b67734d..183e6bb43 100644
--- a/common/boot.c
+++ b/common/boot.c
@@ -77,7 +77,6 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun)
 
 	if (dryrun) {
 		printf("Would run %s\n", bs->scriptpath);
-		return 0;
 	}
 
 	globalvar_add_simple("linux.bootargs.dyn.ip", NULL);
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW
  2021-06-13 22:26 [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Marc Reilly
@ 2021-06-13 22:26 ` Marc Reilly
  2021-06-15  9:11   ` Sascha Hauer
  2021-06-13 22:26 ` [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point Marc Reilly
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Marc Reilly @ 2021-06-13 22:26 UTC (permalink / raw)
  To: barebox

This adds a check against the eeprom contents to see if the board is a
Beaglebone black wireless. (two bytes at offset 0x12 of eeprom will be
"BW").
If it is, the global board.variant is updated to "boneblackwireless"

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
---
 .../defaultenv-beaglebone/data/bbb-eeprom-0x0C      |  1 +
 .../defaultenv-beaglebone/init/check-bbb-type       | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
 create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type

diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
new file mode 100644
index 000000000..258b93951
--- /dev/null
+++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
@@ -0,0 +1 @@
+BW
diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type
new file mode 100644
index 000000000..b7c8b3683
--- /dev/null
+++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+memcmp -b -s /dev/eeprom0 -d /env/data/bbb-eeprom-0x0C 0x0c 0x00 2
+result=$?
+echo $result
+
+if [ $result = 0 ]
+then
+        echo "Beaglebone Wireless detected"
+        global.board.variant=boneblackwireless
+else
+        echo "Beaglebone Black (non-wireless) detected"
+fi
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point
  2021-06-13 22:26 [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Marc Reilly
  2021-06-13 22:26 ` [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW Marc Reilly
@ 2021-06-13 22:26 ` Marc Reilly
  2021-06-15  9:14   ` Sascha Hauer
  2021-06-13 22:26 ` [PATCH 4/4] ARM: beaglebone: init MPU speed to 800Mhz Marc Reilly
  2021-06-14  8:51 ` [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Ahmad Fatoum
  3 siblings, 1 reply; 9+ messages in thread
From: Marc Reilly @ 2021-06-13 22:26 UTC (permalink / raw)
  To: barebox

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
---
 arch/arm/mach-omap/include/mach/am33xx-clock.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-omap/include/mach/am33xx-clock.h b/arch/arm/mach-omap/include/mach/am33xx-clock.h
index e71ecbcd2..3c2143d60 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-clock.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-clock.h
@@ -24,6 +24,7 @@
 #define MPUPLL_M_550	550	/* 125 * n */
 #define MPUPLL_M_600	600	/* 125 * n */
 #define MPUPLL_M_720	720	/* 125 * n */
+#define MPUPLL_M_800	800
 
 #define MPUPLL_M2	1
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/4] ARM: beaglebone: init MPU speed to 800Mhz
  2021-06-13 22:26 [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Marc Reilly
  2021-06-13 22:26 ` [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW Marc Reilly
  2021-06-13 22:26 ` [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point Marc Reilly
@ 2021-06-13 22:26 ` Marc Reilly
  2021-06-14  8:51 ` [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Ahmad Fatoum
  3 siblings, 0 replies; 9+ messages in thread
From: Marc Reilly @ 2021-06-13 22:26 UTC (permalink / raw)
  To: barebox

This sets the core processor speed to 800Mhz (from 500). Doing this helps
speed the boot up a bit until the CPU freq govenor takes over.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
---
 arch/arm/boards/beaglebone/lowlevel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boards/beaglebone/lowlevel.c b/arch/arm/boards/beaglebone/lowlevel.c
index 91d143e41..31211448f 100644
--- a/arch/arm/boards/beaglebone/lowlevel.c
+++ b/arch/arm/boards/beaglebone/lowlevel.c
@@ -126,7 +126,7 @@ static noinline int beaglebone_sram_init(void)
 
 	/* Setup the PLLs and the clocks for the peripherals */
 	if (is_beaglebone_black()) {
-		am33xx_pll_init(MPUPLL_M_500, DDRPLL_M_400);
+		am33xx_pll_init(MPUPLL_M_800, DDRPLL_M_400);
 		am335x_sdram_init(0x18B, &ddr3_cmd_ctrl, &ddr3_regs,
 				&ddr3_data);
 	} else {
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] common: boot: don't return too early in bootscript dryrun
  2021-06-13 22:26 [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Marc Reilly
                   ` (2 preceding siblings ...)
  2021-06-13 22:26 ` [PATCH 4/4] ARM: beaglebone: init MPU speed to 800Mhz Marc Reilly
@ 2021-06-14  8:51 ` Ahmad Fatoum
  2021-06-15  5:31   ` Marc Reilly
  2021-06-15  8:59   ` Sascha Hauer
  3 siblings, 2 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2021-06-14  8:51 UTC (permalink / raw)
  To: Marc Reilly, barebox

Hi,

On 14.06.21 00:26, Marc Reilly wrote:
> A dryrun boot will now run the boot script and a then a
> dryrun of the bootm.

This would change behavior for boot scripts that directly boot
instead of setting up variables for bootm to use, but I think
that's acceptable,

Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> 
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
>  common/boot.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/common/boot.c b/common/boot.c
> index 07b67734d..183e6bb43 100644
> --- a/common/boot.c
> +++ b/common/boot.c
> @@ -77,7 +77,6 @@ static int bootscript_boot(struct bootentry *entry, int verbose, int dryrun)
>  
>  	if (dryrun) {
>  		printf("Would run %s\n", bs->scriptpath);
> -		return 0;

Maybe change message to reflect the new reality?
s/Would run/Running/

>  	}
>  
>  	globalvar_add_simple("linux.bootargs.dyn.ip", NULL);
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] common: boot: don't return too early in bootscript dryrun
  2021-06-14  8:51 ` [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Ahmad Fatoum
@ 2021-06-15  5:31   ` Marc Reilly
  2021-06-15  8:59   ` Sascha Hauer
  1 sibling, 0 replies; 9+ messages in thread
From: Marc Reilly @ 2021-06-15  5:31 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum

Hi Ahmad,

On Monday, 14 June 2021 6:51:27 PM AEST Ahmad Fatoum wrote:
> Hi,
> 
> On 14.06.21 00:26, Marc Reilly wrote:
> > A dryrun boot will now run the boot script and a then a
> > dryrun of the bootm.
> 
> This would change behavior for boot scripts that directly boot
> instead of setting up variables for bootm to use, but I think
> > that's acceptable,

To be honest I didn't consider this .. although I'm not sure what the use case 
for this command would be for that scenario.

Ideally then, there could be two parameters for 'dryrun', one to stop at 
running the script, and one to go through to the call to bootm.
This could also be done using a combination of the 'verbose' and 'dryrun' 
flags ... (somewhat hackish solution)

> > 
> 
> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> 
> > Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> > ---
> > 
> >  common/boot.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/common/boot.c b/common/boot.c
> > index 07b67734d..183e6bb43 100644
> > --- a/common/boot.c
> > +++ b/common/boot.c
> > @@ -77,7 +77,6 @@ static int bootscript_boot(struct bootentry *entry, int
> > verbose, int dryrun)> 
> >  	if (dryrun) {
> >  	
> >  		printf("Would run %s\n", bs->scriptpath);
> > 
> > -		return 0;
> 
> Maybe change message to reflect the new reality?
> > s/Would run/Running/

Sure, I can do this, unless we think the extra parameter should be added to 
the command.


Cheers
Marc

> > 
> 
> >  	}
> >  	
> >  	globalvar_add_simple("linux.bootargs.dyn.ip", NULL);





_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/4] common: boot: don't return too early in bootscript dryrun
  2021-06-14  8:51 ` [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Ahmad Fatoum
  2021-06-15  5:31   ` Marc Reilly
@ 2021-06-15  8:59   ` Sascha Hauer
  1 sibling, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2021-06-15  8:59 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Jun 14, 2021 at 10:51:27AM +0200, Ahmad Fatoum wrote:
> Hi,
> 
> On 14.06.21 00:26, Marc Reilly wrote:
> > A dryrun boot will now run the boot script and a then a
> > dryrun of the bootm.
> 
> This would change behavior for boot scripts that directly boot
> instead of setting up variables for bootm to use, but I think
> that's acceptable,

That's the reason the dryrun for bootscripts is aborted before executing
them. Both ways are not really optimal, but I don't want to replace one
suboptimal solution with another.
Maybe we could pass an option to the bootscript so that a script has
the chance to test for that option before booting. That would still
change the behaviour for scripts that don't test for that option, but
at least they could be fixed.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW
  2021-06-13 22:26 ` [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW Marc Reilly
@ 2021-06-15  9:11   ` Sascha Hauer
  0 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2021-06-15  9:11 UTC (permalink / raw)
  To: Marc Reilly; +Cc: barebox

On Mon, Jun 14, 2021 at 08:26:37AM +1000, Marc Reilly wrote:
> This adds a check against the eeprom contents to see if the board is a
> Beaglebone black wireless. (two bytes at offset 0x12 of eeprom will be
> "BW").
> If it is, the global board.variant is updated to "boneblackwireless"
> 
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
>  .../defaultenv-beaglebone/data/bbb-eeprom-0x0C      |  1 +
>  .../defaultenv-beaglebone/init/check-bbb-type       | 13 +++++++++++++
>  2 files changed, 14 insertions(+)
>  create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
>  create mode 100644 arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type
> 
> diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
> new file mode 100644
> index 000000000..258b93951
> --- /dev/null
> +++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/data/bbb-eeprom-0x0C
> @@ -0,0 +1 @@
> +BW
> diff --git a/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type
> new file mode 100644
> index 000000000..b7c8b3683
> --- /dev/null
> +++ b/arch/arm/boards/beaglebone/defaultenv-beaglebone/init/check-bbb-type
> @@ -0,0 +1,13 @@
> +#!/bin/sh
> +
> +memcmp -b -s /dev/eeprom0 -d /env/data/bbb-eeprom-0x0C 0x0c 0x00 2
> +result=$?
> +echo $result
> +
> +if [ $result = 0 ]
> +then
> +        echo "Beaglebone Wireless detected"
> +        global.board.variant=boneblackwireless
> +else
> +        echo "Beaglebone Black (non-wireless) detected"
> +fi

I think it's worth doing this in C code. A good template for this is in
https://git.pengutronix.de/cgit/barebox/tree/arch/arm/boards/skov-imx6/board.c#n435
Here the board compatible is prepended with a more specific variant, for
the BBB this would be "ti,am335x-bone-black-wireless". With this
bootspec could pick the entry with the right devicetree without further
interventions.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point
  2021-06-13 22:26 ` [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point Marc Reilly
@ 2021-06-15  9:14   ` Sascha Hauer
  0 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2021-06-15  9:14 UTC (permalink / raw)
  To: Marc Reilly; +Cc: barebox

On Mon, Jun 14, 2021 at 08:26:38AM +1000, Marc Reilly wrote:
> Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
> ---
>  arch/arm/mach-omap/include/mach/am33xx-clock.h | 1 +
>  1 file changed, 1 insertion(+)

Applied this one and 4/4 for now.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-06-15 19:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 22:26 [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Marc Reilly
2021-06-13 22:26 ` [PATCH 2/4] ARM: beaglebone: add helper init script for checking if BBBW Marc Reilly
2021-06-15  9:11   ` Sascha Hauer
2021-06-13 22:26 ` [PATCH 3/4] ARM: am33xx: add define for 800Mhz MPU PLL point Marc Reilly
2021-06-15  9:14   ` Sascha Hauer
2021-06-13 22:26 ` [PATCH 4/4] ARM: beaglebone: init MPU speed to 800Mhz Marc Reilly
2021-06-14  8:51 ` [PATCH 1/4] common: boot: don't return too early in bootscript dryrun Ahmad Fatoum
2021-06-15  5:31   ` Marc Reilly
2021-06-15  8:59   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox