
Hi Vignesh,
On 03/07/20 1:04 pm, Vignesh Raghavendra wrote:
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?
Fixed this in v2.
+{
- 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()?
there was an fdtdec_board_setup() which can be overridden for this. Implemented using that in v2.
Thanks, Faiz