[U-Boot] [PATCH v1 07/14] pinctrl: imx: Replace static soc info definitions with run time allocations

Marek Vasut marex at denx.de
Wed Jan 2 14:14:22 UTC 2019


On 1/2/19 9:26 AM, Lukasz Majewski wrote:
> Hi Marek,
> 
>> On 1/2/19 12:37 AM, Lukasz Majewski wrote:
>>> This commit is necessary to be able to re-use the pinctrl code in
>>> early SPL to properly configure pins.
>>>
>>> The problem is that those "static" structures are placed in the
>>> SDRAM area, which corresponds to u-boot proper (not even SPL).
>>> Hence, when one wants to configure pins before relocation via
>>> DTS/DM, the board hangs (imx6q SoC powered one) as only OCRAM area
>>> is available (0x009xxxxx).
>>>
>>> It is also safe to use calloc in this case, as the early SPL code
>>> provides it - either full or trimmed version. The allocated memory
>>> is also correct in respect to the memory area in which the SoC is
>>> currently running (OCRAM vs. SDRAM).  
>>
>> You should be able to access static data in early environment, many
>> other drivers have no problem with it. 
> 
> Have you used pinctrl IMX6Q driver with early DM at SPL?
> 
>> I believe there is some more
>> fundamental problem that needs to be fixed, 
> 
> With the current code - which was not used in OCRAM only available
> memory - the statics are placed in the SDRAM area (0x178x xxxx).
> 
> Instead of changing linker script (and validate it for all drivers and
> boards for SPL and u-boot proper) - the code has been rewritten to use
> malloc (which is available in the early code - either full blown or
> simple version).
> 
>> hacking around it like
>> this is just hiding the real issue.
> 
> The real issue is that IMX6Q uses SDRAM memory for statics/globals from
> the very beginning.
Fix it ? What you're implying here is that rodata (preinitialized static
variables) are misplaced.

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list