From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Revert "fdt: Fix fdtdec_get_addr_size() for 64-bit"
Date: Thu, 06 Aug 2015 12:43:19 -0600 [thread overview]
Message-ID: <55C3AAC7.9070801@wwwdotorg.org> (raw)
In-Reply-To: <CAOMqctSBCf9Q+gyvodjg9Wa89yRbtHAJg01nfSSWt-yp3_mBuQ@mail.gmail.com>
On 08/06/2015 01:09 AM, Michal Suchanek wrote:
> Hello,
>
> On 6 August 2015 at 01:45, Simon Glass <sjg@chromium.org> wrote:
>> Hi Stephen,
>>
>> On 5 August 2015 at 12:22, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> On 08/04/2015 10:08 PM, Simon Glass wrote:
>>>>
>>>> Hi Stephen,
>>>>
>>>> On 3 August 2015 at 12:20, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>>
>>>>> On 08/03/2015 09:52 AM, Simon Glass wrote:
>>>>>>
>>>>>>
>>>>>> Hi Stephen,
>>>>>>
>>>>>> On 3 August 2015 at 09:12, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>>>>
>>>>>>>
>>>>>>> On 08/02/2015 06:13 PM, Simon Glass wrote:
>>>>>>>>
>>>>>>>>
>
>>>> This is a boot loader so we should be willing to make some
>>>> simplifications.
>>>
>>>
>>> When dealing with internal bootloader details, sure assumptions,
>>> simplifications, etc. can be made.
>>>
>>> However, DT is an externally defined standard. The content of DT must be
>>> identical across all OSs (SW stacks, bootloader) and not influenced by
>>> requirements/... of any specific individual OS's (SW stack, bootloader)
>>> quirks. We can't just pick and choose which parts of it we care about. Well,
>>> perhaps if we stop calling it DT we could.
>>
>> So I think in summary:
>>
>> - 64-bit machines should have CONFIG_PHYS_64BIT set correctly
>> - then fdtdec_get_addr_size() would work as expected
>> - I want to make this cases as efficient as possible since it will be
>> called in SPL
>> - You are concerned that making assumptions like this violates the DT spec
>>
>> One option is to split the functions into two - one that works in SPL
>> and makes assumptions, and one that does not and does things the hard
>> way. I suppose we could also add checks/warnings that the DT is
>> 'well-formed' and that the address size matches the machine it is
>> running on.
>
> This depends on the way the binding is defined. If the binding
> description says that the value has as much data as defined in
> #address-cells and #size-cells then you have to parse those values to
> interpret the binding correctly. When the binding description says the
> value is always 32bit or always 64bit or whatever you must always read
> a value with that many bits.
>
> Prime example of this are MTD partitions defined in dt.
>
> If your flash is small you can get away with 32bit partitions and you
> would define #address-cells and #size-cells as 1 even on 64bit system.
> When your flash is large you need 64bits to store the partition size
> and offset and you will define #address-cells and #size-cells as 2
> even on 32bit system because it won't work otherwise.
I agree entirely.
FWIW, my part of this discussion was mainly targeted at the "reg"
property, where #address-cells/#size-cells are defined as applying as
part of the base DT definition. Indeed other bindings can be define this
way to (or not) at the whim of the binding author. The bug with Intel
flash was triggered by using the same piece of code to parse a property
where #address-cells/#size-cells don't apply.
next prev parent reply other threads:[~2015-08-06 18:43 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 0:13 [U-Boot] [PATCH] Revert "fdt: Fix fdtdec_get_addr_size() for 64-bit" Simon Glass
2015-08-03 15:12 ` Stephen Warren
2015-08-03 15:52 ` Simon Glass
2015-08-03 17:25 ` Tom Rini
2015-08-03 17:27 ` Simon Glass
2015-08-03 18:20 ` Stephen Warren
2015-08-05 4:08 ` Simon Glass
2015-08-05 18:22 ` Stephen Warren
2015-08-05 23:45 ` Simon Glass
2015-08-06 7:09 ` Michal Suchanek
2015-08-06 18:43 ` Stephen Warren [this message]
2015-08-06 19:03 ` Stephen Warren
2015-08-09 15:08 ` Simon Glass
2015-08-14 8:10 ` Bin Meng
2015-08-14 8:32 ` Thierry Reding
2015-08-14 8:44 ` Bin Meng
2015-08-14 14:06 ` Thierry Reding
2015-08-14 14:29 ` Bin Meng
2015-08-14 9:01 ` Michal Suchanek
2015-08-14 9:08 ` Bin Meng
2015-08-14 10:04 ` Simon Glass
2015-09-02 16:52 ` Tom Warren
2015-09-02 16:58 ` Simon Glass
2015-09-02 20:04 ` Stephen Warren
2015-09-02 20:39 ` Tom Warren
2015-09-02 20:54 ` Stephen Warren
2015-09-02 23:43 ` Stephen Warren
2015-09-03 2:02 ` Tom Warren
2015-09-16 21:46 ` Tom Warren
2015-09-17 1:10 ` Simon Glass
2015-09-17 1:58 ` Tom Warren
2015-08-14 16:50 ` Simon Glass
2015-08-03 15:40 ` Bin Meng
2015-08-04 15:27 ` Thierry Reding
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=55C3AAC7.9070801@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--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