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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|