[PATCH 6/6] fbd : Port to RTEMS

Christian Mauderer list at c-mauderer.de
Sun Jun 30 19:16:30 UTC 2019


On 30/06/2019 19:57, Vijay Kumar Banerjee wrote:
> 
> On Sun, Jun 30, 2019 at 10:17 PM Christian Mauderer <list at c-mauderer.de
> <mailto:list at c-mauderer.de>> wrote:
> 
>     On 30/06/2019 18:29, Vijay Kumar Banerjee wrote:
>     >     > @@ -366,6 +374,9 @@ driver_t fbd_driver = {
>     >     >  devclass_t   fbd_devclass;
>     >     > 
>     >     >  DRIVER_MODULE(fbd, fb, fbd_driver, fbd_devclass, 0, 0);
>     >     > +#ifdef __rtems__
>     >     > +DRIVER_MODULE(fbd, am335x_lcd, fbd_driver, fbd_devclass, 0, 0);
>     >
>     >     Why is this necessary in this case? I don't see a similar
>     connection in
>     >     FreeBSD.
>     >
>     > the fbd needs to be linked to the am335x_lcd which provides the
>     fb0 device
>     > and the fbd needs to attach to fb0. 
> 
>     It seems that this connection (or a similar one) hasn't been there on
>     FreeBSD. So I wonder why it should be necessary on RTEMS.
> 
>     Note that the situation is a bit different from the one of the i2c bus.
>     There your driver implemented a base for a bus system. Therefore the
>     generic bus had been connected to a device specific driver. I'm not sure
>     that's the case here.
> 
>     It's quite possible that you just have to link the fbd with a line like
>     the following in nexus-devices.h:
> 
>         SYSINIT_MODULE_REFERENCE(fbd);
> 
> This is not working :
> ```
> fb0: failed to attach fbd device
> ``` 
> 
>     Best regards
> 
>     Christian
> 

OK. I had a more detailed look: In FreeBSD it's the following connection:

fbd->fb->fb_mod

For some devices (like freescale/imx/imx51_ipuv3_fbd.c) a specialized fb
is connected to simplebus. So one of the following should work and
should be most likely more correct:

Either

    SYSINIT_DRIVER_REFERENCE(fbd, fb);
    SYSINIT_DRIVER_REFERENCE(fb, fb_mod);
    SYSINIT_MODULE_REFERENCE(fb_mod);

or

    SYSINIT_DRIVER_REFERENCE(fbd, fb);
    SYSINIT_DRIVER_REFERENCE(fb, simplebus);

For the second one the following line will be necessary in fbd.c

    DRIVER_MODULE(fbd, simplebus, fbd_driver, fbd_devclass, 0, 0);

Can you try whether one of these two works? It's just odd to connect the
frame buffer device driver to a specialized device instead of the
general frame buffer where it is connected in FreeBSD. I would expect
problems later with the current construction.



More information about the devel mailing list