Compiling Linux 3.8 for NSA310

Marvell Kirkwood based
Post Reply
lzap
Posts: 39
Joined: Wed Dec 19, 2012 11:46 am

Compiling Linux 3.8 for NSA310

Post by lzap » Sat Mar 16, 2013 2:44 pm

Hello,

I have successfuly modified peeter123 patches for Linux 3.8:

https://github.com/peeter123/NSA310-320-debian

but when I try to boot the new kernel, I have:

Code: Select all

3278280 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-3.8.1
   Created:      2013-03-02  23:10:14 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3278216 Bytes =  3.1 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000d0b).
                                                             
Available machine support:
                          
ID (hex)        NAME
ffffffff        Marvell Kirkwood (Flattened Device Tree)
                                                        
Please check your kernel config and/or bootloader.
Any tips what do I miss?

Here is the patch I have created: http://lzap.fedorapeople.org/patches/ns ... .8.1.patch

The question is if we need this patch, it looks like NSA310 support is there, including LED diods. The patch now only holdds CPUFREQ capabilities. Does ARM need cpufreq scaling at all?

I am trying to build 3.8.3 vanilla now. Maybe we don't need patches anymore.

lzap
Posts: 39
Joined: Wed Dec 19, 2012 11:46 am

Re: Compiling Linux 3.8 for NSA310

Post by lzap » Mon Mar 18, 2013 9:37 am

And here is the resolution: http://lukas.zapletalovi.com/2013/03/bo ... a-310.html

Unfortunately this does not work yet for me:

- LED diods
- console on UART

I think there is already LED support in the mainline kernel, but it does not work for me (they are all green).

For the console, I had to modify some kernel configuration parameter or something. I do have this commandline which was working with peeter123 pathes, but not anymore:

setenv bootargs 'console=ttyS0,115200 root=/dev/sda3 zcache'

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Compiling Linux 3.8 for NSA310

Post by Mijzelf » Mon Mar 18, 2013 12:21 pm

lzap wrote:Unfortunately this does not work yet for me:

- console on UART
AFAIK the Kirkwood has 2 serial ports. Maybe they got swapped. You could try a 'console=ttyS1,115200' in the command line.

lzap
Posts: 39
Joined: Wed Dec 19, 2012 11:46 am

Re: Compiling Linux 3.8 for NSA310

Post by lzap » Mon Mar 18, 2013 12:51 pm

Nope, did not help :-( What can I be missing? I think I do have everything in this kernel. Strange.

Also I noticed when I do "poweroff" it does not go down.

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Compiling Linux 3.8 for NSA310

Post by Mijzelf » Mon Mar 18, 2013 3:35 pm

lzap wrote:- LED diods
Also I noticed when I do "poweroff" it does not go down.
I suppose that is related. Some gpio pin has to be set on powerdown to tell the NAS hardware to switch off.

Ramirez
Posts: 6
Joined: Fri Apr 05, 2013 9:42 pm

Re: Compiling Linux 3.8 for NSA310

Post by Ramirez » Mon Apr 08, 2013 12:33 pm

I did some investigation ;-)

Code: Select all

root@kirkwood-NSA310:~# stty -F /dev/ttyS0
stty: /dev/ttyS0: Input/output error
root@kirkwood-NSA310:~# stty -F /dev/ttyS1
stty: /dev/ttyS1: Input/output error
It looks like the uart isn't initialized. I tried to modify kernel's source to old (non flattened device tree) way, but no success yet :(
I think, gpio is the same problem.

For lzap: budeme pokracovat tady, vic hlav vic vi :) Radek

lzap
Posts: 39
Joined: Wed Dec 19, 2012 11:46 am

Re: Compiling Linux 3.8 for NSA310

Post by lzap » Mon Apr 08, 2013 2:52 pm

The best idea would be linux-arm list if you think you found an issue. For myself, I have a resigned a bit on the 3.8 kernel because I was not able to get f2fs running so far and I am happy with 3.6. Feel free to ping here as well if you have any news about that - interested and appreciated.

Ramirez
Posts: 6
Joined: Fri Apr 05, 2013 9:42 pm

Re: Compiling Linux 3.8 for NSA310

Post by Ramirez » Mon Apr 08, 2013 9:42 pm

I got a little finding about console dysfunction.

Dmesg says:

Code: Select all

...
Warning: unable to open an initial console.
Waiting 10 sec before mounting root device.
...
And kernel's source /init/main.c says:

Code: Select all

/* Open the /dev/console on the rootfs, this should never fail */
	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
		printk(KERN_WARNING "Warning: unable to open an initial console.\n"); 
It looks like there is no rootfs mounted when it's trying to open console ...

DesertF0x
Posts: 25
Joined: Fri Aug 31, 2012 9:46 pm

Re: Compiling Linux 3.8 for NSA310

Post by DesertF0x » Thu Jul 25, 2013 7:08 am

Any success so far? How much output did you have on serial Console?
More than:

Code: Select all

Uncompressing Linux... done, booting the kernel.

DesertF0x
Posts: 25
Joined: Fri Aug 31, 2012 9:46 pm

Re: Compiling Linux 3.8 for NSA310

Post by DesertF0x » Thu Jul 25, 2013 4:44 pm

Thx for the info, FDT works and I am able to boot 3.10.2 Kernel:
kernel: Machine: Marvell Kirkwood (Flattened Device Tree), model: ZyXEL NSA310
Network is working.
Serial, GPIO, USB do not work:
kernel: USB Power Off: Failed to request enable GPIO21: -517
kernel: reg-fixed-voltage 1.regulator: Failed to register regulator: -517
Serial is recognized but output is not initialized:
kernel: Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
Missing ttyS0 like in patched linux-3.5 kernel for example:
kernel: serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A

Seems like something is wrong with the kirkwood-nsa310.dts file where GPIO and Serial are defined for FDT.

DesertF0x
Posts: 25
Joined: Fri Aug 31, 2012 9:46 pm

Re: Compiling Linux 3.8 for NSA310

Post by DesertF0x » Sun Jul 28, 2013 4:08 pm

Ok, I have serial, USB and Sensors working now only LED and GPIO are not working yet.
I had to start over with

Code: Select all

make kirkwood_defconfig
Then LM85 and Realtek Network r8169 had to be re enabled.
Additionally I had to modify arch/arm/boot/dts/kirkwood-nsa310.dts which made sensors and fancontrol work.
adt7476 has to be replaced with lm85.

Code: Select all

i2c@11000 {
			status = "okay";

			lm85: lm85@2e {
				compatible = "lm85";
				reg = <0x2e>;
			};
		};
What helped me was this post and the follow ups on the linux-arm-kernel list

lzap
Posts: 39
Joined: Wed Dec 19, 2012 11:46 am

Re: Compiling Linux 3.8 for NSA310

Post by lzap » Wed Nov 13, 2013 11:15 am

Hey DesertF0x,

please share how did you manage the console to get working please. I gave up, but next week I would like to give latest kernel a try.

Thanks!

Post Reply