From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Thu, 3 Dec 2015 09:59:26 -0700 Subject: [U-Boot] [PATCH v3] dm: core: Enable optional use of fdt_translate_address() In-Reply-To: <56604DC3.1030006@denx.de> References: <1441174944-8878-1-git-send-email-sr@denx.de> <1443589243-9521-1-git-send-email-sr@denx.de> <56604DC3.1030006@denx.de> Message-ID: <566074EE.2000507@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 12/03/2015 07:12 AM, Stefan Roese wrote: > Hi Bin, > > On 03.12.2015 14:34, Bin Meng wrote: >> Hi Stefan, Simon, >> >> On Mon, Oct 19, 2015 at 7:16 AM, Simon Glass wrote: >>> On 29 September 2015 at 23:00, Stefan Roese wrote: >>>> The current "simple" address translation simple_bus_translate() is not >>>> working on some platforms (e.g. MVEBU). As here more complex "ranges" >>>> properties are used in many nodes (multiple tuples etc). This patch >>>> enables the optional use of the common fdt_translate_address() function >>>> which handles this translation correctly. >>>> >>>> Signed-off-by: Stefan Roese >>>> Cc: Simon Glass >>>> Cc: Bin Meng >>>> Cc: Marek Vasut >>>> Cc: Masahiro Yamada >>>> Cc: Stephen Warren >>>> Cc: Lukasz Majewski >>>> --- >>>> v3: >>>> - Rebased on current U-Boot version >>>> - Added Stephen and Lukasz to Cc >>>> >>>> v2: >>>> - Rework code a bit as suggested by Simon. Also added some comments >>>> to make the use of the code paths more clear. >>>> >>>> drivers/core/Kconfig | 30 ++++++++++++++++++++++++++++++ >>>> drivers/core/device.c | 20 ++++++++++++++++++++ >>>> 2 files changed, 50 insertions(+) >>> >>> Applied to u-boot-dm, thanks! >> >> When testing Simon's patch [1], I found PCI UART on Intel Crown Bay no >> longer works. git bisect leads to this commit. Somehow I missed this >> patch before although I see the commit message get me cc'ed but the >> email did not bring to my attention. >> >> I see this patch introduced OF_TRANSLATE and by default set it to y. >> This makes the code logic in dev_get_addr() go through >> fdt_translate_address(), which breaks the things. > > I'm a bit surprised that using the common fdt_translate_address() > function instead of the DM internal simple_bus_translate() causes > problems on your platform. Are you sure that the ranges are > described correctly in your dts? Is the dts a copy from the Linux > original one? Ah, probably not, since we're talking about x86 > which has no DT support in Linux, right? > >> Should we set >> OF_TRANSLATE to n by default? If set to y, this requires dts to have >> complete ranges property everywhere. > > My understanding here is that x86 is a special case. As it doesn't > use the full-blown dts sources from Linux. But most likely some > "simple" ones, written exactly for U-Boot / DM. > > I would still prefer to have this OF_TRANSLATE set to y as default. > As its needed for at least some platforms. But if we decide to > set it to n, I can live with it as well. Is this the driver that uses U-Boot functions that were intended to parse a standard "reg" property to parse some property other than reg, with different semantics? Actually, I think I'm remembering an issue with SPI on some x86 device, but perhaps the problem here is something similar.