mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-22 19:55:33 +08:00
Pinmux: Port to RTEMS
This commit is contained in:
parent
e3bc24e616
commit
59ce99a357
@ -47,6 +47,8 @@ GENERATED += $(LOCAL_INC)/gpiobus_if.h
|
|||||||
GENERATED += $(LOCAL_SRC)/gpiobus_if.c
|
GENERATED += $(LOCAL_SRC)/gpiobus_if.c
|
||||||
GENERATED += $(LOCAL_INC)/iicbus_if.h
|
GENERATED += $(LOCAL_INC)/iicbus_if.h
|
||||||
GENERATED += $(LOCAL_SRC)/iicbus_if.c
|
GENERATED += $(LOCAL_SRC)/iicbus_if.c
|
||||||
|
GENERATED += $(LOCAL_INC)/fdt_pinctrl_if.h
|
||||||
|
GENERATED += $(LOCAL_SRC)/fdt_pinctrl_if.c
|
||||||
GENERATED += rtemsbsd/include/machine/rtems-bsd-regdomain.h
|
GENERATED += rtemsbsd/include/machine/rtems-bsd-regdomain.h
|
||||||
GENERATED += rtemsbsd/rtems/rtems-bsd-regdomain.c
|
GENERATED += rtemsbsd/rtems/rtems-bsd-regdomain.c
|
||||||
|
|
||||||
@ -239,6 +241,17 @@ $(LOCAL_SRC)/sdhci_if.c: $(FREEBSD_SRC)/sys/dev/sdhci/sdhci_if.m
|
|||||||
-e 's|#include "sdhci_if.h"|#include <rtems/bsd/local/sdhci_if.h>|'
|
-e 's|#include "sdhci_if.h"|#include <rtems/bsd/local/sdhci_if.h>|'
|
||||||
mv sdhci_if.c $@
|
mv sdhci_if.c $@
|
||||||
|
|
||||||
|
$(LOCAL_INC)/fdt_pinctrl_if.h: $(FREEBSD_SRC)/sys/dev/fdt/fdt_pinctrl_if.m
|
||||||
|
awk -f $(TOOLS)/makeobjops.awk $< -h
|
||||||
|
mv fdt_pinctrl_if.h $@
|
||||||
|
|
||||||
|
$(LOCAL_SRC)/fdt_pinctrl_if.c: $(FREEBSD_SRC)/sys/dev/fdt/fdt_pinctrl_if.m
|
||||||
|
awk -f $(TOOLS)/makeobjops.awk $< -c
|
||||||
|
sed -i fdt_pinctrl_if.c \
|
||||||
|
-e '1 i\#include <machine/rtems-bsd-kernel-space.h>\n' \
|
||||||
|
-e 's|#include "fdt_pinctrl_if.h"|#include <rtems/bsd/local/fdt_pinctrl_if.h>|'
|
||||||
|
mv fdt_pinctrl_if.c $@
|
||||||
|
|
||||||
$(LOCAL_SRC)/gpio_if.c: $(FREEBSD_SRC)/sys/dev/gpio/gpio_if.m
|
$(LOCAL_SRC)/gpio_if.c: $(FREEBSD_SRC)/sys/dev/gpio/gpio_if.m
|
||||||
awk -f $(TOOLS)/makeobjops.awk $< -c
|
awk -f $(TOOLS)/makeobjops.awk $< -c
|
||||||
mv gpio_if.c $@
|
mv gpio_if.c $@
|
||||||
|
@ -37,6 +37,7 @@ dev_usb_storage = on
|
|||||||
dev_usb_wlan = off
|
dev_usb_wlan = off
|
||||||
dev_wlan_rtwn = off
|
dev_wlan_rtwn = off
|
||||||
iic = on
|
iic = on
|
||||||
|
pinmux = on
|
||||||
dhcpcd = on
|
dhcpcd = on
|
||||||
dpaa = on
|
dpaa = on
|
||||||
evdev = on
|
evdev = on
|
||||||
|
33
libbsd.py
33
libbsd.py
@ -777,6 +777,38 @@ class iic(builder.Module):
|
|||||||
mm.generator['source']()
|
mm.generator['source']()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# PINMUX
|
||||||
|
#
|
||||||
|
class pinmux(builder.Module):
|
||||||
|
|
||||||
|
def __init__(self, manager):
|
||||||
|
super(pinmux, self).__init__(manager, type(self).__name__)
|
||||||
|
|
||||||
|
def generate(self):
|
||||||
|
mm = self.manager
|
||||||
|
self.addKernelSpaceHeaderFiles(
|
||||||
|
[
|
||||||
|
'sys/arm/ti/ti_pinmux.h',
|
||||||
|
'sys/arm/ti/omap4/omap4_scm_padconf.h',
|
||||||
|
'sys/arm/ti/am335x/am335x_scm_padconf.h',
|
||||||
|
]
|
||||||
|
)
|
||||||
|
self.addKernelSpaceSourceFiles(
|
||||||
|
[
|
||||||
|
'sys/arm/ti/ti_pinmux.c',
|
||||||
|
'sys/dev/fdt/fdt_pinctrl.c',
|
||||||
|
'sys/arm/ti/am335x/am335x_scm_padconf.c',
|
||||||
|
],
|
||||||
|
mm.generator['source']()
|
||||||
|
)
|
||||||
|
self.addRTEMSSourceFiles(
|
||||||
|
[
|
||||||
|
'local/fdt_pinctrl_if.c',
|
||||||
|
],
|
||||||
|
mm.generator['source']()
|
||||||
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
# USB
|
# USB
|
||||||
#
|
#
|
||||||
@ -5134,6 +5166,7 @@ def load(mm):
|
|||||||
mm.addModule(dev_input(mm))
|
mm.addModule(dev_input(mm))
|
||||||
mm.addModule(evdev(mm))
|
mm.addModule(evdev(mm))
|
||||||
mm.addModule(iic(mm))
|
mm.addModule(iic(mm))
|
||||||
|
mm.addModule(pinmux(mm))
|
||||||
|
|
||||||
mm.addModule(dev_usb(mm))
|
mm.addModule(dev_usb(mm))
|
||||||
mm.addModule(dev_usb_controller(mm))
|
mm.addModule(dev_usb_controller(mm))
|
||||||
|
@ -54,6 +54,7 @@ RTEMS_BSD_DRIVER_SMC0(0x4e000000, RVPBXA9_IRQ_ETHERNET);
|
|||||||
RTEMS_BSD_DEFINE_NEXUS_DEVICE(ofwbus, 0, 0, NULL);
|
RTEMS_BSD_DEFINE_NEXUS_DEVICE(ofwbus, 0, 0, NULL);
|
||||||
SYSINIT_DRIVER_REFERENCE(simplebus, ofwbus);
|
SYSINIT_DRIVER_REFERENCE(simplebus, ofwbus);
|
||||||
SYSINIT_DRIVER_REFERENCE(ti_scm, simplebus);
|
SYSINIT_DRIVER_REFERENCE(ti_scm, simplebus);
|
||||||
|
SYSINIT_DRIVER_REFERENCE(ti_pinmux, simplebus);
|
||||||
SYSINIT_DRIVER_REFERENCE(am335x_prcm, simplebus);
|
SYSINIT_DRIVER_REFERENCE(am335x_prcm, simplebus);
|
||||||
SYSINIT_DRIVER_REFERENCE(usbss, simplebus);
|
SYSINIT_DRIVER_REFERENCE(usbss, simplebus);
|
||||||
SYSINIT_DRIVER_REFERENCE(musbotg, usbss);
|
SYSINIT_DRIVER_REFERENCE(musbotg, usbss);
|
||||||
|
@ -1226,6 +1226,10 @@
|
|||||||
#define fdt_immr_va _bsd_fdt_immr_va
|
#define fdt_immr_va _bsd_fdt_immr_va
|
||||||
#define fdt_is_compatible_strict _bsd_fdt_is_compatible_strict
|
#define fdt_is_compatible_strict _bsd_fdt_is_compatible_strict
|
||||||
#define fdt_parent_addr_cells _bsd_fdt_parent_addr_cells
|
#define fdt_parent_addr_cells _bsd_fdt_parent_addr_cells
|
||||||
|
#define fdt_pinctrl_configure _bsd_fdt_pinctrl_configure
|
||||||
|
#define fdt_pinctrl_configure_by_name _bsd_fdt_pinctrl_configure_by_name
|
||||||
|
#define fdt_pinctrl_configure_tree _bsd_fdt_pinctrl_configure_tree
|
||||||
|
#define fdt_pinctrl_register _bsd_fdt_pinctrl_register
|
||||||
#define fdt_regsize _bsd_fdt_regsize
|
#define fdt_regsize _bsd_fdt_regsize
|
||||||
#define fib4_free_nh_ext _bsd_fib4_free_nh_ext
|
#define fib4_free_nh_ext _bsd_fib4_free_nh_ext
|
||||||
#define fib4_lookup_nh_basic _bsd_fib4_lookup_nh_basic
|
#define fib4_lookup_nh_basic _bsd_fib4_lookup_nh_basic
|
||||||
@ -4965,6 +4969,7 @@
|
|||||||
#define t_functions _bsd_t_functions
|
#define t_functions _bsd_t_functions
|
||||||
#define t_functions_inited _bsd_t_functions_inited
|
#define t_functions_inited _bsd_t_functions_inited
|
||||||
#define ti_am335x_clk_devmap _bsd_ti_am335x_clk_devmap
|
#define ti_am335x_clk_devmap _bsd_ti_am335x_clk_devmap
|
||||||
|
#define ti_am335x_pinmux_dev _bsd_ti_am335x_pinmux_dev
|
||||||
#define tick _bsd_tick
|
#define tick _bsd_tick
|
||||||
#define ticket_altqs_active _bsd_ticket_altqs_active
|
#define ticket_altqs_active _bsd_ticket_altqs_active
|
||||||
#define ticket_altqs_inactive _bsd_ticket_altqs_inactive
|
#define ticket_altqs_inactive _bsd_ticket_altqs_inactive
|
||||||
@ -4979,6 +4984,10 @@
|
|||||||
#define _timeout_task_init _bsd__timeout_task_init
|
#define _timeout_task_init _bsd__timeout_task_init
|
||||||
#define timevaladd _bsd_timevaladd
|
#define timevaladd _bsd_timevaladd
|
||||||
#define timevalsub _bsd_timevalsub
|
#define timevalsub _bsd_timevalsub
|
||||||
|
#define ti_pinmux_padconf_get _bsd_ti_pinmux_padconf_get
|
||||||
|
#define ti_pinmux_padconf_get_gpiomode _bsd_ti_pinmux_padconf_get_gpiomode
|
||||||
|
#define ti_pinmux_padconf_set _bsd_ti_pinmux_padconf_set
|
||||||
|
#define ti_pinmux_padconf_set_gpiomode _bsd_ti_pinmux_padconf_set_gpiomode
|
||||||
#define ti_prcm_clk_disable _bsd_ti_prcm_clk_disable
|
#define ti_prcm_clk_disable _bsd_ti_prcm_clk_disable
|
||||||
#define ti_prcm_clk_enable _bsd_ti_prcm_clk_enable
|
#define ti_prcm_clk_enable _bsd_ti_prcm_clk_enable
|
||||||
#define ti_prcm_clk_get_source_freq _bsd_ti_prcm_clk_get_source_freq
|
#define ti_prcm_clk_get_source_freq _bsd_ti_prcm_clk_get_source_freq
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* This file is produced automatically.
|
||||||
|
* Do not modify anything in here by hand.
|
||||||
|
*
|
||||||
|
* Created from source file
|
||||||
|
* freebsd-org/sys/dev/fdt/fdt_pinctrl_if.m
|
||||||
|
* with
|
||||||
|
* makeobjops.awk
|
||||||
|
*
|
||||||
|
* See the source file for legal information
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _fdt_pinctrl_if_h_
|
||||||
|
#define _fdt_pinctrl_if_h_
|
||||||
|
|
||||||
|
|
||||||
|
#include <sys/tslog.h>
|
||||||
|
|
||||||
|
/** @brief Unique descriptor for the FDT_PINCTRL_CONFIGURE() method */
|
||||||
|
extern struct kobjop_desc fdt_pinctrl_configure_desc;
|
||||||
|
/** @brief A function implementing the FDT_PINCTRL_CONFIGURE() method */
|
||||||
|
typedef int fdt_pinctrl_configure_t(device_t pinctrl, phandle_t cfgxref);
|
||||||
|
|
||||||
|
static __inline int FDT_PINCTRL_CONFIGURE(device_t pinctrl, phandle_t cfgxref)
|
||||||
|
{
|
||||||
|
kobjop_t _m;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
TSENTER2(device_get_name(pinctrl));
|
||||||
|
|
||||||
|
KOBJOPLOOKUP(((kobj_t)pinctrl)->ops,fdt_pinctrl_configure);
|
||||||
|
rc = ((fdt_pinctrl_configure_t *) _m)(pinctrl, cfgxref);
|
||||||
|
|
||||||
|
TSEXIT2(device_get_name(pinctrl));
|
||||||
|
|
||||||
|
return (rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _fdt_pinctrl_if_h_ */
|
27
rtemsbsd/local/fdt_pinctrl_if.c
Normal file
27
rtemsbsd/local/fdt_pinctrl_if.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#include <machine/rtems-bsd-kernel-space.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is produced automatically.
|
||||||
|
* Do not modify anything in here by hand.
|
||||||
|
*
|
||||||
|
* Created from source file
|
||||||
|
* freebsd-org/sys/dev/fdt/fdt_pinctrl_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/types.h>
|
||||||
|
#include <sys/bus.h>
|
||||||
|
#include <dev/ofw/openfirm.h>
|
||||||
|
#include <rtems/bsd/local/fdt_pinctrl_if.h>
|
||||||
|
|
||||||
|
struct kobjop_desc fdt_pinctrl_configure_desc = {
|
||||||
|
0, { &fdt_pinctrl_configure_desc, (kobjop_t)kobj_error_method }
|
||||||
|
};
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user