nm: add HW patch entry to board descriptor system
This commit is contained in:
parent
afd8dd8f1e
commit
0aee118629
|
|
@ -158,6 +158,9 @@ typedef enum _BD_Tags
|
|||
BD_Hmac_Sha1_4 = 31, /**< "Hash" -> SHA1 HMAC with 4 byte result */
|
||||
BD_Fpga_Info = 32, /**< "UInt32" -> FPGA type/location (0xTTPPRRRR TT=FPGA type, PP=Population location, RRRR=Reserved allways 0000) */
|
||||
|
||||
BD_BOM_Patch = 33, /**< "UInt8" -> Hardware BOM patch of the equipment (BOM changes, same PCB, not SW relevant) */
|
||||
BD_Prod_Variant_Name = 34, /**< "String" -> Product variant */
|
||||
|
||||
BD_Ui_Adapter_Type = 4096, /**< "UInt16" -> IV OG2 UI adapterboard type (0 = not present) */
|
||||
|
||||
BD_Pd_Module0 = 4100,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@
|
|||
static const BD_Context *bdctx_list; /* The board descriptor context */
|
||||
static size_t bdctx_count = 0;
|
||||
|
||||
void bd_register_context_list(const BD_Context *list, size_t count) {
|
||||
void bd_register_context_list(const BD_Context *list, size_t count)
|
||||
{
|
||||
bdctx_list = list;
|
||||
bdctx_count = count;
|
||||
}
|
||||
|
|
@ -87,7 +88,8 @@ exit1:
|
|||
return -1;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_string(bd_uint16_t tag, bd_uint_t index, char* pResult, bd_size_t bufLen ) {
|
||||
static bd_bool_t _get_string(bd_uint16_t tag, bd_uint_t index, char* pResult, bd_size_t bufLen )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -99,7 +101,8 @@ static bd_bool_t _get_string(bd_uint16_t tag, bd_uint_t index, char* pResult, bd
|
|||
return BD_FALSE;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_mac( bd_uint16_t tag, bd_uint_t index, bd_uint8_t pResult[6] ) {
|
||||
static bd_bool_t _get_mac( bd_uint16_t tag, bd_uint_t index, bd_uint8_t pResult[6] )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -111,7 +114,8 @@ static bd_bool_t _get_mac( bd_uint16_t tag, bd_uint_t index, bd_uint8_t pResult[
|
|||
return BD_FALSE;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_uint8( bd_uint16_t tag, bd_uint_t index, bd_uint8_t* pResult ) {
|
||||
static bd_bool_t _get_uint8( bd_uint16_t tag, bd_uint_t index, bd_uint8_t* pResult )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -123,7 +127,8 @@ static bd_bool_t _get_uint8( bd_uint16_t tag, bd_uint_t index, bd_uint8_t* pResu
|
|||
return BD_FALSE;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_uint16( bd_uint16_t tag, bd_uint_t index, bd_uint16_t* pResult ) {
|
||||
static bd_bool_t _get_uint16( bd_uint16_t tag, bd_uint_t index, bd_uint16_t* pResult )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -135,7 +140,8 @@ static bd_bool_t _get_uint16( bd_uint16_t tag, bd_uint_t index, bd_uint16_t* pRe
|
|||
return BD_FALSE;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_uint32( bd_uint16_t tag, bd_uint_t index, bd_uint32_t* pResult ) {
|
||||
static bd_bool_t _get_uint32( bd_uint16_t tag, bd_uint_t index, bd_uint32_t* pResult )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -147,7 +153,8 @@ static bd_bool_t _get_uint32( bd_uint16_t tag, bd_uint_t index, bd_uint32_t* pRe
|
|||
return BD_FALSE;
|
||||
}
|
||||
|
||||
static bd_bool_t _get_partition64( bd_uint16_t tag, bd_uint_t index, BD_PartitionEntry64 *pResult) {
|
||||
static bd_bool_t _get_partition64( bd_uint16_t tag, bd_uint_t index, BD_PartitionEntry64 *pResult)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bdctx_count; i++) {
|
||||
|
|
@ -171,8 +178,8 @@ int bd_get_prodname(char *prodname, size_t len)
|
|||
|
||||
void bd_get_hw_version(int* ver, int* rev)
|
||||
{
|
||||
// TODO: Warum static?
|
||||
static uint8_t hwver;
|
||||
// TODO: Warum static?
|
||||
static uint8_t hwver;
|
||||
static uint8_t hwrev;
|
||||
|
||||
if ( !_get_uint8( BD_Hw_Ver, 0, &hwver) )
|
||||
|
|
@ -185,6 +192,16 @@ void bd_get_hw_version(int* ver, int* rev)
|
|||
*rev = hwrev;
|
||||
}
|
||||
|
||||
void bd_get_hw_patch(int* patch)
|
||||
{
|
||||
uint8_t hwpatch;
|
||||
|
||||
if ( !_get_uint8( BD_BOM_Patch, 0, &hwpatch) )
|
||||
debug("%s() no Hw Patch found\n", __func__);
|
||||
|
||||
*patch = hwpatch;
|
||||
}
|
||||
|
||||
int bd_get_mac(int index, uint8_t *macaddr, size_t len)
|
||||
{
|
||||
if (len != 6) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@
|
|||
int bd_read(int bus_addr, int dev_addr);
|
||||
u8 bd_get_boot_partition(void);
|
||||
int bd_get_mac(uint index, u8 *mac_address, u32 len);
|
||||
int bd_get_hw_version(int* pVer, int* pRev);
|
||||
int bd_get_hw_version(int* ver, int* rev);
|
||||
void bd_get_hw_patch(int* patch);
|
||||
int bd_get_devicetree(char* devicetreename, size_t len);
|
||||
int bd_get_context(BD_Context *bdctx, uint32_t i2caddress, uint32_t offset);
|
||||
void bd_register_context_list(const BD_Context *list, size_t count);
|
||||
|
|
|
|||
Loading…
Reference in New Issue