L4Linux network and SD Access

Matthias Lange matthias.lange at kernkonzept.com
Fri Jul 7 21:43:07 CEST 2017


Hi,

On 07/07/2017 07:02 PM, Daniel (Xiaolong) Wang wrote:
> Thank you so much CHristian. Sorry to bother you again. One more thing
> that is not clear to me hope you can give me some advice. For the the
> BeagleBone Black board I’m using now it seems the eMMC is connected
> through GPIO pins. I’m not sure how to map the MMIO regions and
> interrupts
> (https://github.com/derekmolloy/boneDeviceTree/blob/master/DTSource3.8.12/am33xx.dtsi)
> 
> For example this is the MMC1 and MMC2 I saw on the device tree:

You should have a look into the AM33xx TRM to determine the properties
of the MMC controller.

> 
> */mmc1: mmc at 48060000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc1";
> ti,dual-volt; ti,needs-special-reset; ti,needs-special-hs-handling; dmas
> = <&edma 24 &edma 25>; dma-names = "tx", "rx"; status = "disabled"; };
> /*
> 
> /*mmc2: mmc at 481d8000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc2";
> ti,needs-special-reset; ti,needs-special-hs-handling; dmas = <&edma 2
> &edma 3>; dma-names = "tx", "rx"; status = "disabled"; }; mmc3:
> mmc at 47810000 { compatible = "ti,omap3-hsmmc"; ti,hwmods = "mmc3";
> ti,needs-special-reset; ti,needs-special-hs-handling; status =
> "disabled"; };* /
> 
> Is 48060000 the beginning of MMIO region? How about the size?

The kernel you are looking at is probably to old. A more recent version
of the device tree looks like this:

mmc1: mmc at 48060000 {
                        compatible = "ti,omap4-hsmmc";
                        ti,hwmods = "mmc1";
                        ti,dual-volt;
                        ti,needs-special-reset;
                        ti,needs-special-hs-handling;
                        dmas = <&edma_xbar 24 0 0
                                &edma_xbar 25 0 0>;
                        dma-names = "tx", "rx";
                        interrupts = <64>;
                        interrupt-parent = <&intc>;
                        reg = <0x48060000 0x1000>;
                        status = "disabled";
}

Here you can determine the MMIO region from the 'reg' property. For the
IRQ number you need to work your way up through the interrupt parent
node to get the correct number. You can also see that you need to pass
in the DMA engine device.

> Second for the I2C I saw this:
> 
> */i2c0: i2c at 44e0b000 { compatible = "ti,omap4-i2c"; #address-cells = <1>;
> #size-cells = <0>; ti,hwmods = "i2c1"; /* TODO: Fix hwmod */ reg =
> <0x44e0b000 0x1000>; interrupts = <70>; status = "disabled"; };/*
> 
> Does it mean the MMIO region is [0x44e0b000, 0x44e0c000]?

The end of the MMIO region is 0x44e0bfff.

Regards,
Matthias.

> 
> I’m sorry for asking so dumb many questions.
> 
> Thanks
> -Dan
>   
>> On Jul 7, 2017, at 7:24 AM, Christian Ludwig
>> <christian_ludwig at genua.de <mailto:christian_ludwig at genua.de>> wrote:
>>
>> Hi,
>>
>> On Friday, 7. July 2017, 02:19:34 Daniel  Wang wrote:
>>> I have a question. I just saw in the io/server/src/drivers/gpio
>>> directory.There are only two cc files. One is for bcm2835.c another
>>> one is
>>> for omap.cc <http://omap.cc>. Does that mean if I want to make MMC
>>> and Ethernet drivers
>>> works in guest Linux on platform other than bcm2835, OMAP3 or OMAP4 I
>>> have
>>> to modify the driver file and provide support functions for that
>>> platform?
>>
>> Therse GPIO drivers in io provide a means to pass different GPIO pins to
>> different clients, e.g. Linuxes. It's a way to moderate access to a GPIO
>> controller from multiple clients.
>>
>> As far as I understand, you want to drive MMC and ethernet in one
>> L4Linux. So
>> you just have to pass the proper devices (MMIO regions and interrupts) to
>> Linux. As Adam pointed out, you need to tweak Kconfig files to allow
>> you to
>> select the proper drivers. Note however that your device's drivers are
>> most
>> likely not sufficient to finally get the devices going. These drivers
>> most
>> likely need other infrastructure like clock devices and some power
>> management.
>> You need to find a way to either also pass these to Linux, or build a
>> separate
>> clock/pm server that only passes the necessary clock gates and power
>> lines to
>> Linux. Which also means you need to create a set of new drivers in Linux.
>>
>> If you are really lucky you might be able to patch out the clock/pm
>> calls in
>> the Linux drivers and get a first working version. But no guarantees
>> on that.
>>
>>
>> Hope that helps,
>>
>>
>> - Christian
>>
>>
>> -- 
>> genua GmbH
>> Domagkstrasse 7, 85551 Kirchheim bei Muenchen
>> tel +49 89 991950-0, fax -999, www.genua.de <http://www.genua.de>
>> Geschaeftsfuehrer: Dr. Magnus Harlander, Bernhard Schneck,
>> Mark Tesch. Amtsgericht Muenchen HRB 98238
>> genua ist ein Unternehmen der Bundesdruckerei-Gruppe.
> 
> 
> 
> _______________________________________________
> l4-hackers mailing list
> l4-hackers at os.inf.tu-dresden.de
> http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
> 


-- 
Matthias Lange, matthias.lange at kernkonzept.com, +49-351-41 888 614

Kernkonzept GmbH.  Sitz: Dresden.  Amtsgericht Dresden, HRB 31129.
Geschäftsführer: Dr.-Ing. Michael Hohmuth





More information about the l4-hackers mailing list