[U-Boot] [PATCH 12/12] imx: ventana: switch to SPL
Tim Harvey
tharvey at gateworks.com
Wed May 7 01:35:44 CEST 2014
On Tue, May 6, 2014 at 12:11 PM, Jeroen Hofstee <dasuboot at myspectrum.nl> wrote:
> Hello Tim,
>
> On di, 2014-05-06 at 11:18 -0700, Tim Harvey wrote:
>> On Mon, Apr 28, 2014 at 1:17 PM, Tim Harvey <tharvey at gateworks.com> wrote:
>
>>
>> void board_init_f(ulong dummy)
>> {
>> struct ventana_board_info ventana_info;
>> int board_model;
>>
>> /* Set global data pointer. */
>> gd = &gdata;
>>
>> /* setup AIPS and disable watchdog */
>> arch_cpu_init();
>>
>> /* iomux and setup of i2c */
>> board_early_init_f();
>> i2c_setup_iomux();
>>
>> /* setup GP timer */
>> timer_init();
>>
>> /* UART clocks enabled and gd valid - init serial console */
>> preloader_console_init();
>>
>> /* read/validate EEPROM info to determine board model and SDRAM cfg */
>> board_model = read_eeprom(I2C_GSC, &ventana_info);
>>
>> /* provide some some default: 32bit 128MB */
>> if (GW_UNKNOWN == board_model) {
>> ventana_info.sdram_width = 2;
>> ventana_info.sdram_size = 3;
>> }
>>
>> /* configure MMDC for SDRAM width/size and per-model calibration */
>> spl_dram_init(8 << ventana_info.sdram_width,
>> 16 << ventana_info.sdram_size,
>> board_model);
>>
>> /* Clear the BSS. */
>> memset(__bss_start, 0, __bss_end - __bss_start);
>>
>> /* load/boot image from boot device */
>> board_init_r(NULL, 0);
>> }
>>
>> Does this make sense?
>
> Since Crt0.S already created gd on the stack before calling
> board_init_f, can't the assignment of gd not simply be removed?
> Is there anything special about gdata?
>
> Regards,
> Jeroen
>
>
Jeroen,
That does make sense, but what I find is that York's ocmmit
dec1861be90c948ea9fb771927d3d26a994d2e20 requires that gd be blanked
and its not. This causes bus_i2c_init to skip its initialization
because p->base is not zero.
York, does this make sense? Your patch creates a dependence on
gd->srdata being blank which isn't the case with the SRAM when booting
from the IMX6 boot rom.
Tim
More information about the U-Boot
mailing list