[SeaBIOS] [PATCH 10/31] Add portaddr_t typedef to specify I/O port addresses

2021-02-11 Thread Helge Deller
On x86 I/O ports are located below address 0x4000, while on PA-RISC I/O ports are allowed in the whole 32/64 bit address space. So, introduce a portaddr_t typedef which defaults to the current u16 type on x86 and to unsigned long on PA-RISC. Signed-off-by: Helge Deller --- src/hw/ata.c |

[SeaBIOS] [PATCH 11/31] ata.c: Allow to boot on PA-RISC

2021-02-11 Thread Helge Deller
Fix linkage problem on PA-RISC, no functional change on x86. Signed-off-by: Helge Deller --- src/hw/ata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hw/ata.c b/src/hw/ata.c index fb3b581..af44541 100644 --- a/src/hw/ata.c +++ b/src/hw/ata.c @@ -358,9 +358,9 @@

[SeaBIOS] [PATCH 03/31] Drivers: Use get_bda_ptr() BDA accessor

2021-02-11 Thread Helge Deller
Use the get_bda_ptr() accessor function instead of hardcoding with MAKE_FLATPTR(). Signed-off-by: Helge Deller --- src/block.c | 2 +- src/fw/csm.c | 2 +- src/post.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/block.c b/src/block.c index 1f600b8..ec02d76

[SeaBIOS] [PATCH 06/31] font.c: Disable built-in x86 font on parisc

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/font.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/font.c b/src/font.c index 67e5d46..24cd67f 100644 --- a/src/font.c +++ b/src/font.c @@ -7,6 +7,7 @@ * found at ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip * This font is

[SeaBIOS] [PATCH 09/31] shadow.c: Compile int3 inline assembly on x86 only

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/fw/shadow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fw/shadow.c b/src/fw/shadow.c index 4c627a8..2ea7205 100644 --- a/src/fw/shadow.c +++ b/src/fw/shadow.c @@ -204,5 +204,7 @@ qemu_reboot(void) outb(0x06, PORT_PCI_REBOOT); // Next

[SeaBIOS] [PATCH 20/31] output.c: Add PA-RISC specific output behaviour

2021-02-11 Thread Helge Deller
On PA-RISC call an own screenc() implementation which doesn't use int10, prevent the Intel-specific \r newline when printing \n and don't output to serial debug port. Signed-off-by: Helge Deller --- src/output.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git

[SeaBIOS] [PATCH 26/31] x86.h: Provide replacement functions for PA-RISC

2021-02-11 Thread Helge Deller
This header file is included from many places and provides low-level inline assembly functions used on the Intel CPU. On PA-RISC similiar functions exists, so provide replacement functions in an own header file and include that instead. Signed-off-by: Helge Deller --- src/x86.h | 6 ++ 1

[SeaBIOS] [PATCH 23/31] sercon.c: Use SEROFF_IIR constant

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/sercon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sercon.c b/src/sercon.c index 66a1f24..8ae1f9c 100644 --- a/src/sercon.c +++ b/src/sercon.c @@ -541,7 +541,7 @@ void sercon_setup(void) SET_IVT(0x10, FUNC16(entry_sercon));

[SeaBIOS] [PATCH 22/31] romfile.c: return values are returned as little-endian

2021-02-11 Thread Helge Deller
Convert from little-endian to host-endian when returning the value from romfile_loadint(). Signed-off-by: Helge Deller --- src/romfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/romfile.c b/src/romfile.c index b598274..64abe68 100644 --- a/src/romfile.c +++

[SeaBIOS] [PATCH 21/31] output.c: Make printf() capable to print 64bit int values

2021-02-11 Thread Helge Deller
On PA-RISC we want to print some numbers as 64-bits, so fix the bvprintf() function acordingly. On x86 printing integers was (and still is) limited to 32bit, probaby to avoid gcc to insert calls to __umoddi3 and __udivdi3 and thus getting undefined reference linker errors. Signed-off-by: Helge

[SeaBIOS] [PATCH 24/31] stacks.h: Provide replacement for thread functions when !CONFIG_THREADS

2021-02-11 Thread Helge Deller
Rearrange the thread functions and provide wrappers which evaluates to no code when !CONFIG_THREADS. The function call16_int() isn't used on PA-RISC, so replace it by an empty function call. Signed-off-by: Helge Deller --- src/stacks.h | 17 +++-- 1 file changed, 15 insertions(+),

[SeaBIOS] [PATCH 00/31] Add support for PA-RISC CPU target

2021-02-11 Thread Helge Deller
This patchset modifies SeaBIOS source code to be able to build a firmware for the PA-RISC CPU architecture. This firmware can then be used to boot a virtual PA-RISC machine with PA-Linux and HP/UX on QEMU. Where possible existing SeaBIOS drivers and infrastructure is reused. Since PA-RISC is

[SeaBIOS] [PATCH 05/31] farptr.h: Add FLATPTR* accessor functions for parisc

2021-02-11 Thread Helge Deller
Add wrappers for the FLATPTR_* functions for the parisc architecture. Signed-off-by: Helge Deller --- src/farptr.h | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/farptr.h b/src/farptr.h index 0a4db68..de6331a 100644 --- a/src/farptr.h +++ b/src/farptr.h

[SeaBIOS] [PATCH 01/31] Add config option for PA-RISC arch

2021-02-11 Thread Helge Deller
Add a config option to Kconfig to choose between building for Intel/AMD CPUs (x86) or HP PA-RISC CPUs (parisc/hppa). Add dependency for some config options based on the choosen architecture. Signed-off-by: Helge Deller --- src/Kconfig | 54 +

[SeaBIOS] [PATCH 04/31] byteorder.h: Add endianess conversion functions

2021-02-11 Thread Helge Deller
SeaBIOS until now only supported the little-endian x86 platform. PA-RISC is big endian, so add the necessary conversion functions depending on the architecture. Signed-off-by: Helge Deller --- src/byteorder.h | 74 + 1 file changed, 74

[SeaBIOS] [PATCH 02/31] biosvar.h: Add accessors for various BIOS data areas

2021-02-11 Thread Helge Deller
This patch adds or adjust the existing accessors to the various data areas in a x86 BIOS for usage with a PA-RISC BIOS. On PA-RISC the x86 areas are emulated as normal variables, stored in normal RAM and can be accessed directly. GET_IVT() and SET_IVT() are emulated by a static ivt_table[]

[SeaBIOS] [PATCH 18/31] serialio.h: Add serial port adresses for PA-RISC

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/hw/serialio.h | 8 1 file changed, 8 insertions(+) diff --git a/src/hw/serialio.h b/src/hw/serialio.h index e7df7df..2fef437 100644 --- a/src/hw/serialio.h +++ b/src/hw/serialio.h @@ -3,12 +3,20 @@ #include "types.h" // u16 +#if CONFIG_X86

[SeaBIOS] [PATCH 15/31] lsi-scsi.c: Convert SCSI script to little endian

2021-02-11 Thread Helge Deller
The lsi-scsi driver expects the SCSI script in little-endian format. Do this conversion on PA-RISC (which is big-endian). On x86 this conversion will be optimized away. Signed-off-by: Helge Deller --- src/hw/lsi-scsi.c | 4 1 file changed, 4 insertions(+) diff --git a/src/hw/lsi-scsi.c

[SeaBIOS] [PATCH 16/31] pci.c: Add PCI ports for PA-RISC and access PCI bus in little-endian

2021-02-11 Thread Helge Deller
Add the IO-Ports for the PCI bus on PA-RISC. The PCI bus is little-endian on x86 and PA-RISC, so add the necessary conversions for PA-RISC. Signed-off-by: Helge Deller --- src/hw/pci.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/hw/pci.c b/src/hw/pci.c

[SeaBIOS] [PATCH 17/31] rtc.h: Add CMOS/RTC addresses for PA-RISC

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/hw/rtc.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/hw/rtc.h b/src/hw/rtc.h index 252e73a..7bacc49 100644 --- a/src/hw/rtc.h +++ b/src/hw/rtc.h @@ -1,8 +1,15 @@ #ifndef __RTC_H #define __RTC_H +#if CONFIG_X86 #define PORT_CMOS_INDEX

[SeaBIOS] [PATCH 12/31] ata.h: Add ATA IDE port addresses for PA-RISC

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/hw/ata.h | 8 1 file changed, 8 insertions(+) diff --git a/src/hw/ata.h b/src/hw/ata.h index 36c333d..dff209a 100644 --- a/src/hw/ata.h +++ b/src/hw/ata.h @@ -29,10 +29,18 @@ int ata_process_op(struct disk_op_s *op); int ata_atapi_process_op(struct

[SeaBIOS] [PATCH 29/31] boot.c: Add boot disc chooser for PA-RISC

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/boot.c | 48 1 file changed, 48 insertions(+) diff --git a/src/boot.c b/src/boot.c index 1effd80..be0d734 100644 --- a/src/boot.c +++ b/src/boot.c @@ -790,6 +790,54 @@ interactive_bootmenu(void)

[SeaBIOS] [PATCH 31/31] ata.c: Add missing endianess conversion functions

2021-02-11 Thread Helge Deller
PA-RISC is big endian. Add necessary endianess conversion functions to get disc detection correct. Signed-off-by: Helge Deller --- src/hw/ata.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hw/ata.c b/src/hw/ata.c index af44541..5616360 100644

[SeaBIOS] [PATCH 30/31] block.c: Allow PA-RISC to boot from ATA drives

2021-02-11 Thread Helge Deller
Boot directly from ATA drive without going through the process_op_32() function. Additionally PA-RISC can read/write chunks from disk which are bigger than 64kb, so don't abort when this is tried. Signed-off-by: Helge Deller --- src/block.c | 8 +++- 1 file changed, 7 insertions(+), 1

[SeaBIOS] [PATCH 25/31] version.c: Mark version strings const

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/version.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.c b/src/version.c index a8a58cf..5049e8d 100644 --- a/src/version.c +++ b/src/version.c @@ -1,5 +1,5 @@ // Place build generated version into a C variable #include

[SeaBIOS] [PATCH 28/31] string.c: reimplement mem*_far() functions for PA-RISC

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/string.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/string.c b/src/string.c index adb8198..11a96f3 100644 --- a/src/string.c +++ b/src/string.c @@ -86,24 +86,33 @@ strcmp(const char *s1, const char *s2)

[SeaBIOS] [PATCH 13/31] blockcmd.c: Prevent unaligned access crash on PA-RISC

2021-02-11 Thread Helge Deller
The cdbcmd pointer given to scsi_fill_cmd() can point to an unaligned address. On x86 writing a 64-bit value to an unaligned address will succeed, while on PA-RISC the machine will stop with an unaligned access error (esp. since the fault handlers are not implemented in the firmware). Work around

[SeaBIOS] [PATCH 08/31] pciinit.c: Initialize PA-RISC Dino PCI chip

2021-02-11 Thread Helge Deller
Initialize the PA-RISC Dino PCI chip. On Dino, do not remap PCI IDE ports and allow PCI IO regions above address 0x4000. Signed-off-by: Helge Deller --- src/fw/pciinit.c | 53 ++-- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git

[SeaBIOS] [PATCH 14/31] scsi: Add fields for specifying target and lun of SCSI devices

2021-02-11 Thread Helge Deller
On PA-RISC it's possible to boot from various SCSI targets and LUNs. Add fields to the drive_s struct to be able to store those. Signed-off-by: Helge Deller --- src/block.h | 2 ++ src/hw/blockcmd.c| 4 +++- src/hw/blockcmd.h| 2 +- src/hw/esp-scsi.c| 2 +-

[SeaBIOS] [PATCH 19/31] malloc.c: Implement a PA-RISC specific malloc()

2021-02-11 Thread Helge Deller
On x86 mremap() is used to provide malloc'ed memory. This can't be used on PA-RISC, so provide an own malloc() implementation. Since PA-RISC is fully 32-/64-bit use "unsigned long" instead of "u32". Signed-off-by: Helge Deller --- src/malloc.c | 4 ++-- src/malloc.h | 8 ++-- 2 files

[SeaBIOS] [PATCH 07/31] paravirt.h: Add PORT_QEMU_CFG_CTL for parisc

2021-02-11 Thread Helge Deller
Signed-off-by: Helge Deller --- src/fw/paravirt.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/fw/paravirt.h b/src/fw/paravirt.h index 4e2e993..40ab3f5 100644 --- a/src/fw/paravirt.h +++ b/src/fw/paravirt.h @@ -46,10 +46,17 @@ static inline int runningOnKVM(void) { // Common