I had great hopes of doing these status reports once a week; but it turns out to take more effort to get together that I estimated. Here's the status of ARM device tree support as of today. As always, let me know if you have any corrections or additional information.
1 - Latest news --------------- - The last vestiges of of_platform_bus_type are gone from Linus' tree as of the 2.6.39 merge window. Everything should be using platform_device now. - devicetree/arm on git://git.secretlab.ca/git/linux-2.6 has everything needed to turn on basic device tree support for any platform. - Support has been added for Versatile and Tegra in devicetree/arm - Support for Samsung s5pv310 and Freescale mx5 are in devicetree/test - Similarly, u-boot needs to have the CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ defined to turn on device tree support. - I've also got patches that eliminate the need for CONFIG_SYS_BOOTMAPSZ which I'll post shortly, but they're not quite working yet. - I've also got a trivial patch that should enabled CONFIG_OF_LIBFDT on a large set of boards, but it has had pretty much zero testing. :-) - Jason Hui has been making awesome progress on mx5, and some of their patches are in devicetree/test. Hopefully to move over to devicetree/arm soon. - Shawn Guo has also been making good progress on adding the clock bindings to the mx5 support. There are still questions up in the air about the best way to handle clocks though. While all the clocks /can/ be converted to device tree data, there is also value in sharing clock initialization data between DT and non-DT board support. The of_platform_device_prepare() work mentioned below will help with that. It will also be easier to work on the clock support when the common struct clk patch series from Jeremy gets merged. Until then there ends up being a lot of duplication of code. - Lennert has a series of virq patches for ARM patches completed. He is currently working on cleaning them up to get them posted. - Patches posted for of_platform_prepare() which makes it easier for static platform_device registrations to co-exist with device tree data. Patches are currently in devicetree/test, and will move to devicetree/arm shortly. - Basic DT support has been merged into Nicolas' Linaro kernel tree. - DT is also working on Versatile Express, OMAP, and the new Xilinx platform, but I don't have patches for either of those platforms in my tree. - Rob Herring's work on the early dtb mmu maping is mainlined and makes it much nicer to work with dtbs.
Next steps: -------------- At this point I'm putting on my Linaro hat. Feel free to tune out past this point if you're not interested how DT support will materialize in the next release.
There are a number of very specific tasks that need to be completed for the 11.05 release. The goal is to have basic device tree support turned on and working on all of the platforms supported in the release. There isn't a lot of time to get this pulled together, but all the infrastructure is in places, so most of the work is turning on the configuration options and testing the platforms.
For each board, I need an engineer to do the following:
1) Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro u-boot tree. 2) Enable CONFIG_OF and CONFIG_PROC_DEVICETREE in the kernel 3) Add something like the following to the *existing* machine definition. For initial basic support, you don't need to create a separate <soc>-dt.c board support file yet.
+static const char *omap4_panda_dt_match[] __initdata = { + "ti,omap4-panda", + NULL +}; + MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") [...] + .dt_compat = omap4_panda_dt_match, MACHINE_END
The string in the match table should be in the form "<vendor>,<board-name>"
4) Add a template .dts file for the board in arch/arm/boot/dts/<board>.dts. The following should be sufficient:
/dts-v1/;
/ { model = "TI OMAP4 PandaBoard"; compatible = "ti,omap4-panda"; #address-cells = <1>; #size-cells = <1>;
aliases { };
memory { device_type = "memory"; reg = <0x80000000 0x08000000>; };
chosen { }; }; 5) test it :-) 6) send patches to me for inclusion in the Linaro U-Boot and Kernel trees. I'll collect them to start and ask John and Nicolas to pull them into their trees when they're ready.
This is enough for very basic device tree support and I expect it will only take a day or so of effort to get completed. It won't be particularly useful, but it ensures that the infrastructure is enabled and working.
Bonus points if you're also able to provide patches that add of_platform_device_probe() and of_platform_bus_populate() calls to the board support so that device nodes get attached to the devices and can be used for attaching things like gpios, spi devices, and i2c devices. This is a nice to have for 11.05, but it isn't a requirement to have it working on all boards.
Here is the list of hwpacks that should be supported to the best of my knowledge. Please reply with the hwpacks you can take responsibility for:
efikamx igep imx51 omap3-x11-base omap3 overo panda s5pv310 vexpress
There are also some specific cross-platform tasks that need some love. Let me know if you can take responsibility for any of these items. - Eliminate CONFIG_SYS_BOOTMAPSZ dependency from U-Boot. I've got a patch series that does this, but it is untested. I'll post the series tomorrow. - Add packaging of .dtb files into linux-image-linaro-* packages. Loic and I discussed putting them under /lib/dtb/`uname -r`/, but thinking about it more, it might make more sense to share the modules directory and use /lib/modules/`uname -r`/dtbs. The dtc tool needed to build the .dtbs is included with the kernel tree. - Add relevant dtb files to boot partition in linaro-image tools - Add boot script which passes dtb as 3rd argument to 'bootm'
For purposes of tracking, I'll register bugs for the above items in the Linaro bug tracker tomorrow.
Cheers, g.
Hi Grant
On Mon, 2011-03-21 at 03:25 -0600, Grant Likely wrote:
For each board, I need an engineer to do the following:
- Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro
u-boot tree.
Which tree should I use, u-boot-linaro-stable or u-boot-linaro-next ?
On Tue, Mar 22, 2011 at 09:58:58AM +0000, Tixy wrote:
Hi Grant
On Mon, 2011-03-21 at 03:25 -0600, Grant Likely wrote:
For each board, I need an engineer to do the following:
- Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro
u-boot tree.
Which tree should I use, u-boot-linaro-stable or u-boot-linaro-next ?
John Rigby would know better, but I suspect u-boot-linaro-next is the one to use.
John, which tree should be used for targetting Natty?
g.
FDT support is in both so stick with stable. It is only enabled for beagle. Search of FDT in include/config/omap3_beagle.h to see how to turn it on for other boards.
If we want this turned on for other boards let me know which ones.
John
On Wed, Mar 23, 2011 at 3:09 PM, Grant Likely grant.likely@secretlab.ca wrote:
On Tue, Mar 22, 2011 at 09:58:58AM +0000, Tixy wrote:
Hi Grant
On Mon, 2011-03-21 at 03:25 -0600, Grant Likely wrote:
For each board, I need an engineer to do the following:
- Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro
u-boot tree.
Which tree should I use, u-boot-linaro-stable or u-boot-linaro-next ?
John Rigby would know better, but I suspect u-boot-linaro-next is the one to use.
John, which tree should be used for targetting Natty?
g.
On Wed, Mar 23, 2011 at 04:08:59PM -0600, John Rigby wrote:
FDT support is in both so stick with stable. It is only enabled for beagle. Search of FDT in include/config/omap3_beagle.h to see how to turn it on for other boards.
If we want this turned on for other boards let me know which ones.
Yup, I want it turned on for all the hwpacks maintained by the kernelwg. I've got people lined up to prepare, test and submit patches to you for each of them.
g.
John
On Wed, Mar 23, 2011 at 3:09 PM, Grant Likely grant.likely@secretlab.ca wrote:
On Tue, Mar 22, 2011 at 09:58:58AM +0000, Tixy wrote:
Hi Grant
On Mon, 2011-03-21 at 03:25 -0600, Grant Likely wrote:
For each board, I need an engineer to do the following:
- Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro
u-boot tree.
Which tree should I use, u-boot-linaro-stable or u-boot-linaro-next ?
John Rigby would know better, but I suspect u-boot-linaro-next is the one to use.
John, which tree should be used for targetting Natty?
g.
I'm currently trying to get basic device tree support added to B Beagleboard and I suspect I've been going about things the hard/wrong way. Is there a branch which has all the required infrastructure already merged?
I've been working off linux-linaro-2.6.38.git, so I've applied some patches I found through Google:
"Add dtb make rule" http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg02925.html
"Allow the device tree binary to be appended to zImage" http://www.spinics.net/lists/arm-kernel/msg119379.html
I was about to go hunting down the next missing bits when it dawned on me I must be doing something wrong. Surely there is a branch somewhere which already has all the essential changes?
On Fri, Mar 25, 2011 at 12:22 PM, Tixy tixy@yxit.co.uk wrote:
I'm currently trying to get basic device tree support added to B Beagleboard and I suspect I've been going about things the hard/wrong way. Is there a branch which has all the required infrastructure already merged?
I've been working off linux-linaro-2.6.38.git, so I've applied some patches I found through Google:
"Add dtb make rule" http://www.mail-archive.com/linaro-dev@lists.linaro.org/msg02925.html
While not required, this is a useful patch and I'll probably get it added for the 11.05 release.
"Allow the device tree binary to be appended to zImage" http://www.spinics.net/lists/arm-kernel/msg119379.html
You don't need this patch for what needs to be changed to the hwpack. I may add this one for the 11.05 release, but it is not required when u-boot passes the .dtb image.
I was about to go hunting down the next missing bits when it dawned on me I must be doing something wrong. Surely there is a branch somewhere which already has all the essential changes?
Everything you need should be in the current Linaro kernel and u-boot trees. I'm also working on verifying that now for Panda, and I'll post updates if I find missing bits.
g.
On Fri, 2011-03-25 at 12:47 -0600, Grant Likely wrote:
On Fri, Mar 25, 2011 at 12:22 PM, Tixy tixy@yxit.co.uk wrote:
[...]
"Allow the device tree binary to be appended to zImage" http://www.spinics.net/lists/arm-kernel/msg119379.html
You don't need this patch for what needs to be changed to the hwpack. I may add this one for the 11.05 release, but it is not required when u-boot passes the .dtb image.
That was one of the clues I was missing :-) Are there any instructions anywhere for getting U-Boot to pass a device tree?
From looking at the uboot source I see the flattened device tree file is
the 3rd argument to bootm, and I've found mkimage has a flat_dt type option. But I think I'm still missing something. I can carry on analysing U-Boot code but would be grateful for any tips on now to get my dtb file seen by a running kernel.
Thanks
On Fri, Mar 25, 2011 at 2:21 PM, Tixy tixy@yxit.co.uk wrote:
On Fri, 2011-03-25 at 12:47 -0600, Grant Likely wrote:
On Fri, Mar 25, 2011 at 12:22 PM, Tixy tixy@yxit.co.uk wrote:
[...]
"Allow the device tree binary to be appended to zImage" http://www.spinics.net/lists/arm-kernel/msg119379.html
You don't need this patch for what needs to be changed to the hwpack. I may add this one for the 11.05 release, but it is not required when u-boot passes the .dtb image.
That was one of the clues I was missing :-) Are there any instructions anywhere for getting U-Boot to pass a device tree?
Yes, look at what I wrote in the device tree status update Sunday night for the config bits:
http://lists.ozlabs.org/pipermail/devicetree-discuss/2011-March/005024.html
From looking at the uboot source I see the flattened device tree file is the 3rd argument to bootm, and I've found mkimage has a flat_dt type
Don't use mkimage on the dtb. Just load the raw dtb into RAM and pass the base address in the 3rd argument.
option. But I think I'm still missing something. I can carry on analysing U-Boot code but would be grateful for any tips on now to get my dtb file seen by a running kernel.
g.
For those of you working on bringing up arm device tree support against the Linaro u-boot * kernel trees, I've just pushed out a couple of branches that work on Panda board. It's not complete yet because there are some bugs I found in both the kernel and in u-boot, but it should be useful to base off of when working on the other platforms:
U-boot tree based on u-boot-linaro-stable: git://git.secretlab.ca/git/u-boot devicetree/linaro-stable
Kernet tree based on linux-linaro-2.6.38 git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.38
I'll post the patches that I've got in those branches after I clean them up. Probably Monday.
g.
On Mon, Mar 21, 2011 at 3:25 AM, Grant Likely grant.likely@secretlab.ca wrote:
I had great hopes of doing these status reports once a week; but it turns out to take more effort to get together that I estimated. Here's the status of ARM device tree support as of today. As always, let me know if you have any corrections or additional information.
1 - Latest news
- The last vestiges of of_platform_bus_type are gone from Linus' tree
as of the 2.6.39 merge window. Everything should be using platform_device now.
- devicetree/arm on git://git.secretlab.ca/git/linux-2.6 has
everything needed to turn on basic device tree support for any platform. - Support has been added for Versatile and Tegra in devicetree/arm - Support for Samsung s5pv310 and Freescale mx5 are in devicetree/test
- Similarly, u-boot needs to have the CONFIG_OF_LIBFDT and
CONFIG_SYS_BOOTMAPSZ defined to turn on device tree support. - I've also got patches that eliminate the need for CONFIG_SYS_BOOTMAPSZ which I'll post shortly, but they're not quite working yet. - I've also got a trivial patch that should enabled CONFIG_OF_LIBFDT on a large set of boards, but it has had pretty much zero testing. :-)
- Jason Hui has been making awesome progress on mx5, and some of their
patches are in devicetree/test. Hopefully to move over to devicetree/arm soon.
- Shawn Guo has also been making good progress on adding the clock
bindings to the mx5 support. There are still questions up in the air about the best way to handle clocks though. While all the clocks /can/ be converted to device tree data, there is also value in sharing clock initialization data between DT and non-DT board support. The of_platform_device_prepare() work mentioned below will help with that. It will also be easier to work on the clock support when the common struct clk patch series from Jeremy gets merged. Until then there ends up being a lot of duplication of code.
- Lennert has a series of virq patches for ARM patches completed. He
is currently working on cleaning them up to get them posted.
- Patches posted for of_platform_prepare() which makes it easier for
static platform_device registrations to co-exist with device tree data. Patches are currently in devicetree/test, and will move to devicetree/arm shortly.
- Basic DT support has been merged into Nicolas' Linaro kernel tree.
- DT is also working on Versatile Express, OMAP, and the new Xilinx
platform, but I don't have patches for either of those platforms in my tree.
- Rob Herring's work on the early dtb mmu maping is mainlined and
makes it much nicer to work with dtbs.
Next steps:
At this point I'm putting on my Linaro hat. Feel free to tune out past this point if you're not interested how DT support will materialize in the next release.
There are a number of very specific tasks that need to be completed for the 11.05 release. The goal is to have basic device tree support turned on and working on all of the platforms supported in the release. There isn't a lot of time to get this pulled together, but all the infrastructure is in places, so most of the work is turning on the configuration options and testing the platforms.
For each board, I need an engineer to do the following:
- Enable CONFIG_OF_LIBFDT and CONFIG_SYS_BOOTMAPSZ against the Linaro
u-boot tree. 2) Enable CONFIG_OF and CONFIG_PROC_DEVICETREE in the kernel 3) Add something like the following to the *existing* machine definition. For initial basic support, you don't need to create a separate <soc>-dt.c board support file yet.
+static const char *omap4_panda_dt_match[] __initdata = {
- "ti,omap4-panda",
- NULL
+};
MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") [...]
- .dt_compat = omap4_panda_dt_match,
MACHINE_END
The string in the match table should be in the form "<vendor>,<board-name>"
- Add a template .dts file for the board in
arch/arm/boot/dts/<board>.dts. The following should be sufficient:
/dts-v1/;
/ { model = "TI OMAP4 PandaBoard"; compatible = "ti,omap4-panda"; #address-cells = <1>; #size-cells = <1>;
aliases { };
memory { device_type = "memory"; reg = <0x80000000 0x08000000>; };
chosen { }; }; 5) test it :-) 6) send patches to me for inclusion in the Linaro U-Boot and Kernel trees. I'll collect them to start and ask John and Nicolas to pull them into their trees when they're ready.
This is enough for very basic device tree support and I expect it will only take a day or so of effort to get completed. It won't be particularly useful, but it ensures that the infrastructure is enabled and working.
Bonus points if you're also able to provide patches that add of_platform_device_probe() and of_platform_bus_populate() calls to the board support so that device nodes get attached to the devices and can be used for attaching things like gpios, spi devices, and i2c devices. This is a nice to have for 11.05, but it isn't a requirement to have it working on all boards.
Here is the list of hwpacks that should be supported to the best of my knowledge. Please reply with the hwpacks you can take responsibility for:
efikamx igep imx51 omap3-x11-base omap3 overo panda s5pv310 vexpress
There are also some specific cross-platform tasks that need some love. Let me know if you can take responsibility for any of these items.
- Eliminate CONFIG_SYS_BOOTMAPSZ dependency from U-Boot. I've got a
patch series that does this, but it is untested. I'll post the series tomorrow.
- Add packaging of .dtb files into linux-image-linaro-* packages.
Loic and I discussed putting them under /lib/dtb/`uname -r`/, but thinking about it more, it might make more sense to share the modules directory and use /lib/modules/`uname -r`/dtbs. The dtc tool needed to build the .dtbs is included with the kernel tree.
- Add relevant dtb files to boot partition in linaro-image tools
- Add boot script which passes dtb as 3rd argument to 'bootm'
For purposes of tracking, I'll register bugs for the above items in the Linaro bug tracker tomorrow.
Cheers, g.
-- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Just found a device tree bug which corrupts __machine_type. In arch/arm/kernel/devtree.c at end of setup_machine_fdt()
- __machine_arch_type = mdesc->nr; + __machine_arch_type = mdesc_best->nr;
This was stopping some Beagleboard drivers from being initialised as they were doing run-time checking for machine type.
On Mon, Mar 28, 2011 at 9:10 AM, Tixy tixy@yxit.co.uk wrote:
Just found a device tree bug which corrupts __machine_type. In arch/arm/kernel/devtree.c at end of setup_machine_fdt()
- __machine_arch_type = mdesc->nr;
- __machine_arch_type = mdesc_best->nr;
This was stopping some Beagleboard drivers from being initialised as they were doing run-time checking for machine type.
I've got this fixed in my devicetree/test branch. I'll move it over to devicetree/arm-linaro-2.6.38
g.
On Mon, Mar 28, 2011 at 9:35 AM, Grant Likely grant.likely@secretlab.ca wrote:
On Mon, Mar 28, 2011 at 9:10 AM, Tixy tixy@yxit.co.uk wrote:
Just found a device tree bug which corrupts __machine_type. In arch/arm/kernel/devtree.c at end of setup_machine_fdt()
- __machine_arch_type = mdesc->nr;
- __machine_arch_type = mdesc_best->nr;
This was stopping some Beagleboard drivers from being initialised as they were doing run-time checking for machine type.
I've got this fixed in my devicetree/test branch. I'll move it over to devicetree/arm-linaro-2.6.38
Actually, no, you're right. That's a bug in my test branch too. I'll fix it up. Thanks.
g.
Just found a device tree bug which corrupts __machine_type. In arch/arm/kernel/devtree.c at end of setup_machine_fdt()
- __machine_arch_type = mdesc->nr; + __machine_arch_type = mdesc_best->nr;
This was stopping some Beagleboard drivers from being initialised as they were doing run-time checking for machine type.
On Mon, Mar 21, 2011 at 03:25:16AM -0600, Grant Likely wrote:
[...]
- Add packaging of .dtb files into linux-image-linaro-* packages.
Loic and I discussed putting them under /lib/dtb/`uname -r`/, but thinking about it more, it might make more sense to share the modules directory and use /lib/modules/`uname -r`/dtbs. The dtc tool needed to build the .dtbs is included with the kernel tree.
- Add relevant dtb files to boot partition in linaro-image tools
- Add boot script which passes dtb as 3rd argument to 'bootm'
I just had a talk with Loic. Considering the experience of playing l-m-c and the kind help that people jcrigby, slangasek, lool will give me, I would like to give a shot on this tasks.