Home
last modified time | relevance | path

Searched +full:dev +full:- +full:size (Results 1 – 25 of 898) sorted by relevance

12345678910>>...36

/Zephyr-latest/drivers/bbram/
Dbbram_emul.c3 * SPDX-License-Identifier: Apache-2.0
16 /** BBRAM size (Unit:bytes) */
17 int size; member
35 int bbram_emul_set_invalid(const struct device *dev, bool is_invalid) in bbram_emul_set_invalid() argument
37 struct bbram_emul_data *data = dev->data; in bbram_emul_set_invalid()
39 data->status.is_invalid = is_invalid; in bbram_emul_set_invalid()
43 int bbram_emul_set_standby_power_state(const struct device *dev, bool failure) in bbram_emul_set_standby_power_state() argument
45 struct bbram_emul_data *data = dev->data; in bbram_emul_set_standby_power_state()
47 data->status.standby_failure = failure; in bbram_emul_set_standby_power_state()
51 int bbram_emul_set_power_state(const struct device *dev, bool failure) in bbram_emul_set_power_state() argument
[all …]
Dbbram_npcx.c4 * SPDX-License-Identifier: Apache-2.0
22 #define DRV_STATUS(dev) \ argument
23 (*((volatile uint8_t *)((const struct bbram_npcx_config *)(dev)->config)->status_reg_addr))
25 static int get_bit_and_reset(const struct device *dev, int mask) in get_bit_and_reset() argument
27 int result = DRV_STATUS(dev) & mask; in get_bit_and_reset()
35 DRV_STATUS(dev) &= ~mask; in get_bit_and_reset()
37 DRV_STATUS(dev) = mask; in get_bit_and_reset()
43 static int bbram_npcx_check_invalid(const struct device *dev) in bbram_npcx_check_invalid() argument
45 return get_bit_and_reset(dev, NPCX_STATUS_IBBR); in bbram_npcx_check_invalid()
48 static int bbram_npcx_check_standby_power(const struct device *dev) in bbram_npcx_check_standby_power() argument
[all …]
Dbbram_handlers.c4 * SPDX-License-Identifier: Apache-2.0
10 static inline int z_vrfy_bbram_check_invalid(const struct device *dev) in z_vrfy_bbram_check_invalid() argument
12 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); in z_vrfy_bbram_check_invalid()
13 return z_impl_bbram_check_invalid(dev); in z_vrfy_bbram_check_invalid()
17 static inline int z_vrfy_bbram_check_standby_power(const struct device *dev) in z_vrfy_bbram_check_standby_power() argument
19 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); in z_vrfy_bbram_check_standby_power()
20 return z_impl_bbram_check_standby_power(dev); in z_vrfy_bbram_check_standby_power()
24 static inline int z_vrfy_bbram_check_power(const struct device *dev) in z_vrfy_bbram_check_power() argument
26 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); in z_vrfy_bbram_check_power()
27 return z_impl_bbram_check_power(dev); in z_vrfy_bbram_check_power()
[all …]
Dbbram_xec.c4 * SPDX-License-Identifier: Apache-2.0
21 /** BBRAM size (Unit:bytes) */
22 int size; member
25 static int bbram_xec_check_invalid(const struct device *dev) in bbram_xec_check_invalid() argument
30 if (regs->PFRS & BIT(MCHP_VBATR_PFRS_VBAT_RST_POS)) { in bbram_xec_check_invalid()
31 regs->PFRS |= BIT(MCHP_VBATR_PFRS_VBAT_RST_POS); in bbram_xec_check_invalid()
33 return -EFAULT; in bbram_xec_check_invalid()
39 static int bbram_xec_get_size(const struct device *dev, size_t *size) in bbram_xec_get_size() argument
41 const struct bbram_xec_config *dcfg = dev->config; in bbram_xec_get_size()
43 *size = dcfg->size; in bbram_xec_get_size()
[all …]
Dbbram_it8xxx2.c4 * SPDX-License-Identifier: Apache-2.0
37 static int bbram_it8xxx2_read(const struct device *dev, size_t offset, size_t size, uint8_t *data) in bbram_it8xxx2_read() argument
39 const struct bbram_it8xxx2_config *config = dev->config; in bbram_it8xxx2_read()
41 if (size < 1 || offset + size > config->size) { in bbram_it8xxx2_read()
42 return -EINVAL; in bbram_it8xxx2_read()
45 bytecpy(data, ((uint8_t *)config->base_addr + offset), size); in bbram_it8xxx2_read()
49 static int bbram_it8xxx2_write(const struct device *dev, size_t offset, size_t size, in bbram_it8xxx2_write() argument
52 const struct bbram_it8xxx2_config *config = dev->config; in bbram_it8xxx2_write()
54 if (size < 1 || offset + size > config->size) { in bbram_it8xxx2_write()
55 return -EINVAL; in bbram_it8xxx2_write()
[all …]
/Zephyr-latest/include/zephyr/drivers/
Dretained_mem.h4 * SPDX-License-Identifier: Apache-2.0
28 "Size of off_t must be equal or less than size of size_t");
41 * @brief Callback API to get size of retained memory area.
44 typedef ssize_t (*retained_mem_size_api)(const struct device *dev);
51 typedef int (*retained_mem_read_api)(const struct device *dev, off_t offset, uint8_t *buffer,
52 size_t size);
59 typedef int (*retained_mem_write_api)(const struct device *dev, off_t offset,
60 const uint8_t *buffer, size_t size);
67 typedef int (*retained_mem_clear_api)(const struct device *dev);
74 * non-initialised RAM region, or in specific registers, but is not reset when a different
[all …]
Dbbram.h4 * SPDX-License-Identifier: Apache-2.0
31 typedef int (*bbram_api_check_invalid_t)(const struct device *dev);
39 typedef int (*bbram_api_check_standby_power_t)(const struct device *dev);
47 typedef int (*bbram_api_check_power_t)(const struct device *dev);
51 * @brief API template to check the size of the BBRAM
55 typedef int (*bbram_api_get_size_t)(const struct device *dev, size_t *size);
63 typedef int (*bbram_api_read_t)(const struct device *dev, size_t offset, size_t size,
72 typedef int (*bbram_api_write_t)(const struct device *dev, size_t offset, size_t size,
87 * Check if "Invalid Battery-Backed RAM" status is set then reset the status bit. This may occur as
90 * @param[in] dev BBRAM device pointer.
[all …]
Dsyscon.h4 * SPDX-License-Identifier: Apache-2.0
36 typedef int (*syscon_api_get_base)(const struct device *dev, uintptr_t *addr);
43 typedef int (*syscon_api_read_reg)(const struct device *dev, uint16_t reg, uint32_t *val);
50 typedef int (*syscon_api_write_reg)(const struct device *dev, uint16_t reg, uint32_t val);
53 * API template to get the size of the syscon register.
57 typedef int (*syscon_api_get_size)(const struct device *dev, size_t *size);
72 * @param dev The device to get the register size for.
76 __syscall int syscon_get_base(const struct device *dev, uintptr_t *addr);
78 static inline int z_impl_syscon_get_base(const struct device *dev, uintptr_t *addr) in z_impl_syscon_get_base() argument
80 const struct syscon_driver_api *api = (const struct syscon_driver_api *)dev->api; in z_impl_syscon_get_base()
[all …]
Dcellular.h5 * SPDX-License-Identifier: Apache-2.0
52 /** Size of bands */
53 uint16_t size; member
89 typedef int (*cellular_api_configure_networks)(const struct device *dev,
91 uint8_t size);
94 typedef int (*cellular_api_get_supported_networks)(const struct device *dev,
96 uint8_t *size);
99 typedef int (*cellular_api_get_signal)(const struct device *dev,
103 typedef int (*cellular_api_get_modem_info)(const struct device *dev,
105 char *info, size_t size);
[all …]
Dflash.h2 * Copyright (c) 2017-2024 Nordic Semiconductor ASA
5 * SPDX-License-Identifier: Apache-2.0
36 size_t pages_count; /* count of pages sequence of the same size */
60 /** Minimal write alignment and size */
85 #define FLASH_ERASE_CAPS_UNSET (int)-1
110 return (p->caps.no_explicit_erase) ? 0 : FLASH_ERASE_C_EXPLICIT; in flash_params_get_erase_cap()
128 typedef int (*flash_api_read)(const struct device *dev, off_t offset,
135 * the driver, with the driver responsible for ensuring the "write-protect"
136 * after the operation completes (successfully or not) matches the write-protect
139 typedef int (*flash_api_write)(const struct device *dev, off_t offset,
[all …]
/Zephyr-latest/drivers/retained_mem/
Dretained_mem_nrf_gpregret.c4 * SPDX-License-Identifier: Apache-2.0
27 size_t size; member
30 static inline void nrf_gpregret_lock_take(const struct device *dev) in nrf_gpregret_lock_take() argument
33 struct nrf_gpregret_data *data = dev->data; in nrf_gpregret_lock_take()
35 k_mutex_lock(&data->lock, K_FOREVER); in nrf_gpregret_lock_take()
37 ARG_UNUSED(dev); in nrf_gpregret_lock_take()
41 static inline void nrf_gpregret_lock_release(const struct device *dev) in nrf_gpregret_lock_release() argument
44 struct nrf_gpregret_data *data = dev->data; in nrf_gpregret_lock_release()
46 k_mutex_unlock(&data->lock); in nrf_gpregret_lock_release()
48 ARG_UNUSED(dev); in nrf_gpregret_lock_release()
[all …]
Dretained_mem_zephyr_reg.c5 * SPDX-License-Identifier: Apache-2.0
28 size_t size; member
31 static inline void zephyr_retained_mem_reg_lock_take(const struct device *dev) in zephyr_retained_mem_reg_lock_take() argument
34 struct zephyr_retained_mem_reg_data *data = dev->data; in zephyr_retained_mem_reg_lock_take()
36 k_mutex_lock(&data->lock, K_FOREVER); in zephyr_retained_mem_reg_lock_take()
38 ARG_UNUSED(dev); in zephyr_retained_mem_reg_lock_take()
42 static inline void zephyr_retained_mem_reg_lock_release(const struct device *dev) in zephyr_retained_mem_reg_lock_release() argument
45 struct zephyr_retained_mem_reg_data *data = dev->data; in zephyr_retained_mem_reg_lock_release()
47 k_mutex_unlock(&data->lock); in zephyr_retained_mem_reg_lock_release()
49 ARG_UNUSED(dev); in zephyr_retained_mem_reg_lock_release()
[all …]
Dretained_mem_zephyr_ram.c4 * SPDX-License-Identifier: Apache-2.0
27 size_t size; member
30 static inline void zephyr_retained_mem_ram_lock_take(const struct device *dev) in zephyr_retained_mem_ram_lock_take() argument
33 struct zephyr_retained_mem_ram_data *data = dev->data; in zephyr_retained_mem_ram_lock_take()
35 k_mutex_lock(&data->lock, K_FOREVER); in zephyr_retained_mem_ram_lock_take()
37 ARG_UNUSED(dev); in zephyr_retained_mem_ram_lock_take()
41 static inline void zephyr_retained_mem_ram_lock_release(const struct device *dev) in zephyr_retained_mem_ram_lock_release() argument
44 struct zephyr_retained_mem_ram_data *data = dev->data; in zephyr_retained_mem_ram_lock_release()
46 k_mutex_unlock(&data->lock); in zephyr_retained_mem_ram_lock_release()
48 ARG_UNUSED(dev); in zephyr_retained_mem_ram_lock_release()
[all …]
Dretained_mem_handlers.c4 * SPDX-License-Identifier: Apache-2.0
10 static inline ssize_t z_vrfy_retained_mem_size(const struct device *dev) in z_vrfy_retained_mem_size() argument
12 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); in z_vrfy_retained_mem_size()
13 return z_impl_retained_mem_size(dev); in z_vrfy_retained_mem_size()
17 static inline int z_vrfy_retained_mem_read(const struct device *dev, off_t offset, in z_vrfy_retained_mem_read() argument
18 uint8_t *buffer, size_t size) in z_vrfy_retained_mem_read() argument
20 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); in z_vrfy_retained_mem_read()
21 K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, size)); in z_vrfy_retained_mem_read()
22 return z_impl_retained_mem_read(dev, offset, buffer, size); in z_vrfy_retained_mem_read()
26 static inline int z_vrfy_retained_mem_write(const struct device *dev, off_t offset, in z_vrfy_retained_mem_write() argument
[all …]
/Zephyr-latest/drivers/flash/
Dflash_npcx_fiu_nor.c4 * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/dt-bindings/flash_controller/npcx_fiu_qspi.h>
35 /* Size of nor device in bytes, from size property */
37 /* Maximum chip erase time-out in ms */
48 /* Specific control operation for Quad-SPI Nor Flash */
63 static inline bool is_within_region(off_t addr, size_t size, off_t region_start, in is_within_region() argument
68 ((addr + size) <= (region_start + region_size))); in is_within_region()
71 static int flash_npcx_uma_transceive(const struct device *dev, struct npcx_uma_cfg *cfg, in flash_npcx_uma_transceive() argument
74 const struct flash_npcx_nor_config *config = dev->config; in flash_npcx_uma_transceive()
75 struct flash_npcx_nor_data *data = dev->data; in flash_npcx_uma_transceive()
[all …]
Dflash_handlers.c5 * SPDX-License-Identifier: Apache-2.0
11 static inline int z_vrfy_flash_read(const struct device *dev, off_t offset, in z_vrfy_flash_read() argument
14 K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read)); in z_vrfy_flash_read()
16 return z_impl_flash_read((const struct device *)dev, offset, in z_vrfy_flash_read()
22 static inline int z_vrfy_flash_write(const struct device *dev, off_t offset, in z_vrfy_flash_write() argument
25 K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, write)); in z_vrfy_flash_write()
27 return z_impl_flash_write((const struct device *)dev, offset, in z_vrfy_flash_write()
32 static inline int z_vrfy_flash_erase(const struct device *dev, off_t offset, in z_vrfy_flash_erase() argument
33 size_t size) in z_vrfy_flash_erase() argument
35 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH)); in z_vrfy_flash_erase()
[all …]
Dflash_gecko.c4 * SPDX-License-Identifier: Apache-2.0
33 static bool write_range_is_valid(off_t offset, uint32_t size);
34 static bool read_range_is_valid(off_t offset, uint32_t size);
35 static int erase_flash_block(off_t offset, size_t size);
38 static int flash_gecko_read(const struct device *dev, off_t offset, in flash_gecko_read() argument
40 size_t size) in flash_gecko_read() argument
42 if (!read_range_is_valid(offset, size)) { in flash_gecko_read()
43 return -EINVAL; in flash_gecko_read()
46 if (!size) { in flash_gecko_read()
50 memcpy(data, (uint8_t *)CONFIG_FLASH_BASE_ADDRESS + offset, size); in flash_gecko_read()
[all …]
Dnrf_qspi_nor.c2 * Copyright (c) 2019-2024, Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
50 /* Size from devicetree, in bytes */
51 uint32_t size; member
63 /* instance 0 flash size in bytes */
66 #elif DT_INST_NODE_HAS_PROP(0, size)
67 #define INST_0_BYTES (DT_INST_PROP(0, size) / 8)
69 #error "No size specified. 'size' or 'size-in-bytes' must be set"
72 BUILD_ASSERT(!(DT_INST_NODE_HAS_PROP(0, size_in_bytes) && DT_INST_NODE_HAS_PROP(0, size)),
73 "Node " DT_NODE_PATH(DT_DRV_INST(0)) " has both size and size-in-bytes "
[all …]
Dflash_andes_qspi.c4 * SPDX-License-Identifier: Apache-2.0
34 #define flash_andes_qspi_cmd_read(dev, opcode, dest, length) \ argument
35 flash_andes_qspi_access(dev, opcode, 0, 0, dest, length)
36 #define flash_andes_qspi_cmd_addr_read(dev, opcode, addr, dest, length) \ argument
37 flash_andes_qspi_access(dev, opcode, ANDES_ACCESS_ADDRESSED, addr, \
39 #define flash_andes_qspi_cmd_write(dev, opcode) \ argument
40 flash_andes_qspi_access(dev, opcode, ANDES_ACCESS_WRITE, 0, NULL, 0)
41 #define flash_andes_qspi_cmd_addr_write(dev, opcode, addr, src, length) \ argument
42 flash_andes_qspi_access(dev, opcode, \
86 static int flash_andes_qspi_write_protection_set(const struct device *dev,
[all …]
Dflash_si32.c4 * SPDX-License-Identifier: Apache-2.0
44 static bool flash_si32_valid_range(off_t offset, uint32_t size, bool write) in flash_si32_valid_range() argument
50 if ((offset > SOC_NV_FLASH_SIZE) || ((offset + size) > SOC_NV_FLASH_SIZE)) { in flash_si32_valid_range()
56 return -EINVAL; in flash_si32_valid_range()
59 if ((size % SOC_NV_FLASH_WRITE_BLOCK_SIZE) != 0) { in flash_si32_valid_range()
60 return -EINVAL; in flash_si32_valid_range()
67 static int flash_si32_read(const struct device *dev, off_t offset, void *data, size_t size) in flash_si32_read() argument
69 if (!flash_si32_valid_range(offset, size, false)) { in flash_si32_read()
70 return -EINVAL; in flash_si32_read()
73 if (!size) { in flash_si32_read()
[all …]
/Zephyr-latest/include/zephyr/retention/
Dretention.h4 * SPDX-License-Identifier: Apache-2.0
35 typedef ssize_t (*retention_size_api)(const struct device *dev);
36 typedef int (*retention_is_valid_api)(const struct device *dev);
37 typedef int (*retention_read_api)(const struct device *dev, off_t offset, uint8_t *buffer,
38 size_t size);
39 typedef int (*retention_write_api)(const struct device *dev, off_t offset,
40 const uint8_t *buffer, size_t size);
41 typedef int (*retention_clear_api)(const struct device *dev);
44 retention_size_api size; member
52 * @brief Returns the size of the retention area.
[all …]
/Zephyr-latest/drivers/syscon/
Dsyscon.c4 * SPDX-License-Identifier: Apache-2.0
27 size_t size; member
30 static int syscon_generic_get_base(const struct device *dev, uintptr_t *addr) in syscon_generic_get_base() argument
32 if (!dev) { in syscon_generic_get_base()
33 return -ENODEV; in syscon_generic_get_base()
36 *addr = DEVICE_MMIO_GET(dev); in syscon_generic_get_base()
40 static int syscon_generic_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) in syscon_generic_read_reg() argument
46 if (!dev) { in syscon_generic_read_reg()
47 return -ENODEV; in syscon_generic_read_reg()
50 data = dev->data; in syscon_generic_read_reg()
[all …]
/Zephyr-latest/include/zephyr/drivers/pcie/endpoint/
Dpcie_ep.h8 * SPDX-License-Identifier: Apache-2.0
23 PCIE_OB_LOWMEM, /**< PCIe OB window within 32-bit address range */
24 PCIE_OB_HIGHMEM, /**< PCIe OB window above 32-bit address range */
50 * interrupt-safe APIS. Registration of callbacks is done via
60 int (*conf_read)(const struct device *dev, uint32_t offset,
62 void (*conf_write)(const struct device *dev, uint32_t offset,
64 int (*map_addr)(const struct device *dev, uint64_t pcie_addr,
65 uint64_t *mapped_addr, uint32_t size,
67 void (*unmap_addr)(const struct device *dev, uint64_t mapped_addr);
68 int (*raise_irq)(const struct device *dev,
[all …]
/Zephyr-latest/drivers/cache/
Dcache_aspeed.c4 * SPDX-License-Identifier: Apache-2.0
14 * 0: no-cache
28 #define CACHED_SRAM_END (CACHED_SRAM_ADDR + CACHED_SRAM_SIZE - 1)
40 /* cache size = 32B * 128 = 4KB */
52 const struct device *const dev = DEVICE_DT_GET(DT_NODELABEL(syscon)); in aspeed_cache_init() local
55 /* set all cache areas to no-cache by default */ in aspeed_cache_init()
56 syscon_write_reg(dev, CACHE_FUNC_CTRL_REG, 0); in aspeed_cache_init()
59 max_bit = 8 * sizeof(uint32_t) - 1; in aspeed_cache_init()
62 syscon_write_reg(dev, CACHE_AREA_CTRL_REG, GENMASK(end_bit, start_bit)); in aspeed_cache_init()
65 syscon_write_reg(dev, CACHE_FUNC_CTRL_REG, CACHE_ENABLE); in aspeed_cache_init()
[all …]
/Zephyr-latest/include/zephyr/drivers/uart/
Dserial_test.h4 * SPDX-License-Identifier: Apache-2.0
26 * @param dev Address of virtual serial port.
28 * @param size Data size (in bytes).
32 int serial_vnd_queue_in_data(const struct device *dev, const unsigned char *data, uint32_t size);
35 * @brief Returns size of unread written data.
37 * @param dev Address of virtual serial port.
39 * @return Output data size (in bytes).
41 uint32_t serial_vnd_out_data_size_get(const struct device *dev);
55 * @param dev Address of virtual serial port.
57 * @param size Data size (in bytes).
[all …]

12345678910>>...36