diff options
| author | erikchan <[email protected]> | 2023-07-25 13:50:50 +0800 |
|---|---|---|
| committer | guo <[email protected]> | 2023-07-27 11:16:55 +0800 |
| commit | 0eaa757cffe21231ee6b57e0e2c9681f966e6f56 (patch) | |
| tree | 134704ab3f9b80b5e3972202fb84c50633c807d3 | |
| parent | c1cc1332e98fd8ba55a4fef9fbcacf45f4081b36 (diff) | |
【dd2.0】move the core header files to include/drivers/core
| -rw-r--r-- | components/drivers/include/drivers/core/bus.h (renamed from components/drivers/include/core/bus.h) | 0 | ||||
| -rw-r--r-- | components/drivers/include/drivers/core/device.h (renamed from components/drivers/include/core/device.h) | 0 | ||||
| -rw-r--r-- | components/drivers/include/drivers/core/dm.h (renamed from components/drivers/include/core/dm.h) | 0 | ||||
| -rw-r--r-- | components/drivers/include/drivers/core/driver.h (renamed from components/drivers/include/core/driver.h) | 0 | ||||
| -rwxr-xr-x | components/drivers/include/drivers/core/rtdm.h | 50 | ||||
| -rw-r--r-- | components/drivers/include/drivers/platform.h | 44 |
6 files changed, 44 insertions, 50 deletions
diff --git a/components/drivers/include/core/bus.h b/components/drivers/include/drivers/core/bus.h index 10e7fa10ea..10e7fa10ea 100644 --- a/components/drivers/include/core/bus.h +++ b/components/drivers/include/drivers/core/bus.h diff --git a/components/drivers/include/core/device.h b/components/drivers/include/drivers/core/device.h index 87019a3797..87019a3797 100644 --- a/components/drivers/include/core/device.h +++ b/components/drivers/include/drivers/core/device.h diff --git a/components/drivers/include/core/dm.h b/components/drivers/include/drivers/core/dm.h index fc7d0d3a30..fc7d0d3a30 100644 --- a/components/drivers/include/core/dm.h +++ b/components/drivers/include/drivers/core/dm.h diff --git a/components/drivers/include/core/driver.h b/components/drivers/include/drivers/core/driver.h index 60661a2cfb..60661a2cfb 100644 --- a/components/drivers/include/core/driver.h +++ b/components/drivers/include/drivers/core/driver.h diff --git a/components/drivers/include/drivers/core/rtdm.h b/components/drivers/include/drivers/core/rtdm.h deleted file mode 100755 index 95d3c259b8..0000000000 --- a/components/drivers/include/drivers/core/rtdm.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2023-04-20 ErikChan the first version - */ - -#ifndef __RT_DM_H__ -#define __RT_DM_H__ - -#include <rthw.h> -#include <rtdef.h> -#include <drivers/misc.h> -#include <drivers/byteorder.h> - -#ifndef RT_CPUS_NR -#define RT_CPUS_NR 1 -#endif - -#ifndef RT_USING_SMP -extern int rt_hw_cpu_id(void); -#endif - -void rt_dm_secondary_cpu_init(void); - -int rt_dm_set_dev_name_auto(rt_device_t dev, const char *prefix); -int rt_dm_get_dev_name_id(rt_device_t dev); - -int rt_dm_set_dev_name(rt_device_t dev, const char *format, ...); -const char *rt_dm_get_dev_name(rt_device_t dev); - -/* init cpu, memory, interrupt-controller, bus... */ -#define INIT_CORE_EXPORT(fn) INIT_EXPORT(fn, "1.0") -/* init pci/pcie, usb platform driver... */ -#define INIT_FRAMEWORK_EXPORT(fn) INIT_EXPORT(fn, "1.1") -/* init platform, user code... */ -#define INIT_PLATFORM_EXPORT(fn) INIT_EXPORT(fn, "1.2") -/* init sys-timer, clk, pinctrl... */ -#define INIT_SUBSYS_EXPORT(fn) INIT_EXPORT(fn, "1.3") -/* init early drivers */ -#define INIT_DRIVER_EARLY_EXPORT(fn) INIT_EXPORT(fn, "1.4") -/* init in secondary_cpu_c_start */ -#define INIT_SECONDARY_CPU_EXPORT(fn) INIT_EXPORT(fn, "7") -/* init after mount fs */ -#define INIT_FS_EXPORT(fn) INIT_EXPORT(fn, "6.0") - -#endif /* __RT_DM_H__ */ diff --git a/components/drivers/include/drivers/platform.h b/components/drivers/include/drivers/platform.h new file mode 100644 index 0000000000..3caccabd2d --- /dev/null +++ b/components/drivers/include/drivers/platform.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2023-04-12 ErikChan the first version + */ + +#ifndef __PLATFORM_H__ +#define __PLATFORM_H__ + +#include <drivers/ofw.h> +#include <drivers/core/driver.h> + +struct rt_platform_device +{ + struct rt_device parent; + + const char *name; + const struct rt_ofw_node_id *id; + + void *priv; +}; + +struct rt_platform_driver +{ + struct rt_driver parent; + + const char *name; + const struct rt_ofw_node_id *ids; + + rt_err_t (*probe)(struct rt_platform_device *pdev); +}; + +struct rt_platform_device *rt_platform_device_alloc(const char *name); + +rt_err_t rt_platform_driver_register(struct rt_platform_driver *pdrv); +rt_err_t rt_platform_device_register(struct rt_platform_device *pdev); + +#define RT_PLATFORM_DRIVER_EXPORT(driver) RT_DRIVER_EXPORT(driver, platform, BUILIN) + +#endif /* __PLATFORM_H__ */ |
