Ethernet device module for odroidc2
I have been trying to use the ethernet driver for the UNSW Asdvanced Operating Systems course but I still get these messages: find_compatible_driver_module@io.c:434 No suitable driver was found for path /soc/ethernet@c9410000, ignoring server_init@ethdriver.c:382 Unable to find an ethernet device I thought that I had to copy the driver to the utils lib folder and provide a preprocessor macro as someone else had suggested but I may be missing a few other things. Best, Nkem
Hi Nkem,
I have been trying to use the ethernet driver for the UNSW Asdvanced Operating Systems course but I still get these messages:
find_compatible_driver_module@io.c:434 No suitable driver was found for path /soc/ethernet@c9410000, ignoring server_init@ethdriver.c:382 Unable to find an ethernet device
I thought that I had to copy the driver to the utils lib folder and provide a preprocessor macro as someone else had suggested but I may be missing a few other things.
It seems that you're pretty close to getting everything complete. You're only missing one more step, and this is to add some bootstrapping code to get the driver to initialise and register itself with the interface registration service so that it can be found by the Ethdriver CAmkES component. To do this, you can copy the example from the i.MX6 Ethernet driver and change it up a bit so that it works for the Odroid C2. More specifically, you'd copy this function [1], modify the contents of the function to use the correct initialisation function for the C2, and also modify the callbacks [2] and [3] so that it gets the correct registers and IRQs from the kernel's version of the Odroid C2's DTS. Finally, you also need copy this [4] and modify the following string array and the last argument in the preprocessor symbol to point to the function you copied earlier. I hope this helps, Damon [1] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [2] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [3] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [4] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im...
I have seemingly done as you have suggested but the result remains the same. I do not even get any error messages to suggest I have modified anything incorrectly which again leads me to believe that maybe its an issue with how I have set up the folder but I don't see how as it follows the same conventions to the other plat from source files in libethdrivers. My second guess is simply that despite adding the parts for bootstrapping, it is making no attempt to do so. Again, apologies if my issues are trivial as this is my first time working with anything like this. Best, Nkem On Mon, 25 Jan 2021 at 03:27, Lee, Damon (Data61, Eveleigh) < Damon.Lee@data61.csiro.au> wrote:
Hi Nkem,
I have been trying to use the ethernet driver for the UNSW Asdvanced Operating Systems course but I still get these messages:
find_compatible_driver_module@io.c:434 No suitable driver was found for path /soc/ethernet@c9410000, ignoring server_init@ethdriver.c:382 Unable to find an ethernet device
I thought that I had to copy the driver to the utils lib folder and provide a preprocessor macro as someone else had suggested but I may be missing a few other things.
It seems that you're pretty close to getting everything complete. You're only missing one more step, and this is to add some bootstrapping code to get the driver to initialise and register itself with the interface registration service so that it can be found by the Ethdriver CAmkES component.
To do this, you can copy the example from the i.MX6 Ethernet driver and change it up a bit so that it works for the Odroid C2. More specifically, you'd copy this function [1], modify the contents of the function to use the correct initialisation function for the C2, and also modify the callbacks [2] and [3] so that it gets the correct registers and IRQs from the kernel's version of the Odroid C2's DTS. Finally, you also need copy this [4] and modify the following string array and the last argument in the preprocessor symbol to point to the function you copied earlier.
I hope this helps, Damon
[1]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [2]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [3]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [4]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... _______________________________________________ Devel mailing list -- devel@sel4.systems To unsubscribe send an email to devel-leave@sel4.systems
Just to clarify, a modification I made was calling the ethif_init function
ethernet.c file[1] and passing some parameters (base_addr,mac,
dma_ops,ethif_recv_callback). Currently, dma_ops and ethif_recv_callback
contain null values and I'm not too sure what I need to initialise them as.
Secondly, as I still was not getting a different message in the terminal to
suggest an error, I used the same method used for the pc99 boards for
initialising the ethernet device. I called the ethif_odroid_init_module
function which is the function that the preprocessor symbol is pointing to.
Doing so I was able at least try and see if I had done the modification of
the code correctly which leads me back to the first point as an assertion
error occurred for dma_ops and I presume would happen
to ethif_recv_callback as well. Also, please could you clarify how I am
meant to modify the callbacks so that it gets the correct registers and
IRQs from the DTS.
[1]
https://github.com/SEL4PROJ/AOS/blob/master/libethernet/src/ethernet.c#L63
Thanks,
Nkem
On Tue, 26 Jan 2021 at 10:23, Nkem Ogosi
I have seemingly done as you have suggested but the result remains the same. I do not even get any error messages to suggest I have modified anything incorrectly which again leads me to believe that maybe its an issue with how I have set up the folder but I don't see how as it follows the same conventions to the other plat from source files in libethdrivers. My second guess is simply that despite adding the parts for bootstrapping, it is making no attempt to do so. Again, apologies if my issues are trivial as this is my first time working with anything like this.
Best, Nkem
On Mon, 25 Jan 2021 at 03:27, Lee, Damon (Data61, Eveleigh) < Damon.Lee@data61.csiro.au> wrote:
Hi Nkem,
I have been trying to use the ethernet driver for the UNSW Asdvanced Operating Systems course but I still get these messages:
find_compatible_driver_module@io.c:434 No suitable driver was found for path /soc/ethernet@c9410000, ignoring server_init@ethdriver.c:382 Unable to find an ethernet device
I thought that I had to copy the driver to the utils lib folder and provide a preprocessor macro as someone else had suggested but I may be missing a few other things.
It seems that you're pretty close to getting everything complete. You're only missing one more step, and this is to add some bootstrapping code to get the driver to initialise and register itself with the interface registration service so that it can be found by the Ethdriver CAmkES component.
To do this, you can copy the example from the i.MX6 Ethernet driver and change it up a bit so that it works for the Odroid C2. More specifically, you'd copy this function [1], modify the contents of the function to use the correct initialisation function for the C2, and also modify the callbacks [2] and [3] so that it gets the correct registers and IRQs from the kernel's version of the Odroid C2's DTS. Finally, you also need copy this [4] and modify the following string array and the last argument in the preprocessor symbol to point to the function you copied earlier.
I hope this helps, Damon
[1]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [2]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [3]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... [4]
https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im... _______________________________________________ Devel mailing list -- devel@sel4.systems To unsubscribe send an email to devel-leave@sel4.systems
Hi Nkem,
Just to clarify, a modification I made was calling the ethif_init function
ethernet.c file[1] and passing some parameters (base_addr,mac,
dma_ops,ethif_recv_callback). Currently, dma_ops and ethif_recv_callback
contain null values and I'm not too sure what I need to initialise them as.
The issue is more clear now, the issue lies with the fact that the Ethernet driver structure layout is different from the expected layout in libethdrivers. For the `dma_ops` case, this shouldn't be NULL, and depending on what CAmkES application (e.g. picoserver) you are using, this will be handled automatically for you. Otherwise, you can call `camkes_io_ops` and then you can access the underlying `dma_ops` structure inside the `ps_io_ops_t` pointer. As for the `ethif_recv_callback` this shouldn't be there, the libethdrivers drivers instead require these functions to be filled in [1]. What I'm trying to say here is that the model of the AOS Ethernet driver is different from those expected in libethdrivers, and you would need to modify the AOS Ethernet driver quite heavily so that it matches the model in libethdrivers.
Also, please could you clarify how I am meant to modify the callbacks so
that it gets the correct registers and IRQs from the DTS.
The callbacks are called like a lambda in a 'map' function like in other languages. It's given the current IRQ or register information each time it's called and the user can choose to take that information and use it to allocate hardware resources. So in the case of the C2, looking at the kernel DTS for it (kernel/tools/dts/odroidc2.dts), the Ethernet node (/soc/ethernet@c9410000) contains one interrupt entry and two register entries. The interrupt entry is simple, you could simple call `ps_irq_register` on the IRQ information in the first invocation. As for the registers, you would need to call `ps_mem_map` twice, once for each time the callback is called. If aren't in a rush to solve these issues, the team is considering porting over the AOS Ethernet driver for the C2 over to libethdrivers in the next few days. Though this would take a few days to do, review, and have it pushed out to upstream. Hope this helps, Damon [1] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im...
Thanks Damon, I see that the driver has since been added to util_libs and I was just wondering about some errors I am getting when trying to use it. I made a quick hello world app and set up the camkes file as such: Hello World! Assertion failed: !"sys_socket not implemented" (/home/nkem/Test/projects/camkes-tool/libsel4camkes/src/sys_socket.c: camkes_sys_socket: 42) dwmac.687000 Waiting for PHY auto negotiation to complete.......... done Speed: 1000, full duplex Assertion failed: buf (/home/nkem/Test/projects/global-components/components/Ethdriver/src/ethdriver.c: server_init: 388) On Thu, 28 Jan 2021 at 01:19, Lee, Damon (Data61, Eveleigh) < Damon.Lee@data61.csiro.au> wrote:
Hi Nkem,
Just to clarify, a modification I made was calling the ethif_init function
ethernet.c file[1] and passing some parameters (base_addr,mac,
dma_ops,ethif_recv_callback). Currently, dma_ops and ethif_recv_callback
contain null values and I'm not too sure what I need to initialise them as.
The issue is more clear now, the issue lies with the fact that the Ethernet
driver structure layout is different from the expected layout in libethdrivers.
For the `dma_ops` case, this shouldn't be NULL, and depending on what CAmkES
application (e.g. picoserver) you are using, this will be handled automatically
for you. Otherwise, you can call `camkes_io_ops` and then you can access the
underlying `dma_ops` structure inside the `ps_io_ops_t` pointer.
As for the `ethif_recv_callback` this shouldn't be there, the libethdrivers
drivers instead require these functions to be filled in [1]. What I'm trying to
say here is that the model of the AOS Ethernet driver is different from those
expected in libethdrivers, and you would need to modify the AOS Ethernet driver
quite heavily so that it matches the model in libethdrivers.
Also, please could you clarify how I am meant to modify the callbacks so
that it gets the correct registers and IRQs from the DTS.
The callbacks are called like a lambda in a 'map' function like in other
languages. It's given the current IRQ or register information each time it's
called and the user can choose to take that information and use it to allocate
hardware resources. So in the case of the C2, looking at the kernel DTS for it
(kernel/tools/dts/odroidc2.dts), the Ethernet node (/soc/ethernet@c9410000)
contains one interrupt entry and two register entries. The interrupt entry is
simple, you could simple call `ps_irq_register` on the IRQ information in the
first invocation. As for the registers, you would need to call `ps_mem_map`
twice, once for each time the callback is called.
If aren't in a rush to solve these issues, the team is considering porting over
the AOS Ethernet driver for the C2 over to libethdrivers in the next few days.
Though this would take a few days to do, review, and have it pushed out to
upstream.
Hope this helps,
Damon
[1] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im...
Sorry I accidentally sent the email without finishing it. The camkes file
was set up as such:
import
Thanks Damon,
I see that the driver has since been added to util_libs and I was just wondering about some errors I am getting when trying to use it. I made a quick hello world app and set up the camkes file as such:
Hello World! Assertion failed: !"sys_socket not implemented" (/home/nkem/Test/projects/camkes-tool/libsel4camkes/src/sys_socket.c: camkes_sys_socket: 42) dwmac.687000 Waiting for PHY auto negotiation to complete.......... done Speed: 1000, full duplex Assertion failed: buf (/home/nkem/Test/projects/global-components/components/Ethdriver/src/ethdriver.c: server_init: 388)
On Thu, 28 Jan 2021 at 01:19, Lee, Damon (Data61, Eveleigh) < Damon.Lee@data61.csiro.au> wrote:
Hi Nkem,
Just to clarify, a modification I made was calling the ethif_init function
ethernet.c file[1] and passing some parameters (base_addr,mac,
dma_ops,ethif_recv_callback). Currently, dma_ops and ethif_recv_callback
contain null values and I'm not too sure what I need to initialise them as.
The issue is more clear now, the issue lies with the fact that the Ethernet
driver structure layout is different from the expected layout in libethdrivers.
For the `dma_ops` case, this shouldn't be NULL, and depending on what CAmkES
application (e.g. picoserver) you are using, this will be handled automatically
for you. Otherwise, you can call `camkes_io_ops` and then you can access the
underlying `dma_ops` structure inside the `ps_io_ops_t` pointer.
As for the `ethif_recv_callback` this shouldn't be there, the libethdrivers
drivers instead require these functions to be filled in [1]. What I'm trying to
say here is that the model of the AOS Ethernet driver is different from those
expected in libethdrivers, and you would need to modify the AOS Ethernet driver
quite heavily so that it matches the model in libethdrivers.
Also, please could you clarify how I am meant to modify the callbacks so
that it gets the correct registers and IRQs from the DTS.
The callbacks are called like a lambda in a 'map' function like in other
languages. It's given the current IRQ or register information each time it's
called and the user can choose to take that information and use it to allocate
hardware resources. So in the case of the C2, looking at the kernel DTS for it
(kernel/tools/dts/odroidc2.dts), the Ethernet node (/soc/ethernet@c9410000)
contains one interrupt entry and two register entries. The interrupt entry is
simple, you could simple call `ps_irq_register` on the IRQ information in the
first invocation. As for the registers, you would need to call `ps_mem_map`
twice, once for each time the callback is called.
If aren't in a rush to solve these issues, the team is considering porting over
the AOS Ethernet driver for the C2 over to libethdrivers in the next few days.
Though this would take a few days to do, review, and have it pushed out to
upstream.
Hope this helps,
Damon
[1] https://github.com/seL4/util_libs/blob/master/libethdrivers/src/plat/imx6/im...
participants (3)
-
Lee, Damon (Data61, Eveleigh)
-
Nkem Ogosi
-
ogosinkem@gmail.com