This series of patches allows to build openbios on a
powerpc64 host. It has been tested with the following targets:
ppc, sparc32, sparc64. It has also been tested on x86_64 host
with the same targets.
v2: remove patches 3/5 and 4/5 of the first series and replace it
with patch 4/4. We don't include the system includes using
full pathname but use '-iquote' intead of '-I'
A preliminary patch is needed for fcode-utils, as "toke" is
broken on big endian architecture:
diff -ru fcode-utils/toke/scanner.c fcode-utils-new/toke/scanner.c
--- fcode-utils/toke/scanner.c 2006-10-30 09:48:28.000000000 +0100
+++ fcode-utils-new/toke/scanner.c 2015-10-19 00:21:43.417373690 +0200
@@ -1625,7 +1625,7 @@
void user_message( tic_param_t pfield )
{
- char delim = (char)pfield.deflt_elem ;
+ char delim = (char)pfield.fw_token ;
handle_user_message( delim, TRUE);
}
@@ -5295,7 +5295,7 @@
void process_remark( tic_param_t pfield )
{
- char until_char = (char)pfield.deflt_elem ;
+ char until_char = (char)pfield.fw_token ;
unsigned int start_lineno = lineno;
#ifdef DEBUG_SCANNER
Laurent Vivier (4):
switch-arch: factorize code to compute architecture properties.
switch-arch: compute base arch and allow native compiler for 32bit
and 64bit.
switch-arch: as for powerpc64, select sparc64 compiler to compile
sparc32
bootstrap: don't include files from target/include as system includes.
Makefile.target | 2 +-
config/scripts/switch-arch | 85 +++++++++++++++++++++++++---------------------
include/arch/ppc/types.h | 8 -----
3 files changed, 48 insertions(+), 47 deletions(-)
--
2.4.3
Author: mcayland
Date: Fri Oct 23 14:58:22 2015
New Revision: 1353
URL: http://tracker.coreboot.org/trac/openbios/changeset/1353
Log:
ppc: add ob_ide_quiesce() and call it from the PPC CIF quiesce word
Add a new ob_ide_quiesce() function and hook it into QEMU PPC's ciface_quiesce()
routine to properly prepare the drives for transferring control to the operating
system.
Without this OS 9 becomes confused about the initial drive state on boot and
refuses to correctly detect and initialise it.
Based upon an original patch by Cormac O'Brien <cormac(a)c-obrien.org>.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/arch/ppc/qemu/methods.c
trunk/openbios-devel/drivers/ide.c
trunk/openbios-devel/include/drivers/drivers.h
Modified: trunk/openbios-devel/arch/ppc/qemu/methods.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/methods.c Fri Oct 23 14:58:20 2015 (r1352)
+++ trunk/openbios-devel/arch/ppc/qemu/methods.c Fri Oct 23 14:58:22 2015 (r1353)
@@ -114,6 +114,8 @@
ciface_quiesce( unsigned long args[], unsigned long ret[] )
{
usb_exit();
+
+ ob_ide_quiesce();
#if 0
unsigned long msr;
/* This seems to be the correct thing to do - but I'm not sure */
Modified: trunk/openbios-devel/drivers/ide.c
==============================================================================
--- trunk/openbios-devel/drivers/ide.c Fri Oct 23 14:58:20 2015 (r1352)
+++ trunk/openbios-devel/drivers/ide.c Fri Oct 23 14:58:22 2015 (r1353)
@@ -1488,6 +1488,28 @@
return 0;
}
+void ob_ide_quiesce(void)
+{
+ struct ide_channel *channel;
+ int i;
+
+ channel = channels;
+ while (channel) {
+ for (i = 0; i < 2; i++) {
+ struct ide_drive *drive = &channel->drives[i];
+
+ if (!drive->present)
+ continue;
+
+ ob_ide_select_drive(drive);
+ ob_ide_software_reset(drive);
+ ob_ide_device_type_check(drive);
+ }
+
+ channel = channel->next;
+ }
+}
+
#if defined(CONFIG_DRIVER_MACIO)
static unsigned char
macio_ide_inb(struct ide_channel *chan, unsigned int port)
Modified: trunk/openbios-devel/include/drivers/drivers.h
==============================================================================
--- trunk/openbios-devel/include/drivers/drivers.h Fri Oct 23 14:58:20 2015 (r1352)
+++ trunk/openbios-devel/include/drivers/drivers.h Fri Oct 23 14:58:22 2015 (r1353)
@@ -52,6 +52,7 @@
/* drivers/ide.c */
int ob_ide_init(const char *path, uint32_t io_port0, uint32_t ctl_port0,
uint32_t io_port1, uint32_t ctl_port1);
+void ob_ide_quiesce(void);
int macio_ide_init(const char *path, uint32_t addr, int nb_channels);
#endif
#ifdef CONFIG_DRIVER_ESP
Author: mcayland
Date: Fri Oct 23 14:58:18 2015
New Revision: 1351
URL: http://tracker.coreboot.org/trac/openbios/changeset/1351
Log:
ppc: fix CUDA ADB error packet detection
CUDA ADB error packets contain a 3-byte payload rather than a standard 2-byte
header plus payload (as seen in QEMU <= 2.4). Allow cuda_adb_req() to differentiate
between the two formats and act accordingly.
Signed-off-by: Cormac O'Brien <cormac(a)c-obrien.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/drivers/cuda.c
Modified: trunk/openbios-devel/drivers/cuda.c
==============================================================================
--- trunk/openbios-devel/drivers/cuda.c Fri Oct 23 14:58:16 2015 (r1350)
+++ trunk/openbios-devel/drivers/cuda.c Fri Oct 23 14:58:18 2015 (r1351)
@@ -144,8 +144,22 @@
// CUDA_DPRINTF("len: %d %02x\n", len, snd_buf[0]);
len = cuda_request(host, ADB_PACKET, snd_buf, len, buffer);
if (len > 1 && buffer[0] == ADB_PACKET) {
- pos = buffer + 2;
- len -= 2;
+ /* We handle 2 types of ADB packet here:
+ Normal: <type> <status> <data> ...
+ Error : <type> <status> <cmd> (<data> ...)
+ Ideally we should use buffer[1] (status) to determine whether this
+ is a normal or error packet but this requires a corresponding fix
+ in QEMU <= 2.4. Hence we temporarily handle it this way to ease
+ the transition. */
+ if (len > 2 && buffer[2] == snd_buf[0]) {
+ /* Error */
+ pos = buffer + 3;
+ len -= 3;
+ } else {
+ /* Normal */
+ pos = buffer + 2;
+ len -= 2;
+ }
} else {
pos = buffer + 1;
len = -1;
Hi all,
Here is a slightly reworked version of Cormac's GSoC MacOS 9 patchset which
I believe is ready to apply.
A considerable amount of time was spent by Cormac finding the correct set of
properties required by OS 9 whilst also not regressing existing images. The
patchset in it's current form here passes all of my local PPC image tests
while still progressing OS 9 boot as before.
The patches are mostly untouched other than adding my SoB except for patch 3
where I altered the version referenced in the comment and commit message,
and splitting patch 4 into 2 separate patches as requested by Alex, along with
some other minor tidy-ups.
Note: patch 1 from Cormac's original patchset was a hack from me to allow the
OS 9 bootloader to run, however it is not included here because it causes
problems with yaboot. People interested in the OS 9 work can apply the patch
by hand in the meantime.
Several review comments suggested the use of a helper function for string
properties, however recent work on SPARC has shown that building up string
properties in this way is prevalent throughout the OpenBIOS codebase. In the
interest of progressing work in this area, I'd like to apply the patches as-is
and then globally rework string properties using a helper at a later date.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Cormac O'Brien (4):
ppc: fix up power-mgt properties
ppc: add ESCC legacy support
ppc: fix CUDA ADB packet header format
ppc: fix up IDE device tree and control transfer
Mark Cave-Ayland (1):
ppc: add ob_ide_quiesce() and call it from the PPC CIF quiesce word
openbios-devel/arch/ppc/qemu/methods.c | 2 +
openbios-devel/drivers/cuda.c | 17 +++++-
openbios-devel/drivers/escc.c | 88 ++++++++++++++++++++++++------
openbios-devel/drivers/escc.h | 2 +
openbios-devel/drivers/ide.c | 36 ++++++++++--
openbios-devel/drivers/pci.c | 6 ++
openbios-devel/include/drivers/drivers.h | 1 +
7 files changed, 128 insertions(+), 24 deletions(-)
--
1.7.10.4
Author: mcayland
Date: Sun Oct 4 19:24:13 2015
New Revision: 1348
URL: http://tracker.coreboot.org/trac/openbios/changeset/1348
Log:
SPARC64: fix PCI-EBus bridge ranges property
The child address of the PCI-EBus bridge "ranges" property should be offset from
the BAR address and not the beginning of the address space (similar as to how
the "assigned-addresses" property is generated). This fixes EBus enumeration
under FreeBSD SPARC64.
Reported-by: Marius Strobl <marius(a)alchemy.franken.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/drivers/pci.c
Modified: trunk/openbios-devel/drivers/pci.c
==============================================================================
--- trunk/openbios-devel/drivers/pci.c Sun Jul 12 12:24:11 2015 (r1347)
+++ trunk/openbios-devel/drivers/pci.c Sun Oct 4 19:24:13 2015 (r1348)
@@ -824,7 +824,7 @@
ncells += pci_encode_phys_addr(props + ncells,
flags, space_code, config->dev,
PCI_BASE_ADDR_0 + (i * sizeof(uint32_t)),
- 0);
+ config->assigned[i] & ~mask);
props[ncells++] = config->sizes[i];
}