[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 1/5] Misc VOF fixes
From: |
BALATON Zoltan |
Subject: |
[RFC PATCH 1/5] Misc VOF fixes |
Date: |
Sun, 06 Jun 2021 17:46:35 +0200 |
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/ppc/vof.c | 11 +++++++----
pc-bios/vof.bin | Bin 3784 -> 3784 bytes
pc-bios/vof/entry.S | 2 +-
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/vof.c b/hw/ppc/vof.c
index a283b7d251..ac95be9666 100644
--- a/hw/ppc/vof.c
+++ b/hw/ppc/vof.c
@@ -144,12 +144,15 @@ static uint32_t vof_finddevice(const void *fdt, uint32_t
nodeaddr)
char fullnode[VOF_MAX_PATH];
uint32_t ret = -1;
int offset;
+ gchar *p;
if (readstr(nodeaddr, fullnode, sizeof(fullnode))) {
return (uint32_t) ret;
}
- offset = fdt_path_offset(fdt, fullnode);
+ p = g_ascii_strdown(fullnode, -1);
+ offset = fdt_path_offset(fdt, p);
+ g_free(p);
if (offset >= 0) {
ret = fdt_get_phandle(fdt, offset);
}
@@ -160,14 +163,14 @@ static uint32_t vof_finddevice(const void *fdt, uint32_t
nodeaddr)
static const void *getprop(const void *fdt, int nodeoff, const char *propname,
int *proplen, bool *write0)
{
- const char *unit, *prop;
+ const char *unit, *prop = fdt_getprop(fdt, nodeoff, propname, proplen);
/*
* The "name" property is not actually stored as a property in the FDT,
* we emulate it by returning a pointer to the node's name and adjust
* proplen to include only the name but not the unit.
*/
- if (strcmp(propname, "name") == 0) {
+ if (!prop && strcmp(propname, "name") == 0) {
prop = fdt_get_name(fdt, nodeoff, proplen);
if (!prop) {
*proplen = 0;
@@ -193,7 +196,7 @@ static const void *getprop(const void *fdt, int nodeoff,
const char *propname,
if (write0) {
*write0 = false;
}
- return fdt_getprop(fdt, nodeoff, propname, proplen);
+ return prop;
}
static uint32_t vof_getprop(const void *fdt, uint32_t nodeph, uint32_t pname,
diff --git a/pc-bios/vof.bin b/pc-bios/vof.bin
index
7e4c3742deae3c1904f4b2bf03ef72576b12d532..1ec670be82134adcb5ae128732aff6e371281360
100755
GIT binary patch
delta 14
VcmX>hdqQ@D4kKgpW?jbFyZ|U11hoJF
delta 14
VcmX>hdqQ@D4kP31&AN=Uc>yYn1swnY
diff --git a/pc-bios/vof/entry.S b/pc-bios/vof/entry.S
index 569688714c..f8066775ec 100644
--- a/pc-bios/vof/entry.S
+++ b/pc-bios/vof/entry.S
@@ -30,7 +30,7 @@ ENTRY(_prom_entry)
bl prom_entry
nop
mtlr %r31
- ld %r31,104(%r1)
+ lwz %r31,104(%r1)
addi %r1,%r1,112
blr
--
2.21.4