All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] odroid-c2: Enable distro boot
@ 2016-11-01 21:11 ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2016-11-01 21:11 UTC (permalink / raw)
  To: u-boot

Use the generic "distro" boot framework to enable automatic DHCP boot.

Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
 Kconfig                             |  2 +-
 configs/odroid-c2_defconfig         |  1 -
 include/configs/meson-gxbb-common.h | 13 +++++++++++++
 include/configs/odroid-c2.h         |  2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Kconfig b/Kconfig
index 1263d0b..3c085cf 100644
--- a/Kconfig
+++ b/Kconfig
@@ -55,7 +55,7 @@ config CC_OPTIMIZE_FOR_SIZE
 
 config DISTRO_DEFAULTS
 	bool "Select defaults suitable for booting general purpose Linux distributions"
-	default y if ARCH_SUNXI
+	default y if ARCH_MESON || ARCH_SUNXI
 	default n
 	select CMD_BOOTZ if ARM && !ARM64
 	select CMD_BOOTI if ARM64
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 9db718c..dfc19d9 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_FPGA is not set
-# CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h
index 3bba2e6..0c467fe 100644
--- a/include/configs/meson-gxbb-common.h
+++ b/include/configs/meson-gxbb-common.h
@@ -40,4 +40,17 @@
 
 #include <config_distro_defaults.h>
 
+#define BOOT_TARGET_DEVICES(func) \
+	func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"fdt_addr_r=0x01000000\0" \
+	"scriptaddr=0x1f000000\0" \
+	"kernel_addr_r=0x20000000\0" \
+	"pxefile_addr_r=0x20000000\0" \
+	"ramdisk_addr_r=0x28000000\0" \
+	MESON_FDTFILE_SETTING \
+	BOOTENV
+
 #endif /* __MESON_GXBB_COMMON_CONFIG_H */
diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
index 1d5b3d5..bf7e1af 100644
--- a/include/configs/odroid-c2.h
+++ b/include/configs/odroid-c2.h
@@ -12,6 +12,8 @@
 #define CONFIG_CONS_INDEX		0
 #define CONFIG_BAUDRATE			115200
 
+#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-odroidc2.dtb\0"
+
 #include <configs/meson-gxbb-common.h>
 
 #endif /* __CONFIG_H */
-- 
2.6.6

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

* [PATCH] odroid-c2: Enable distro boot
@ 2016-11-01 21:11 ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2016-11-01 21:11 UTC (permalink / raw)
  To: linus-amlogic

Use the generic "distro" boot framework to enable automatic DHCP boot.

Signed-off-by: Andreas F?rber <afaerber@suse.de>
---
 Kconfig                             |  2 +-
 configs/odroid-c2_defconfig         |  1 -
 include/configs/meson-gxbb-common.h | 13 +++++++++++++
 include/configs/odroid-c2.h         |  2 ++
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Kconfig b/Kconfig
index 1263d0b..3c085cf 100644
--- a/Kconfig
+++ b/Kconfig
@@ -55,7 +55,7 @@ config CC_OPTIMIZE_FOR_SIZE
 
 config DISTRO_DEFAULTS
 	bool "Select defaults suitable for booting general purpose Linux distributions"
-	default y if ARCH_SUNXI
+	default y if ARCH_MESON || ARCH_SUNXI
 	default n
 	select CMD_BOOTZ if ARM && !ARM64
 	select CMD_BOOTI if ARM64
diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
index 9db718c..dfc19d9 100644
--- a/configs/odroid-c2_defconfig
+++ b/configs/odroid-c2_defconfig
@@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_LOADS is not set
 # CONFIG_CMD_FPGA is not set
-# CONFIG_CMD_SOURCE is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_CONTROL=y
 CONFIG_NET_RANDOM_ETHADDR=y
diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h
index 3bba2e6..0c467fe 100644
--- a/include/configs/meson-gxbb-common.h
+++ b/include/configs/meson-gxbb-common.h
@@ -40,4 +40,17 @@
 
 #include <config_distro_defaults.h>
 
+#define BOOT_TARGET_DEVICES(func) \
+	func(DHCP, dhcp, na)
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"fdt_addr_r=0x01000000\0" \
+	"scriptaddr=0x1f000000\0" \
+	"kernel_addr_r=0x20000000\0" \
+	"pxefile_addr_r=0x20000000\0" \
+	"ramdisk_addr_r=0x28000000\0" \
+	MESON_FDTFILE_SETTING \
+	BOOTENV
+
 #endif /* __MESON_GXBB_COMMON_CONFIG_H */
diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
index 1d5b3d5..bf7e1af 100644
--- a/include/configs/odroid-c2.h
+++ b/include/configs/odroid-c2.h
@@ -12,6 +12,8 @@
 #define CONFIG_CONS_INDEX		0
 #define CONFIG_BAUDRATE			115200
 
+#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-odroidc2.dtb\0"
+
 #include <configs/meson-gxbb-common.h>
 
 #endif /* __CONFIG_H */
-- 
2.6.6

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

* [U-Boot] [PATCH] odroid-c2: Enable distro boot
  2016-11-01 21:11 ` Andreas Färber
@ 2016-11-01 21:19   ` Alexander Graf
  -1 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2016-11-01 21:19 UTC (permalink / raw)
  To: u-boot



On 01/11/2016 22:11, Andreas F?rber wrote:
> Use the generic "distro" boot framework to enable automatic DHCP boot.

Thanks :)

>
> Signed-off-by: Andreas F?rber <afaerber@suse.de>
> ---
>  Kconfig                             |  2 +-
>  configs/odroid-c2_defconfig         |  1 -
>  include/configs/meson-gxbb-common.h | 13 +++++++++++++
>  include/configs/odroid-c2.h         |  2 ++
>  4 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/Kconfig b/Kconfig
> index 1263d0b..3c085cf 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -55,7 +55,7 @@ config CC_OPTIMIZE_FOR_SIZE
>
>  config DISTRO_DEFAULTS
>  	bool "Select defaults suitable for booting general purpose Linux distributions"
> -	default y if ARCH_SUNXI
> +	default y if ARCH_MESON || ARCH_SUNXI
>  	default n
>  	select CMD_BOOTZ if ARM && !ARM64
>  	select CMD_BOOTI if ARM64
> diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
> index 9db718c..dfc19d9 100644
> --- a/configs/odroid-c2_defconfig
> +++ b/configs/odroid-c2_defconfig
> @@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_LOADS is not set
>  # CONFIG_CMD_FPGA is not set
> -# CONFIG_CMD_SOURCE is not set
>  # CONFIG_CMD_SETEXPR is not set
>  CONFIG_OF_CONTROL=y
>  CONFIG_NET_RANDOM_ETHADDR=y
> diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h
> index 3bba2e6..0c467fe 100644
> --- a/include/configs/meson-gxbb-common.h
> +++ b/include/configs/meson-gxbb-common.h
> @@ -40,4 +40,17 @@
>
>  #include <config_distro_defaults.h>
>
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(DHCP, dhcp, na)

Does the board have more common I/O available than Ethernet? MMC? SATA? 
If so, please add those too :).

> +#include <config_distro_bootcmd.h>
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> +	"fdt_addr_r=0x01000000\0" \

This puts the device tree at 16MB. I don't know how smart the kernel is 
these days about accessing

   a) critical memory below its own starting point
   b) memory that might collide with its own relocation point

so to be safe I think you're better off putting the device tree 
somewhere higher up. Maybe around 800MB?


Alex

> +	"scriptaddr=0x1f000000\0" \
> +	"kernel_addr_r=0x20000000\0" \
> +	"pxefile_addr_r=0x20000000\0" \
> +	"ramdisk_addr_r=0x28000000\0" \
> +	MESON_FDTFILE_SETTING \
> +	BOOTENV
> +
>  #endif /* __MESON_GXBB_COMMON_CONFIG_H */
> diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
> index 1d5b3d5..bf7e1af 100644
> --- a/include/configs/odroid-c2.h
> +++ b/include/configs/odroid-c2.h
> @@ -12,6 +12,8 @@
>  #define CONFIG_CONS_INDEX		0
>  #define CONFIG_BAUDRATE			115200
>
> +#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-odroidc2.dtb\0"
> +
>  #include <configs/meson-gxbb-common.h>
>
>  #endif /* __CONFIG_H */
>

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

* [PATCH] odroid-c2: Enable distro boot
@ 2016-11-01 21:19   ` Alexander Graf
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Graf @ 2016-11-01 21:19 UTC (permalink / raw)
  To: linus-amlogic



On 01/11/2016 22:11, Andreas F?rber wrote:
> Use the generic "distro" boot framework to enable automatic DHCP boot.

Thanks :)

>
> Signed-off-by: Andreas F?rber <afaerber@suse.de>
> ---
>  Kconfig                             |  2 +-
>  configs/odroid-c2_defconfig         |  1 -
>  include/configs/meson-gxbb-common.h | 13 +++++++++++++
>  include/configs/odroid-c2.h         |  2 ++
>  4 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/Kconfig b/Kconfig
> index 1263d0b..3c085cf 100644
> --- a/Kconfig
> +++ b/Kconfig
> @@ -55,7 +55,7 @@ config CC_OPTIMIZE_FOR_SIZE
>
>  config DISTRO_DEFAULTS
>  	bool "Select defaults suitable for booting general purpose Linux distributions"
> -	default y if ARCH_SUNXI
> +	default y if ARCH_MESON || ARCH_SUNXI
>  	default n
>  	select CMD_BOOTZ if ARM && !ARM64
>  	select CMD_BOOTI if ARM64
> diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig
> index 9db718c..dfc19d9 100644
> --- a/configs/odroid-c2_defconfig
> +++ b/configs/odroid-c2_defconfig
> @@ -12,7 +12,6 @@ CONFIG_HUSH_PARSER=y
>  # CONFIG_CMD_IMLS is not set
>  # CONFIG_CMD_LOADS is not set
>  # CONFIG_CMD_FPGA is not set
> -# CONFIG_CMD_SOURCE is not set
>  # CONFIG_CMD_SETEXPR is not set
>  CONFIG_OF_CONTROL=y
>  CONFIG_NET_RANDOM_ETHADDR=y
> diff --git a/include/configs/meson-gxbb-common.h b/include/configs/meson-gxbb-common.h
> index 3bba2e6..0c467fe 100644
> --- a/include/configs/meson-gxbb-common.h
> +++ b/include/configs/meson-gxbb-common.h
> @@ -40,4 +40,17 @@
>
>  #include <config_distro_defaults.h>
>
> +#define BOOT_TARGET_DEVICES(func) \
> +	func(DHCP, dhcp, na)

Does the board have more common I/O available than Ethernet? MMC? SATA? 
If so, please add those too :).

> +#include <config_distro_bootcmd.h>
> +
> +#define CONFIG_EXTRA_ENV_SETTINGS \
> +	"fdt_addr_r=0x01000000\0" \

This puts the device tree at 16MB. I don't know how smart the kernel is 
these days about accessing

   a) critical memory below its own starting point
   b) memory that might collide with its own relocation point

so to be safe I think you're better off putting the device tree 
somewhere higher up. Maybe around 800MB?


Alex

> +	"scriptaddr=0x1f000000\0" \
> +	"kernel_addr_r=0x20000000\0" \
> +	"pxefile_addr_r=0x20000000\0" \
> +	"ramdisk_addr_r=0x28000000\0" \
> +	MESON_FDTFILE_SETTING \
> +	BOOTENV
> +
>  #endif /* __MESON_GXBB_COMMON_CONFIG_H */
> diff --git a/include/configs/odroid-c2.h b/include/configs/odroid-c2.h
> index 1d5b3d5..bf7e1af 100644
> --- a/include/configs/odroid-c2.h
> +++ b/include/configs/odroid-c2.h
> @@ -12,6 +12,8 @@
>  #define CONFIG_CONS_INDEX		0
>  #define CONFIG_BAUDRATE			115200
>
> +#define MESON_FDTFILE_SETTING "fdtfile=amlogic/meson-gxbb-odroidc2.dtb\0"
> +
>  #include <configs/meson-gxbb-common.h>
>
>  #endif /* __CONFIG_H */
>

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

* [U-Boot] [PATCH] odroid-c2: Enable distro boot
  2016-11-01 21:19   ` Alexander Graf
@ 2016-11-01 21:51     ` Andreas Färber
  -1 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2016-11-01 21:51 UTC (permalink / raw)
  To: u-boot

Hi Alex,

Am 01.11.2016 um 22:19 schrieb Alexander Graf:
> On 01/11/2016 22:11, Andreas F?rber wrote:
>> diff --git a/include/configs/meson-gxbb-common.h
>> b/include/configs/meson-gxbb-common.h
>> index 3bba2e6..0c467fe 100644
>> --- a/include/configs/meson-gxbb-common.h
>> +++ b/include/configs/meson-gxbb-common.h
>> @@ -40,4 +40,17 @@
>>
>>  #include <config_distro_defaults.h>
>>
>> +#define BOOT_TARGET_DEVICES(func) \
>> +    func(DHCP, dhcp, na)
> 
> Does the board have more common I/O available than Ethernet? MMC? SATA?

The board yes, U-Boot no. :) That's why I needed to get PXE to work. ;)
Thanks for your help.

FTR I noticed that in v2016.11-rc3 `bootp; bootefi 0x01000000` leads to
an odd $net_{default,efinet0}_mac in GRUB. CONFIG_DISTRO_DEFAULTS
(pulling in CONFIG_CMD_DHCP) resolved this, even when not booting
through the distro framework as before.

BTW it was unclear to me why CONFIG_CMD_SOURCE was disabled in the
defconfig - the distro framework emits an error if missing when it first
tries to execute the PXE file as script, therefore restoring the default
of enabling.

> If so, please add those too :).
> 
>> +#include <config_distro_bootcmd.h>
>> +
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> +    "fdt_addr_r=0x01000000\0" \
> 
> This puts the device tree at 16MB. I don't know how smart the kernel is
> these days about accessing
> 
>   a) critical memory below its own starting point
>   b) memory that might collide with its own relocation point
> 
> so to be safe I think you're better off putting the device tree
> somewhere higher up. Maybe around 800MB?

The fdt and kernel addresses were adopted from the vendor U-Boot and
they worked for my PXE GRUB setup. ramdisk_addr_r was chosen by me and
is untested.

That said, maybe the linux-amlogic people have some input here.

Cheers,
Andreas

>> +    "scriptaddr=0x1f000000\0" \
>> +    "kernel_addr_r=0x20000000\0" \
>> +    "pxefile_addr_r=0x20000000\0" \
>> +    "ramdisk_addr_r=0x28000000\0" \
>> +    MESON_FDTFILE_SETTING \
>> +    BOOTENV
>> +
>>  #endif /* __MESON_GXBB_COMMON_CONFIG_H */
[snip]

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

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

* [PATCH] odroid-c2: Enable distro boot
@ 2016-11-01 21:51     ` Andreas Färber
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2016-11-01 21:51 UTC (permalink / raw)
  To: linus-amlogic

Hi Alex,

Am 01.11.2016 um 22:19 schrieb Alexander Graf:
> On 01/11/2016 22:11, Andreas F?rber wrote:
>> diff --git a/include/configs/meson-gxbb-common.h
>> b/include/configs/meson-gxbb-common.h
>> index 3bba2e6..0c467fe 100644
>> --- a/include/configs/meson-gxbb-common.h
>> +++ b/include/configs/meson-gxbb-common.h
>> @@ -40,4 +40,17 @@
>>
>>  #include <config_distro_defaults.h>
>>
>> +#define BOOT_TARGET_DEVICES(func) \
>> +    func(DHCP, dhcp, na)
> 
> Does the board have more common I/O available than Ethernet? MMC? SATA?

The board yes, U-Boot no. :) That's why I needed to get PXE to work. ;)
Thanks for your help.

FTR I noticed that in v2016.11-rc3 `bootp; bootefi 0x01000000` leads to
an odd $net_{default,efinet0}_mac in GRUB. CONFIG_DISTRO_DEFAULTS
(pulling in CONFIG_CMD_DHCP) resolved this, even when not booting
through the distro framework as before.

BTW it was unclear to me why CONFIG_CMD_SOURCE was disabled in the
defconfig - the distro framework emits an error if missing when it first
tries to execute the PXE file as script, therefore restoring the default
of enabling.

> If so, please add those too :).
> 
>> +#include <config_distro_bootcmd.h>
>> +
>> +#define CONFIG_EXTRA_ENV_SETTINGS \
>> +    "fdt_addr_r=0x01000000\0" \
> 
> This puts the device tree at 16MB. I don't know how smart the kernel is
> these days about accessing
> 
>   a) critical memory below its own starting point
>   b) memory that might collide with its own relocation point
> 
> so to be safe I think you're better off putting the device tree
> somewhere higher up. Maybe around 800MB?

The fdt and kernel addresses were adopted from the vendor U-Boot and
they worked for my PXE GRUB setup. ramdisk_addr_r was chosen by me and
is untested.

That said, maybe the linux-amlogic people have some input here.

Cheers,
Andreas

>> +    "scriptaddr=0x1f000000\0" \
>> +    "kernel_addr_r=0x20000000\0" \
>> +    "pxefile_addr_r=0x20000000\0" \
>> +    "ramdisk_addr_r=0x28000000\0" \
>> +    MESON_FDTFILE_SETTING \
>> +    BOOTENV
>> +
>>  #endif /* __MESON_GXBB_COMMON_CONFIG_H */
[snip]

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 N?rnberg, Germany
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)

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

end of thread, other threads:[~2016-11-01 21:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 21:11 [U-Boot] [PATCH] odroid-c2: Enable distro boot Andreas Färber
2016-11-01 21:11 ` Andreas Färber
2016-11-01 21:19 ` [U-Boot] " Alexander Graf
2016-11-01 21:19   ` Alexander Graf
2016-11-01 21:51   ` [U-Boot] " Andreas Färber
2016-11-01 21:51     ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.