[SeaBIOS] Possibility to merge the SeaBIOS-parisc tree?

2021-02-04 Thread Helge Deller
Dear SeaBIOS developers, a few years back I forked the SeaBIOS sources to create a SeaBIOS firmware for usage with the parisc/hppa architecture. This fork is on github: https://github.com/hdeller/seabios-hppa Main goal of this fork was to provide a firmware which can be used to boot a virtual

[SeaBIOS] Re: Possibility to merge the SeaBIOS-parisc tree?

2021-02-09 Thread Helge Deller
On 2/9/21 12:21 AM, Kevin O'Connor wrote: On Tue, Feb 02, 2021 at 03:31:56PM +0100, Helge Deller wrote: Dear SeaBIOS developers, a few years back I forked the SeaBIOS sources to create a SeaBIOS firmware for usage with the parisc/hppa architecture. This fork is on github: https://github.com

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

2021-03-03 Thread Helge Deller
Hi Kevin, On 2/24/21 2:23 AM, Kevin O'Connor wrote: On Thu, Feb 11, 2021 at 11:00:34PM +0100, Helge Deller wrote: 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

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

2021-02-16 Thread Helge Deller
On 2/12/21 12:37 PM, Valentine wrote:  > +#if CONFIG_X86 I understand that Helge adapted sources for PA-RISC, but will not it be more convenient to use #if CONFIG_PA_RISC So that by default SeaBIOS would compile as usual? You mean that I should exchange the logic? Sure, that's possible,

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

2021-02-16 Thread Helge Deller
On 2/16/21 2:35 PM, Valentine wrote: Hello, Helge! I meant, to use: #ifdef CONFIG_PA_RISC  // PA-RISC code #else  // x86 code #endif Then if CONFIG_PA_RISC is not defined, the compilation will go as before without the need of toolchain modification. Ok, understood. But, of course,

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

2021-02-16 Thread Helge Deller
* 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

[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

[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 +++ b

[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
is native 32/64-Bit, the various segment accessors are not needed and replaced by simple variable accesses. Helge Deller (31): Add config option for PA-RISC arch biosvar.h: Add accessors for various BIOS data areas Drivers: Use get_bda_ptr() BDA accessor byteorder.h: Add endianess

[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 insertions

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

2021-02-11 Thread Helge Deller
. Introduce a get_bda_ptr() inline function to return the address of the Bios Data Area (BDA). GET_BDA() and SET_BDA() are used to directly access variables from the BDA. GET_GLOBAL() is used to access variables directly. Signed-off-by: Helge Deller --- src/biosvar.h | 31

[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

[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 b

[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
that issue by using a temporary variable and copy it to the destination when finished. Signed-off-by: Helge Deller --- src/hw/blockcmd.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c index 6b6fea9..1b447ac 100644 --- a/src

[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 a/src/fw

[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 +- src/hw/lsi

[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 |

[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