EDmini v2 mainline kernel support

Ethernet disk mini v2
giarrettu
Posts: 16
Joined: Tue Jun 17, 2008 8:34 am

Re: EDmini v2 mainstream kernel support

Post by giarrettu » Tue Aug 05, 2008 7:23 pm

hello,

great work petris! I have just some questions concerning your described steps.

how did you install the rosbif kernel? what does serial connection enable? I have a hacked lacie edmini v2, can I use a ssh prompt to perform your installation steps?

giarrettu

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Thu Aug 07, 2008 7:12 am

EDIT: IMPORTANT: before updating your kernel please read this topic: http://forums.nas-central.org/viewtopic.php?f=146&t=406

Albert Aribaud and I have been working on getting EDmini v2 support into the mainline (http://www.kernel.org) Linux kernel.

I submitted a patch to LAK: http://lists.arm.linux.org.uk/lurker/me ... d3.en.html

It has passed its first hurdle: it has been accepted by Marvell and they have asked Russell King to pull it: http://lists.arm.linux.org.uk/lurker/me ... cb.en.html

If all goes well it should find its way into the 2.6.27 kernel ;-)
UPDATE: unfortunately Marvell now want to hold off till 2.6.28 :( see: http://lists.arm.linux.org.uk/lurker/me ... b2.en.html
UPDATE: Linus has pulled the patch into his git tree ;-)
UPDATE: it is now in 2.6.28-rc1 ;-)
UPDATE: it made it into the 2.6.28 stable version :D

I'll edit this post as it progresses.

IMPORTANT: the stock Marvell/LaCie U-Boot passes a bogus machine type (526 = 0x20e) in r1 to the Linux kernel :(
To use this kernel you will need one of the following:
  • a) DANGEROUS: a corrected U-Boot: for example Albert's (see http://forums.nas-central.org/viewtopic ... &sk=t&sd=a). Unfortunately if flashing this goes wrong you will brick your EDmini v2 :( Recovery may be possible with JTAG.
    b) UNTESTED: a patch to the EDmini v2 entry in arch/arm/tools/mach-types from 1756 to 526 to use the bogus machine type
    c) a patch to arch/arm/boot/Makefile to overwrite the bogus machine type with 1756 (=0x6dc) before the kernel starts up
Last edited by rosbif on Mon Dec 29, 2008 11:08 am, edited 4 times in total.

petris
Posts: 8
Joined: Thu Jun 12, 2008 10:59 pm
Location: Kladno, Czech Republic
Contact:

Re: EDmini v2 mainstream kernel support

Post by petris » Thu Aug 21, 2008 10:09 pm

giarrettu wrote:how did you install the rosbif kernel?
I've updatated u-boot, because configuration can't be saved with the original one. Then I've placed kernel on the disk and changed u-boot configuration.

Overwriting the original kernel should work too, but I didn't try it.
what does serial connection enable? I have a hacked lacie edmini v2, can I use a ssh prompt to perform your installation steps?
Serial connection is required for u-boot configuration and is very helpfull if something goes wrong. But you should be able to install debian over ssh:
1. prepare debian root on the biggest partition
2. write program which will mount the biggest partition, call pivot_root and start init (read pivot_root man page)
3. now you need to know original u-boot settings and replace the original init with your program

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Tue Oct 21, 2008 3:22 am

IMPORTANT: before updating your kernel please read this topic: http://forums.nas-central.org/viewtopic.php?f=146&t=406

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Sat Oct 25, 2008 6:40 am

EDmini v2 support is now in the first release candidate for the mainline 2.6.28 Linux kernel ;-)

2.6.28-rc1 contains the following EDmini v2 related stuff from aaribaud and me:-
  • [ARM] Orion: add LaCie Ethernet Disk mini V2 support
    [ARM] EDMINIV2: add support for LED and power button
    [MTD] cfi_cmdset_0002.c: Add Macronix CFI V1.0 TopBottom detection
You will also need a "machine type" fixup; see this post: http://forums.nas-central.org/viewtopic ... rt=15#p916

But please remember that XFS may be broken on recent kernels: http://forums.nas-central.org/viewtopic.php?f=146&t=406

kosmaty
Posts: 32
Joined: Sat May 17, 2008 2:57 pm

Re: EDmini v2 mainstream kernel support

Post by kosmaty » Sat Oct 25, 2008 3:32 pm

rosbif wrote:EDmini v2 support is now in the first release candidate for the mainline 2.6.28 Linux kernel
Great!
rosbif wrote:2.6.28-rc1 contains the following EDmini v2 related stuff from aaribaud and me
Could you tell me how to download 2.6.28-rc1 via git? Again by using this repo: git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion.git ? Or completely in a diffrent way?

EDIT:

Downloading via ftp from here ftp://ftp.kernel.org/pub/linux/kernel/v ... rc1.tar.gz ? Is it ok?

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Sat Oct 25, 2008 7:27 pm

First I am absolutely not a git expert so somebody please correct me if necessary :(
kosmaty wrote:Could you tell me how to download 2.6.28-rc1 via git?
You can clone Linus' git repository: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
In this repository 2.6.28-rc1 is tagged with v2.6.28-rc1
kosmaty wrote:Again by using this repo: git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion.git ?
I think that this will eventually be updated from Linus' tree and have the same tag.
AFAICS it has not been updated yet.
kosmaty wrote:Downloading via ftp from here ftp://ftp.kernel.org/pub/linux/kernel/v ... rc1.tar.gz ? Is it ok?
In this case you must also download 2.6.27 (not 2.6.27.x) and apply the above as a patch to it.

kosmaty
Posts: 32
Joined: Sat May 17, 2008 2:57 pm

Re: EDmini v2 mainstream kernel support

Post by kosmaty » Sat Oct 25, 2008 7:40 pm

EDIT:
I didn't notice that you had answered, when I was writing next message ;) . In the meanwhile I have just compiled this kernel and it works ;) . Thank you for your tips about git!
/EDIT

I have a few questions about this new features and kernel:
- how to control LED?

Code: Select all

echo "255"> /sys/class/leds/power\:blue/brightness

control brightness I guess ;) . But could we do any magic with trigger and uevent :D ?

- when I run top, just before it starts, I receive warning like this: Unknown HZ value! (92) Assume 100. Is it OK?

- when kernel starts, on the beginning, there is a line:

Code: Select all

edmini_v2: USB device port, flash write and power-off are not yet supported.
but according to your post these things are implemented already, so I don't have to worry about it?

Once again: great job!

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Sat Oct 25, 2008 8:31 pm

kosmaty wrote:I have just compiled this kernel and it works ;) .
Great !
Actually I haven't tried it myself yet :(
kosmaty wrote:how to control LED?
I hope Albert (aaribaud) won't mind me quoting from a private e-mail:
aaribaud wrote:LED controls goes through sysfs, so it is found in /sys. File Documentation/leds-class.txt tells everything you need to know. Basically, you first define the LED's global behaviour by writing the appropriate trigger keyword in /sys/class/leds/<device>/trigger (you can see what keywords you can use by doing a cat). For instance you'll find a 'timer' trigger for blinking a LED. Actually, writing 'timer' to the trigger entry does not blink the LED yet: once you write 'timer' to /sys/class/leds/<device>/trigger, then you will see new entries in /sys/class/leds/<device>: delay_on and delay_off, which you cat read and write to actually start blinking and fine-tune the on-off times (values expressed in ms): writing '500' to both delay entries makes the LED blink 1Hz; writing 990 to delay_off and 10 to delay_on gets you a 1 Hz 'flash" blink.
kosmaty wrote:But could we do any magic with trigger and uevent :D ?
I don't know; I haven't thought about this.
kosmaty wrote:when I run top, just before it starts, I receive warning like this: Unknown HZ value! (92) Assume 100. Is it OK?
I have this systematically in the boot log with recent kernels but I do not know why :(
However I haven't noticed it when running "top" or other commands.
I don't think that it is due to anything I have done ;-) but I haven't seen reports of it on other hardware :(
EDIT: it seems to be due to a user space bug in procps: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460331
kosmaty wrote:when kernel starts, on the beginning, there is a line:

Code: Select all

edmini_v2: USB device port, flash write and power-off are not yet supported.
but according to your post these things are implemented already, so I don't have to worry about it?
The USB device (slave) port is not supported in mainline (but it is in the stock LaCie kernel). Did I really say that it was supported?
Albert disabled flash write because the flash chip was wrongly detected and we were afraid that flash writes would brick the EDmini :( They may work now but I have not tried :(
Albert added power button support but I think it currently needs a user space daemon to actually get it to perform power-off.
Again from a private e-mail:
aaribaud wrote:As for buttons, that goes through the input events subsystem (see file Documentation/input/input.txt), so they appear on /dev/input/event0 as binary data (there's actually lots of entries also in /sys but none, to my knowledge, which provide the button status). I just cat the file into another file, do button presses/releases and check on my host that the data which appeared is correct. You probably also can see some debugging info via dmesg if you set the relevant debug options in the kernel config.

kosmaty
Posts: 32
Joined: Sat May 17, 2008 2:57 pm

Re: EDmini v2 mainstream kernel support

Post by kosmaty » Sat Nov 01, 2008 9:36 pm

Thank you for these instructions and explanations!
rosbif wrote:The USB device (slave) port is not supported in mainline (but it is in the stock LaCie kernel). Did I really say that it was supported?
No, it was my mental leap. I should have been more precise :P - sorry about that. I was thinking only about "flash write and power-off", because only about these things you wrote in 2.6.28-rc1 content.

giarrettu
Posts: 16
Joined: Tue Jun 17, 2008 8:34 am

Re: EDmini v2 mainstream kernel support

Post by giarrettu » Tue Dec 30, 2008 9:50 pm

Hello

Could you please give me an advice about the .config file to use in order to compile 2.6.28-rc1 kernel source?
thank you in advance

Giarrettu

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: EDmini v2 mainstream kernel support

Post by rosbif » Tue Dec 30, 2008 10:58 pm

giarrettu wrote:Could you please give me an advice about the .config file to use in order to compile 2.6.28-rc1 kernel source?
Use arch/arm/configs/orion5x_defconfig
IIRC you can just do this:-

Code: Select all

make orion5x_defconfig
Note also that the stable 2.6.28 kernel has now been released.

Season's greetings to you all.

Chris

giarrettu
Posts: 16
Joined: Tue Jun 17, 2008 8:34 am

Re: EDmini v2 mainstream kernel support

Post by giarrettu » Wed Dec 31, 2008 2:30 pm

hi,

thank you very much for your help. I have successfully compiled the kernel directly within my edmini . I have compiled the modules too. I have orerwritten the partition sda6 (where the kernel is) with

dd if=./arch/arm/boot/Image of=/dev/sda6

but I had to revert the /dev/sda6 with the original kernel because the edmini disn't start up.

did I do the correct steps?

good new year to you all :-)

Giarrettu

kosmaty
Posts: 32
Joined: Sat May 17, 2008 2:57 pm

Re: EDmini v2 mainstream kernel support

Post by kosmaty » Wed Dec 31, 2008 3:14 pm

Just like I wrote you in private message: you have to create uImage. Then use this file as a source for dd.

Happy New Year!

:D

giarrettu
Posts: 16
Joined: Tue Jun 17, 2008 8:34 am

Re: EDmini v2 mainstream kernel support

Post by giarrettu » Wed Dec 31, 2008 4:04 pm

hi,

thank you,

I have created uImge with the command

root@lacie:/temp/linux-2.6.28-rc9/arch/arm/boot# mkimage -A arm -O linux -T ker
nel -C none -a 0 -e 0 -n "uImage" -d Image uImage
Image Name: uImage
Created: Wed Dec 31 16:56:43 2008
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3597952 Bytes = 3513.62 kB = 3.43 MB
Load Address: 0x00000000
Entry Point: 0x00000000

then I put the uImage on my edmini but it doesn't work.

could you please give me an advice?

thank you again

Giarrettu

Post Reply