From 21bde1ecb6cecba1d2f0219a1b79c240bed78749 Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Thu, 8 Jul 2021 16:56:25 +1000 Subject: spapr: Fix implementation of Open Firmware client interface This addresses the comments from v22. The functional changes are (the VOF ones need retesting with Pegasos2): (VOF) setprop will start failing if the machine class callback did not handle it; (VOF) unit addresses are lowered in path_offset(); (SPAPR) /chosen/bootargs is initialized from kernel_cmdline if the client did not change it. Fixes: 5c991e5d4378 ("spapr: Implement Open Firmware client interface") Cc: BALATON Zoltan Signed-off-by: Alexey Kardashevskiy Message-Id: <20210708065625.548396-1-aik@ozlabs.ru> Tested-by: BALATON Zoltan Signed-off-by: David Gibson --- pc-bios/vof.bin | Bin 3784 -> 3456 bytes pc-bios/vof/ci.c | 2 +- pc-bios/vof/libc.c | 26 -------------------------- pc-bios/vof/main.c | 2 +- pc-bios/vof/vof.h | 2 -- 5 files changed, 2 insertions(+), 30 deletions(-) (limited to 'pc-bios') diff --git a/pc-bios/vof.bin b/pc-bios/vof.bin index 1ec670b..300cb7c 100755 Binary files a/pc-bios/vof.bin and b/pc-bios/vof.bin differ diff --git a/pc-bios/vof/ci.c b/pc-bios/vof/ci.c index 2b56050..fc4821b 100644 --- a/pc-bios/vof/ci.c +++ b/pc-bios/vof/ci.c @@ -69,7 +69,7 @@ static int call_ci(const char *service, int nargs, int nret, ...) } if (ci_entry((uint32_t)(&args)) < 0) { - return PROM_ERROR; + return -1; } return (nret > 0) ? args.args[nargs] : 0; diff --git a/pc-bios/vof/libc.c b/pc-bios/vof/libc.c index 00c10e6..fdbc30f 100644 --- a/pc-bios/vof/libc.c +++ b/pc-bios/vof/libc.c @@ -54,32 +54,6 @@ int memcmp(const void *ptr1, const void *ptr2, size_t n) return 0; } -void *memmove(void *dest, const void *src, size_t n) -{ - char *cdest; - const char *csrc; - int i; - - /* Do the buffers overlap in a bad way? */ - if (src < dest && src + n >= dest) { - /* Copy from end to start */ - cdest = dest + n - 1; - csrc = src + n - 1; - for (i = 0; i < n; i++) { - *cdest-- = *csrc--; - } - } else { - /* Normal copy is possible */ - cdest = dest; - csrc = src; - for (i = 0; i < n; i++) { - *cdest++ = *csrc++; - } - } - - return dest; -} - void *memset(void *dest, int c, size_t size) { unsigned char *d = (unsigned char *)dest; diff --git a/pc-bios/vof/main.c b/pc-bios/vof/main.c index 9fc30d2..0f0f6b4 100644 --- a/pc-bios/vof/main.c +++ b/pc-bios/vof/main.c @@ -6,7 +6,7 @@ void do_boot(unsigned long addr, unsigned long _r3, unsigned long _r4) register unsigned long r4 __asm__("r4") = _r4; register unsigned long r5 __asm__("r5") = (unsigned long) _prom_entry; - ((client *)(uint32_t)addr)(); + ((void (*)(void))(uint32_t)addr)(); } void entry_c(void) diff --git a/pc-bios/vof/vof.h b/pc-bios/vof/vof.h index 2d89580..5f12c07 100644 --- a/pc-bios/vof/vof.h +++ b/pc-bios/vof/vof.h @@ -10,11 +10,9 @@ typedef unsigned short uint16_t; typedef unsigned long uint32_t; typedef unsigned long long uint64_t; #define NULL (0) -#define PROM_ERROR (-1u) typedef unsigned long ihandle; typedef unsigned long phandle; typedef int size_t; -typedef void client(void); /* globals */ extern void _prom_entry(void); /* OF CI entry point (i.e. this firmware) */ -- cgit v1.1