From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data
Date: Tue, 11 Feb 2014 13:46:08 -0800 [thread overview]
Message-ID: <52FA9A20.60704@freescale.com> (raw)
In-Reply-To: <52FA6584.6070100@freescale.com>
On 02/11/2014 10:01 AM, York Sun wrote:
> On 02/10/2014 02:45 PM, Tom Rini wrote:
>> On Mon, Feb 10, 2014 at 02:28:01PM -0800, York Sun wrote:
>>> On 02/10/2014 02:10 PM, Tom Rini wrote:
>>>> On Mon, Feb 10, 2014 at 02:02:52PM -0800, York Sun wrote:
>>>>
>>>>> This driver needs a data structure in SRAM before SDRAM is available.
>>>>> This is not alway the case using .data section. Moving this data
>>>>> structure to global_data guarantees it is writable.
>>>>>
>>>>> Signed-off-by: York Sun <yorksun@freescale.com>
>>>>> CC: Troy Kisky <troy.kisky@boundarydevices.com>
>>>>
>>>> If you need something in SRAM then you need to place it in that section,
>>>> see arch/arm/cpu/armv7/am33xx/u-boot-spl.lds for example
>>>>
>>>
>>> I am not sure if it is a similar situation. But anyway, I am open to
>>> suggestions.
>>>
>>> For this driver, the variable needs to be writable. I guess it wasn't
>>> a problem for existing platforms which probably call this driver after
>>> relocation.
>>>
>>> Does the SRAM code/data relocate to SDRAM? I don't want this variable
>>> to stay in SRAM once u-boot relocates to normal memory.
>>
>> So in this case the problem is still within SPL right? You would put
>> the parts you need to have in SRAM during SPL and DDR in full U-Boot
>> with __attribute__((section(".data.srdata"))) and in the SoC's linker
>> scripts make sure that drivers/i2c/built-in.o(.data.srdata) ends up in
>> the appropriate place for each case.
>>
>> I say all of this as I think we really want to avoid expanding on
>> gd->arch-> stuff if we can (which reminds me, your patch expands on main
>> gd not gd->arch so NAK on that either way).
>>
>
> I tried the linker script and made it work. But it is not what I want. I expect
> this variable relocates to DDR, but the offset is not right.
> I am not using SPL. This is full u-boot, which boots from flash, calls i2c
> driver, initializes DDR, then relocates. Putting this variable into stack might
> be the solution. Suggestions?
>
Tom,
I haven't found an easy way to put this variable into stack. Would you
reconsider global data, as I originally proposed in the patch?
York
next prev parent reply other threads:[~2014-02-11 21:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 22:02 [U-Boot] [PATCH] driver/mxc_i2c: Move static data structure to global_data York Sun
2014-02-10 22:10 ` Tom Rini
2014-02-10 22:28 ` York Sun
2014-02-10 22:45 ` Tom Rini
2014-02-10 22:47 ` York Sun
2014-02-11 18:01 ` York Sun
2014-02-11 21:46 ` York Sun [this message]
2014-02-12 14:41 ` Tom Rini
2014-02-11 2:34 ` York Sun
2014-02-11 19:25 ` Troy Kisky
2014-02-11 19:46 ` York Sun
2014-02-11 19:59 ` Wolfgang Denk
2014-02-11 20:03 ` York Sun
2014-02-11 20:57 ` Wolfgang Denk
2014-02-11 21:02 ` York Sun
2014-02-11 22:12 ` Wolfgang Denk
2014-02-11 22:20 ` York Sun
2014-02-12 14:27 ` Wolfgang Denk
2014-02-12 14:43 ` Tom Rini
2014-02-12 17:56 ` York Sun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FA9A20.60704@freescale.com \
--to=yorksun@freescale.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox