Hi guys,
Nicolas, thanks for taking a look at the basic device tree patches. I've fixed up the defects you've pointed out and pushed the fixed versions out to my tree. Other than that, does it look okay to you?
With that series it is possible to turn on device tree booting for any arm platform by turning on CONFIG_OF and adding a dt_compat string table to the existing machine_desc. It is far from complete support since it only decodes the kernel parameters, the initrd location and the memory size, but it is enough for others to start playing with the infrastructure.
On the u-boot side of things, everything needed to support device tree appears to be complete and working, other than a bug I ran into on systems with memory based at 0. (fix sent to list). Turning on CONFIG_OF_LIBFDT was simple on Tegra, and I expect it will be on the other platforms too.
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loïc.
Cheers, g.
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loïc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Nicolas
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Absolutely. I'll do that.
g.
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
The following changes since commit 18fac29199a8cd9053adde99849c37dbf2a8b8d9:
regulators: Moved define for number of regulators in ab8500 (2011-01-26 16:38:15 -0500)
are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
Grant Likely (7): dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch() of/flattree: Add of_flat_dt_match() helper function arm/dt: Make __vet_atags also accept a dtb image arm/dt: allow bootmem reservation for device tree blob and initrd arm/dt: consolidate atags setup into setup_machine_atags arm/dt: probe for platforms via the device tree arm/dt: Basic versatile devicetree support
Jeremy Kerr (1): arm/dt: Allow CONFIG_OF on ARM
arch/arm/Kconfig | 7 ++ arch/arm/include/asm/mach/arch.h | 2 + arch/arm/include/asm/prom.h | 34 ++++++++++ arch/arm/include/asm/setup.h | 4 + arch/arm/kernel/Makefile | 1 + arch/arm/kernel/devtree.c | 107 ++++++++++++++++++++++++++++++++ arch/arm/kernel/head-common.S | 24 +++++-- arch/arm/kernel/head.S | 8 +- arch/arm/kernel/setup.c | 78 +++++++++++++---------- arch/arm/mach-versatile/versatile_ab.c | 6 ++ arch/arm/mach-versatile/versatile_pb.c | 6 ++ arch/arm/mm/init.c | 23 +++++++ arch/microblaze/kernel/prom.c | 4 +- arch/mips/kernel/prom.c | 6 +- arch/powerpc/kernel/prom.c | 4 +- drivers/of/fdt.c | 33 ++++++++-- include/linux/of_fdt.h | 3 +- 17 files changed, 291 insertions(+), 59 deletions(-) create mode 100644 arch/arm/include/asm/prom.h create mode 100644 arch/arm/kernel/devtree.c
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
The following changes since commit 18fac29199a8cd9053adde99849c37dbf2a8b8d9:
regulators: Moved define for number of regulators in ab8500 (2011-01-26 16:38:15 -0500)
are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
It seems that this branch lack some patches which you summit to LKM, such as DT_MACHINE_START/DT_MACHINE_END definion etc.
Which branch I need work on to add DT support for FSL i.MX support?
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
On Jan 27, 2011 4:07 AM, "Liu Hui-R64343" r64343@freescale.com wrote:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are
from
devicetree/arm. You can find the result here:
The following changes since commit 18fac29199a8cd9053adde99849c37dbf2a8b8d9:
regulators: Moved define for number of regulators in ab8500 (2011-01-26 16:38:15 -0500)
are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
It seems that this branch lack some patches which you summit to LKM, such
as
DT_MACHINE_START/DT_MACHINE_END definion etc.
Correct. The devicetree/arm and devicetree/arm-linaro-2.6.37 branches only contain the bare minimum to turn on dt support. I'm only putting stuff in those branches that I'm confident are pretty close to final form. It doesn't have the clk stuff and it doesn't have the DT_MACHINE_START macro.
DT_MACHINE_START is missing because I'm not sure whether or not it is necessary. Support for dt can be added to a regular MACHINE_START without the DT version simply by populating the dt_compat table. It is no longer necessary to have a "magic" 0xffffffff dt machine number (but the machine number does need to still be valid, at least until 2.6.39).
You can find the patches I'm not decided on yet in my devicetree/test branch. But be warned, that branch gets rebased. The devicetree/arm branch does not.
Which branch I need work on to add DT support for FSL i.MX support?
You should still be able to use devicetree/arm
g.
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Hi, Grant,
On Fri, Jan 28, 2011 at 3:50 PM, Grant Likely grant.likely@secretlab.ca wrote:
On Jan 27, 2011 4:07 AM, "Liu Hui-R64343" r64343@freescale.com wrote:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
The following changes since commit 18fac29199a8cd9053adde99849c37dbf2a8b8d9:
regulators: Moved define for number of regulators in ab8500 (2011-01-26 16:38:15 -0500)
are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
It seems that this branch lack some patches which you summit to LKM, such as DT_MACHINE_START/DT_MACHINE_END definion etc.
Correct. The devicetree/arm and devicetree/arm-linaro-2.6.37 branches only contain the bare minimum to turn on dt support. I'm only putting stuff in those branches that I'm confident are pretty close to final form. It doesn't have the clk stuff and it doesn't have the DT_MACHINE_START macro.
DT_MACHINE_START is missing because I'm not sure whether or not it is necessary. Support for dt can be added to a regular MACHINE_START without the DT version simply by populating the dt_compat table. It is no longer necessary to have a "magic" 0xffffffff dt machine number (but the machine number does need to still be valid, at least until 2.6.39).
Yes, make sense.
You can find the patches I'm not decided on yet in my devicetree/test branch. But be warned, that branch gets rebased. The devicetree/arm branch does not.
Which branch I need work on to add DT support for FSL i.MX support?
You should still be able to use devicetree/arm
OK. Since there still be some fix to be pulled in, this branch should be rebased timely.
BR, Jason
g.
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
g.
The following changes since commit 18fac29199a8cd9053adde99849c37dbf2a8b8d9:
regulators: Moved define for number of regulators in ab8500 (2011-01-26 16:38:15 -0500)
are available in the git repository at: git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
Grant Likely (7): dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch() of/flattree: Add of_flat_dt_match() helper function arm/dt: Make __vet_atags also accept a dtb image arm/dt: allow bootmem reservation for device tree blob and initrd arm/dt: consolidate atags setup into setup_machine_atags arm/dt: probe for platforms via the device tree arm/dt: Basic versatile devicetree support
Jeremy Kerr (1): arm/dt: Allow CONFIG_OF on ARM
arch/arm/Kconfig | 7 ++ arch/arm/include/asm/mach/arch.h | 2 + arch/arm/include/asm/prom.h | 34 ++++++++++ arch/arm/include/asm/setup.h | 4 + arch/arm/kernel/Makefile | 1 + arch/arm/kernel/devtree.c | 107 ++++++++++++++++++++++++++++++++ arch/arm/kernel/head-common.S | 24 +++++-- arch/arm/kernel/head.S | 8 +- arch/arm/kernel/setup.c | 78 +++++++++++++---------- arch/arm/mach-versatile/versatile_ab.c | 6 ++ arch/arm/mach-versatile/versatile_pb.c | 6 ++ arch/arm/mm/init.c | 23 +++++++ arch/microblaze/kernel/prom.c | 4 +- arch/mips/kernel/prom.c | 6 +- arch/powerpc/kernel/prom.c | 4 +- drivers/of/fdt.c | 33 ++++++++-- include/linux/of_fdt.h | 3 +- 17 files changed, 291 insertions(+), 59 deletions(-) create mode 100644 arch/arm/include/asm/prom.h create mode 100644 arch/arm/kernel/devtree.c
On Thu, 27 Jan 2011, Grant Likely wrote:
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
No problem. I hadn't pushed it out yet.
Nicolas
Hi, Grant and Nico,
On Fri, Jan 28, 2011 at 2:51 AM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Thu, 27 Jan 2011, Grant Likely wrote:
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
No problem. I hadn't pushed it out yet.
I have run into one problem when play with DT support on MX51, here is what I'm doing,
- Enable CONFIG_OF_LIBFDT in u-boot and build for mx51evk,
+#define CONFIG_OF_LIBFDT +#define CONFIG_SYS_BOOTMAPSZ 0x800000
- Add mx51-dt.c in kernel to add mx51 dt probe and support,
- Build the kernel and uboot, no problem,
- run uboot with DT support, log as the followings,
## Booting kernel from Legacy Image at 90800000 ... Image Name: Linux-2.6.37-rc7+ Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1866572 Bytes = 1.8 MiB Load Address: 90008000 Entry Point: 90008000 Verifying Checksum ... OK ## Flattened Device Tree blob at 90000000 Booting using the fdt blob at 0x90000000 Loading Kernel Image ... OK OK Loading Device Tree to 907fc000, end 907ff6f1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
No message output, but if print log_buf, here is the log information,
dump /W 0xC03B550C..0xC03B650C
+0x0 +0x4 +0x8 +0xC ------------------------------------------------ S:0xC03B5500 4C3E353C <5>L S:0xC03B5510 78756E69 72657620 6E6F6973 362E3220 inux version 2.6 S:0xC03B5520 2D37332E 2B376372 36722820 33343334 .37-rc7+ (r64343 S:0xC03B5530 34367240 2D333433 6B736564 29706F74 @r64343-desktop) S:0xC03B5540 63672820 65762063 6F697372 2E34206E (gcc version 4. S:0xC03B5550 20332E33 756F5328 72656372 2B472079 3.3 (Sourcery G+ S:0xC03B5560 694C202B 32206574 71393030 30322D31 + Lite 2009q1-20 S:0xC03B5570 29202933 20342320 20697246 206E614A 3) ) #4 Fri Jan S:0xC03B5580 31203832 30313A35 2031303A 20545343 28 15:10:01 CST S:0xC03B5590 31313032 3E343C0A 3A555043 4D524120 2011.<4>CPU: ARM S:0xC03B55A0 50203776 65636F72 726F7373 31345B20 v7 Processor [41 S:0xC03B55B0 30636632 205D3538 69766572 6E6F6973 2fc085] revision S:0xC03B55C0 28203520 764D5241 202C2937 313D7263 5 (ARMv7), cr=1 S:0xC03B55D0 33356330 0A663763 433E343C 203A5550 0c53c7f.<4>CPU: S:0xC03B55E0 54504956 6E6F6E20 61696C61 676E6973 VIPT nonaliasing S:0xC03B55F0 74616420 61632061 2C656863 50495620 data cache, VIP S:0xC03B5600 6C612054 69736169 6920676E 7274736E T aliasing instr S:0xC03B5610 69746375 63206E6F 65686361 0000000A uction cache....
After narrow down the issue I found the error happen in the function,
struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) { struct boot_param_header *devtree; struct machine_desc *mdesc, *mdesc_best = NULL; unsigned int score, mdesc_score = ~1; unsigned long dt_root;
devtree = phys_to_virt(dt_phys);
.....
here the dt_phys is 0,
Nicolas _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
Hi, Grant,
On Fri, Jan 28, 2011 at 3:57 PM, Jason Hui jason.hui@linaro.org wrote:
Hi, Grant and Nico,
On Fri, Jan 28, 2011 at 2:51 AM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Thu, 27 Jan 2011, Grant Likely wrote:
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
No problem. I hadn't pushed it out yet.
I have run into one problem when play with DT support on MX51, here is what I'm doing,
- Enable CONFIG_OF_LIBFDT in u-boot and build for mx51evk,
+#define CONFIG_OF_LIBFDT +#define CONFIG_SYS_BOOTMAPSZ 0x800000
Add mx51-dt.c in kernel to add mx51 dt probe and support,
Build the kernel and uboot, no problem,
run uboot with DT support, log as the followings,
## Booting kernel from Legacy Image at 90800000 ... Image Name: Linux-2.6.37-rc7+ Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1866572 Bytes = 1.8 MiB Load Address: 90008000 Entry Point: 90008000 Verifying Checksum ... OK ## Flattened Device Tree blob at 90000000 Booting using the fdt blob at 0x90000000 Loading Kernel Image ... OK OK Loading Device Tree to 907fc000, end 907ff6f1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
No message output, but if print log_buf, here is the log information,
dump /W 0xC03B550C..0xC03B650C
+0x0 +0x4 +0x8 +0xC ------------------------------------------------ S:0xC03B5500 4C3E353C <5>L S:0xC03B5510 78756E69 72657620 6E6F6973 362E3220 inux version 2.6 S:0xC03B5520 2D37332E 2B376372 36722820 33343334 .37-rc7+ (r64343 S:0xC03B5530 34367240 2D333433 6B736564 29706F74 @r64343-desktop) S:0xC03B5540 63672820 65762063 6F697372 2E34206E (gcc version 4. S:0xC03B5550 20332E33 756F5328 72656372 2B472079 3.3 (Sourcery G+ S:0xC03B5560 694C202B 32206574 71393030 30322D31 + Lite 2009q1-20 S:0xC03B5570 29202933 20342320 20697246 206E614A 3) ) #4 Fri Jan S:0xC03B5580 31203832 30313A35 2031303A 20545343 28 15:10:01 CST S:0xC03B5590 31313032 3E343C0A 3A555043 4D524120 2011.<4>CPU: ARM S:0xC03B55A0 50203776 65636F72 726F7373 31345B20 v7 Processor [41 S:0xC03B55B0 30636632 205D3538 69766572 6E6F6973 2fc085] revision S:0xC03B55C0 28203520 764D5241 202C2937 313D7263 5 (ARMv7), cr=1 S:0xC03B55D0 33356330 0A663763 433E343C 203A5550 0c53c7f.<4>CPU: S:0xC03B55E0 54504956 6E6F6E20 61696C61 676E6973 VIPT nonaliasing S:0xC03B55F0 74616420 61632061 2C656863 50495620 data cache, VIP S:0xC03B5600 6C612054 69736169 6920676E 7274736E T aliasing instr S:0xC03B5610 69746375 63206E6F 65686361 0000000A uction cache....
After narrow down the issue I found the error happen in the function,
struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) { struct boot_param_header *devtree; struct machine_desc *mdesc, *mdesc_best = NULL; unsigned int score, mdesc_score = ~1; unsigned long dt_root;
devtree = phys_to_virt(dt_phys);
.....
here the dt_phys is 0,
I did the following modification, which make the basic DT support boot up on MX51 board,
- Let uboot pass MACH_TYPE_DT to kernel via r1, - Add the following patch to make sure DT blob is mapped by MMU
+#ifdef CONFIG_OF_FLATTREE*/ + /* Make sure DT blob is mapped */ + mov r0, r2 + mov r0, r0, lsr #20 + mov r0, r0, lsl #20 + sub r3, r0, #PHYS_OFFSET + add r3, r3, #PAGE_OFFSET + add r3, r4, r3, lsr #18 + orr r6, r7, r0 + str r6, [r3] + add r6, r6, #0x100000 + str r6, [r3, #4] #ifdef CONFIG_DEBUG_LL #ifndef CONFIG_DEBUG_ICEDCC
BR, Jason Liu
Nicolas _______________________________________________ linaro-dev mailing list linaro-dev@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-dev
On Fri, Jan 28, 2011 at 07:52:03PM +0800, Jason Hui wrote:
Hi, Grant,
On Fri, Jan 28, 2011 at 3:57 PM, Jason Hui jason.hui@linaro.org wrote:
Hi, Grant and Nico,
On Fri, Jan 28, 2011 at 2:51 AM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Thu, 27 Jan 2011, Grant Likely wrote:
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
> If I were able to get all the supported Linaro platforms modified and > tested to support dt booting, would you be okay with picking up the > current dt support series and having CONFIG_OF turned on by default > for the next Linaro release? There are also some details to nail down > with respect to packaging the .dtb files, but I'm working out those > details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
No problem. I hadn't pushed it out yet.
I have run into one problem when play with DT support on MX51, here is what I'm doing,
- Enable CONFIG_OF_LIBFDT in u-boot and build for mx51evk,
+#define CONFIG_OF_LIBFDT +#define CONFIG_SYS_BOOTMAPSZ 0x800000
Add mx51-dt.c in kernel to add mx51 dt probe and support,
Build the kernel and uboot, no problem,
run uboot with DT support, log as the followings,
## Booting kernel from Legacy Image at 90800000 ... Image Name: Linux-2.6.37-rc7+ Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1866572 Bytes = 1.8 MiB Load Address: 90008000 Entry Point: 90008000 Verifying Checksum ... OK ## Flattened Device Tree blob at 90000000 Booting using the fdt blob at 0x90000000 Loading Kernel Image ... OK OK Loading Device Tree to 907fc000, end 907ff6f1 ... OK
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
No message output, but if print log_buf, here is the log information,
dump /W 0xC03B550C..0xC03B650C
+0x0 +0x4 +0x8 +0xC ------------------------------------------------ S:0xC03B5500 4C3E353C <5>L S:0xC03B5510 78756E69 72657620 6E6F6973 362E3220 inux version 2.6 S:0xC03B5520 2D37332E 2B376372 36722820 33343334 .37-rc7+ (r64343 S:0xC03B5530 34367240 2D333433 6B736564 29706F74 @r64343-desktop) S:0xC03B5540 63672820 65762063 6F697372 2E34206E (gcc version 4. S:0xC03B5550 20332E33 756F5328 72656372 2B472079 3.3 (Sourcery G+ S:0xC03B5560 694C202B 32206574 71393030 30322D31 + Lite 2009q1-20 S:0xC03B5570 29202933 20342320 20697246 206E614A 3) ) #4 Fri Jan S:0xC03B5580 31203832 30313A35 2031303A 20545343 28 15:10:01 CST S:0xC03B5590 31313032 3E343C0A 3A555043 4D524120 2011.<4>CPU: ARM S:0xC03B55A0 50203776 65636F72 726F7373 31345B20 v7 Processor [41 S:0xC03B55B0 30636632 205D3538 69766572 6E6F6973 2fc085] revision S:0xC03B55C0 28203520 764D5241 202C2937 313D7263 5 (ARMv7), cr=1 S:0xC03B55D0 33356330 0A663763 433E343C 203A5550 0c53c7f.<4>CPU: S:0xC03B55E0 54504956 6E6F6E20 61696C61 676E6973 VIPT nonaliasing S:0xC03B55F0 74616420 61632061 2C656863 50495620 data cache, VIP S:0xC03B5600 6C612054 69736169 6920676E 7274736E T aliasing instr S:0xC03B5610 69746375 63206E6F 65686361 0000000A uction cache....
After narrow down the issue I found the error happen in the function,
struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) { struct boot_param_header *devtree; struct machine_desc *mdesc, *mdesc_best = NULL; unsigned int score, mdesc_score = ~1; unsigned long dt_root;
devtree = phys_to_virt(dt_phys);
.....
here the dt_phys is 0,
I did the following modification, which make the basic DT support boot up on MX51 board,
- Let uboot pass MACH_TYPE_DT to kernel via r1,
This is a temporary situation. When passing a .dtb, the kernel doesn't actually need to care what the value of r1 is. Russell has a patch for 2.6.39 which removes the early validation of r1. I should also add the patch to the devicetree/arm branch.
- Add the following patch to make sure DT blob is mapped by MMU
+#ifdef CONFIG_OF_FLATTREE*/
/* Make sure DT blob is mapped */
mov r0, r2
mov r0, r0, lsr #20
mov r0, r0, lsl #20
sub r3, r0, #PHYS_OFFSET
add r3, r3, #PAGE_OFFSET
add r3, r4, r3, lsr #18
orr r6, r7, r0
str r6, [r3]
add r6, r6, #0x100000
str r6, [r3, #4]
#ifdef CONFIG_DEBUG_LL #ifndef CONFIG_DEBUG_ICEDCC
If you load the dtb into the first 16k of RAM, then it works without this patch, but it isn't ideal. Rob has posted an updated patch for this which builds on top of some of Russell's changes for 2.6.39 which makes things better for both atags and dtbs. I'm also planning to pick up a version of that patch into devicetree/arm which should also make things simpler for you.
g.
On Thu, Jan 27, 2011 at 11:51 AM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Thu, 27 Jan 2011, Grant Likely wrote:
2011/1/26 Grant Likely grant.likely@secretlab.ca:
On Wed, Jan 26, 2011 at 2:49 PM, Nicolas Pitre nicolas.pitre@linaro.org wrote:
On Wed, 26 Jan 2011, Grant Likely wrote:
If I were able to get all the supported Linaro platforms modified and tested to support dt booting, would you be okay with picking up the current dt support series and having CONFIG_OF turned on by default for the next Linaro release? There are also some details to nail down with respect to packaging the .dtb files, but I'm working out those details with Loďc.
May I ask you to create a linaro-2.6.37 branch in your repo based on git://git.linaro.org/kernel/linux-linaro-2.6.37.git and merge your DT branch in it? If the result look sane to you then I should be able to merge it in the current Linaro kernel for people to play with.
Done. My branch is based on 2.6.38-rc1, so I cherry picked rather than rebased. The first two commits are in Linus' tree, the remainder are from devicetree/arm. You can find the result here:
Oops, I've run into a bug. Hold off on this for the moment until I dig it out and squash it.
No problem. I hadn't pushed it out yet.
Alright, everything fixed up now. Here's the new pull request. I'll also be sending out the 2.6.38 based series for review that this branch cherry picks from.
g.
The following changes since commit fa3c5afc525bacfcdd2ba5107da5a2d93a04b32b:
Merge branch 'display-patches-for-linaro-37' of git://dev.omapzoom.org/pub/scm/anand/linux-omap-usb into linaro-2.6.37 (2011-02-09 18:49:56 -0500)
are available in the git repository at:
git://git.secretlab.ca/git/linux-2.6 devicetree/arm-linaro-2.6.37
Grant Likely (7): dt/flattree: Return virtual address from early_init_dt_alloc_memory_arch() of/flattree: Add of_flat_dt_match() helper function arm/dt: Make __vet_atags also accept a dtb image arm/dt: consolidate atags setup into setup_machine_atags arm/dt: probe for platforms via the device tree arm/dt: Basic versatile devicetree support arm/dt: Basic tegra devicetree support
Jeremy Kerr (1): arm/dt: Allow CONFIG_OF on ARM
Rob Herring (1): ARM/dt: map ATAGs when not in first 1MB of RAM
arch/arm/Kconfig | 7 ++ arch/arm/include/asm/mach/arch.h | 2 + arch/arm/include/asm/prom.h | 37 +++++++++ arch/arm/include/asm/setup.h | 3 + arch/arm/kernel/Makefile | 1 + arch/arm/kernel/devtree.c | 136 ++++++++++++++++++++++++++++++++ arch/arm/kernel/head-common.S | 24 ++++-- arch/arm/kernel/head.S | 27 +++++- arch/arm/kernel/setup.c | 78 ++++++++++-------- arch/arm/mach-tegra/board-harmony.c | 6 ++ arch/arm/mach-versatile/versatile_ab.c | 6 ++ arch/arm/mach-versatile/versatile_pb.c | 6 ++ arch/arm/mm/init.c | 11 +++ arch/microblaze/kernel/prom.c | 4 +- arch/mips/kernel/prom.c | 6 +- arch/powerpc/kernel/prom.c | 4 +- drivers/of/fdt.c | 33 +++++++- include/linux/of_fdt.h | 3 +- 18 files changed, 334 insertions(+), 60 deletions(-) create mode 100644 arch/arm/include/asm/prom.h create mode 100644 arch/arm/kernel/devtree.c