openbios.git
3 months ago.github/workflows: add release.yml for generating an OpenBIOS release master
Mark Cave-Ayland [Sat, 19 Feb 2022 15:45:13 +0000 (15:45 +0000)] 
.github/workflows: add release.yml for generating an OpenBIOS release

This is a GitHub push action that builds OpenBIOS for all of the currently
supported architectures (amd64, sparc32, sparc64, ppc and x86) and a new
GitHub release consisting of an output zip file containing debug and release
binaries, along with the source in .tar.gz and .zip formats.

A release build is triggered by pushing a tag beginning with "v" indicating a
version number in contrast to pushing a branch.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 months ago.github/workflows: add main.yml for building OpenBIOS upon push
Mark Cave-Ayland [Sat, 19 Feb 2022 15:45:13 +0000 (15:45 +0000)] 
.github/workflows: add main.yml for building OpenBIOS upon push

This is a GitHub push action that builds OpenBIOS for all of the currently
supported architectures (amd64, sparc32, sparc64, ppc and x86) and generates
an output zip file containing debug and release binaries.

The output zip file is stored both as a build artifact (which has a maximum
lifetime of 90 days) and for upstream OpenBIOS builds a "latest" release is
added to the repository.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 months ago.github/workflows: add build-openbios-builder.yml action
Mark Cave-Ayland [Sat, 19 Feb 2022 15:45:13 +0000 (15:45 +0000)] 
.github/workflows: add build-openbios-builder.yml action

This is a GitHub manual action that generates a container image from
docker/Dockerfile.builder and pushes the result to
ghcr.io/openbios/openbios-builder:master for public use.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 months agodocker: introduce Dockerfile.builder for openbios-builder container
Mark Cave-Ayland [Sat, 19 Feb 2022 15:45:13 +0000 (15:45 +0000)] 
docker: introduce Dockerfile.builder for openbios-builder container

This introduces a new Dockerfile.builder file that can be used by docker
build to generate a container that can build OpenBIOS based upon Debian
11.2 and the crosstool compilers from kernel.org.

The installed cross-compilers allow the building of SPARC32, SPARC64 and
PPC binaries.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 months agoppc: Do not generate .stabs ELF sections to prevent GDB from choking on them
Glenn Washburn [Thu, 17 Feb 2022 19:13:22 +0000 (13:13 -0600)] 
ppc: Do not generate .stabs ELF sections to prevent GDB from choking on them

Recent versions of GDB (and probably older ones too, but not checked) crash
with and abort when loading the non-stripped 32-bit PPC QEMU build[1]. This
is due to a bug in GDB on reading stab symbols. The only place in OpenBIOS
where stab symbols are generated is in libgcc/crtsavres.S, which was copied
from the linux kernel[2].

Symbols that were defined in the stabs section are still able to be seen in
GDB after stabs removal. There does not appear to be a loss in debugging
functionality.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=28900
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/include/asm/ppc_asm.h?h=v5.17-rc4#n211

Signed-off-by: Glenn Washburn <development@efficientek.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 months agoarch/unix/unix.c: fix build on x86 architecture with modern gcc compilers
Mark Cave-Ayland [Tue, 8 Feb 2022 22:10:11 +0000 (22:10 +0000)] 
arch/unix/unix.c: fix build on x86 architecture with modern gcc compilers

Modern gcc compilers will fail to build x86 OpenBIOS failing with the error
message "libc/misc.c:20: multiple definition of `errno_int'" during link.

Since the accompanying comment mentions that the reason for adding the
definition is to allow compilation to succeed on OS X, surround it with
suitable #if defined(__APPLE__) ... #endif guards.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 months agoconfig/scripts/switch-arch: allow x86_64 prefix for x86 builds
Mark Cave-Ayland [Tue, 8 Feb 2022 22:10:11 +0000 (22:10 +0000)] 
config/scripts/switch-arch: allow x86_64 prefix for x86 builds

Modern 64-bit compilers with a gcc multilib-capable toolchain are easily able
to build x86 OpenBIOS. If the build is not gcc multilib-capable then the
build typically fails with the message "fatal error: sys/cdefs.h: No such file
or directory".

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 months agoppc: fix ciface_milliseconds using incorrect frequency for delay
Glenn Washburn [Mon, 31 Jan 2022 17:15:04 +0000 (11:15 -0600)] 
ppc: fix ciface_milliseconds using incorrect frequency for delay

Instead of using a constant frequency for all CPUs, use the processor timebase
frequency provided by QEMU. This fixes issues where delays from
ciface_milliseconds were not corresponding to elapsed time as given by the real
time clock on certain platforms, eg. QEMU's mac99 machine.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 months agocuda: fix get-time word
Glenn Washburn [Tue, 18 Jan 2022 21:52:23 +0000 (15:52 -0600)] 
cuda: fix get-time word

An extra byte is written after the CUDA_GET_TIME command causing the
command to return an incorrect time. Running QEMU with CUDA debug
messages on yields these messages:

  1177318@1642469573.070752:cuda_packet_receive length 3
  1177318@1642469573.070768:cuda_packet_receive_data [0] 0x01
  1177318@1642469573.070771:cuda_packet_receive_data [1] 0x03
  1177318@1642469573.070773:cuda_packet_receive_data [2] 0xfb
  1177318@1642469573.070776:cuda_receive_packet_cmd handling command
  GET_TIME CUDA: GET_TIME: wrong parameters 2

Fix the outgoing command length to remove the extra byte.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 months agoppc: Add PVRs for the MPC7450 family
Fabiano Rosas [Mon, 10 Jan 2022 14:26:48 +0000 (11:26 -0300)] 
ppc: Add PVRs for the MPC7450 family

This allows the processors from the 7450 family to pass the initial
PVR verification. Enables 7441, 7445, 7447, 7447a, 7450, 7451, 7455,
7457 and 7457a.

This should be used along with a QEMU that includes commit 1da666cd8e
("target/ppc: Disable software TLB for the 7450 family").

With Linux 5.15:

$ cd buildroot
$ make qemu_ppc_mac99_defconfig
$ make
$ qemu-system-ppc -m 1G -M mac99,via=pmu -cpu 7450 \
-kernel ./output/images/vmlinux \
-append root=/dev/sda \
-drive file=./output/images/rootfs.ext2,format=raw \
-net nic,model=sungem -net user -serial mon:stdio -nographic

>> =============================================================
>> OpenBIOS 1.1 [Jan 10 2022 13:27]
>> Configuration device id QEMU version 1 machine id 1
>> CPUs: 1
>> Memory: 1024M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,G4
(...)
Booting Linux via __start() @ 0x01000000 ...
(...)
Welcome to Buildroot
buildroot login:

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 months agodrivers: Spell QEMU all caps
Philippe Mathieu-Daudé [Fri, 19 Nov 2021 09:24:34 +0000 (10:24 +0100)] 
drivers: Spell QEMU all caps

Replace Qemu -> QEMU.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 months agodrivers/usb: Fix building with gcc 10.x
BALATON Zoltan [Sat, 6 Nov 2021 16:52:15 +0000 (17:52 +0100)] 
drivers/usb: Fix building with gcc 10.x

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
7 months agocuda: fix reset-all and power-off words
Mark Cave-Ayland [Sun, 19 Sep 2021 10:05:12 +0000 (11:05 +0100)] 
cuda: fix reset-all and power-off words

There is a long-standing bug in the CUDA implementation of the reset-all and
power-off words whereby an extra byte is written after the CUDA_RESET_SYSTEM
and CUDA_POWERDOWN commands.

This extra byte used to be ignored in QEMU until commits 017da0b568 ("cuda:
port POWERDOWN command to new framework") and 54e894442e ("cuda: port
RESET_SYSTEM command to new framework") added a check which rejects the
command if the command length is incorrect.

Fix the outgoing command length to remove the extra byte which allows the
reset-all and power-off words to work in QEMU once again.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/624

9 months agoescc: send software reset command before configuring the port
Mark Cave-Ayland [Thu, 2 Sep 2021 09:06:02 +0000 (10:06 +0100)] 
escc: send software reset command before configuring the port

According to the ESCC datasheet all register values are undetermined until an
explicit reset command is sent. This is required to fix an issue with QEMU's
ESCC device to ensure that the registers are set to default values if the
default power-on values are changed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
9 months agoescc: add port index to uart_init_line()
Mark Cave-Ayland [Thu, 2 Sep 2021 09:03:03 +0000 (10:03 +0100)] 
escc: add port index to uart_init_line()

This will be needed to allow uart_init_line() to reset the correct port.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
16 months agopci: Rename pci_xbox_blacklisted() as pci_xbox_ignore_device()
Philippe Mathieu-Daudé [Thu, 11 Feb 2021 14:42:44 +0000 (15:42 +0100)] 
pci: Rename pci_xbox_blacklisted() as pci_xbox_ignore_device()

In order to use inclusive terminology, rename pci_xbox_blacklisted()
as pci_xbox_ignore_device(), and remove an obvious comment.

Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
16 months ago40p: simplify IRQ swizzling
Philippe Mathieu-Daudé [Wed, 3 Feb 2021 11:56:23 +0000 (12:56 +0100)] 
40p: simplify IRQ swizzling

LSI SCSI on PReP is the unique particular case where we use
fixed IRQ routing. All other cases use regular IRQ swizzling.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
16 months ago40p: use is_apple() macro
Philippe Mathieu-Daudé [Wed, 3 Feb 2021 11:56:22 +0000 (12:56 +0100)] 
40p: use is_apple() macro

Simplify using the is_apple() macro.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
16 months ago40p: Allow Raven controller to handle all IRQs
Philippe Mathieu-Daudé [Wed, 3 Feb 2021 11:56:21 +0000 (12:56 +0100)] 
40p: Allow Raven controller to handle all IRQs

In commit ce7fa4d29b we adapted to match QEMU (invalid) code.
Now than QEMU has been fixed and handle the 4 IRQs, update the
OF device tree again.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
23 months agoPPC: mark first 4 pages of physical and virtual memory as unavailable github/master
Mark Cave-Ayland [Sat, 25 Jul 2020 09:00:22 +0000 (10:00 +0100)] 
PPC: mark first 4 pages of physical and virtual memory as unavailable

The Debian ports images have now switched from using yaboot to grub as their
bootloader. Recent versions of these images will hang rather than boot under
QEMU despite there being no obvious changes to the boot process.

Further investigation reveals that the second stage grub bootloader appears
to use low memory whilst loading the kernel/initrd from disk: unfortunately
the OpenBIOS vector table lives within the first few pages of physical RAM
and so grub writes over the vector table (in particular overwriting the MMU
fault handlers) causing them to fail next time they are executed which
causes the hang.

Fortunately just before this stage of the bootloader executes, it uses the
CIF to request the contents of the /memory node "available" property. It
seems that the low memory locations used by grub are taken from the start
of the available range, so we can simply increase the number of RAM pages
reserved at the bottom of RAM to ensure that the area chosen by the bootloader
doesn't conflict with the vector table.

This patch raises the start of available memory from 0x1000 to 0x4000 which
allows grub to boot successfully in my tests. According to dumps of device trees
taken from real PPC Macs there are already several examples where the start of
available memory is set to 0x3000 or 0x4000, so as this is already present on
real hardware it should not cause any regressions.

Finally it is worth noting that even in the earlier grub images I could see
write accesses to low memory that would overwrite the vector table: I think
that until recently we were lucky that they happened to avoid anything that
was critical to allow the kernel to load and boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
23 months agoSPARC: add implementation of addr word
Mark Cave-Ayland [Thu, 2 Jul 2020 19:33:45 +0000 (20:33 +0100)] 
SPARC: add implementation of addr word

OpenBSD uses the addr word to retrieve the address of several framebuffer
variables during initialisation. Provide an implementation of addr which
allows OpenBSD to initialise the framebuffer correctly on SPARC32 and SPARC64.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agovirtio: limit ring size to a maximum of 128 descriptor entries
Mark Cave-Ayland [Sat, 16 May 2020 13:01:31 +0000 (14:01 +0100)] 
virtio: limit ring size to a maximum of 128 descriptor entries

QEMU commit c9b7d9ec21 "virtio: increase virtqueue size for virtio-scsi and
virtio-blk" increased the number of queue descriptors from 128 to 256 which
caused OpenBIOS to fail when booting from a virtio-blk device under
qemu-system-ppc due to a memory overflow.

Update the virtio-blk driver so that it uses a maximum of 128 descriptor
entries (the previous value) to fix the issue, and also ensure that any
further increases in virtqueue size will not cause the same failure.

Note that this commit also fixes the vring_area size calculation which was
incorrectly based upon the number of virtqueues, and not the number of
descriptor entries.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: Enable bus-master on virtio_blk
Brandon Bergren [Wed, 13 May 2020 17:13:56 +0000 (12:13 -0500)] 
pci: Enable bus-master on virtio_blk

In qemu 9d7bd0826f2d19f88631ad7078662668148f7b5f, the behavior of vring
processing was changed to not run whenever bus-mastering is disabled.

Since we were never enabling it in the first place, OpenBIOS was no longer
able to access virtio disks on qemu.

Fix this by enabling bus-mastering before initializing.

Signed-off-by: Brandon Bergren <git@bdragon.rtk0.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoSPARC32: fix kernel and initrd mapping to match SILO
Mark Cave-Ayland [Sat, 25 Apr 2020 21:08:22 +0000 (22:08 +0100)] 
SPARC32: fix kernel and initrd mapping to match SILO

The previous attempt to fix this was wrong in that I misinterpreted what SILO was
doing: whilst it detects a free region of memory for the kernel/initrd, it simply
maps the areas at fixed addresses rather than allocating them.

Fixes: f633f31 "SPARC32: mark initrd memory as mapped and in use before booting kernel"
Fixes: c87d0eb "SPARC32: mark kernel memory as mapped"
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoSPARC64: fix kernel and initrd mapping to match SILO
Mark Cave-Ayland [Sat, 25 Apr 2020 12:34:33 +0000 (13:34 +0100)] 
SPARC64: fix kernel and initrd mapping to match SILO

The previous attempt to fix this was wrong in that I misinterpreted what SILO was
doing: whilst it detects a free region of memory for the kernel/initrd, it simply
maps the areas at fixed addresses rather than allocating them.

Fixes: 3464681 "SPARC64: mark initrd memory as mapped and in use before booting kernel"
Fixes: c21c366 "SPARC64: mark kernel memory as mapped and in use before booting kernel"
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoide: locate drives by iterating over the device tree during ob_ide_quiesce()
Mark Cave-Ayland [Tue, 22 Oct 2019 18:00:24 +0000 (19:00 +0100)] 
ide: locate drives by iterating over the device tree during ob_ide_quiesce()

It is now possible to locate IDE drives by searching the device tree for "block"
type devices containing a C drive instance variable. Rewrite ob_ide_quiesce() to
locate and quiesce IDE drives using this method which finally enables us to
remove the global IDE channels list and its remaining ide_add_channel() function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoide: use instance values to hold C drive and channel structures
Mark Cave-Ayland [Tue, 22 Oct 2019 18:00:24 +0000 (19:00 +0100)] 
ide: use instance values to hold C drive and channel structures

Rather than iterate over the global IDE channels list, use instance variables to
hold the relevant pointers. This allows us to remove ide_seek_channel() since
it is no longer necessary for each IDE device to iterate over the global list
in order to locate the drive/channel information.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoescc: explicitly mark variable containing incoming keyboard character as volatile
Mark Cave-Ayland [Thu, 17 Oct 2019 17:27:44 +0000 (18:27 +0100)] 
escc: explicitly mark variable containing incoming keyboard character as volatile

Otherwise the compiler may not understand that a read from the assigned buffer
is comming from memory-mapped IO space and fail to update accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoadmin/devices.fs: Format assigned-addresses property
BALATON Zoltan [Sun, 21 Jul 2019 01:37:26 +0000 (03:37 +0200)] 
admin/devices.fs: Format assigned-addresses property

To help reading property listing also format assigned-addresses
property the same way as reg was already formatted.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
2 years agovirtio: use instance value to initialise C instance parameter
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
virtio: use instance value to initialise C instance parameter

This simplifies the open word by avoiding having to locate and read the value
of the _vdev property.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agolsi: use instance value to hold sd_private_t pointer
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
lsi: use instance value to hold sd_private_t pointer

It is also possible to remove the global_lsi variable by adding a pointer to
the parent lsi_private_t instance within sd_private_t.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopc_kbd: use instance value to initialise C instance parameter
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pc_kbd: use instance value to initialise C instance parameter

This simplifies the open word by avoiding having to locate and read the value
of the address property.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopc_serial: remove separate init word
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pc_serial: remove separate init word

Instead use an instance value and initialise the C instance parameter within
the open word.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: call set-args before configuring PCI device nodes
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pci: call set-args before configuring PCI device nodes

This is to ensure that the my-space and my-address words are set correctly
for any PCI devices that wish to execute FCode.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: remove explicit setting of my-self from PCI devices
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pci: remove explicit setting of my-self from PCI devices

Since the correct current instance is now being set during probe, there is no
need to explicitly set it whilst creating the device.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: remove explicit find-device from PCI devices
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pci: remove explicit find-device from PCI devices

Since the correct active package is now being set during probe, there is no
need to explicitly find the parent node before creating the device.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agox86: set active package and current instance to root device node before probe
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
x86: set active package and current instance to root device node before probe

Now that all PCI devices have been converted to new-device...finish-device we can
set both the active package and current instance to the root device node before
probe, giving all child devices a correct active package and instance chain during
creation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoSPARC64: set active package and current instance to root device node before probe
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
SPARC64: set active package and current instance to root device node before probe

Now that all PCI devices have been converted to new-device...finish-device we can
set both the active package and current instance to the root device node before
probe, giving all child devices a correct active package and instance chain during
creation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoppc: set active package and current instance to root device node before probe
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
ppc: set active package and current instance to root device node before probe

Now that all PCI devices have been converted to new-device...finish-device we can
set both the active package and current instance to the root device node before
probe, giving all child devices a correct active package and instance chain during
creation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoppc: move New World uninorth and nvram device node creation to the root device
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
ppc: move New World uninorth and nvram device node creation to the root device

Whilst the NVRAM device node exists under the mac-io device node for Old World
Macs, both itself and the Uninorth device node exist under the root device node
on New World Macs.

Move creation of both device nodes to arch_of_init() for New World machines to
enable the active package and current instance to be set correctly during device
tree construction.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agonvram: ensure that NVRAM configuration is separate from NVRAM node creation
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
nvram: ensure that NVRAM configuration is separate from NVRAM node creation

As part of this separation we can also move "update-nvram" directly to the
NVRAM node bindings.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agolibopenbios: remove REGISTER_NAMED_NODE and REGISTER_NAMED_NODE_PHANDLE macros
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
libopenbios: remove REGISTER_NAMED_NODE and REGISTER_NAMED_NODE_PHANDLE macros

Now that we've removed all references to these binding macros they can be removed
completely.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: remove ob_pci_initialize() and ob_pci_empty_node
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pci: remove ob_pci_initialize() and ob_pci_empty_node

The ob_pci_initialize() function can be removed as it is empty, whilst
ob_pci_empty_node is no longer required since the existing fallback code
will always apply the ob_pci_simple_node bindings if no callback is
configured.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopci: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pci: convert to use BIND_NODE_METHODS() macro

Moving the setup of PCI devices to within a new-device...finish-device sequence
as part of the conversion further enables us to move the PCI host bridge
configuration logic from ob_pci_init() to ob_configure_pci_device() where it
belongs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agovirtio: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
virtio: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agolsi: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
lsi: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agolsi: don't change active package when setting device alias
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
lsi: don't change active package when setting device alias

When generating the DT based upon the active package and current instance, we
cannot change either when setting the alias. Instead look up the phandle and
then set the properties directly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agonvram: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
nvram: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agousbhid: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
usbhid: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopmu: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pmu: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agomacio: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
macio: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agocuda: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
cuda: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoescc: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
escc: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoadb: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
adb: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoide: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
ide: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agofloppy: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
floppy: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopc_serial: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pc_serial: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agopc_kbd: convert to use BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
pc_kbd: convert to use BIND_NODE_METHODS() macro

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agolibopenbios: introduce BIND_NODE_METHODS() macro
Mark Cave-Ayland [Sun, 18 Aug 2019 20:16:50 +0000 (21:16 +0100)] 
libopenbios: introduce BIND_NODE_METHODS() macro

This macro is designed to bind C functions into Forth words during creation
of the device tree, but only into an existing node and without attempting
to create any missing parent nodes.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoppc: reduce size of Forth dictionary to 384K
Mark Cave-Ayland [Fri, 16 Aug 2019 07:13:42 +0000 (08:13 +0100)] 
ppc: reduce size of Forth dictionary to 384K

gcc 9 emits a fatal error when building OpenBIOS for ppc because the size of the
generated image is greater than the available ROM area when building with -O0.

Reduce the size of the Forth dictionary from 512K to 384K to allow sufficient
space for generating OpenBIOS images suitable for debugging.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoall: gcc 9 build fixes
Mark Cave-Ayland [Fri, 16 Aug 2019 07:13:42 +0000 (08:13 +0100)] 
all: gcc 9 build fixes

Fix up warnings generated by building with -Werror under gcc 9.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoSPARC64: use serial console when QEMU is launched with -vga none
Mark Cave-Ayland [Sun, 23 Jun 2019 13:57:37 +0000 (14:57 +0100)] 
SPARC64: use serial console when QEMU is launched with -vga none

If no display device has been installed in the DT e.g. passing -vga none into
the QEMU command line then fall back to using the serial console as already
occurs when launching QEMU in -nographic mode.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agoSPARC32: use serial console when QEMU is launched with -vga none
Mark Cave-Ayland [Wed, 12 Jun 2019 19:29:26 +0000 (20:29 +0100)] 
SPARC32: use serial console when QEMU is launched with -vga none

If no display device has been installed in the DT e.g. passing -vga none into
the QEMU command line then fall back to using the serial console as already
occurs when launching QEMU in -nographic mode.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2 years agosbus: don't use internal fallback TCX driver with QEMU
Mark Cave-Ayland [Wed, 12 Jun 2019 19:23:57 +0000 (20:23 +0100)] 
sbus: don't use internal fallback TCX driver with QEMU

OpenBIOS SPARC32 has always maintained a fallback option of an internal TCX
driver if an FCode driver cannot be located on the TCX card itself.

Since QEMU's TCX adapter has supported FCode payloads for a long time then
we only require this logic for non-QEMU builds. Otherwise we unintentionally
install the fallback driver and device node even if the framebuffer card hasn't
been installed into the machine.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC64: mark initrd memory as mapped and in use before booting kernel
Mark Cave-Ayland [Fri, 25 Jan 2019 16:19:08 +0000 (16:19 +0000)] 
SPARC64: mark initrd memory as mapped and in use before booting kernel

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC64: mark kernel memory as mapped and in use before booting kernel
Mark Cave-Ayland [Fri, 25 Jan 2019 16:14:15 +0000 (16:14 +0000)] 
SPARC64: mark kernel memory as mapped and in use before booting kernel

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC32: mark initrd memory as mapped and in use before booting kernel
Mark Cave-Ayland [Fri, 25 Jan 2019 16:11:29 +0000 (16:11 +0000)] 
SPARC32: mark initrd memory as mapped and in use before booting kernel

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC32: mark kernel memory as mapped
Mark Cave-Ayland [Fri, 25 Jan 2019 17:16:16 +0000 (17:16 +0000)] 
SPARC32: mark kernel memory as mapped

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC32: fix obp_arg.argv when no kernel command line specified
Mark Cave-Ayland [Fri, 1 Feb 2019 13:09:06 +0000 (13:09 +0000)] 
SPARC32: fix obp_arg.argv when no kernel command line specified

Make sure that obp_arg.argv is set to an empty string if no command line is
passed from QEMU. Otherwise the kernel will panic on startup when trying to
access it.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC32: divide physical memory reg property into SIMM-sized ranges
Mark Cave-Ayland [Sun, 30 Dec 2018 18:35:40 +0000 (18:35 +0000)] 
SPARC32: divide physical memory reg property into SIMM-sized ranges

Currently the /memory node reg property is set to a single range encompassing
the entire physical RAM of the machine. This seems to cause issues with
Solaris when booting on QEMU SS-10 and SS-20 machines whereby having just a
single entry causes the top of physical memory to be calculated incorrectly
and triggers a panic on boot.

Instead copy the behaviour of OBP which is to divide the reg property into a
set of ranges representing the physical SIMM arrangement in the machine, which
fixes the error and allows Solaris to boot under the QEMU SS-10 and SS-20
machines.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years ago40p: change residual data model name to IBM PPS Model 6015
Mark Cave-Ayland [Mon, 1 Oct 2018 17:25:29 +0000 (18:25 +0100)] 
40p: change residual data model name to IBM PPS Model 6015

With the corresponding QEMU patches applied, it is now possible to change the
reported firmware name to that of a real 40p machine and boot to a working
userspace with the Linux sandalfoot zImage.

3 years ago40p: update interrupt routing code to match QEMU
Mark Cave-Ayland [Sun, 9 Sep 2018 12:32:58 +0000 (13:32 +0100)] 
40p: update interrupt routing code to match QEMU

Note that whilst guest OSs should be relying on residual data rather than the
OF device tree to determine the hardware, we still update the interrupt
properties to match the new code in QEMU for consistency.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years ago40p: fix up generation of interrupt properties
Mark Cave-Ayland [Mon, 27 Aug 2018 12:04:15 +0000 (13:04 +0100)] 
40p: fix up generation of interrupt properties

Since support for QEMU's 40p machine has been added there is now the possibility
of having a PPC architecture where !is_newworld() and !is_oldworld() are both
true.

Fix up a couple of instances in this logic that were preventing the generation
of interrupt properties in the device tree for 40p machines.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
3 years agoconfig: enable virtio-blk driver for default PPC and SPARC64 builds
Mark Cave-Ayland [Sun, 26 Aug 2018 14:38:29 +0000 (15:38 +0100)] 
config: enable virtio-blk driver for default PPC and SPARC64 builds

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agodrivers: add virtio-1.0 virtio-blk driver
Mark Cave-Ayland [Sun, 26 Aug 2018 14:38:29 +0000 (15:38 +0100)] 
drivers: add virtio-1.0 virtio-blk driver

Note that as part of this commit we rename the legacy virtio-blk device node
from "virtio-blk" to "scsi" to match up with the QEMU fw path generator.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC64: add bootindex support
Mark Cave-Ayland [Sun, 26 Aug 2018 14:38:29 +0000 (15:38 +0100)] 
SPARC64: add bootindex support

This provides an alternative mechanism for supporting boot device order
information from QEMU compared with the legacy FW_CFG_BOOT_DEVICE
functionality specified via -boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoppc: add bootindex support
Mark Cave-Ayland [Sun, 26 Aug 2018 14:38:29 +0000 (15:38 +0100)] 
ppc: add bootindex support

This provides an alternative mechanism for supporting boot device order
information from QEMU compared with the legacy FW_CFG_BOOT_DEVICE
functionality specified via -boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoppc: make sure that we correctly map loader RAM at load-base
Mark Cave-Ayland [Sun, 26 Aug 2018 13:23:17 +0000 (14:23 +0100)] 
ppc: make sure that we correctly map loader RAM at load-base

An error in the logic related to FREE_BASE meant that instead of mapping the
RAM for the loader at load-base, a small section was being mapped at the
bottom of RAM instead.

Fix this by deferring the mapping of the load-base RAM to arch_init() when
we can access the load-base variable and map 8MB RAM with a 1:1 phys to
virt mapping.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC64: fix endian naming of architecture in_*() and out_*() functions
Mark Cave-Ayland [Sun, 26 Aug 2018 08:03:03 +0000 (09:03 +0100)] 
SPARC64: fix endian naming of architecture in_*() and out_*() functions

For reasons lost in the history of time, the SPARC64 endian accessors were
given the opposite names to their function i.e. out_le32() would use a
standard load whilst out_be32() would use a little-endian load. Switch
them around so that their implementation matches their name (and also that
of all other architectures).

Note that since the references in the inb/inw/inl and outb/outw/outl wrappers
are also swapped around then these accessors for legacy ioports (i.e. little
endian) will still behave exactly the same as before.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoSPARC64: fix up dma-* words
Mark Cave-Ayland [Sun, 19 Aug 2018 10:47:18 +0000 (11:47 +0100)] 
SPARC64: fix up dma-* words

Commit 8584d42 "SPARC64: implement dma-* words" introduced the dma-* words
for SPARC64 but accidentally introduced an older prototype implementation
(probably introduced during a rebase) rather than using the correct defer
words.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoppc: move init-program client stack to 1:1 virt to phys mapped memory
Mark Cave-Ayland [Fri, 17 Aug 2018 09:35:48 +0000 (10:35 +0100)] 
ppc: move init-program client stack to 1:1 virt to phys mapped memory

The default context used by init-program is allocated from the OpenBIOS
heap which uses a different virt to phys mapping to avoid having to
physically relocate the PROM on startup for PPC machines.

It seems that the OpenBSD bootloader isn't happy with this change
introduced by the context rework, most likely because there is an
assumption that the client stack is mapped 1:1 virt to phys.

Fix this by overriding the default context stack during init-program
to a location just under the MMU hash table (SDR1) which was its
previous hard-coded location in 1:1 virt to phys mapped memory, and
allow OpenBSD to boot.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agopci: use absolute PCI IO addresses when programming bridge IO limits
Mark Cave-Ayland [Sun, 12 Aug 2018 12:55:12 +0000 (13:55 +0100)] 
pci: use absolute PCI IO addresses when programming bridge IO limits

The upper IO bridge limit was being calculated relative to the lower IO
bridge limit, rather than as an absolute address.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agolibopenbios: don't allow find_package_method() to push a NULL for empty strings
Mark Cave-Ayland [Sun, 12 Aug 2018 12:55:11 +0000 (13:55 +0100)] 
libopenbios: don't allow find_package_method() to push a NULL for empty strings

Instead push a valid address with zero length otherwise the Forth find-method
word can reference a NULL pointer.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
3 years agoide: don't use ioports as part of the controller node address
Mark Cave-Ayland [Sun, 12 Aug 2018 12:55:10 +0000 (13:55 +0100)] 
ide: don't use ioports as part of the controller node address

The problem with using the ioport as part of the controller node
address is that the address cannot be determined until after the PCI
BARs have been programmed.

This causes a problem when trying to generate fw bootpaths because by
definition they must be passed to the firmware before PCI initialisation.

Instead of using the controller ioport address, use the controller
index for the node address to provide a consistent device node
regardless of how the PCI BARs are programmed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agousbhid: fix up keyboard alias for USB keyboards
Mark Cave-Ayland [Sat, 9 Jun 2018 15:46:58 +0000 (16:46 +0100)] 
usbhid: fix up keyboard alias for USB keyboards

A USB keyboard is not an ADB keyboard, so make sure that we set the keyboard
alias rather than the adb-keyboard alias.

This also enables us to simplify the alias logic in the PPC arch_of_init()
function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: add PMU driver
Mark Cave-Ayland [Sat, 9 Jun 2018 15:46:58 +0000 (16:46 +0100)] 
ppc: add PMU driver

The PMU hardware supercedes the CUDA hardware on more modern Macs providing
additional power management functionality which is required for more modern
Mac OSs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoadb: set compatible property differently if PMU is present
Mark Cave-Ayland [Sat, 9 Jun 2018 15:46:58 +0000 (16:46 +0100)] 
adb: set compatible property differently if PMU is present

This matches the device tree from a real mac99 system.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: add GPIO devices to the device tree when PMU hardware detected
Mark Cave-Ayland [Sat, 9 Jun 2018 15:46:58 +0000 (16:46 +0100)] 
ppc: add GPIO devices to the device tree when PMU hardware detected

PMU Mac models expose GPIOs via a separate address range at the start
of the via-pmu device.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: add fw_cfg interface for passing VIA/ADB configuration from QEMU
Mark Cave-Ayland [Sat, 9 Jun 2018 15:46:58 +0000 (16:46 +0100)] 
ppc: add fw_cfg interface for passing VIA/ADB configuration from QEMU

This is in preparation for allowing OpenBIOS to detect the difference
between CUDA/PMU hardware and build the device tree accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoprep: disable VBE extensions when executing client program
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
prep: disable VBE extensions when executing client program

PReP payloads such as Linux expect to be able to set standard VGA modes
on startup, but VBE prevents certain modes such as text-only.

Disable VBE extensions when executing the client program to allow this
behaviour which also matches that of Open HackWare.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agolibopenbios: add PReP boot partition loader for PPC
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
libopenbios: add PReP boot partition loader for PPC

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agopc-parts: allow successful detection of PReP boot partitions
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
pc-parts: allow successful detection of PReP boot partitions

The PReP boot partition has its own separate layout, so if we detect a PReP
partition then assume success without attempting the filesystem probe (which
is always going to fail).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: use proper context when pre-loading kernels
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
ppc: use proper context when pre-loading kernels

Before the introduction of proper init-program contexts, OpenBIOS
used a simple assembler call_elf() function to execute the guest
kernel directly.

Switch over to using proper contexts via arch_init_program() which
enables us to remove the legacy call_elf() completely.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: add PReP residual data block
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
ppc: add PReP residual data block

This is borrowed from OpenHackWare in order to provide hardware data to
the client OS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agopci: add driver for LSI 53C810 SCSI controller
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
pci: add driver for LSI 53C810 SCSI controller

This is to enable booting PReP machines in OpenBIOS.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agoppc: add PReP support to dma-map-in
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
ppc: add PReP support to dma-map-in

PReP machines have a separate iova address space mapped into the CPU address
space at 0x80000000, so add a new dma-map-in implementation that supports
this behaviour for the PReP machine.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agobootcode_load: ensure LOADER_NOT_SUPPORT is returned if no bootcode is present
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
bootcode_load: ensure LOADER_NOT_SUPPORT is returned if no bootcode is present

Otherwise we try unsucessfully to load the bootcode and fail rather than continuing
on to the next loader.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agopci: add AMD PCNET information to PCI database
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
pci: add AMD PCNET information to PCI database

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agopci: rename i82378 keyboard device from 8042 to keyboard
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
pci: rename i82378 keyboard device from 8042 to keyboard

This ensures the keyboard appears with a more sensible name in the device
tree.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 years agopc_kbd: ensure that we properly reset the 8042 controller and keyboard device
Mark Cave-Ayland [Sat, 26 May 2018 19:09:22 +0000 (20:09 +0100)] 
pc_kbd: ensure that we properly reset the 8042 controller and keyboard device

More recent versions of QEMU disable scanning until the controller and
keyboard device have been explicitly reset.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>