SoC information class.
More...
SoC information class.
Facts about the SoC, such as its unique ID, read from the block holding them.
uint8_t uid[16];
...
}
size_t pbl_socinfo_get_unique_id_size(const struct pbl_socinfo *si)
Get the size of the unique ID.
int pbl_socinfo_get_unique_id(const struct pbl_socinfo *si, void *buf, size_t len)
Read the unique ID.
const struct pbl_socinfo *const SOCINFO
The SoC.
◆ pbl_socinfo
◆ PBL_SOCINFO_DEFINE
| #define PBL_SOCINFO_DEFINE |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_uid |
|
) |
| |
Value:
.uid = _uid, \
}; \
PBL_DEVICE_REGISTER(sym, &sym.
dev)
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
struct pbl_device dev
Device.
Definition socinfo.h:32
SoC information.
Definition socinfo.h:30
Define the SoC information.
- Parameters
-
| sym | Symbol of the device. |
| _name | Name. |
| _uid | Cell of the unique ID, from PBL_NVMEM_CELL(). |
◆ pbl_socinfo_get_unique_id()
| int pbl_socinfo_get_unique_id |
( |
const struct pbl_socinfo * |
si, |
|
|
void * |
buf, |
|
|
size_t |
len |
|
) |
| |
Read the unique ID.
- Parameters
-
- Returns
- 0, -ENODEV if the device or its memory is not ready, -EINVAL if
buf is too small, or a negative errno from the memory.
◆ pbl_socinfo_get_unique_id_size()
| size_t pbl_socinfo_get_unique_id_size |
( |
const struct pbl_socinfo * |
si | ) |
|
Get the size of the unique ID.
- Parameters
-
- Returns
- Size of the unique ID, in bytes.
◆ SOCINFO