mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 11:55:03 +00:00
arm64: zynqmp: Add support for SVD devices
SVDs are using different name which can't be handled via zynqmp_devices structure. That's why introduce zynqmp_detect_svd_name() which checks ID code for these devices and show proper name for them. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
ab09e16d5a
commit
ddf8deabc3
1 changed files with 27 additions and 1 deletions
|
@ -185,6 +185,32 @@ static const struct {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct {
|
||||||
|
u32 id;
|
||||||
|
char *name;
|
||||||
|
} zynqmp_svd_devices[] = {
|
||||||
|
{
|
||||||
|
.id = 0x04714093,
|
||||||
|
.name = "xck24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.id = 0x04724093,
|
||||||
|
.name = "xck26",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static char *zynqmp_detect_svd_name(u32 idcode)
|
||||||
|
{
|
||||||
|
u32 i;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(zynqmp_svd_devices); i++) {
|
||||||
|
if (zynqmp_svd_devices[i].id == (idcode & 0x0FFFFFFF))
|
||||||
|
return zynqmp_svd_devices[i].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
|
||||||
static char *zynqmp_get_silicon_idcode_name(void)
|
static char *zynqmp_get_silicon_idcode_name(void)
|
||||||
{
|
{
|
||||||
u32 i;
|
u32 i;
|
||||||
|
@ -219,7 +245,7 @@ static char *zynqmp_get_silicon_idcode_name(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i >= ARRAY_SIZE(zynqmp_devices))
|
if (i >= ARRAY_SIZE(zynqmp_devices))
|
||||||
return "unknown";
|
return zynqmp_detect_svd_name(idcode);
|
||||||
|
|
||||||
/* Add device prefix to the name */
|
/* Add device prefix to the name */
|
||||||
ret = snprintf(name, ZYNQMP_VERSION_SIZE, "zu%d",
|
ret = snprintf(name, ZYNQMP_VERSION_SIZE, "zu%d",
|
||||||
|
|
Loading…
Add table
Reference in a new issue