[PATCH v1 7/9] configs: gxp: add core support

Tom Rini trini at konsulko.com
Thu Jun 2 16:50:05 CEST 2022


On Thu, Jun 02, 2022 at 02:46:09PM +0000, Hawkins, Nick wrote:
> 
> 
> > Can we figure any of that out dynamically instead?  Since CONFIG_SYS_SDRAM_SIZE is only used (for ARM) in board code, I'd rather see this handled in there, with SZ_xxx and not use CONFIG_SYS_SDRAM_SIZE at all.
> 
> Hi Tom,
> 
> Would something like this be acceptable?
> 
> int dram_init(void)
> {
> #ifdef CONFIG_TARGET_GXP
>         #ifdef CONFIG_GXP_ECC
>         gd->ram_size = SZ_128M + SZ_64M + SZ_32M + SZ_16M + SZ_8M;
>         #else
>         gd->ram_size = SZ_256M + SZ_128M + SZ_64M + SZ_32M + SZ_16M;
>         #endif
> #endif
> 
> #ifdef CONFIG_GXP_VROM_64MB
>         #ifdef CONFIG_GXP_ECC
>         gd->ram_size = SZ_128M + SZ_64M;
>         #else
>         gd->ram_size = SZ_256M + SZ_128M;
>         #endif
> #endif
>         return 0;
> }
> 
> Thanks for the feedback,

Without indenting the #ifdef's, yes, that's better.  Ideally you should
just call get_ram_size(base_addr, max-possible-valid-size) and that
will return the correct value.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220602/62a2d54e/attachment.sig>


More information about the U-Boot mailing list