I upgraded genode-imx and genode to version 22.11 for my IMX project. As per the drivers.config example in genode-imx/recipes/raw/drivers_nic-imx8q_evk/drivers.config I added a new ROM service for the nic_drv.dtb as follows: <service name="ROM" label="nic_drv.dtb"><parent label="fec_nic_drv-imx8q_evk.dtb"/>
My fec_nic config now looks like as follows: <start name="eth0_drv" caps="130" priority="0"> <binary name="fec_nic_drv" /> <resource name="RAM" quantum="20M"/> <resource name="CPU" quantum="30"/> <config verbose="yes" mode="uplink_client"/> } <route> <service name="CPU"><parent/></service> <service name="LOG"><parent/></service> <service name="PD"><parent/></service> <service name="RM"><parent/></service> <service name="ROM" label="nic_drv.dtb"> <parent label="fec_nic_drv-imx8q_evk.dtb"/> </service> <service name="ROM"><parent/></service> <service name="Uplink"> <child name="net0_router"/></service> <service name="Timer"> <child name="timer_drv"/></service> <service name="Platform"><child name="platform_drv"/></service> </route> </start>
Now everything compiles successfully but I get a runtime setup error where the driver complains about an unavailable IO resource:
[init -> eth0_drv] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [init -> eth0_drv] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns [init -> eth0_drv] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns [init -> eth0_drv] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [init -> eth0_drv] clocksource: Switched to clocksource dde_counter [init -> eth0_drv] mdio_bus: Fixed MDIO Bus: probed [init -> eth0_drv] Error: memory-mapped I/O resource 0x30be0000 (size=0x10000) unavailable
What might be the cause of this error?
Best regards, Pontus
Hello Pontus,
On Tue, Dec 20, 2022 at 08:29:28PM +0100, Pontus Åström wrote:
Now everything compiles successfully but I get a runtime setup error where the driver complains about an unavailable IO resource:
[init -> eth0_drv] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [init -> eth0_drv] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns [init -> eth0_drv] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns [init -> eth0_drv] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [init -> eth0_drv] clocksource: Switched to clocksource dde_counter [init -> eth0_drv] mdio_bus: Fixed MDIO Bus: probed [init -> eth0_drv] Error: memory-mapped I/O resource 0x30be0000 (size=0x10000) unavailable
What might be the cause of this error?
Probably the problem can be found within the devices ROM delivered to the platform driver. Formerly, the old driver expected an I/O memory area of size 0x4000, but the updated FEC driver that uses the original device-tree information of the Linux kernel expects an I/O memory area of size 0x10000. Moreover, the new driver needs additional informations related to its clocks that is also incorporated into the devices information consumed by the platform driver. You can see the changes when looking at file changes of `board/imx8q_evk/devices` within the following commit:
https://github.com/genodelabs/genode-imx/commit/a7bdd5cbdce98371e22fc3ff1330...
To circumvent similar problems in the future, you can incorporate the mentioned devices file as boot ROM within your scenario, and provide it to the platform driver. Then you automatically profit from further updates of the devices descriptions and its interplay with our provided drivers.
Best regards Stefan
Hello Stefan,
I think I'm already doing as you recommend with respect to the devices ROM.
I have the following import in my runscript in case the target is evk: if { [have_board imx8q_evk] } { import_from_depot \ [depot_user]/src/fec_nic_drv \ [depot_user]/src/imx8mq_platform_drv \ [depot_user]/src/imx8mq_usb_host_drv \ [depot_user]/raw/imx8q_evk-devices \ [depot_user]/src/usb_net_drv }
I have checked the depot devices file in raw/imx8q_evk-devices and it is identical to the one you committed on nov 17.
My platform config looks as follows: <start name="platform_drv" caps="300" managing_system="yes" priority="0"> <binary name="imx8mq_platform_drv"/> <resource name="RAM" quantum="8M"/> <provides> <service name="Platform"/> </provides> <route> <any-service><parent/></any-service> </route> <config> <policy label="eth0_drv -> "><device name="fec"/></policy> <policy label="usb_drv -> " info="yes"> <device name="usb_host_2"/> <device name="usb_phy_2"/> </policy> </config> </start>
I think the policy for the eth0_drv will use the "fec" device from your nov 17 commit. When I run my scenario I can see that a rom file named "devices" is loaded, which I think is the correct one as I do not have another devices file in the scenario. To me the error message from my first mail seems to indicate that the Platform has read the correct "devices" config but that for some reason the requested IO resource at address 0x30be0000 (size=0x10000) is unavailable. What do you think about that interpretation?
Best regards, Pontus
On Wed, Dec 21, 2022 at 11:54 AM Stefan Kalkowski stefan.kalkowski@genode-labs.com wrote:
Hello Pontus,
On Tue, Dec 20, 2022 at 08:29:28PM +0100, Pontus Åström wrote:
Now everything compiles successfully but I get a runtime setup error where the driver complains about an unavailable IO resource:
[init -> eth0_drv] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [init -> eth0_drv] clocksource: dde_counter: mask: 0xffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns [init -> eth0_drv] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns [init -> eth0_drv] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [init -> eth0_drv] clocksource: Switched to clocksource dde_counter [init -> eth0_drv] mdio_bus: Fixed MDIO Bus: probed [init -> eth0_drv] Error: memory-mapped I/O resource 0x30be0000 (size=0x10000) unavailable
What might be the cause of this error?
Probably the problem can be found within the devices ROM delivered to the platform driver. Formerly, the old driver expected an I/O memory area of size 0x4000, but the updated FEC driver that uses the original device-tree information of the Linux kernel expects an I/O memory area of size 0x10000. Moreover, the new driver needs additional informations related to its clocks that is also incorporated into the devices information consumed by the platform driver. You can see the changes when looking at file changes of `board/imx8q_evk/devices` within the following commit:
https://github.com/genodelabs/genode-imx/commit/a7bdd5cbdce98371e22fc3ff1330...
To circumvent similar problems in the future, you can incorporate the mentioned devices file as boot ROM within your scenario, and provide it to the platform driver. Then you automatically profit from further updates of the devices descriptions and its interplay with our provided drivers.
Best regards Stefan
-- Stefan Kalkowski Genode labs
https://github.com/skalk | https://genode.org
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users
Hello Pontus,
My platform config looks as follows:
<start name="platform_drv" caps="300" managing_system="yes" priority="0"> <binary name="imx8mq_platform_drv"/> <resource name="RAM" quantum="8M"/> <provides> <service name="Platform"/> </provides> <route> <any-service><parent/></any-service> </route> <config> <policy label="eth0_drv -> "><device name="fec"/></policy> <policy label="usb_drv -> " info="yes"> <device name="usb_host_2"/> <device name="usb_phy_2"/> </policy> </config> </start>
from looking at this config snippet, I guess that the 'info="yes"' attribute [1] is missing from the eth0_drv policy. The new driver uses this physical information to correlate device-tree nodes with the physical resources obtained from the platform driver.
[1] https://github.com/genodelabs/genode/blob/master/repos/os/src/drivers/platfo...
Cheers Norman
Thank you Norman,
Your suggestion solved the problem.
Best regards, Pontus
On Wed, Dec 21, 2022 at 11:03 PM Norman Feske norman.feske@genode-labs.com wrote:
Hello Pontus,
My platform config looks as follows:
<start name="platform_drv" caps="300" managing_system="yes" priority="0"> <binary name="imx8mq_platform_drv"/> <resource name="RAM" quantum="8M"/> <provides> <service name="Platform"/> </provides> <route> <any-service><parent/></any-service> </route> <config> <policy label="eth0_drv -> "><device name="fec"/></policy> <policy label="usb_drv -> " info="yes"> <device name="usb_host_2"/> <device name="usb_phy_2"/> </policy> </config> </start>
from looking at this config snippet, I guess that the 'info="yes"' attribute [1] is missing from the eth0_drv policy. The new driver uses this physical information to correlate device-tree nodes with the physical resources obtained from the platform driver.
[1] https://github.com/genodelabs/genode/blob/master/repos/os/src/drivers/platfo...
Cheers Norman
-- Dr.-Ing. Norman Feske Genode Labs
https://www.genode-labs.com · https://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users