[U-Boot] common: fdt: set the value of MEMORY_BANKS_MAX to 8

Message ID 20180810115414.2650-1-linux.amoon@gmail.com
State Deferred
Delegated to: Tom Rini
Headers show
Series
  • [U-Boot] common: fdt: set the value of MEMORY_BANKS_MAX to 8
Related show

Commit Message

Anand Moon Aug. 10, 2018, 11:54 a.m.
set the value of MEMORY_BANKS_MAX to 8.
Odroid-XU4 fails to boot with following message

fdt_fixup_memory_banks: num banks 8 exceeds hardcoded limit 4.
Recompile with higher MEMORY_BANKS_MAX?
ERROR: arch-specific fdt fixup failed
 - must RESET the board to recover.

Fixes: commit 2a1f4f1758b5 (Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS if defined")

CC: Ramon Fried <ramon.fried@gmail.com>
CC: Simon Glass <sjg@chromium.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 common/fdt_support.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ramon Fried Aug. 10, 2018, 4:44 p.m. | #1
On Fri, Aug 10, 2018 at 2:54 PM Anand Moon <linux.amoon@gmail.com> wrote:

> set the value of MEMORY_BANKS_MAX to 8.
> Odroid-XU4 fails to boot with following message
>
> fdt_fixup_memory_banks: num banks 8 exceeds hardcoded limit 4.
> Recompile with higher MEMORY_BANKS_MAX?
> ERROR: arch-specific fdt fixup failed
>  - must RESET the board to recover.
>
> Fixes: commit 2a1f4f1758b5 (Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS
> if defined")
>
> CC: Ramon Fried <ramon.fried@gmail.com>
> CC: Simon Glass <sjg@chromium.org>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
>  common/fdt_support.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index 34d2bd59c4..ad87f31ab3 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -409,7 +409,7 @@ static int fdt_pack_reg(const void *fdt, void *buf,
> u64 *address, u64 *size,
>         return p - (char *)buf;
>  }
>
> I think it's better to check if MEMORY_BANKS was defined and only if not
to define it to 4.
Then users can define MEMORY_BANKS at include/configs/....h
Simon, what do you say ?

-#define MEMORY_BANKS_MAX 4
> +#define MEMORY_BANKS_MAX 8
>  int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
>  {
>         int err, nodeoffset;
> --
> 2.17.1
>
>
Simon Glass Aug. 17, 2018, 12:48 p.m. | #2
Hi,

On 10 August 2018 at 10:44, Ramon Fried <ramon.fried@gmail.com> wrote:
>
>
>
> On Fri, Aug 10, 2018 at 2:54 PM Anand Moon <linux.amoon@gmail.com> wrote:
>>
>> set the value of MEMORY_BANKS_MAX to 8.
>> Odroid-XU4 fails to boot with following message
>>
>> fdt_fixup_memory_banks: num banks 8 exceeds hardcoded limit 4.
>> Recompile with higher MEMORY_BANKS_MAX?
>> ERROR: arch-specific fdt fixup failed
>>  - must RESET the board to recover.
>>
>> Fixes: commit 2a1f4f1758b5 (Revert "fdt_support: Use CONFIG_NR_DRAM_BANKS if defined")
>>
>> CC: Ramon Fried <ramon.fried@gmail.com>
>> CC: Simon Glass <sjg@chromium.org>
>> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
>> ---
>>  common/fdt_support.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/common/fdt_support.c b/common/fdt_support.c
>> index 34d2bd59c4..ad87f31ab3 100644
>> --- a/common/fdt_support.c
>> +++ b/common/fdt_support.c
>> @@ -409,7 +409,7 @@ static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
>>         return p - (char *)buf;
>>  }
>>
> I think it's better to check if MEMORY_BANKS was defined and only if not to define it to 4.
> Then users can define MEMORY_BANKS at include/configs/....h
> Simon, what do you say ?

My vote is for Kconfig to define this, perhaps with a defaul of 4. But
I see there is a lot of discussion and I have been out for a few
weeks, so I don't have a strong opinion.

>
>> -#define MEMORY_BANKS_MAX 4
>> +#define MEMORY_BANKS_MAX 8
>>  int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
>>  {
>>         int err, nodeoffset;
>> --
>> 2.17.1
>>

Regards,
Simon

Patch

diff --git a/common/fdt_support.c b/common/fdt_support.c
index 34d2bd59c4..ad87f31ab3 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -409,7 +409,7 @@  static int fdt_pack_reg(const void *fdt, void *buf, u64 *address, u64 *size,
 	return p - (char *)buf;
 }
 
-#define MEMORY_BANKS_MAX 4
+#define MEMORY_BANKS_MAX 8
 int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[], int banks)
 {
 	int err, nodeoffset;