Age | Commit message (Collapse) | Author | Files | Lines |
|
An upcoming series for QEMU's ESP emulation will check that ESP commands are
only issued according to their valid states as listed in the datasheet, and
otherwise generate an illegal command interrupt.
Currently if a SCSI command is expected to return no data or transfers data
successfully, the ASC is not returned to its disconnected state. This means
that any subsequent ESP initiator commands should be rejected until the SCSI
bus transaction is terminated.
Update the ESP driver so that if a SCSI command is successful then the ICCS
and MSGACC commands are issued by the host to complete the SCSI transaction.
This ensures that the ASC is returned to the disconnected state which allows
the ESP to accept subsequent SCSI commands without generating an illegal
command interrupt.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Rather than rely on the DMA interrupt to determine that an ESP interrupt has
occurred, poll the ESP interrupt register directly. This enables us to poll
until one of the specified interrupts occurs.
Since an ESP interrupt can still be in a pending state before issuing an ESP
command, read the ESP interrupt register beforehand to clear any pending
interrupts.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
This ensures that any partially transferred data is removed from the FIFO
before issuing the next ESP command.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
The linuxbios.org website does not exist anymore, so point the reader towards
coreboot.org instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Resolves: https://github.com/openbios/openbios/issues/17
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
|
|
When advancing buffer by 1, len should be shorthened by appropriate
amount, instead of setting it to -1.
Found with cppcheck.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
This is based upon a similar patch currently being carried in the QEMU Debian package
sources.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
The marvinpinto/action-automatic-releases action is currently unmaintained and
displays several GitHub deprecation warnings during use. Switch over to using the
forked crowbarmaster/GH-Automatic-Releases action which is an updated version of
the original marvinpinto/action-automatic-releases action.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Now it is possible to build fully functional OpenBIOS binaries for all
architectures using the Debian cross-compiler packages, so switch the
builder image from the kernel crosstools compilers to the packaged
Debian cross-compilers.
Sigend-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
This is required to ensure that the output binaries are generated in a
form that will execute correctly as firmware at a fixed location.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
When compiling with gcc 12 drivers/usb.c generates the following error:
/root/drivers/usb.c: In function 'get_descriptor':
/root/drivers/usb.c:200:23: error: array subscript 'device_descriptor_t[0]' is partly outside array bounds of 'u8[8]' {aka 'unsigned char[8]'} [-Werror=array-bounds]
200 | if (dd->bMaxPacketSize0 != 0)
| ^~
/root/drivers/usb.c:181:12: note: object 'buf' of size 8
181 | u8 buf[8];
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [rules.mak:229: target/drivers/usb.o] Error 1
make[1]: Leaving directory '/root/obj-ppc'
The compiler is complaining that a device_descriptor_t pointer cast to the 8 byte buffer
means that a pointer dereference to some members of the device_descriptor_t could go
beyond the end of the 8 byte buffer. Whilst this sounds as if it should be allowed, some
searching suggests that the behaviour of such a cast is undefined.
Rework get_descriptor() so that an entire device_descriptor_t is used to store the first
8 bytes of the incoming descriptor, and update the buf references to use the equivalent
device_descriptor_t fields instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
When compiled with gcc 12 packages/pc-parts.c generates the following error:
/root/packages/pc-parts.c:243:64: error: array subscript 1 is outside array bounds of 'struct pc_partition[1]' [-Werror=array-bounds]
243 | cur_table = ext_start + __le32_to_cpu(p[1].start_sect);
| ~^~~
/root/include/libc/byteorder.h:12:13: note: in definition of macro '__bswap32'
12 | ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
| ^
/root/packages/pc-parts.c:243:49: note: in expansion of macro '__le32_to_cpu'
243 | cur_table = ext_start + __le32_to_cpu(p[1].start_sect);
| ^~~~~~~~~~~~~
/root/packages/pc-parts.c:143:13: note: at offset 16 into object of size 16 allocated by 'malloc'
143 | p = malloc(sizeof(struct pc_partition));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [rules.mak:191: target/packages/pc-parts.o] Error 1
make[1]: Leaving directory '/root/obj-ppc'
Upon inspection this appears to be a genuine bug whereby the attempt to access
the second extended partition entry incorrectly accesses the memory beyond the
end of the aligned copy of the first extended partition entry.
Copy the second extended partition entry into aligned extended partition buffer
and access the values from there to resolve the issue.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Dereferencing a constant address pointer when -Warray-bounds is enabled in gcc
generates an erroneous warning:
In function 'ppc64_patch_handlers',
inlined from 'cpu_970_init' at /root/arch/ppc/qemu/init.c:433:5:
/root/arch/ppc/qemu/init.c:400:10: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
400 | *dsi = 0x48002002;
| ~~~~~^~~~~~~~~~~~
/root/arch/ppc/qemu/init.c:403:10: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds]
403 | *isi = 0x48002202;
| ~~~~~^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [rules.mak:323: target/arch/ppc/qemu/init.o] Error 1
make[1]: Leaving directory '/root/obj-ppc'
This is a known bug in gcc 12 as described at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523. Work around the bug for
now by disabling the warning for ppc64_patch_handlers().
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Eliminates following warning from linker:
powerpc-unknown-linux-gnu-ld: warning: crtsavres.o: missing .note.GNU-stack section implies executable stack
powerpc-unknown-linux-gnu-ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Removes -Wunused-result warning.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
OpenBIOS currently fails to link with stack protector enabled, as it is
unlikely needed in boot loader anyway, just make sure it is disabled on
all targets.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Add -Wbuiltin-declaration-mismatch -Wimplicit-fallthrough -Woverride-init
-Wno-maybe-uninitialized to HOSTCFLAGS and CFLAGS.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
There is few places where code wants to fallthrough, label them so it is
known that it is expected. Detected with -Wimplicit-fallthrough
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Should not affect behaviour as it just calls ofmem_malloc which takes
size_t as argument anyway. Reported when build with
-Wbuiltin-declaration-mismatch.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Fix typo, where last definition should have been F16 instead of F15.
Found with -Woverride-init
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
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>
|
|
Add parse-nhex word reusing existing parse-ints and use that in
parse-hex instead of an independent implementation. The parse-nhex
name matches Apple OF, while SLOF calls the same operation
hex-decode-unit so adding this word increases compatibility with other
OF implementations.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Some device trees can contain large chunks of binary data that result
in .properties output to get lost in the dump of all binary bytes. Put
an upper limit of the bytes dumped.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Replace Qemu -> QEMU.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|