diff mbox

[U-Boot,v5,18/23] ppc: Enable generic board support

Message ID 1360336339-10703-19-git-send-email-sjg@chromium.org
State Deferred, archived
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Feb. 8, 2013, 3:12 p.m. UTC
This enables generic board support so that ppc boards can define
CONFIG_SYS_GENERIC_BOARD.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/powerpc/config.mk            | 3 ---
 arch/powerpc/include/asm/u-boot.h | 7 +++++++
 arch/powerpc/lib/Makefile         | 2 ++
 3 files changed, 9 insertions(+), 3 deletions(-)

Comments

Simon Glass Feb. 12, 2013, 10:29 p.m. UTC | #1
Hi Scott,

On Tue, Feb 12, 2013 at 12:38 PM, Scott Wood <scottwood@freescale.com> wrote:
> On 02/08/2013 09:12:14 AM, Simon Glass wrote:
>>
>> This enables generic board support so that ppc boards can define
>> CONFIG_SYS_GENERIC_BOARD.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>> Changes in v5: None
>> Changes in v4: None
>> Changes in v3: None
>> Changes in v2: None
>>
>>  arch/powerpc/config.mk            | 3 ---
>>  arch/powerpc/include/asm/u-boot.h | 7 +++++++
>>  arch/powerpc/lib/Makefile         | 2 ++
>>  3 files changed, 9 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
>> index bf77090..b706281 100644
>> --- a/arch/powerpc/config.mk
>> +++ b/arch/powerpc/config.mk
>> @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable
>> -ffunction-sections -fdata-sections
>>  PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
>>  PLATFORM_LDFLAGS  += -n
>>
>> -# Move to unified board system later
>> -CONFIG_SYS_LEGACY_BOARD := y
>> -
>>  #
>>  # When cross-compiling on NetBSD, we have to define __PPC__ or else we
>>  # will pick up a va_list declaration that is incompatible with the
>> diff --git a/arch/powerpc/include/asm/u-boot.h
>> b/arch/powerpc/include/asm/u-boot.h
>> index 7229a98..951dd6a 100644
>> --- a/arch/powerpc/include/asm/u-boot.h
>> +++ b/arch/powerpc/include/asm/u-boot.h
>> @@ -34,6 +34,11 @@
>>   * include/asm-ppc/u-boot.h
>>   */
>>
>> +#ifdef CONFIG_SYS_GENERIC_BOARD
>> +/* Use the generic board which requires a unified bd_info */
>> +#include <asm-generic/u-boot.h>
>> +#else
>
>
> Note that a unified bd_info means you're breaking compatibility with old,
> pre-device-tree kernels (including possibly some non-Linux OSes that still
> don't use the device tree) -- in which case why keep it around at all?

It's not intended to break things - are you saying that every arch is
defined to use a different variant of bd_t in these OSes, or are you
just referring to PPC?

>
> If you meant for the unified bd_info to be backwards compatible, it's
> missing bi_ip_addr.

OK, I see. I saw a commit that punted it, so I punted it. I didn't
notice the re-add later. I will put it back.

Regards,
Simon

>
> -Scott
Scott Wood Feb. 12, 2013, 10:40 p.m. UTC | #2
On 02/12/2013 04:29:56 PM, Simon Glass wrote:
> Hi Scott,
> 
> On Tue, Feb 12, 2013 at 12:38 PM, Scott Wood  
> <scottwood@freescale.com> wrote:
> > On 02/08/2013 09:12:14 AM, Simon Glass wrote:
> >>
> >> This enables generic board support so that ppc boards can define
> >> CONFIG_SYS_GENERIC_BOARD.
> >>
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> >> ---
> >> Changes in v5: None
> >> Changes in v4: None
> >> Changes in v3: None
> >> Changes in v2: None
> >>
> >>  arch/powerpc/config.mk            | 3 ---
> >>  arch/powerpc/include/asm/u-boot.h | 7 +++++++
> >>  arch/powerpc/lib/Makefile         | 2 ++
> >>  3 files changed, 9 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
> >> index bf77090..b706281 100644
> >> --- a/arch/powerpc/config.mk
> >> +++ b/arch/powerpc/config.mk
> >> @@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable
> >> -ffunction-sections -fdata-sections
> >>  PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
> >>  PLATFORM_LDFLAGS  += -n
> >>
> >> -# Move to unified board system later
> >> -CONFIG_SYS_LEGACY_BOARD := y
> >> -
> >>  #
> >>  # When cross-compiling on NetBSD, we have to define __PPC__ or  
> else we
> >>  # will pick up a va_list declaration that is incompatible with the
> >> diff --git a/arch/powerpc/include/asm/u-boot.h
> >> b/arch/powerpc/include/asm/u-boot.h
> >> index 7229a98..951dd6a 100644
> >> --- a/arch/powerpc/include/asm/u-boot.h
> >> +++ b/arch/powerpc/include/asm/u-boot.h
> >> @@ -34,6 +34,11 @@
> >>   * include/asm-ppc/u-boot.h
> >>   */
> >>
> >> +#ifdef CONFIG_SYS_GENERIC_BOARD
> >> +/* Use the generic board which requires a unified bd_info */
> >> +#include <asm-generic/u-boot.h>
> >> +#else
> >
> >
> > Note that a unified bd_info means you're breaking compatibility  
> with old,
> > pre-device-tree kernels (including possibly some non-Linux OSes  
> that still
> > don't use the device tree) -- in which case why keep it around at  
> all?
> 
> It's not intended to break things - are you saying that every arch is
> defined to use a different variant of bd_t in these OSes, or are you
> just referring to PPC?

Any OS that uses bd_info is going to rely on things not changing (other  
than additions to the end) from whatever was used for that particular  
platform at the time the OS copied the struct definition.

-Scott
diff mbox

Patch

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index bf77090..b706281 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -29,9 +29,6 @@  PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
-
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
 # will pick up a va_list declaration that is incompatible with the
diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h
index 7229a98..951dd6a 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -34,6 +34,11 @@ 
  * include/asm-ppc/u-boot.h
  */
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include <asm-generic/u-boot.h>
+#else
+
 #ifndef __ASSEMBLY__
 
 typedef struct bd_info {
@@ -144,6 +149,8 @@  typedef struct bd_info {
 
 #endif /* __ASSEMBLY__ */
 
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_PPC
 
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 86cf02a..59c723b 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -59,8 +59,10 @@  SOBJS-y	+= reloc.o
 
 COBJS-$(CONFIG_BAT_RW) += bat_rw.o
 ifndef CONFIG_SPL_BUILD
+ifndef CONFIG_SYS_GENERIC_BOARD
 COBJS-y	+= board.o
 endif
+endif
 COBJS-y	+= bootm.o
 COBJS-y	+= cache.o
 COBJS-y	+= extable.o