| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Apple OF has parse-1hex, parse-2hex, parse-3hex words that may be used
by FCode ROMs so add these for compatibility
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
| |
Instead of reimplementing it several times use parse-nhex to decode
two hex numbers,
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Fix up warnings generated by building with -Werror under gcc 9.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
| |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
| |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
| |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
This enables disk drivers to call the dma-* words as required by the
specification.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the dma-* words in the root node using Forth, except for dma-alloc
and dma-sync which require C to use the in-built aligned memory allocator and
MMU flushing.
Note that as OpenBIOS doesn't enable the IOMMU for SPARC64 it is possible to
use the aligned memory allocator directly without any extra support code.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
| |
Implement the dma-* words in the root node using Forth, except for dma-alloc
and dma-sync which require C to use the in-built aligned memory allocator and
I-cache and D-cache flushing.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
| |
Implement flush_dcache_range() similar to flush_icache_range() in preparation
for adding dma command support.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
| |
Use Forth wrappers around the existing C functions to implement all the dma-* words
in the root package.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
| |
This is to enable us to use its functions for the upcoming DMA functionality.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
| |
The system bus frequency has been available from the QEMU fw_cfg interface for
some time, so let's use it rather than hard-coding the relevant values.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
| |
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Newer versions of gcc fail to compile OpenBIOS giving a
"error: ‘multiboot_header’ defined but not used" message when the default
build with -Werror enabled is used.
Remove the static declaration to enable compilation to succeed, which
incidentally matches the other copies of multiboot.c in the OpenBIOS
source tree.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix up the ebus device interrupt parents, plus remove deprecated code for
mapping PCI devices to the PCI root bus as this is no longer possible.
Now that the transition to a simba configuration is complete, make sure
that we update mem_base and io_base to match the start address of each
simba module, and update pci_mem_base accordingly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The IEEE-1275 interpose specification suggests that interposed packages should
not be visible unless an interpose-aware Forth word is used.
Commit 247c6169 "Fix for interpose problem" realised this by converting the romvec
obp_inst2pkg() function over to use ihandle>non-interposed-phandle but didn't make
the same change to the equivalent CIF call instance-to-path (which is presumably
correct since the interpose specification also states that interposed packages are
only visible to a new instance-to-interposed-path CIF call).
Here we add a new instance-to-package word as a wrapper to
ihandle>non-interposed-phandle and update obp_inst2pkg() and instance-to-path to
use it accordingly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
| |
Make the PCI configuration space size match that of a real Ultra5 machine.
Currently the declared PCI configuration space is too large and actually
overlaps PCI memory space.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the address of the PCI memory base in the host ranges property was
offset by pci_mem_base. While technically correct, Linux incorrectly calculates
the start of the Simba window based upon this address.
Change the memory base to APB_MEM_BASE to match a real Ultra 5 which prevents
Linux from outputting warnings about incorrect window sizes.
Signed-off-by: Mark Cave-ayland <mark.cave-ayland@ilande.co.uk>
|
|
|
|
|
|
|
| |
This is required to ensure that we can fit both SUNW,simba devices within
the available space.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|