New IT forum
24 April 2014, 06:04:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: CubieBoard 2 and Cubietruck both now in stock.
 
   Home   SHOP Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Mirabox Kernel Modification  (Read 5087 times)
jpronans
Newbie
*
Posts: 7


« on: 02 May 2013, 12:01:02 pm »

Hi,

I'm looking for some guidance.  I have a Mirabox here (since this morning) and I wish to make some modifications to the kernel running on it.

My first step, i thought would be to get the uImage from
http://www.plugcomputer.org/downloads/mirabox/#sources just to check that I understand the tftp process for later.

So I downloaded that, used tftp to put it into the box, and when I booted it the boot failed.  It's obviously missing an initramfs or something.

My next step would be to build the kernel that is already present (Linux-2.6.35.9) put that on, and check that boots, and if successful I could then move onto newer kernels.

I'm obviously missing a critical step but I'm stuck at present.

Any direction appreciated.
Logged
jpronans
Newbie
*
Posts: 7


« Reply #1 on: 02 May 2013, 03:07:33 pm »

For reference.
This uImage doesn't work
http://www.plugcomputer.org/405/us/mirabox/binaries/kernel_image/uImage

This does.
http://mirabox.googlecode.com/files/uImage-v2.6.35.9-gti-mirabox-v5-0-1-120924
The latter doesn't apear to have an initramfs of any consequence, so I assume it uses the modules already present in the filesystem to boot with. 

I just need to figure out all the modules it uses and I should be able to get my own to boot.
Logged
kage
Newbie
*
Posts: 6


« Reply #2 on: 02 May 2013, 04:21:00 pm »


It works when the root is on an SD Card (I also put the kernel on it, but should not change something) :

Code:
set bootcmd 'usb start; fatload usb 1 0x6400000 uImage; bootm 0x6400000'
set bootargs 'console=ttyS0,115200 root=/dev/sdb2 rootwait'
boot

but it doesn't when I set :
Code:
set bootargs 'console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'

I think the first step is trying to boot a complete system from SD Card, it's easier and it seems to only need usb-storage module in kernel.
Logged
jpronans
Newbie
*
Posts: 7


« Reply #3 on: 02 May 2013, 04:33:48 pm »


It works when the root is on an SD Card (I also put the kernel on it, but should not change something) :

Code:
set bootcmd 'usb start; fatload usb 1 0x6400000 uImage; bootm 0x6400000'
set bootargs 'console=ttyS0,115200 root=/dev/sdb2 rootwait'
boot

but it doesn't when I set :
Code:
set bootargs 'console=ttyS0,115200 $mtdparts ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs'

I think the first step is trying to boot a complete system from SD Card, it's easier and it seems to only need usb-storage module in kernel.

Oh ok, in my head, my first step was to boot the existing kernel from tftp. That way I can check things quickly without touching the installed filesystem.  I'll look for an SD card for tomorrow.
Logged
kage
Newbie
*
Posts: 6


« Reply #4 on: 03 May 2013, 12:15:49 pm »

In this topic : http://www.newit.co.uk/forum/index.php?topic=3880.0, there is an 3.4.2 kernel and a rootfs that can boot on SD card or nand without any problem.

Code:
Linux dreamplug-debian 3.4.2 #6 Wed Nov 14 09:11:34 EST 2012 armv7l GNU/Linux

But it doesn't solve our question : how build a "good" kernel for the mirabox

For the moment, I build a kernel with :
Code:
# Cross-compiling env
export PATH=$PATH:/home/kage/x-tools/arm-unknown-linux-gnueabi/bin/
export ARCH=arm
export CROSS_COMPILE=arm-unknown-linux-gnueabi-

# Get default configuration for mvebu boards
make mvebu_defconfig

# Can edit the configuration, in a first time I disable wireless marvell module : wifi & bluetooth and kernel module system
# Don't forget to enable usb-storage module (compiled in kernel "*")
make menuconfig

# Compile the kernel
time make -j2

# Create the uImage that the board can boot
cat arch/arm/boot/dts/armada-370-mirabox.dtb >> arch/arm/boot/zImage
./scripts/mkuboot.sh -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-marvell' -d arch/arm/boot/zImage arch/arm/boot/uImage

After all this step, your uImage is there : arch/arm/boot/uImage

You can boot it from tftp with :
Code:
set serverip '192.168.1.1'
set ipaddr '192.168.1.2'
set bootcmd 'tftpboot 0x6400000 uImage; bootm 0x6400000'
set bootargs 'console=ttyS0,115200 root=/dev/sdb2 rootwait'
boot

The kernel will be loaded by tftp and use the sdb2 partition to load the root directory (so the 2nd partition on sd card).

To load on the nand, it will need all ubi & ubifs features compiled but I want to have a kernel bootable on sdcard before make any other tests.

It boots but I haven't get a terminal for the moment, if you have any idea... :-)
« Last Edit: 03 May 2013, 12:20:36 pm by kage » Logged
jpronans
Newbie
*
Posts: 7


« Reply #5 on: 03 May 2013, 04:03:45 pm »

So, here is what I got.

I started with this, which works on the 3.9 kernel.

Code:
PATH="/home/build/smile/armv7-marvell-linux-gnueabi/bin:$PATH" make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- mvebu_defconfig

PATH="/home/build/smile/armv7-marvell-linux-gnueabi/bin:$PATH" make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- zImage

PATH="/home/build/smile/armv7-marvell-linux-gnueabi/bin:$PATH" make ARCH=arm CROSS_COMPILE=arm-marvell-linux-gnueabi- armada-370-mirabox.dtb

cp arch/arm/boot/zImage zImage-with-dtb

cat arch/arm/boot/dts/armada-370-mirabox.dtb >> zImage-with-dtb

./scripts/mkuboot.sh -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-marvell' -d zImage-with-dtb uImage

I took the config from this chaps post (and did a makeoldconfig, you need to say 'Yes' to experimental drivers IIRC)
http://lists.opensuse.org/opensuse-arm/2013-04/msg00082.html and re-built the kernel with it.

I created a rootfs on a MicroSD using these instructions
http://www.newit.co.uk/forum/index.php?topic=3880.0

Loaded my kernel via tftp with
Code:
tftpboot 0x6400000 10.4.50.166:uImage
set bootargs 'console=ttyS0,115200 root=/dev/sdb2 rootwait'

and Voila
Code:
root@dreamplug-debian:~# cat /proc/version
Linux version 3.9.0 (root@ubuntu-build) (gcc version 4.2.0 20070413 (prerelease) (CodeSourcery 2007q1-10. Marvell 2009q3-11 20090730)) #2 Fri May 3 15:27:05 IST 2013
root@dreamplug-debian:~#

Regards
John
Logged
kage
Newbie
*
Posts: 6


« Reply #6 on: 06 May 2013, 02:13:01 pm »

Okay thx, it's working but without Wifi, bluetooth, USB3 and NAND access.

https://github.com/tpetazzoni seems working on the Mirabox (Armanda 370) and it should be possible to find a kernel there https://github.com/MISL-EBU-System-SW/mainline-public with PCIe support so USB3.

NAND support isn't for today : https://github.com/MISL-EBU-System-SW/mainline-public/issues/23 is in Milestone kernel 3.11-rc1...

So, I think for the moment, if you want to boot on NAND, you haven't so much the choice to use the 2.6 Marvell kernel.
Logged
jpronans
Newbie
*
Posts: 7


« Reply #7 on: 07 May 2013, 11:27:23 am »

Okay thx, it's working but without Wifi, bluetooth, USB3 and NAND access.

https://github.com/tpetazzoni seems working on the Mirabox (Armanda 370) and it should be possible to find a kernel there https://github.com/MISL-EBU-System-SW/mainline-public with PCIe support so USB3.

NAND support isn't for today : https://github.com/MISL-EBU-System-SW/mainline-public/issues/23 is in Milestone kernel 3.11-rc1...

So, I think for the moment, if you want to boot on NAND, you haven't so much the choice to use the 2.6 Marvell kernel.
Yes, that pretty much sums it up.

John
Logged
helper
Newbie
*
Posts: 5


« Reply #8 on: 16 August 2013, 10:11:27 pm »

Has anyone tried one of the 3.11rc releases?

I was able to get a build to work with 3.11-rc5 but I can't seem to get the ethernet ports working. It is able to detect link on both ports, but doesn't respond to ARP requests.

I'm wondering if anyone has made anymore progress.
Logged
Lotharyx
Newbie
*
Posts: 5


« Reply #9 on: 19 August 2013, 02:38:51 am »

Hi folks,

I'm onto this project now as well.  My goal is to have a recent kernel with ethernet and USB3 both working.  If I hit on anything, I'll be sure to post here!
Logged
helper
Newbie
*
Posts: 5


« Reply #10 on: 20 August 2013, 10:42:29 pm »

I was able to get the network up using my 3.11-rc5 kernel from the information in this thread:  http://www.spinics.net/linux/fedora/fedora-arm/msg06390.html.

Basically if you run dhcp on both interfaces in uboot before loading the kernel they will then work correctly. Not a good solution, but at least its a temporary work around.
Logged
Lotharyx
Newbie
*
Posts: 5


« Reply #11 on: 20 August 2013, 11:49:28 pm »

Wow, I'm glad you found that.  It works for me too, and it seems to work even if the link is down during uboot.  I think I will add that to my bootcmd.

I'm using 3.11-rc6.  Got there because lots of googling through Kconfig files suggested that 3.9 wouldn't enable PCIe (and from there, XHCI) for the Armada 370, but 3.11 does. 

I'm very tempted to e-mail the developers of the Marvell driver, but I think that might be presumptuous of me...
Logged
vb
Newbie
*
Posts: 2


« Reply #12 on: 22 August 2013, 12:01:37 pm »

Had some problems with 3.10.5; kernel panics after adding CONFIG_PACKET=y to kernel config.

I'm now trying to get 3.11-rc6 to work, but also ran into the NIC issue. The DHCP workaround is working fine for now,...

I have read that NAND features would be added in 3.11-rc1, but I don't think this was added already, right?

Has anyone got the bluetooth and WiFi to work? Anyone willing to share their kernel config?
« Last Edit: 22 August 2013, 12:03:31 pm by vb » Logged
vb
Newbie
*
Posts: 2


« Reply #13 on: 04 September 2013, 06:24:27 am »

I noticed that 3.11 has been released... how can I check that the NAND features are available?
Logged
helper
Newbie
*
Posts: 5


« Reply #14 on: 04 September 2013, 10:20:18 pm »

A patch was submitted today by Thomas Petazzoni to the linux-arm-kernel list that fixes the network interfaces issue: http://www.spinics.net/lists/stable/msg18994.html

I'm afraid the NAND work hasn't made it into the kernel yet.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!