diff --git a/configs/Kconfig b/configs/Kconfig index 4a9c2516a1..43e876f870 100644 --- a/configs/Kconfig +++ b/configs/Kconfig @@ -1764,6 +1764,22 @@ config BOARDCTL_RESET Architecture specific logic must provide the board_reset() interface. +config BOARDCTL_UNIQUEID + bool "Return board unique ID" + default n + ---help--- + Enables support for the BOARDIOC_UNIQUEID boardctl() command. + Architecture specific logic must provide the board_uniqueid() + interface. + +config BOARDCTL_UNIQUEID_SIZE + int "Size of the board unique ID (bytes)" + default 16 + depends on BOARDCTL_UNIQUEID + ---help--- + Provides the size of the memory buffer that must be provided by the + caller of board_uniqueid() in which to receive the board unique ID. + config BOARDCTL_SYMTAB bool "Enable symbol table interfaces" default n diff --git a/configs/boardctl.c b/configs/boardctl.c index b175cc6240..1898faf3d7 100644 --- a/configs/boardctl.c +++ b/configs/boardctl.c @@ -131,6 +131,23 @@ int boardctl(unsigned int cmd, uintptr_t arg) break; #endif +#ifdef CONFIG_BOARDCTL_UNIQUEID + /* CMD: BOARDIOC_UNIQUEID + * DESCRIPTION: Return a unique ID associated with the board (such + * as a serial number or a MAC address). + * ARG: A writable array of size CONFIG_BOARDCTL_UNIQUEID_SIZE + * in which to receive the board unique ID. + * DEPENDENCIES: Board logic must provide the board_uniqueid() + * interface. + */ + + case BOARDIOC_UNIQUEID: + { + ret = board_uniqueid((FAR uint8_t *)arg); + } + break; +#endif + #ifdef CONFIG_BOARDCTL_SYMTAB /* CMD: BOARDIOC_SYMTAB * DESCRIPTION: Select a symbol table