Lines Matching +full:driver +full:- +full:bar
4 * SPDX-License-Identifier: Apache-2.0
13 * @defgroup device-mmio Device memory-mapped IO management
16 * Definitions and helper macros for managing driver memory-mapped
20 * including this separately may be needed for arch-level driver code
28 /* Storing MMIO addresses in RAM is a system-wide decision based on
34 * If we have PCIE enabled, this does mean that non-PCIE drivers may waste
54 * to PCIe devices, which must query the bus for BAR information.
85 * The mapped linear address will have read-write access to supervisor mode.
102 * read-write access. in device_map()
140 * @defgroup device-mmio-single Single MMIO region macros
141 * @ingroup device-mmio
163 * Example for a driver named "foo":
175 * No build-time initialization of this memory is necessary; it
188 * Return a pointer to the RAM-based storage area for a device's MMIO
197 #define DEVICE_MMIO_RAM_PTR(device) (mm_reg_t *)((device)->data)
216 * Example for a driver named "foo":
233 * Return a pointer to the ROM-based storage area for a device's MMIO
242 ((struct z_device_mmio_rom *)((dev)->config))
247 * Initialize MMIO-related information within a specific instance of
250 * Example for a driver belonging to the "foo" subsystem:
288 DEVICE_MMIO_ROM_PTR(dev)->phys_addr, \
289 DEVICE_MMIO_ROM_PTR(dev)->size, \
301 * build time, and we can store this in device->config, residing in ROM.
304 * because they need to be memory-mapped into the address space, enumerated
307 * This macro returns the linear address of the driver's MMIO region.
309 * A call must have been made to device_map() in the driver init function.
317 #define DEVICE_MMIO_GET(dev) (DEVICE_MMIO_ROM_PTR(dev)->addr)
322 * @defgroup device-mmio-named Named MMIO region macros
323 * @ingroup device-mmio
346 * Example for a driver named "foo":
360 * No build-time initialization of this memory is necessary; it
376 * a properly typed pointer to the particular dev_data struct for this driver.
383 (&(DEV_DATA(dev)->name))
403 * Example for a driver named "foo":
408 * int bar;
424 * Return a pointer to the ROM-based storage area for a device's MMIO
429 * driver.
435 #define DEVICE_MMIO_NAMED_ROM_PTR(dev, name) (&(DEV_CFG(dev)->name))
440 * Initialize MMIO-related information within a specific instance of
443 * Example for an instance of a driver belonging to the "foo" subsystem
449 * bar = 7;
473 * Example for an instance of a driver belonging to the "foo" subsystem
474 * that will have two DT-defined regions named 'chip' and 'dale':
480 * reg-names = "chip", "dale";
489 * bar = 7;
517 * This should be called from the driver's init function, once for each
522 * and config structs for this driver.
536 (DEVICE_MMIO_NAMED_ROM_PTR((dev), name)->phys_addr), \
537 (DEVICE_MMIO_NAMED_ROM_PTR((dev), name)->size), \
555 * and config structs for this driver.
569 ((DEVICE_MMIO_NAMED_ROM_PTR((dev), name))->addr)
575 * @defgroup device-mmio-toplevel Top-level MMIO region macros
576 * @ingroup device-mmio
578 * For drivers which do not use Zephyr's driver model and do not
579 * associate struct device with a driver instance. Top-level storage
584 * Currently PCIe devices are not well-supported with this set of macros.
585 * Either use Zephyr's driver model for these kinds of devices, or
597 * @brief Declare top-level storage for MMIO information, global scope
599 * This is intended for drivers which do not use Zephyr's driver model
602 * Instead, this is a top-level declaration for the driver's C file.
607 * @param node_id Device-tree node identifier for this region
626 * Provide an extern reference to a top-level MMIO region
628 * If a top-level MMIO region defined with DEVICE_MMIO_DEFINE needs to be
634 * @param name Name of the top-level MMIO region
649 * @brief Declare top-level storage for MMIO information, static scope
651 * This is intended for drivers which do not use Zephyr's driver model
654 * Instead, this is a top-level declaration for the driver's C file.
657 * @param name Name of the top-level MMIO region
658 * @param node_id Device-tree node identifier for this region
686 * Return a pointer to the ROM-based storage area for a toplevel MMIO region.
696 * @brief Set up memory for a driver'sMMIO region
705 * This should be called once from the driver's init function.
711 * @param name Name of the top-level MMIO region
726 * @brief Obtain the MMIO address for a device declared top-level
730 * @param name Name of the top-level MMIO region