aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-02-02parisc: Add Linux TER16x32 font to STI firmwareHelge Deller4-3/+2084
The new 16x32 font can be selected as default firmware font with this Qemu option: -fw_cfg opt/font,string=2 Any other values will choose the current HP 8x16 font. Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-12parisc: Add opt/console fw_cfg option to select default consoleHelge Deller1-4/+24
By default the firmware will choose the (virtual) graphics card as firmware console if the graphics card is available. If not it defaults to serial console. In some configurations it's useful to select the serial console als default output device even if the graphics card is available. For that, this patch adds the opt/console fw_cfg qemu option. Qemu option usage to switch the firmare to use the serial or graphics default output: -fw_cfg opt/console,string=serial -fw_cfg opt/console,string=graphics Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-12parisc: Warn if CONFIG_PARISC is not enabledHelge Deller1-0/+3
Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-12parisc: Allow 16 CPUsHelge Deller2-5/+9
Move the HPA for MEMORY_HPA out of the address space of the 16th CPU, and fix the PDC_COPROC_CFG PDC function to report functional FPUs for all configured CPUs. The documentation specifies that cr10 can only report for 8 CPUs, but that seems outdated as both HP-UX 10 and HP-UX 11 accepts this change. Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-11parisc: Leave IRQs disabled after rendevouzHelge Deller1-2/+1
And only enable the timer IRQ for wakeup (not all). Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-06parisc: Add TOC button supportHelge Deller4-10/+279
Add support for an emulated TOC/NMI button. Almost all PA-RISC machines have either a button that is labeled with 'TOC' or a BMC/GSP function to trigger a TOC. TOC is a non-maskable interrupt that is sent to the processor. This can be used for diagnostic purposes like obtaining a stack trace/register dump or to enter KDB/KGDB in Linux. This patch adds support for such an emulated TOC button. This patch writes the CPU registers into PIM (processor internal memmory) for later analysis. It uses the CPU "shadow registers", the IAOQ-back and IASQ-back values are provided by qemu in r24/r25. This patch uses the new qemu aritificial opcode "getshadowregs" (0xfffdead2) which restores the original values of the shadow registers. To trigger a TOC, switch to the "qemu monitor" with Ctrl-A C, and type in the command "nmi". After the TOC started the OS-debugger, exit the qemu monitor with Ctrl-A C. Signed-off-by: Helge Deller <deller@gmx.de>
2022-01-02parisc: Add opt/hostid fw_cfg option to change hostidHelge Deller1-3/+7
Allow the user to select another hostid value. In HP/UX the "uname -i" command shows the number, and in Linux it's visible in the /proc/cpuinfo output. The default hostid number is 2006243326, any other value can be selected with this qemu command line option: -fw_cfg opt/hostid,string=334455 Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24parisc: Increase SEABIOS_HPPA_VERSION to version 2seabios-hppa-v2parisc-qemu-6hppa-target-2Helge Deller1-1/+1
This version adds fixes which allow choosing the primary boot device. Either via qemu bootindex parameter, e.g.: -device scsi-hd,drive=drive1,bus=scsi0.0,channel=0,scsi-id=6,lun=0,bootindex=1 -drive file=image.img,if=none,id=drive1 or via qemu boot order option to select the SCSI ID, e.g.: -boot order=g-m: machine implementation dependent drives (SCSI ID) where "g" means SCSI ID 0, "h" is SCSI ID 1 and so on. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24parisc: Add sha256.c sha512.c and ror() functionHelge Deller2-1/+6
Needed to cope with upstream changes. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24parisc: Document the fw_cfg opt/pdc_debug optionHelge Deller1-0/+1
Enable firmware debug info at startup with this option: -fw_cfg pdc_debug,string=<val> <val> is an integer with this bitmask: DEBUG_PDC 0x0001, enables debug info for PDC calls DEBUG_IODC 0x0002, enables debug info for IODC calls Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24parisc: Fix boot priority and malloc initializationsHelge Deller1-2/+6
Make the malloc area initialization the first step after bootup. It's important, because the first mallocs otherwise ends up in lower memory area (PAGE0 from parisc) which will gets overwritten later. That change fixes the fw_cfg() interface as well. Before that change fw_cfg got initialized and zeroed-out shortly later in the boot process. And now the initialization of the boot structures succeeds too, so we can run boot_init() directly after setting up malloc and fw_cfg, and the bootindex parameter from qemu suddenly works out of the box. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24boot: Fix qemu bootindex parameter on parisc architectureHelge Deller1-0/+4
On parisc qemu reports the main PCI bus as "/dino-pcihost" instead of "/pci@i0cf8". This is important when using the bootindex parameter for SCSI discs, because the seabios boot code uses this name as prefix when identifying and sorting the bootable discs. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24boot: Allow boot order=g-m option to choose boot SCSI IDHelge Deller1-1/+10
Add support to boot from a specific SCSI ID by mapping drives g-m to SCSI IDs 0-7, e.g. -boot order=g for SCSI ID 0, and -boot order=l for SCSI ID 5 Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24ata.c: Add missing endianess conversion functionsHelge Deller1-10/+10
PA-RISC is big endian. Add necessary endianess conversion functions to get disc detection correct. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24block.c: Allow PA-RISC to boot from ATA drivesHelge Deller1-1/+7
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 <deller@gmx.de>
2021-09-24boot.c: Add boot disc chooser for PA-RISCHelge Deller1-0/+48
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24string.c: reimplement mem*_far() functions for PA-RISCHelge Deller1-1/+26
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24parisc: Add PA-RISC related codeHelge Deller16-1/+5762
This patch adds the various drivers for PA-RISC. To build the parisc firmware enable CONFIG_PARISC and run "make parisc". Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24x86.h: Provide replacement functions for PA-RISCHelge Deller1-0/+6
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 <deller@gmx.de>
2021-09-24version.c: Mark version strings constHelge Deller1-2/+2
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24stacks.h: Provide replacement for thread functions when !CONFIG_THREADSHelge Deller1-2/+15
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 <deller@gmx.de>
2021-09-24sercon.c: Use SEROFF_IIR constantHelge Deller1-1/+1
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24romfile.c: return values are returned as little-endianHelge Deller1-1/+3
Convert from little-endian to host-endian when returning the value from romfile_loadint(). Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24output.c: Make printf() capable to print 64bit int valuesHelge Deller1-21/+23
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 Deller <deller@gmx.de>
2021-09-24output.c: Add PA-RISC specific output behaviourHelge Deller1-2/+10
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 <deller@gmx.de>
2021-09-24malloc.c: Implement a PA-RISC specific malloc()Helge Deller2-4/+8
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 <deller@gmx.de>
2021-09-24serialio.h: Add serial port adresses for PA-RISCHelge Deller1-0/+8
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24rtc.h: Add CMOS/RTC addresses for PA-RISCHelge Deller1-0/+7
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24pci.c: Add PCI ports for PA-RISC and access PCI bus in little-endianHelge Deller1-4/+9
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 <deller@gmx.de>
2021-09-24lsi-scsi.c: Convert SCSI script to little endianHelge Deller1-0/+4
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 <deller@gmx.de>
2021-09-24scsi: Add fields for specifying target and lun of SCSI devicesHelge Deller11-10/+14
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 <deller@gmx.de>
2021-09-24blockcmd.c: Prevent unaligned access crash on PA-RISCHelge Deller1-5/+8
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 that issue by using a temporary variable and copy it to the destination when finished. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24ata.h: Add ATA IDE port addresses for PA-RISCHelge Deller1-0/+8
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24ata.c: Allow to boot on PA-RISCHelge Deller1-1/+1
Fix linkage problem on PA-RISC, no functional change on x86. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24Add portaddr_t typedef to specify I/O port addressesHelge Deller6-31/+39
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 <deller@gmx.de>
2021-09-24shadow.c: Compile int3 inline assembly on x86 onlyHelge Deller1-0/+2
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24pciinit.c: Initialize PA-RISC Dino PCI chipHelge Deller1-6/+47
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 <deller@gmx.de>
2021-09-24paravirt.h: Add PORT_QEMU_CFG_CTL for pariscHelge Deller1-0/+7
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24font.c: Disable built-in x86 font on pariscHelge Deller1-0/+2
Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24farptr.h: Add FLATPTR* accessor functions for pariscHelge Deller1-1/+13
Add wrappers for the FLATPTR_* functions for the parisc architecture. Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24byteorder.h: Add endianess conversion functionsHelge Deller1-0/+74
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 <deller@gmx.de>
2021-09-24Drivers: Use get_bda_ptr() BDA accessorHelge Deller3-3/+3
Use the get_bda_ptr() accessor function instead of hardcoding with MAKE_FLATPTR(). Signed-off-by: Helge Deller <deller@gmx.de>
2021-09-24biosvar.h: Add accessors for various BIOS data areasHelge Deller1-0/+31
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[] array. 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 <deller@gmx.de>
2021-09-24Add config option for PA-RISC archHelge Deller1-16/+38
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 <deller@gmx.de>
2021-09-23tcgbios: Disable platform hierarchy in case of failureupstreamStefan Berger1-0/+1
In the rare case of a TPM 2 failure, disable the platform hierarchy after disabling the endorsement and owner hierarchies. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-30nvme: fix missing newline on sq full printAlex Martens via SeaBIOS1-1/+1
Signed-off-by: Alex Martens <alexmgit@protonmail.com>
2021-06-30tcgbios: Use The proper sha function for each PCR bankStefan Berger1-15/+43
Instead of just using sha1 for all PCR banks (and truncating the value or zero-padding it) use the proper hash function for each one of the banks. For unimplemented hashes, fill the buffer with 0xff. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-30Add implementations for sha256, sha384, and sha512Stefan Berger8-14/+479
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-30tcgbios: Fix details in log entriesStefan Berger1-2/+3
Fix two details of the logs: - Set the field 'SpecErrata' to 2 as required by specs. - Write the separator into the log entry's event field. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-09stacks: call check_irqs() after switch_next()Volker RĂ¼melin1-3/+2
In function run_thread() the function check_irqs() gets called after the thread switch for atomic handoff reasons. In yield() it's the other way round. If check_irqs() is called after run_thread() and check_irqs() is called before switch_next() in yield(), it can happen in a constructed case that a background thread runs twice without a check_irqs() call in between. Call check_irqs() after switch_next() in yield() to prevent this. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de>