[PATCH 4/6] am335x display drivers: Port to RTEMS

Christian Mauderer list at c-mauderer.de
Sun Jun 30 15:51:13 UTC 2019


On 30/06/2019 17:29, Vijay Kumar Banerjee wrote:
> ---
>  Makefile.todo                                 | 13 ++++++
>  libbsd.py                                     | 12 +++++
>  rtemsbsd/include/bsp/nexus-devices.h          |  2 +
>  .../machine/rtems-bsd-kernel-namespace.h      |  2 +
>  rtemsbsd/include/rtems/bsd/local/fb_if.h      | 45 +++++++++++++++++++
>  rtemsbsd/include/rtems/bsd/local/opt_splash.h |  0
>  .../include/rtems/bsd/local/opt_syscons.h     |  0
>  rtemsbsd/include/rtems/bsd/local/opt_teken.h  |  0
>  rtemsbsd/local/fb_if.c                        | 30 +++++++++++++
>  9 files changed, 104 insertions(+)
>  create mode 100644 rtemsbsd/include/rtems/bsd/local/fb_if.h
>  create mode 100644 rtemsbsd/include/rtems/bsd/local/opt_splash.h
>  create mode 100644 rtemsbsd/include/rtems/bsd/local/opt_syscons.h
>  create mode 100644 rtemsbsd/include/rtems/bsd/local/opt_teken.h
>  create mode 100644 rtemsbsd/local/fb_if.c
> 
> diff --git a/Makefile.todo b/Makefile.todo
> index 358d6956..ed1e428e 100644
> --- a/Makefile.todo
> +++ b/Makefile.todo
> @@ -51,6 +51,8 @@ GENERATED += $(LOCAL_INC)/clknode_if.h
>  GENERATED += $(LOCAL_SRC)/clknode_if.c
>  GENERATED += $(LOCAL_INC)/hdmi_if.h
>  GENERATED += $(LOCAL_SRC)/hdmi_if.c
> +GENERATED += $(LOCAL_INC)/fb_if.h
> +GENERATED += $(LOCAL_SRC)/fb_if.c
>  GENERATED += rtemsbsd/include/machine/rtems-bsd-regdomain.h
>  GENERATED += rtemsbsd/rtems/rtems-bsd-regdomain.c
>  
> @@ -266,6 +268,17 @@ $(LOCAL_SRC)/hdmi_if.c: $(FREEBSD_SRC)/sys/dev/hdmi/hdmi_if.m
>  	    -e 's|#include "hdmi_if.h"|#include <rtems/bsd/local/hdmi_if.h>|'
>  	mv hdmi_if.c $@
>  
> +$(LOCAL_INC)/fb_if.h: $(FREEBSD_SRC)/sys/dev/fb/fb_if.m
> +	awk -f $(TOOLS)/makeobjops.awk $< -h
> +	mv fb_if.h $@
> +
> +$(LOCAL_SRC)/fb_if.c: $(FREEBSD_SRC)/sys/dev/fb/fb_if.m
> +	awk -f $(TOOLS)/makeobjops.awk $< -c
> +	sed -i fb_if.c \
> +	    -e '1 i\#include <machine/rtems-bsd-kernel-space.h>\n' \
> +	    -e 's|#include "fb_if.h"|#include <rtems/bsd/local/fb_if.h>|'
> +	mv fb_if.c $@
> +
>  $(LOCAL_SRC)/gpio_if.c: $(FREEBSD_SRC)/sys/dev/gpio/gpio_if.m
>  	awk -f $(TOOLS)/makeobjops.awk $< -c
>  	mv gpio_if.c $@
> diff --git a/libbsd.py b/libbsd.py
> index b21ddccf..bce1d268 100644
> --- a/libbsd.py
> +++ b/libbsd.py
> @@ -799,6 +799,14 @@ class display(builder.Module):
>                  'sys/dev/videomode/ediddevs.h',
>                  'sys/dev/videomode/ediddevs_data.h',
>                  'sys/dev/videomode/vesagtf.h',
> +                'sys/arm/ti/am335x/am335x_lcd.h',
> +                'sys/arm/ti/am335x/am335x_pwm.h',
> +                'sys/dev/fb/fbreg.h',
> +                'sys/dev/vt/vt.h',
> +                'sys/teken/teken.h',
>From the header:

   This library converts an UTF-8 stream of bytes to terminal drawing
   commands.

Where is that necessary?

> +                'sys/sys/fbio.h',
> +                'sys/sys/consio.h',
> +                'sys/sys/terminal.h',
>              ]
>          )
>          self.addKernelSpaceSourceFiles(
> @@ -811,6 +819,9 @@ class display(builder.Module):
>                  'sys/dev/videomode/edid.c',
>                  'sys/dev/videomode/vesagtf.c',
>                  'sys/dev/videomode/videomode.c',
> +                'sys/arm/ti/am335x/am335x_lcd.c',
> +                'sys/arm/ti/am335x/am335x_pwmss.c',
> +                'sys/arm/ti/am335x/am335x_ecap.c',
>              ],
>              mm.generator['source']()
>          )
> @@ -818,6 +829,7 @@ class display(builder.Module):
>              [
>                  'local/clknode_if.c',
>                  'local/hdmi_if.c',
> +                'local/fb_if.c',
>              ],
>              mm.generator['source']()
>          )
> diff --git a/rtemsbsd/include/bsp/nexus-devices.h b/rtemsbsd/include/bsp/nexus-devices.h
> index 3ec136ae..2c718295 100644
> --- a/rtemsbsd/include/bsp/nexus-devices.h
> +++ b/rtemsbsd/include/bsp/nexus-devices.h
> @@ -61,6 +61,8 @@ SYSINIT_DRIVER_REFERENCE(sdhci_ti, simplebus);
>  SYSINIT_DRIVER_REFERENCE(mmcsd, mmc);
>  SYSINIT_DRIVER_REFERENCE(cpsw, cpswss);
>  SYSINIT_DRIVER_REFERENCE(ukphy, miibus);
> +SYSINIT_DRIVER_REFERENCE(am335x_lcd, simplebus);
> +SYSINIT_DRIVER_REFERENCE(am335x_pwmss, simplebus);
>  SYSINIT_DRIVER_REFERENCE(rtems_i2c, simplebus);
>  SYSINIT_DRIVER_REFERENCE(ofw_iicbus, rtems_i2c);
>  SYSINIT_DRIVER_REFERENCE(iic, iicbus);
> diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
> index bef9f411..3951da79 100644
> --- a/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
> +++ b/rtemsbsd/include/machine/rtems-bsd-kernel-namespace.h
> @@ -46,6 +46,8 @@
>  #define	altq_remove _bsd_altq_remove
>  #define	altq_remove_queue _bsd_altq_remove_queue
>  #define	altqs_inactive_open _bsd_altqs_inactive_open
> +#define	am335x_pwm_config_ecap _bsd_am335x_pwm_config_ecap
> +#define	am335x_pwmss_driver _bsd_am335x_pwmss_driver
>  #define	arp_announce_ifaddr _bsd_arp_announce_ifaddr
>  #define	arp_ifinit _bsd_arp_ifinit
>  #define	arprequest _bsd_arprequest
> diff --git a/rtemsbsd/include/rtems/bsd/local/fb_if.h b/rtemsbsd/include/rtems/bsd/local/fb_if.h
> new file mode 100644
> index 00000000..7b97028f
> --- /dev/null
> +++ b/rtemsbsd/include/rtems/bsd/local/fb_if.h
> @@ -0,0 +1,45 @@
> +/*
> + * This file is @generated automatically.
> + * Do not modify anything in here by hand.
> + *
> + * Created from source file
> + *   freebsd-org/sys/dev/fb/fb_if.m
> + * with
> + *   makeobjops.awk
> + *
> + * See the source file for legal information
> + */
> +
> +
> +#ifndef _fb_if_h_
> +#define _fb_if_h_
> +
> +/** @brief Unique descriptor for the FB_PIN_MAX() method */
> +extern struct kobjop_desc fb_pin_max_desc;
> +/** @brief A function implementing the FB_PIN_MAX() method */
> +typedef int fb_pin_max_t(device_t dev, int *npins);
> +
> +static __inline int FB_PIN_MAX(device_t dev, int *npins)
> +{
> +	kobjop_t _m;
> +	int rc;
> +	KOBJOPLOOKUP(((kobj_t)dev)->ops,fb_pin_max);
> +	rc = ((fb_pin_max_t *) _m)(dev, npins);
> +	return (rc);
> +}
> +
> +/** @brief Unique descriptor for the FB_GETINFO() method */
> +extern struct kobjop_desc fb_getinfo_desc;
> +/** @brief A function implementing the FB_GETINFO() method */
> +typedef struct fb_info * fb_getinfo_t(device_t dev);
> +
> +static __inline struct fb_info * FB_GETINFO(device_t dev)
> +{
> +	kobjop_t _m;
> +	struct fb_info * rc;
> +	KOBJOPLOOKUP(((kobj_t)dev)->ops,fb_getinfo);
> +	rc = ((fb_getinfo_t *) _m)(dev);
> +	return (rc);
> +}
> +
> +#endif /* _fb_if_h_ */
> diff --git a/rtemsbsd/include/rtems/bsd/local/opt_splash.h b/rtemsbsd/include/rtems/bsd/local/opt_splash.h
> new file mode 100644
> index 00000000..e69de29b
> diff --git a/rtemsbsd/include/rtems/bsd/local/opt_syscons.h b/rtemsbsd/include/rtems/bsd/local/opt_syscons.h
> new file mode 100644
> index 00000000..e69de29b
> diff --git a/rtemsbsd/include/rtems/bsd/local/opt_teken.h b/rtemsbsd/include/rtems/bsd/local/opt_teken.h
> new file mode 100644
> index 00000000..e69de29b
> diff --git a/rtemsbsd/local/fb_if.c b/rtemsbsd/local/fb_if.c
> new file mode 100644
> index 00000000..ceb57e4b
> --- /dev/null
> +++ b/rtemsbsd/local/fb_if.c
> @@ -0,0 +1,30 @@
> +#include <machine/rtems-bsd-kernel-space.h>
> +
> +/*
> + * This file is @generated automatically.
> + * Do not modify anything in here by hand.
> + *
> + * Created from source file
> + *   freebsd-org/sys/dev/fb/fb_if.m
> + * with
> + *   makeobjops.awk
> + *
> + * See the source file for legal information
> + */
> +
> +#include <sys/param.h>
> +#include <sys/queue.h>
> +#include <sys/kernel.h>
> +#include <sys/kobj.h>
> +#include <sys/bus.h>
> +#include <sys/fbio.h>
> +#include <rtems/bsd/local/fb_if.h>
> +
> +struct kobjop_desc fb_pin_max_desc = {
> +	0, { &fb_pin_max_desc, (kobjop_t)kobj_error_method }
> +};
> +
> +struct kobjop_desc fb_getinfo_desc = {
> +	0, { &fb_getinfo_desc, (kobjop_t)kobj_error_method }
> +};
> +
> 



More information about the devel mailing list