How to change root device on L4 Linux ?

Wei Jin coder.soap at gmail.com
Mon Apr 21 16:16:43 CEST 2014


Hi Taeung!

I think your goal is to make SD controller work on L4Linux right ? If my
guess is right then I could share my experience since I did something
similar.

First you need to create the 'devs' file and 'vbus' file with the hardware
resource information( IO address and IRQ number). These could be found on
the reference manual of you board.
This step assure L4Linux's accessibility of related hardware resource.

Then you need to find out which SD controller driver is the one that your
board is using. This could be done by looking into the defconfig of your
board.

Since L4Linux is different from ARM Linux, there should be lots of configs
unavailable when you select ARCH=l4, including those related to devices and
drivers, because of the dependency
check of Linux build system. You have to manually modify them one by one to
pass the dependency check. This step is very complicated.


Here's an example: https://github.com/Ksys-labs/L4Reap
This project has made some devices work on L4Linux. Maybe you can learn how
they did from it.


On Mon, Apr 21, 2014 at 9:19 PM, Taeung <treeze.taeung at gmail.com> wrote:

>  Hello, Matthias :-)
>
> Would you mind I ask you a question ?
>
> I did not understood your answer, because I was uncertain it.
> But, now I'm catching on. I'm analyzing 'L4 Re' document.
>
> I've modified 'l4lx-vbus.io' and 'arm-rv-eb-mc.devs' file as follows..
>
> *vi 'l4lx-vbus.io <http://l4lx-vbus.io>**'*
> ============
> # vim:set ft=ioconfig:
> # configuration file for io
>
> l4linux => new System_bus()
> {
>    NIC => wrap(hw-root.NIC);
>    FLASHMEMORY => wrap(hw-root.FLASHMEMORY);
> }
> ============
>
> *vi 'arm-rv-eb-mc.devs'*
> ============
> local Hw = Io.Hw
> local Res = Io.Res
>
> Io.hw_add_devices
> {
>
>   FLASHMEMORY = Hw.Device
>   {
>     hid = "flashmemory";
>     Res.mmio(0x02198000 , 0x0219BFFF);
>
>   },
>
>   NIC = Hw.Device
>   {
>     hid = "smsc911x";
>     Res.mmio(0x02188000, 0x0218BFFF);
>     Res.irq(41);
>   },
> }
> ============
>
> But I've failed booting with kernel commandline
> '....root=/dev/mtdblock0p1...' to set RootFilesystem as SD
> card(/dev/mtdblock0p1).
>
> The log is ...
> ============
> ...(*omitted*)
>
> Added static device '(noname)' with 0
> resources.
>
> Added static device 'NIC' with 2
> resources.
>
> Added static device 'FLASHMEMORY' with 1
> resources.
>
>
>
> ...(*omitted*)
>
>
> L4 serial
> driver
>
> ttyLv0 at MMIO 0x1 (irq = 211, base_baud = 230400) is a
> L4
>
> l4ser_shm: L4 shared mem serial
> driver
>
> l4cdds: No name given, not
> starting.
>
> brd: module
> loaded
>
> l4bdds: No name given, not
> starting.
>
> mousedev: PS/2 mouse device common for all
> mice
>
> TCP: cubic
> registered
>
> NET: Registered protocol family 17
>
>
> Waiting for root device /dev/mtdblock0p1...
>
> ============
>
> The log message has been stopped at 'Waiting for root device
> /dev/mtdblock0p1... '
>
> I guess kernel command line is wrong.
> Is my guess right ?
>
> Or is '.io' , '.devs' file wrong ?
>
>
>
> If anyone give me small hints , I would appreciate.
>
> - Taeung -
>
>
> On 04/01/2014 09:23 PM, Matthias Lange wrote:
>
> Hi,
>
> On Tue, Apr 01, 2014 at 07:07:44PM +0900, Taeung wrote:
>
>  Hello, L4 hackers :-)
>
> I want to change *root device* on L4 Linux instead of ramdisk.
> Root device I want is like '*/dev/mtdblock0*' or '/dev/mmcblk1p1'
> instead of 'rom/ramdisk-arm.rd'.
>
> So, I've configured somethings in 'L4 Linux menuconfig', additionally.
> Somethings are as follows ..
> ==============================
> <*> MMC/SD/SDIO card support  --->
>
> <*> The Extended 4 (ext4) filesystem
>  [*]   Ext4 POSIX Access Control Lists
>  [*]   Ext4 Security Labels
> ==============================
> kernel command line : "rom/vmlinuz.arm console=ttyLv0
> root=/dev/mtdblock0 rootwait rw "
> ==============================
> But it is hangs at '*Waiting for root device /dev/mtdblock0...*'.
>
> I've heard that the solution of this is to pass-through the physical MMC device to L4Linux.
> Please, tell me it's concrete ways or hints about what I must study for solving this.
> I can't even guess what the solution mean.. please.
>
>  First you need to identify the native Linux driver for the SD controller. Then
> you need to identify all the resources (IO memory, GPIO pins, IRQs, clocks,
> ...) the driver requires. Then you need to make those resources available to
> L4Linux. Most likely you have to define a custom L4Linux ARM platform and
> create a platform file which defines all devices for it. Then the first step
> is to get the SD driver successfully pass the probe function.
>
> Matthias.
>
>
>
>
>
> _______________________________________________
> l4-hackers mailing list
> l4-hackers at os.inf.tu-dresden.de
> http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20140421/4a5c3f19/attachment.htm>


More information about the l4-hackers mailing list