Hi,

On 02/07/20 1:32 pm, Faiz Abbas wrote:

[...]
> int am6_spl_early_init(void)

Can this be static or do you intend to use this outside of this func file?

> +{
> +     int ret;
> +#if CONFIG_VAL(SYS_MALLOC_F_LEN)
> +#ifdef CONFIG_MALLOC_F_ADDR
> +     gd->malloc_base = CONFIG_MALLOC_F_ADDR;
> +#endif
> +     gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
> +     gd->malloc_ptr = 0;
> +#endif
> +     ret = fdtdec_setup();
> +     if (ret) {
> +             printf("fdtdec_setup() returned error %d\n", ret);
> +             return ret;
> +     }
> +
> +#if CONFIG_IS_ENABLED(DFU) || CONFIG_IS_ENABLED(USB_STORAGE)
> +     fixup_usb_boot();
> +#endif
> +     /* With CONFIG_SPL_OF_PLATDATA, bring in all devices */
> +     ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
> +     if (ret) {
> +             printf("dm_init_and_scan() returned error %d\n", ret);
> +             return ret;
> +     }
> +
> +     gd->flags |= GD_FLG_SPL_EARLY_INIT;
> +
> +     return 0;
> +}
>  void board_init_f(ulong dummy)
>  {
>  #if defined(CONFIG_K3_LOAD_SYSFW) || defined(CONFIG_K3_AM654_DDRSS)
> @@ -141,9 +206,8 @@ void board_init_f(ulong dummy)
>       disable_linefill_optimization();
>       setup_k3_mpu_regions();
>  #endif
> -
>       /* Init DM early in-order to invoke system controller */
> -     spl_early_init();

I don't like this part as patch now open codes part of spl_early_init()
here and any fixes/enhancements to that core code would not be available
for am6 unless explicitly ported....

How about having a arch specific post fdtdec_setup() hook instead, that
gets called from spl_common_init()?

> +     am6_spl_early_init();
>  
>  #ifdef CONFIG_K3_EARLY_CONS
>       /*
> -- 2.17.1


Regards
Vignesh

Reply via email to