parallella / parallella-linux

Linux Kernel forked from ADI (with latest ADI HDMI drivers)
Other
68 stars 44 forks source link

Update kernel to 4.1.x #8

Open luxas opened 9 years ago

luxas commented 9 years ago

Hello everyone! Is it possible to upgrade to v4.1.x linux kernel? So one could use it with docker and overlay? I'm probably going to use Arch Linux ARM, but the first step is the kernel compilation

See my project

luxas commented 9 years ago

/cc @aolofsson

aolofsson commented 9 years ago

Lucas,

Nice project! Yes, that should be possible. There should be a headless kernel that works with mainline and even has a basic device tree for parallella up-streamed.

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

@olajep can comment further

EmbeddedAndroid commented 9 years ago

Lucas,

The kernelci.org project tests the parallella with all the upstream kernels, and basic functionality is working fine in mainline and other development trees upstream.

http://kernelci.org/boot/zynq-parallella/

aolofsson commented 9 years ago

Whaaat? How come i didnt know about this?:-) Very cool! On Oct 15, 2015 6:16 PM, "Tyler Baker" notifications@github.com wrote:

Lucas,

The kernelci.org project tests the parallella with all the upstream kernels, and basic functionality is working fine in mainline and other development trees upstream.

http://kernelci.org/boot/zynq-parallella/

— Reply to this email directly or view it on GitHub https://github.com/parallella/parallella-linux/issues/8#issuecomment-148538700 .

luxas commented 9 years ago

Thanks for the information! If I go with this and the multi_v7_defconfig modules, how should the bootloader be handled?

Doesn't the generic zImage require a parallella.bin or something in the same /boot dir for it to work?

EmbeddedAndroid commented 9 years ago

You'll need the following binaries:

http://storage.kernelci.org/stable/v4.2.3/arm-multi_v7_defconfig/zImage http://storage.kernelci.org/stable/v4.2.3/arm-multi_v7_defconfig/modules.tar.xz http://storage.kernelci.org/stable/v4.2.3/arm-multi_v7_defconfig/dtbs/zynq-parallella.dtb ftp://ftp.parallella.org/ubuntu/dists/trusty/image/ - parallella.bin from the images hosted there.

First I wrap the zImage with a u-boot header using the following command:

mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -d zImage uImage

Then in u-boot I load the bitstream from the mmc card (whatever came with the image when I installed it to the mmc)

fatload mmc 0 0x4000000 parallella.bin fpga load 0 0x4000000 0x3dbafc

Now load the kernel, dtb, set the boot args and boot.

setenv bootargs 'console=ttyPS0,115200 root=/dev/sdaX ip=dhcp' fatload mmc 0 0x3000000 uImage fatload mmc 0 0x2a00000 zynq-parallella.dtb bootm 0x3000000 - 0x2a00000

luxas commented 9 years ago

Ok, in which file I should put this content?

fatload mmc 0 0x4000000 parallella.bin
fpga load 0 0x4000000 0x3dbafc
setenv bootargs 'console=ttyPS0,115200 root=/dev/sdaX ip=dhcp'
fatload mmc 0 0x3000000 uImage
fatload mmc 0 0x2a00000 zynq-parallella.dtb
bootm 0x3000000 - 0x2a00000

And should /boot and / (rootfs) have different partitions for this to work? About the parallella.bin file, should I mount the .img to an empty dir and get the parallella.bin from the boot dir? Thanks for your answer. I´m completely new to u-boot, haven't used it before. :smile:

cloud-rocket commented 8 years ago

Hi @EmbeddedAndroid

I tried to boot kernel 4.4.3 on Parallella following your instructions and have some questions:

I used setenv bootargs 'console=ttyPS0,115200 root=/dev/mmcblk0p2 ip=dhcp' (otherwise kernel cannot find the root)

(1) Which kernel modules do I need to use from "modules.tar.xz"? Do I need to overwrite some files within Ubuntu rootfs?

(2) The boot process ends up in read-only filesystem

During OS boot I receive the following messages:

The disk drive for / is not ready yet or not present.
keys:Continue to wait, or Press S to skip mounting or M for manual recovery

After pressing Skip:

keys:
The disk drive for /tmp is not ready yet or not present.
keys:Continue to wait, or Press S to skip mounting or M for manual recovery
 * Starting Bridge file events into upstart                              [ OK ]
Waiting for network configuration...
Waiting up to 20 more seconds for network configuration...
Booting system without full network configuration...

Even though it seems that DHCP is not working - eventually I do have IP address received from DHCP.

The boot completes successfully with bash prompt in UART.

I documented my steps here

Thanks!

EmbeddedAndroid commented 8 years ago

Hi @cloud-rocket,

To answer (1), you unpack the modules.tar.xz to / on the target's rootfs. If you look into the tarball you'll see it has a structure of /lib/modules/kernelversion, so it won't effect modules for other kernels you may use. I typically deploy all the modules in the tarball.

As far as (2) goes, you can try to add root=/dev/mmcblk0p2 rw to your boot args and see if that helps. Typically, when the rootfs is mounted RO, it's due to some sort of corruption of the rootfs, so I'd double check that rootfs works with another kernel.

When you specify ip=dhcp as a kernel argument, you instruct the kernel to perform the DHCP operations. However the distro you are using, has a daemon which is doing this as well. You can drop this line from your kernel arguments, and let the daemon in userspace handle everything. We use the ip=dhcp parameter when booting with NFS or an initrd with no userspace dhcp daemon.

Hope that helps, and thanks for writing up those steps!

Cheers,

Tyler

cloud-rocket commented 8 years ago

@EmbeddedAndroid - Thanks for a kind help!

(2) setenv bootargs 'console=ttyPS0,115200 root=/dev/mmcblk0p2 rw' Seems to be working with no strange stuff - great!!

(1) modules.tar.xz seems to be containing none standard Ubuntu structure with kernel modules:

modules.tar.xz/lib/modules/4.4.3/kernel
- arch
- crypto
- drivers
- fs
- lib
- net
- sound

Original rootfs does not contain any loadable modules, so I am not sure why do I need it..... Which modules do you think are important? Except Epiphany co-processor, everything else is more or less standard and I didn't noticed anything related to Epiphany there.... Am I right?

Thanks again! Meir

cloud-rocket commented 8 years ago

BTW CPU cores and network throughput look even better than with 3.14, so I guess we are on a good way....

luxas commented 8 years ago

@cloud-rocket It would be a relief if a the 4.x kernel performed better than the 3.10. 3.10 was practically unusable with docker. One thing, is there any way to automate the setenv/fatload... process? I mean, to use something other than UART (I don't have the cable). Can one put that into a file and compile that to boot.scr for example?

cloud-rocket commented 8 years ago

@luxas

Read "Automatic boot" section

BTW - I'd be changing the title to 4.4.3 (SOLVED) :)

luxas commented 8 years ago

What about parallella.bin? Isn't that file required?

cloud-rocket commented 8 years ago

It's FPGA bit file (mine has a name parallella.bit.bin) - I don't see any reason to touch it (yet, I didn't checked Epiphany functionality)...