omap3 usb platform and other

Giorgio Wicklein giowckln at googlemail.com
Wed Nov 2 12:46:22 CET 2011


Hi,

I spent a lot of time trying to get specific OMAP3/Beagleboard hardware modules working (EHCI USB mainly).
So far, without luck.

A generic "how-to-integrate-linux-drivers-in-l4linux" example would be very helpful.
The procedure is not very clear to me (since I'm really new here).

Based on Vasily's work, I changed some sources of linux drivers, to get musb,
otg, and usb-ehci compiled without errors. The bootlog compared to Vasily's
one [1], is very different; Drivers seems to load, but they don't recognize the
hardware (I think).

For example the following boot messages doesn't appear on mine:

omap_register_i2c_bus bus_id=1 nr_ports=3
omap2_i2c_add_bus
omap_register_i2c_bus bus_id=3 nr_ports=3
omap2_i2c_add_bus

or

__l4x_ioremap: Mapping physaddr 48200000 [0x1000 Bytes,
48200000+001000] to 04507000+000000
IRQ: Found an INTC at 0x04507000 (revision 4.0) with 96 interrupts

or

twl4030: PIH (irq 7) chaining IRQs 368..375
twl4030: power (irq 373) chaining IRQs 376..383
print_constraints: VUSB1V5: 1500 mV normal standby
print_constraints: VUSB1V8: 1800 mV normal standby
print_constraints: VUSB3V1: 3100 mV normal standby
twl4030_usb twl4030_usb: HW_CONDITIONS 0x90/144; link 1
twl4030_usb twl4030_usb: Initialized TWL4030 USB module
omap_i2c omap_i2c.3: bus 3 rev3.12 at 400 kHz
Switching to clocksource kip
musb-hdrc: version 6.0, pio, peripheral
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk
split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 1.400
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
musb-hdrc musb-hdrc: USB Peripheral mode controller at 0450b000 using

and such...

Some of these messages are generated by sources from the mach-omap2 directroy,
which AFAIK are not necessary, since changes where not mentioned in Vasily's
patch. Do I need to include mach-omap? If yes, how?

Please take a look at my patch (attached below). I did some work, specific for
ehci usb Beagleboard support.

What is the correct method for adding those drivers?
Any suggestions? Or examples (since Vasily's is not complete for me)...

My configs are in the attachment with the main patch.

Thanks,
Giorgio

[1] Vasily's bootlog - http://os.inf.tu-dresden.de/pipermail/l4-hackers/2011/005069.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: l4_plat_omap3beagle.patch
Type: text/x-diff
Size: 47738 bytes
Desc: not available
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20111102/baae721a/attachment.patch>
-------------- next part --------------
-- vim:set ft=lua:

loader = L4.default_loader;


vbus_l4linux = loader:new_channel();

local lxname = "vmlinuz";
if L4.Info.arch() == "arm" then
  lxname = "vmlinuz.arm";
end

loader:start(
{
	caps = {
		sigma0  = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0);
		icu     = L4.Env.icu;
        l4linux = vbus_l4linux:svr(); 
	},
	log      = { "IO", "y" },
	l4re_dbg = L4.Dbg.Warn,
}, "rom/io rom/arm-omap3-bb.devs rom/arm-omap3-bb.io");


-- Start L4Linux
L4.default_loader:start(
{
    caps = {
        vbus = vbus_l4linux; 
        log = L4.Env.log:m("rws"),
    },
    log = { "l4linux", "yellow" },
    l4re_dbg = L4.Dbg.Warn,
}, "rom/" .. lxname .. " mem=128M console=ttyLv0 l4x_rd=rom/ramdisk-" ..  L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 init=/linuxrc");
-------------- next part --------------
#TODO: fix this
hw-root
{

  gpio => new Device()
  {
    .hid = "gpio";
    new-res Mmio(0x48310000 .. 0x48310fff);
    new-res Mmio(0x49050000 .. 0x49050fff);
    new-res Mmio(0x49052000 .. 0x49052fff);
    new-res Mmio(0x49054000 .. 0x49054fff);
    new-res Mmio(0x49056000 .. 0x49056fff);
    new-res Mmio(0x49058000 .. 0x49058fff);
  }

  lcd => new Device()
  {
    .hid = "OMAP_LCD";
    new-res Mmio(0x48050000 .. 0x48050fff);
  }

  i2c1 => new Device()
  {
    .hid = "i2c";
    new-res Mmio(0x48070000 .. 0x48070fff);
  }

  mcspi => new Device()
  {
    .hid = "mcspi";
    new-res Mmio(0x48098000 .. 0x48098fff);
  }

  sys => new Device()
  {
    .hid = "System Control";
    new-res Mmio(0x48002000 .. 0x480047ff);#ctrl
    new-res Mmio(0x48004800 .. 0x4800ffff);#CM
  }


  NIC2 => new Device()
  {
    .hid = "dm9000";
    new-res Mmio(0x2c000000 .. 0x2c000003);
    new-res Mmio(0x2c000400 .. 0x2c000403);
    new-res Irq(185);
  }

  prcm2 => new Device()
  {
    .hid = "prcm2";

    new-res Mmio(0x48060000 .. 0x4806007f);#i2c
#    new-res Mmio(0x48070000 .. 0x4807003f);
    new-res Mmio(0x48072000 .. 0x4807207f);

    new-res Mmio(0x480AB000 .. 0x480ACfff);


    new-res Mmio(0x48200000 .. 0x4820ffff);#ICs


    new-res Mmio(0x48306800 .. 0x48309fff);#PRCM
    new-res Mmio(0x4830A000 .. 0x4830ffff);#tap

    new-res Mmio(0x6C000000 .. 0x6Cffffff);#sms
    new-res Mmio(0x6D000000 .. 0x6Dffffff);#sdrc

    new-res Irq(56);
    new-res Irq(61);
    new-res Irq(57);
    new-res Irq(7);
    new-res Irq(92);

  }

  plat => new Device()
  {
    .hid = "plat";
    new-res Irq(77);
  }

  prcm3 => new Device()
  {
    .hid = "prcm3";
    new-res Mmio(0x6e000000 .. 0x6e000fff); #gmpc
    new-res Mmio(0x30000000 .. 0x30000fff); #nand
  }

  tsc => new Device()
  {
    .hid = "OMAP_TSC";
    new-res Mmio(0x48098000 .. 0x48098fff);
    new-res Irq(32);
  }

  usb => new Device()
  {
    .hid = "usb";
    new-res Mmio(0x48062000 .. 0x48063fff); #usbtll
    new-res Mmio(0x48064000 .. 0x48065fff); #usb host
    new-res Irq(77);
  }
}
-------------- next part --------------
#TODO: fix this
l4linux => new System_bus()
{
    sys => wrap(hw-root.sys);
    i2c1 => wrap(hw-root.i2c1);
    prcm2 => wrap(hw-root.prcm2);
    usb =>  wrap(hw-root.usb);
    plat =>  wrap(hw-root.plat);
} 

fs_bus => new System_bus()
{
  prcm3 => wrap(hw-root.prcm3);
}

gui => new System_bus()
{
  tsc => wrap(hw-root.tsc);
  gpio => wrap(hw-root.gpio);
  prcm2 => wrap(hw-root.prcm2);
  mcspi => wrap(hw-root.mcspi);
}

fbdrv => new System_bus()
{
  sys => wrap(hw-root.sys);
  lcd => wrap(hw-root.lcd);
  i2c1 => wrap(hw-root.i2c1);
  gpio => wrap(hw-root.gpio);
#  mcspi => wrap(hw-root.mcspi);
}


More information about the l4-hackers mailing list