devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* DT overlay issues - dtc flags
@ 2017-04-10 16:16 Andreas Färber
       [not found] ` <1264bdc3-e61e-0256-0a0f-fdd8dbf50397-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Färber @ 2017-04-10 16:16 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA, U-Boot
  Cc: Rob Herring,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Alexander Graf,
	Simon Glass

Hi,

I've tried to play around with Device Tree overlays (.dtbo files):

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt

First of all, that document refers to a non-existing
Documentation/devicetree/dt-object-internal.txt. Could someone please
fix that one way or another?

In my particular example I've tried to extend the &i2c1 and &gpio nodes
of 4.11-rc5 arm64 broadcom/bcm2837-rpi-3-b.dts. The above documentation
prominently claims that this can be done via target = <&foo> syntax, but
U-Boot's fdt apply command fails for such a file. If instead I use the
alternative target-path = "/soc/..." then it works just fine.

As mentioned in the very bottom of the documentation, resolution of
phandle target references requires a __symbols__ node in the base .dtb.
IIUC this is only generated when passing the -@ dtc command line flag.

At first I thought this were an issue with how we build the .dtb files
in openSUSE [1], but by my reading of the kernel Makefiles not passing
-@ in DTC_FLAGS or cmd_dtc, you should run into the exact same issue.

I could think of a few ARMv7-M systems where such DT bloat might be
undesired (small flash sector sizes), but then it would seem easier to
suppress -@ where needed than to have a feature that by all practical
means is half unusable by default.

U-Boot itself appears to face a similar issue in that its internal
Device Trees are built without -@, and via Alex' distro boot extensions
this internal DT is passed on via UEFI as fallback when no external .dtb
file is found. So in the non-SPL case the DT should probably be built
with -@, too.

Or am I misunderstanding something here?

Thanks,
Andreas

[1]
https://build.opensuse.org/package/view_file/Kernel:HEAD/dtb-aarch64/dtb-aarch64.spec?expand=1

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: DT overlay issues - dtc flags
       [not found] ` <1264bdc3-e61e-0256-0a0f-fdd8dbf50397-l3A5Bk7waGM@public.gmane.org>
@ 2017-04-10 20:44   ` Frank Rowand
  2017-04-10 21:19   ` Frank Rowand
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2017-04-10 20:44 UTC (permalink / raw)
  To: Andreas Färber, devicetree-u79uwXL29TY76Z2rM5mHXA, U-Boot
  Cc: Simon Glass, Rob Herring,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Alexander Graf, Frank Rowand

adding cc to myself so I will see replies.


On 04/10/17 09:16, Andreas Färber wrote:
> Hi,
> 
> I've tried to play around with Device Tree overlays (.dtbo files):
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
> 
> First of all, that document refers to a non-existing
> Documentation/devicetree/dt-object-internal.txt. Could someone please
> fix that one way or another?
> 
> In my particular example I've tried to extend the &i2c1 and &gpio nodes
> of 4.11-rc5 arm64 broadcom/bcm2837-rpi-3-b.dts. The above documentation
> prominently claims that this can be done via target = <&foo> syntax, but
> U-Boot's fdt apply command fails for such a file. If instead I use the
> alternative target-path = "/soc/..." then it works just fine.
> 
> As mentioned in the very bottom of the documentation, resolution of
> phandle target references requires a __symbols__ node in the base .dtb.
> IIUC this is only generated when passing the -@ dtc command line flag.
> 
> At first I thought this were an issue with how we build the .dtb files
> in openSUSE [1], but by my reading of the kernel Makefiles not passing
> -@ in DTC_FLAGS or cmd_dtc, you should run into the exact same issue.
> 
> I could think of a few ARMv7-M systems where such DT bloat might be
> undesired (small flash sector sizes), but then it would seem easier to
> suppress -@ where needed than to have a feature that by all practical
> means is half unusable by default.
> 
> U-Boot itself appears to face a similar issue in that its internal
> Device Trees are built without -@, and via Alex' distro boot extensions
> this internal DT is passed on via UEFI as fallback when no external .dtb
> file is found. So in the non-SPL case the DT should probably be built
> with -@, too.
> 
> Or am I misunderstanding something here?
> 
> Thanks,
> Andreas
> 
> [1]
> https://build.opensuse.org/package/view_file/Kernel:HEAD/dtb-aarch64/dtb-aarch64.spec?expand=1
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: DT overlay issues - dtc flags
       [not found] ` <1264bdc3-e61e-0256-0a0f-fdd8dbf50397-l3A5Bk7waGM@public.gmane.org>
  2017-04-10 20:44   ` Frank Rowand
@ 2017-04-10 21:19   ` Frank Rowand
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2017-04-10 21:19 UTC (permalink / raw)
  To: Andreas Färber, devicetree-u79uwXL29TY76Z2rM5mHXA, U-Boot
  Cc: Simon Glass, Rob Herring,
	linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	Alexander Graf

On 04/10/17 09:16, Andreas Färber wrote:
> Hi,
> 
> I've tried to play around with Device Tree overlays (.dtbo files):
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
> 
> First of all, that document refers to a non-existing
> Documentation/devicetree/dt-object-internal.txt. Could someone please
> fix that one way or another?

I will.


> In my particular example I've tried to extend the &i2c1 and &gpio nodes
> of 4.11-rc5 arm64 broadcom/bcm2837-rpi-3-b.dts. The above documentation
> prominently claims that this can be done via target = <&foo> syntax, but
> U-Boot's fdt apply command fails for such a file. If instead I use the
> alternative target-path = "/soc/..." then it works just fine.

The "target = <&foo>" syntax is the internal dtb syntax that the kernel
expects.  The plan is to hide this internal format so it is not visble
at the source level, but that will require some more changes to the dtc
compiler.


> As mentioned in the very bottom of the documentation, resolution of
> phandle target references requires a __symbols__ node in the base .dtb.
> IIUC this is only generated when passing the -@ dtc command line flag.
> 
> At first I thought this were an issue with how we build the .dtb files
> in openSUSE [1], but by my reading of the kernel Makefiles not passing
> -@ in DTC_FLAGS or cmd_dtc, you should run into the exact same issue.

Yes, the kernel support for overlays is not complete.  This is one of
the issues that has not been addressed yet.

I don't have the rpi-3 documentation handy, so I'm going to take a wild
guess that the &i2c1 and &gpio node changes that you need are for
hardware on a hat.  If so, the plan for the kernel is to describe
the signals available via the hat connectors in the device tree and
then make those signals available through the connector node instead
of having the hat overlay directly reference the signal node.  The
connector abstraction has been discussed but is not implemented.


> I could think of a few ARMv7-M systems where such DT bloat might be
> undesired (small flash sector sizes), but then it would seem easier to
> suppress -@ where needed than to have a feature that by all practical
> means is half unusable by default.
> 
> U-Boot itself appears to face a similar issue in that its internal
> Device Trees are built without -@, and via Alex' distro boot extensions
> this internal DT is passed on via UEFI as fallback when no external .dtb
> file is found. So in the non-SPL case the DT should probably be built
> with -@, too.
> 
> Or am I misunderstanding something here?
> 
> Thanks,
> Andreas
> 
> [1]
> https://build.opensuse.org/package/view_file/Kernel:HEAD/dtb-aarch64/dtb-aarch64.spec?expand=1
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-10 21:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-10 16:16 DT overlay issues - dtc flags Andreas Färber
     [not found] ` <1264bdc3-e61e-0256-0a0f-fdd8dbf50397-l3A5Bk7waGM@public.gmane.org>
2017-04-10 20:44   ` Frank Rowand
2017-04-10 21:19   ` Frank Rowand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).