* [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header
@ 2013-03-10 16:16 Andreas Bießmann
2013-03-14 1:46 ` Bo Shen
2013-05-10 15:05 ` [U-Boot] [PATCH v2] " Andreas Bießmann
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Bießmann @ 2013-03-10 16:16 UTC (permalink / raw)
To: u-boot
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
Cc: Bo Shen <voice.shen@atmel.com>
---
board/atmel/at91sam9260ek/at91sam9260ek.c | 12 ------------
include/configs/at91sam9260ek.h | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
index 3aa394a..049b3d7 100644
--- a/board/atmel/at91sam9260ek/at91sam9260ek.c
+++ b/board/atmel/at91sam9260ek/at91sam9260ek.c
@@ -157,18 +157,6 @@ int board_early_init_f(void)
int board_init(void)
{
-#ifdef CONFIG_AT91SAM9G20EK_2MMC
- /* arch number of AT91SAM9G20EK_2MMC-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK_2MMC;
-#else
-#ifdef CONFIG_AT91SAM9G20EK
- /* arch number of AT91SAM9G20EK-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK;
-#else
- /* arch number of AT91SAM9260EK-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9260EK;
-#endif
-#endif
/* adress of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index 02696b3..2d2efb2 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -125,6 +125,26 @@
(ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
#endif
+/*
+ * The (arm)linux board id set by generic code depending on configured board
+ * (see boards.cfg for different boards)
+ */
+#ifdef CONFIG_AT91SAM9G20
+ /* the sam9g20 variants have two different board ids */
+# ifdef CONFIG_AT91SAM9G20EK_2MMC
+ /* we may be setup for the 2MMC variant of at91sam9g20ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
+# else
+# ifdef CONFIG_AT91SAM9G20EK
+ /* or the normal at91sam9g20ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
+# endif
+# endif
+#else
+ /* otherwise default to good old at91sam9260ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
+#endif
+
/* DataFlash */
#ifndef CONFIG_AT91SAM9G20EK_2MMC
#define CONFIG_ATMEL_DATAFLASH_SPI
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header
2013-03-10 16:16 [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header Andreas Bießmann
@ 2013-03-14 1:46 ` Bo Shen
2013-03-14 8:44 ` Andreas Bießmann
2013-05-10 15:05 ` [U-Boot] [PATCH v2] " Andreas Bießmann
1 sibling, 1 reply; 5+ messages in thread
From: Bo Shen @ 2013-03-14 1:46 UTC (permalink / raw)
To: u-boot
On 3/11/2013 0:16, Andreas Bie?mann wrote:
> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
> Cc: Bo Shen <voice.shen@atmel.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
> ---
> board/atmel/at91sam9260ek/at91sam9260ek.c | 12 ------------
> include/configs/at91sam9260ek.h | 20 ++++++++++++++++++++
> 2 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
> index 3aa394a..049b3d7 100644
> --- a/board/atmel/at91sam9260ek/at91sam9260ek.c
> +++ b/board/atmel/at91sam9260ek/at91sam9260ek.c
> @@ -157,18 +157,6 @@ int board_early_init_f(void)
>
> int board_init(void)
> {
> -#ifdef CONFIG_AT91SAM9G20EK_2MMC
> - /* arch number of AT91SAM9G20EK_2MMC-Board */
> - gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK_2MMC;
> -#else
> -#ifdef CONFIG_AT91SAM9G20EK
> - /* arch number of AT91SAM9G20EK-Board */
> - gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK;
> -#else
> - /* arch number of AT91SAM9260EK-Board */
> - gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9260EK;
> -#endif
> -#endif
> /* adress of boot parameters */
> gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
>
> diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
> index 02696b3..2d2efb2 100644
> --- a/include/configs/at91sam9260ek.h
> +++ b/include/configs/at91sam9260ek.h
> @@ -125,6 +125,26 @@
> (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
> #endif
>
> +/*
> + * The (arm)linux board id set by generic code depending on configured board
> + * (see boards.cfg for different boards)
> + */
> +#ifdef CONFIG_AT91SAM9G20
> + /* the sam9g20 variants have two different board ids */
> +# ifdef CONFIG_AT91SAM9G20EK_2MMC
> + /* we may be setup for the 2MMC variant of at91sam9g20ek */
> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
> +# else
> +# ifdef CONFIG_AT91SAM9G20EK
> + /* or the normal at91sam9g20ek */
> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
> +# endif
> +# endif
> +#else
> + /* otherwise default to good old at91sam9260ek */
> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
> +#endif
> +
> /* DataFlash */
> #ifndef CONFIG_AT91SAM9G20EK_2MMC
> #define CONFIG_ATMEL_DATAFLASH_SPI
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header
2013-03-14 1:46 ` Bo Shen
@ 2013-03-14 8:44 ` Andreas Bießmann
2013-03-14 10:25 ` Bo Shen
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Bießmann @ 2013-03-14 8:44 UTC (permalink / raw)
To: u-boot
Hi Bo,
On 03/14/2013 02:46 AM, Bo Shen wrote:
> On 3/11/2013 0:16, Andreas Bie?mann wrote:
>> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
>> Cc: Bo Shen <voice.shen@atmel.com>
>
> Acked-by: Bo Shen <voice.shen@atmel.com>
>
>> ---
>> board/atmel/at91sam9260ek/at91sam9260ek.c | 12 ------------
>> include/configs/at91sam9260ek.h | 20 ++++++++++++++++++++
>> 2 files changed, 20 insertions(+), 12 deletions(-)
>>
<snip>
>> --- a/include/configs/at91sam9260ek.h
>> +++ b/include/configs/at91sam9260ek.h
>> @@ -125,6 +125,26 @@
>> (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
>> #endif
>>
>> +/*
>> + * The (arm)linux board id set by generic code depending on
>> configured board
>> + * (see boards.cfg for different boards)
>> + */
>> +#ifdef CONFIG_AT91SAM9G20
>> + /* the sam9g20 variants have two different board ids */
>> +# ifdef CONFIG_AT91SAM9G20EK_2MMC
>> + /* we may be setup for the 2MMC variant of at91sam9g20ek */
>> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
>> +# else
>> +# ifdef CONFIG_AT91SAM9G20EK
>> + /* or the normal at91sam9g20ek */
>> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
>> +# endif
>> +# endif
I think I'll generate a v2 here. It is safer to have:
#ifdef AT91SAM9G20
#ifdef 2MMC
// 2MMC
#else
// default for SAM9G20
#endif
#else
// default for SAM9260
#endif
Best regards
Andreas Bie?mann
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header
2013-03-14 8:44 ` Andreas Bießmann
@ 2013-03-14 10:25 ` Bo Shen
0 siblings, 0 replies; 5+ messages in thread
From: Bo Shen @ 2013-03-14 10:25 UTC (permalink / raw)
To: u-boot
Hi Andreas,
On 3/14/2013 16:44, Andreas Bie?mann wrote:
> Hi Bo,
>
> On 03/14/2013 02:46 AM, Bo Shen wrote:
>> On 3/11/2013 0:16, Andreas Bie?mann wrote:
>>> Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
>>> Cc: Bo Shen <voice.shen@atmel.com>
>>
>> Acked-by: Bo Shen <voice.shen@atmel.com>
>>
>>> ---
>>> board/atmel/at91sam9260ek/at91sam9260ek.c | 12 ------------
>>> include/configs/at91sam9260ek.h | 20 ++++++++++++++++++++
>>> 2 files changed, 20 insertions(+), 12 deletions(-)
>>>
>
> <snip>
>
>>> --- a/include/configs/at91sam9260ek.h
>>> +++ b/include/configs/at91sam9260ek.h
>>> @@ -125,6 +125,26 @@
>>> (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
>>> #endif
>>>
>>> +/*
>>> + * The (arm)linux board id set by generic code depending on
>>> configured board
>>> + * (see boards.cfg for different boards)
>>> + */
>>> +#ifdef CONFIG_AT91SAM9G20
>>> + /* the sam9g20 variants have two different board ids */
>>> +# ifdef CONFIG_AT91SAM9G20EK_2MMC
>>> + /* we may be setup for the 2MMC variant of at91sam9g20ek */
>>> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
>>> +# else
>>> +# ifdef CONFIG_AT91SAM9G20EK
>>> + /* or the normal at91sam9g20ek */
>>> +# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
>>> +# endif
>>> +# endif
>
> I think I'll generate a v2 here. It is safer to have:
>
> #ifdef AT91SAM9G20
> #ifdef 2MMC
> // 2MMC
> #else
> // default for SAM9G20
> #endif
> #else
> // default for SAM9260
> #endif
I agree.
> Best regards
>
> Andreas Bie?mann
>
Best Regards,
Bo Shen
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] at91sam9260ek: move board id setup to config header
2013-03-10 16:16 [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header Andreas Bießmann
2013-03-14 1:46 ` Bo Shen
@ 2013-05-10 15:05 ` Andreas Bießmann
1 sibling, 0 replies; 5+ messages in thread
From: Andreas Bießmann @ 2013-05-10 15:05 UTC (permalink / raw)
To: u-boot
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
Acked-by: Bo Shen <voice.shen@atmel.com>
---
Changes in v2:
* use only one ifdef for sam9G variants
board/atmel/at91sam9260ek/at91sam9260ek.c | 12 ------------
include/configs/at91sam9260ek.h | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/board/atmel/at91sam9260ek/at91sam9260ek.c b/board/atmel/at91sam9260ek/at91sam9260ek.c
index 3aa394a..049b3d7 100644
--- a/board/atmel/at91sam9260ek/at91sam9260ek.c
+++ b/board/atmel/at91sam9260ek/at91sam9260ek.c
@@ -157,18 +157,6 @@ int board_early_init_f(void)
int board_init(void)
{
-#ifdef CONFIG_AT91SAM9G20EK_2MMC
- /* arch number of AT91SAM9G20EK_2MMC-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK_2MMC;
-#else
-#ifdef CONFIG_AT91SAM9G20EK
- /* arch number of AT91SAM9G20EK-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK;
-#else
- /* arch number of AT91SAM9260EK-Board */
- gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9260EK;
-#endif
-#endif
/* adress of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index ebcc69a..39a8fc2 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -128,6 +128,24 @@
(ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
#endif
+/*
+ * The (arm)linux board id set by generic code depending on configured board
+ * (see boards.cfg for different boards)
+ */
+#ifdef CONFIG_AT91SAM9G20
+ /* the sam9g20 variants have two different board ids */
+# ifdef CONFIG_AT91SAM9G20EK_2MMC
+ /* we may be setup for the 2MMC variant of at91sam9g20ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
+# else
+ /* or the normal at91sam9g20ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
+# endif
+#else
+ /* otherwise default to good old at91sam9260ek */
+# define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
+#endif
+
/* DataFlash */
#ifndef CONFIG_AT91SAM9G20EK_2MMC
#define CONFIG_ATMEL_DATAFLASH_SPI
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-10 15:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-10 16:16 [U-Boot] [PATCH] at91sam9260ek: move board id setup to config header Andreas Bießmann
2013-03-14 1:46 ` Bo Shen
2013-03-14 8:44 ` Andreas Bießmann
2013-03-14 10:25 ` Bo Shen
2013-05-10 15:05 ` [U-Boot] [PATCH v2] " Andreas Bießmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox