Patchwork [U-Boot,v2,1/3] arm: add CONFIG_MACH_TYPE setting and documentation

login
register
mail settings
Submitter Igor Grinberg
Date July 14, 2011, 3:45 p.m.
Message ID <1310658307-5278-1-git-send-email-grinberg@compulab.co.il>
Download mbox | patch
Permalink /patch/104691/
State Accepted
Commit 7eb29398c0ff6ad431a333a4eb56d917acbc85c1
Delegated to: Albert ARIBAUD
Headers show

Comments

Igor Grinberg - July 14, 2011, 3:45 p.m.
CONFIG_MACH_TYPE is used to set the machine type number in the
common arm code instead of setting it in the board code.
Boards with dynamically discoverable machine types can still set the
machine type number in the board code.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
---
v2:	Document the option as mandatory.
	Move the bi_arch_number setting to board_init_f()

 README               |   10 ++++++++++
 arch/arm/lib/board.c |    4 ++++
 2 files changed, 14 insertions(+), 0 deletions(-)
Igor Grinberg - July 17, 2011, 6:56 a.m.
Hi Albert,


Do you plan on including this in the current merge window?



On 07/14/11 18:45, Igor Grinberg wrote:

> CONFIG_MACH_TYPE is used to set the machine type number in the
> common arm code instead of setting it in the board code.
> Boards with dynamically discoverable machine types can still set the
> machine type number in the board code.
>
> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> v2:	Document the option as mandatory.
> 	Move the bi_arch_number setting to board_init_f()
>
>  README               |   10 ++++++++++
>  arch/arm/lib/board.c |    4 ++++
>  2 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/README b/README
> index 446966d..0b6802d 100644
> --- a/README
> +++ b/README
> @@ -442,6 +442,16 @@ The following options need to be configured:
>  		crash. This is needed for buggy hardware (uc101) where
>  		no pull down resistor is connected to the signal IDE5V_DD7.
>  
> +		CONFIG_MACH_TYPE	[relevant for ARM only][mandatory]
> +
> +		This setting is mandatory for all boards that have only one
> +		machine type and must be used to specify the machine type
> +		number as it appears in the ARM machine registry
> +		(see http://www.arm.linux.org.uk/developer/machines/).
> +		Only boards that have multiple machine types supported
> +		in a single configuration file and the machine type is
> +		runtime discoverable, do not have to use this setting.
> +
>  - vxWorks boot parameters:
>  
>  		bootvx constructs a valid bootline using the following
> diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
> index 169dfeb..9901694 100644
> --- a/arch/arm/lib/board.c
> +++ b/arch/arm/lib/board.c
> @@ -281,6 +281,10 @@ void board_init_f (ulong bootflag)
>  
>  	gd->mon_len = _bss_end_ofs;
>  
> +#ifdef CONFIG_MACH_TYPE
> +	gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
> +#endif
> +
>  	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
>  		if ((*init_fnc_ptr)() != 0) {
>  			hang ();
Albert ARIBAUD - July 17, 2011, 9:08 a.m.
Hi Igor,

Le 14/07/2011 17:45, Igor Grinberg a écrit :
> CONFIG_MACH_TYPE is used to set the machine type number in the
> common arm code instead of setting it in the board code.
> Boards with dynamically discoverable machine types can still set the
> machine type number in the board code.
>
> Signed-off-by: Igor Grinberg<grinberg@compulab.co.il>
> ---
> v2:	Document the option as mandatory.
> 	Move the bi_arch_number setting to board_init_f()

Applied to u-boot-arm/master, thanks!

Amicalement,
Albert ARIBAUD - July 17, 2011, 9:10 a.m.
Hi Igor,

Le 17/07/2011 08:56, Igor Grinberg a écrit :
> Hi Albert,
>
>
> Do you plan on including this in the current merge window?

Done. The other two will be going in as well as they were initially 
submitted before the merge window closure.

Amicalement,

Patch

diff --git a/README b/README
index 446966d..0b6802d 100644
--- a/README
+++ b/README
@@ -442,6 +442,16 @@  The following options need to be configured:
 		crash. This is needed for buggy hardware (uc101) where
 		no pull down resistor is connected to the signal IDE5V_DD7.
 
+		CONFIG_MACH_TYPE	[relevant for ARM only][mandatory]
+
+		This setting is mandatory for all boards that have only one
+		machine type and must be used to specify the machine type
+		number as it appears in the ARM machine registry
+		(see http://www.arm.linux.org.uk/developer/machines/).
+		Only boards that have multiple machine types supported
+		in a single configuration file and the machine type is
+		runtime discoverable, do not have to use this setting.
+
 - vxWorks boot parameters:
 
 		bootvx constructs a valid bootline using the following
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..9901694 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -281,6 +281,10 @@  void board_init_f (ulong bootflag)
 
 	gd->mon_len = _bss_end_ofs;
 
+#ifdef CONFIG_MACH_TYPE
+	gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
+#endif
+
 	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
 		if ((*init_fnc_ptr)() != 0) {
 			hang ();