drivers: hwinfo: Initial hwinfo driver support for Renesas RA
Initial hwinfo driver support for Renesas RA Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
This commit is contained in:
parent
f64aa23eed
commit
0661d65689
3 changed files with 27 additions and 0 deletions
|
@ -26,6 +26,7 @@ zephyr_library_sources_ifdef(CONFIG_HWINFO_NRF hwinfo_nrf.c)
|
|||
zephyr_library_sources_ifdef(CONFIG_HWINFO_NUMAKER hwinfo_numaker.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_NUMAKER_RMC hwinfo_numaker_rmc.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_PSOC6 hwinfo_psoc6.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_RENESAS_RA hwinfo_renesas_ra.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_RPI_PICO hwinfo_rpi_pico.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_RW61X hwinfo_rw61x.c)
|
||||
zephyr_library_sources_ifdef(CONFIG_HWINFO_SAM hwinfo_sam.c)
|
||||
|
|
|
@ -273,4 +273,12 @@ config HWINFO_MAX32
|
|||
help
|
||||
Enable MAX32 hwinfo driver.
|
||||
|
||||
config HWINFO_RENESAS_RA
|
||||
bool "Renesas RA device ID"
|
||||
default y
|
||||
depends on SOC_FAMILY_RENESAS_RA
|
||||
select HWINFO_HAS_DRIVER
|
||||
help
|
||||
Enable RENESAS RA hwinfo driver
|
||||
|
||||
endif
|
||||
|
|
18
drivers/hwinfo/hwinfo_renesas_ra.c
Normal file
18
drivers/hwinfo/hwinfo_renesas_ra.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Renesas Electronics Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <soc.h>
|
||||
#include <zephyr/drivers/hwinfo.h>
|
||||
|
||||
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
|
||||
{
|
||||
bsp_unique_id_t const *unique_id = R_BSP_UniqueIdGet();
|
||||
size_t len = MIN(length, sizeof(unique_id->unique_id_bytes));
|
||||
|
||||
memcpy(buffer, &unique_id->unique_id_bytes[0], len);
|
||||
|
||||
return len;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue