Skip to contentSkip to conversation

Converting kirkwood-goflexnet to DTS

DISCUSSION Andrew Lunn 4 participants 9 messages Jun 14, 2012 – Jun 17, 2012

lore
Share & tools
lore
#0 lore raw

Hi Josh

Welcome to the fun...

# CONFIG_SERIAL_OF_PLATFORM is not set

You need this one, if you want the serial ports to work... Also, don't be surprised when they do work, even though IRQ=0!

It is a good idea to build the kernel with earlyprintk support and to pass it as a kernel parameter.

Also, -rc2 is FUBAR on all Orion platforms, unless you have:

http://comments.gmane.org/gmane.linux.ports.arm.kernel/170442

Andrew

#1 lore raw

Finally some progress. Using the printk patch along with earlyprintk and the config tweaks as suggested, my kernel at least now shows why it's dying:

--------------------------
## Booting kernel from Legacy Image at 00800000 ...

   Image Name:   Linux-3.5.0-rc2-ARCH
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3015272 Bytes = 2.9 MiB

Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000c11).

Available machine support:

ID (hex) NAME
ffffffff Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
--------------------------

Obviously, I've missed something with my work as my machine is not showing up as a supported unit in that list. At least the machine ID being detected is correct, so that's a plus.

I should be able to crack this and have another test kernel in 4 hours, I'm hoping with good results.

Josh C

#2 lore raw
Quoted 21 lines · Josh Coombs

Finally some progress. ?Using the printk patch along with earlyprintk and the config tweaks as suggested, my kernel at least now shows why it's dying:

--------------------------
## Booting kernel from Legacy Image at 00800000 ... ? Image Name: ? Linux-3.5.0-rc2-ARCH
? Image Type: ? ARM Linux Kernel Image (uncompressed) ? Data Size: ? ?3015272 Bytes = 2.9 MiB
? Load Address: 00008000
? Entry Point: ?00008000
? Verifying Checksum ... OK
? Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000c11).

Quoted 7 lines

Available machine support:

ID (hex) ? ? ? ?NAME
ffffffff ? ? ? ?Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
--------------------------

I'm still stuck with the same error. I'm working against 5.2rc2 with the Orion/kirkwood printk.c patch.

I'm not 100% on proper etiquette here so rather than spam first and get scolded, I've pastebined the relevant info.

My current patchset is here: http://pastie.org/4090298
The stripped kernel conf I'm using is here: http://pastie.org/4090323

I'm including all but the iconnect flattened tree board types in my config, included DTS early testing, and am appending the DTS definitions to the end of the kernel as I don't expect my uboot to play nice, so I'm rather surprised to not see any of the boards show up as supported with that boot error. I feel like this has got to be a kernel conf issue, or I'm missing a step in preparing a DTS based kernel.

I also know my board definition will need cleanup to support both the GoFlex Net and Home but went this way just to test the concept first.

Josh C

#3 lore raw

Hello,

Le Fri, 15 Jun 2012 00:53:45 -0400,
Josh Coombs <[email protected]> a ?crit :

Quoted 29 lines
Quoted 11 lines

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000c11).

Available machine support:

ID (hex) ? ? ? ?NAME
ffffffff ? ? ? ?Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
--------------------------

I'm still stuck with the same error. I'm working against 5.2rc2 with the Orion/kirkwood printk.c patch.

I'm not 100% on proper etiquette here so rather than spam first and get scolded, I've pastebined the relevant info.

My current patchset is here: http://pastie.org/4090298
The stripped kernel conf I'm using is here: http://pastie.org/4090323

I'm including all but the iconnect flattened tree board types in my config, included DTS early testing, and am appending the DTS definitions to the end of the kernel as I don't expect my uboot to play nice, so I'm rather surprised to not see any of the boards show up as supported with that boot error. I feel like this has got to be a kernel conf issue, or I'm missing a step in preparing a DTS based kernel.

Quoted 2 lines

I also know my board definition will need cleanup to support both the GoFlex Net and Home but went this way just to test the concept first.

Seems like your kernel isn't seeing the appended DTB, and therefore falls back at looking at r1 for a machine ID. Can you detail the command line you're using to build your kernel?

What I'm doing is:

1) Build the zImage

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4

2) Build the DTB

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- armada-xp-db.dtb

3) Concatenate zImage+DTB

arch/arm/boot/zImage arch/arm/boot/armada-xp-db.dtb > zImage-armada-xp.dtb

4) Run mkimage on it

/bin/bash scripts/mkuboot.sh -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-marvell' -d zImage-armada-xp.dtb arch/arm/boot/uImage.armada-xp

5) Boot arch/arm/boot/uImage.armada-xp

Of course, in the final step, you need to adjust the -a and -e options as needed for your platform. But apparently, your platform uses the same addresses.

Are you doing something similar to prepare your uImage? As far as I know, the kernel build process does not automatically append the DTB, so you have to do it manually as detailed above.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

Thomas, Andrew,

You were both correct. After one additional test failure last night and a lot more reading I reached the same conclusion, I was foolishly thinking .dtbs would be automatically appended to the kernel when configured to support that method of including them.

What I did this morning:

make
make kirkwood-goflexnet.dtb
cat arch/arm/boot/kirkwood-goflexnet.dtb >> arch/arm/boot/zImage make uImage

That resulted in: http://pastie.org/4092019

Boots, with some serious errors, doesn't seem to mount a FS and stops.
Reducing my kernel arguments down to "console=ttyS0,115200
earlyprintk rootfs=/dev/sda1 rootdelay=10" I see the same errors, but I also show the key hardware involved being detected, and the nand partitioning looks correct. My status LED goes solid green, so it appears something is working right. I'll dig into goflexnet_init next to try and determine what is wrong in there.

Josh C

#5 lore raw

Josh,

Le Fri, 15 Jun 2012 08:40:48 -0400,
Josh Coombs <[email protected]> a ?crit :

Quoted 4 lines

You were both correct. After one additional test failure last night and a lot more reading I reached the same conclusion, I was foolishly thinking .dtbs would be automatically appended to the kernel when configured to support that method of including them.

Yeah, but the DTB append feature is only a development/debugging feature provided to allow DT-related development with non-DT capable bootloaders. However, my understanding is that it is assumed that people should ultimately use DT-capable bootloaders.

Quoted 9 lines

That resulted in: http://pastie.org/4092019

Boots, with some serious errors, doesn't seem to mount a FS and stops.
Reducing my kernel arguments down to "console=ttyS0,115200
earlyprintk rootfs=/dev/sda1 rootdelay=10" I see the same errors, but I also show the key hardware involved being detected, and the nand partitioning looks correct. My status LED goes solid green, so it appears something is working right. I'll dig into goflexnet_init next to try and determine what is wrong in there.

Haven't looked at the details, but aren't certain devices registered multiple times?

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw
In reply to Josh Coombs
Quoted 7 lines · Josh Coombs

Thomas, Andrew,

You were both correct. After one additional test failure last night and a lot more reading I reached the same conclusion, I was foolishly thinking .dtbs would be automatically appended to the kernel when configured to support that method of including them.

Quoted 9 lines

What I did this morning:

make
make kirkwood-goflexnet.dtb
cat arch/arm/boot/kirkwood-goflexnet.dtb >> arch/arm/boot/zImage make uImage

That resulted in: http://pastie.org/4092019

[   18.294288] [<c055f99c>] (kirkwood_init+0x50/0x7c) from [<c056023c>] (goflexnet_init+0x8/0x7c)

seems wrong. You don't have to call kirkwood_init() in DT case afaik.

Arnaud

#7 lore raw
Quoted 7 lines
Quoted 7 lines

What I did this morning:

make
make kirkwood-goflexnet.dtb
cat arch/arm/boot/kirkwood-goflexnet.dtb >> arch/arm/boot/zImage make uImage

Quoted 7 lines
Quoted 2 lines

That resulted in: http://pastie.org/4092019

[ ? 18.294288] [<c055f99c>] (kirkwood_init+0x50/0x7c) from [<c056023c>] (goflexnet_init+0x8/0x7c)

seems wrong. You don't have to call kirkwood_init() in DT case afaik.

Arnaud

You're correct Arnaud, chalk that up to another rookie mistake on my part. So close now. Correcting goflexnet_init, I now only get one bit of noise during init, seems to be related to cfq? The kernel sees my drives and volumes, but it's still not proceeding to mount a rootfs and proceed with the boot.

http://pastie.org/4095067

My next line of thought is to tweak my kernel conf so I'm just using noop, and to specify my rootfs as a compiled in kernel arg to see if there is something going on with how uboot args are getting passed on.
I'd expect it to complain about a missing rootfs if it wasn't getting
that string but I'm not sure how else to verify correct behavior.

Josh C

#8 lore raw

Decided to backtrack a bit. I rolled my setup into 3.4.2 to see what happens as I'm currently running that version via a non-DTS based patch right now. Same behavior, the kernel initializes but stops before attaching a root device and firing up init.

I've got a couple more hacks to try next to see if I can pinpoint what's keeping my GoFlex from working when other similar Kirkwoods seem to play with DTS kernels just fine.

Josh Coombs