All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] drivers: core: Add translation in live tree case
Date: Mon, 18 Dec 2017 16:03:02 -0700	[thread overview]
Message-ID: <4b8e72e6-989e-778c-5c53-75bbce227c25@wwwdotorg.org> (raw)
In-Reply-To: <db43aa45-f5b8-8f66-3eaa-291e665a6b6c@wwwdotorg.org>

On 12/18/2017 03:33 PM, Stephen Warren wrote:
> On 12/18/2017 03:29 PM, Stephen Warren wrote:
>> On 12/18/2017 01:34 AM, Mario Six wrote:
>>> The function dev_read_addr calls ofnode_get_addr_index in the live tree
>>> case, which does not apply bus translations to the address read from the
>>> device tree. This results in illegal addresses on boards that rely on
>>> bus translations being applied.
>>>
>>> Fix this situation by applying bus translations in the live tree case as
>>> well.
>>
>> Tested-by: Stephen Warren <swarren@nvidia.com>
> 
> Uggh. Sorry, I take that back. This seems to break NVIDIA Jetson TX1 
> (p2371-2180 board), even though it did solve this issue that was present 
> on other boards in the previous patch version. I'll try and see what's 
> up (something to do with I2C accesses early during boot)...

I guess this is something to do with:

> +		if (IS_ENABLED(CONFIG_OF_TRANSLATE)) {
> +			u64 paddr = of_translate_address(ofnode_to_np(node), &addr);
> +
> +			return be32_to_cpu((fdt_addr_t)paddr);

My tests passed on a 32-bit platform but failed on a 64-bit platform. I 
expect you need be64_to_cpu() there on 64-bit platforms? Actually, it 
should really base the bit-width on #address-cells, but we only support 
32- or 64-bit at the moment so switching between the two is probably fine.

  reply	other threads:[~2017-12-18 23:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  8:34 [U-Boot] [PATCH v3] drivers: core: Add translation in live tree case Mario Six
2017-12-18 22:29 ` Stephen Warren
2017-12-18 22:33   ` Stephen Warren
2017-12-18 23:03     ` Stephen Warren [this message]
2017-12-20  9:00       ` Mario Six

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=4b8e72e6-989e-778c-5c53-75bbce227c25@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.