Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
For drivers which do not use Zephyr's driver model and do not associate struct device with a driver instance. More...
Macros | |
#define | DEVICE_MMIO_TOPLEVEL(name, node_id) |
Declare top-level storage for MMIO information, global scope. | |
#define | DEVICE_MMIO_TOPLEVEL_DECLARE(name) |
Provide an extern reference to a top-level MMIO region. | |
#define | DEVICE_MMIO_TOPLEVEL_STATIC(name, node_id) |
Declare top-level storage for MMIO information, static scope. | |
#define | DEVICE_MMIO_TOPLEVEL_RAM_PTR(name) &Z_TOPLEVEL_RAM_NAME(name) |
Return a pointer to the RAM storage for a device's toplevel MMIO address. | |
#define | DEVICE_MMIO_TOPLEVEL_ROM_PTR(name) &Z_TOPLEVEL_ROM_NAME(name) |
Return a pointer to the ROM-based storage area for a toplevel MMIO region. | |
#define | DEVICE_MMIO_TOPLEVEL_MAP(name, flags) |
Set up memory for a driver'sMMIO region. | |
#define | DEVICE_MMIO_TOPLEVEL_GET(name) ((mm_reg_t)Z_TOPLEVEL_RAM_NAME(name)) |
Obtain the MMIO address for a device declared top-level. | |
For drivers which do not use Zephyr's driver model and do not associate struct device with a driver instance.
Top-level storage is used instead, with either global or static scope.
This is often useful for interrupt controller and timer drivers.
Currently PCIe devices are not well-supported with this set of macros. Either use Zephyr's driver model for these kinds of devices, or manage memory manually with calls to device_map().
#define DEVICE_MMIO_TOPLEVEL | ( | name, | |
node_id | |||
) |
#include <include/zephyr/sys/device_mmio.h>
Declare top-level storage for MMIO information, global scope.
This is intended for drivers which do not use Zephyr's driver model of config/dev_data linked to a struct device.
Instead, this is a top-level declaration for the driver's C file. The scope of this declaration is global and may be referenced by other C files, using DEVICE_MMIO_TOPLEVEL_DECLARE.
name | Base symbol name |
node_id | Device-tree node identifier for this region |
#define DEVICE_MMIO_TOPLEVEL_DECLARE | ( | name | ) |
#include <include/zephyr/sys/device_mmio.h>
Provide an extern reference to a top-level MMIO region.
If a top-level MMIO region defined with DEVICE_MMIO_DEFINE needs to be referenced from other C files, this macro provides the necessary extern definitions.
name | Name of the top-level MMIO region |
#define DEVICE_MMIO_TOPLEVEL_GET | ( | name | ) | ((mm_reg_t)Z_TOPLEVEL_RAM_NAME(name)) |
#include <include/zephyr/sys/device_mmio.h>
Obtain the MMIO address for a device declared top-level.
name | Name of the top-level MMIO region |
#define DEVICE_MMIO_TOPLEVEL_MAP | ( | name, | |
flags | |||
) |
#include <include/zephyr/sys/device_mmio.h>
Set up memory for a driver'sMMIO region.
This performs the necessary MMU virtual memory mapping such that DEVICE_MMIO_GET() returns a suitable linear memory address for the MMIO region.
If such operations are not required by the target hardware, this expands to nothing.
This should be called once from the driver's init function.
The flags argument is currently used for caching mode, which should be one of the DEVICE_CACHE_* macros. Unused bits are reserved for future expansion.
name | Name of the top-level MMIO region |
flags | One of the DEVICE_CACHE_* caching modes |
#define DEVICE_MMIO_TOPLEVEL_RAM_PTR | ( | name | ) | &Z_TOPLEVEL_RAM_NAME(name) |
#include <include/zephyr/sys/device_mmio.h>
Return a pointer to the RAM storage for a device's toplevel MMIO address.
name | Name of toplevel MMIO region |
mm_reg_t | pointer to storage location |
#define DEVICE_MMIO_TOPLEVEL_ROM_PTR | ( | name | ) | &Z_TOPLEVEL_ROM_NAME(name) |
#include <include/zephyr/sys/device_mmio.h>
Return a pointer to the ROM-based storage area for a toplevel MMIO region.
name | MMIO region name |
struct | device_mmio_rom * pointer to storage location |
#define DEVICE_MMIO_TOPLEVEL_STATIC | ( | name, | |
node_id | |||
) |
#include <include/zephyr/sys/device_mmio.h>
Declare top-level storage for MMIO information, static scope.
This is intended for drivers which do not use Zephyr's driver model of config/dev_data linked to a struct device.
Instead, this is a top-level declaration for the driver's C file. The scope of this declaration is static.
name | Name of the top-level MMIO region |
node_id | Device-tree node identifier for this region |