Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kernel to 4.1.x #8

Open
luxas opened this issue Oct 15, 2015 · 15 comments
Open

Update kernel to 4.1.x #8

luxas opened this issue Oct 15, 2015 · 15 comments

Comments

@luxas
Copy link

luxas commented Oct 15, 2015

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
Copy link
Author

luxas commented Oct 15, 2015

/cc @aolofsson

@aolofsson
Copy link
Member

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
Copy link

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
Copy link
Member

Whaaat? How come i didnt know about this?:-) Very cool!
On Oct 15, 2015 6:16 PM, "Tyler Baker" [email protected] 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
#8 (comment)
.

@luxas
Copy link
Author

luxas commented Oct 18, 2015

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
Copy link

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
Copy link
Author

luxas commented Oct 19, 2015

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. 😄

@cloud-rocket
Copy link

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
Copy link

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
Copy link

@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
Copy link

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

@luxas
Copy link
Author

luxas commented Mar 2, 2016

@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
Copy link

@luxas

Read "Automatic boot" section

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

@luxas
Copy link
Author

luxas commented Mar 2, 2016

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

@cloud-rocket
Copy link

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)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants