Author: mcayland
Date: Mon Aug 25 15:07:56 2014
New Revision: 1315
URL: http://tracker.coreboot.org/trac/openbios/changeset/1315
Log:
macio ide: Fix dev tree entries for macio ide ports
Only add the two ide ports that are emulated by QEMU to the device
tree to avoid clients trying to access the non-existent third one and
fix their names and properties for mac99 to match those used by Apple.
This makes MorphOS able to find and use these.
Signed-off-by: BALATON Zoltan <balaton(a)eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/drivers/ide.c
trunk/openbios-devel/drivers/macio.c
Modified: trunk/openbios-devel/drivers/ide.c
==============================================================================
--- trunk/openbios-devel/drivers/ide.c Mon Aug 25 15:07:53 2014 (r1314)
+++ trunk/openbios-devel/drivers/ide.c Mon Aug 25 15:07:56 2014 (r1315)
@@ -1526,6 +1526,10 @@
u32 props[8];
struct ide_channel *chan;
+ /* IDE ports on Macs are numbered from 3.
+ * Also see comments in macio.c:openpic_init() */
+ current_channel = 3;
+
for (i = 0; i < nb_channels; i++, current_channel++) {
chan = malloc(sizeof(struct ide_channel));
@@ -1574,7 +1578,8 @@
dnode = find_dev(nodebuff);
- set_property(dnode, "compatible", "heathrow-ata", 13);
+ set_property(dnode, "compatible", (is_oldworld() ?
+ "heathrow-ata" : "keylargo-ata"), 13);
props[0] = 0x00000526;
props[1] = 0x00000085;
Modified: trunk/openbios-devel/drivers/macio.c
==============================================================================
--- trunk/openbios-devel/drivers/macio.c Mon Aug 25 15:07:53 2014 (r1314)
+++ trunk/openbios-devel/drivers/macio.c Mon Aug 25 15:07:56 2014 (r1315)
@@ -136,7 +136,7 @@
int i;
unsigned int it_shift = macio_nvram_shift();
- for (i=0; i< arch_nvram_size() ; i++)
+ for (i=0; i < arch_nvram_size(); i++)
nvram[i << it_shift] = buf[i];
#ifdef DUMP_NVRAM
printk("new nvram:\n");
@@ -203,13 +203,16 @@
target_node = find_dev("/pci/mac-io/escc/ch-b");
set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci/mac-io/ata-1");
- set_int_property(target_node, "interrupt-parent", dnode);
-
- target_node = find_dev("/pci/mac-io/ata-2");
+ /* QEMU only emulates 2 of the 3 ata buses currently */
+ /* On a new world Mac these are not numbered but named by the
+ * ATA version they support. Thus we have: ata-3, ata-3, ata-4
+ * On g3beige they all called just ide.
+ * We take ata-3 and ata-4 which seems to work for both
+ * at least for clients we care about */
+ target_node = find_dev("/pci/mac-io/ata-3");
set_int_property(target_node, "interrupt-parent", dnode);
- target_node = find_dev("/pci/mac-io/ata-3");
+ target_node = find_dev("/pci/mac-io/ata-4");
set_int_property(target_node, "interrupt-parent", dnode);
target_node = find_dev("/pci/mac-io/via-cuda");
@@ -312,7 +315,7 @@
/* The NewWorld NVRAM is not located in the MacIO device */
macio_nvram_init("", 0);
escc_init(path, addr);
- macio_ide_init(path, addr, 3);
+ macio_ide_init(path, addr, 2);
openpic_init(path, addr);
ob_unin_init();
}
Author: mcayland
Date: Mon Aug 25 15:07:53 2014
New Revision: 1314
URL: http://tracker.coreboot.org/trac/openbios/changeset/1314
Log:
arch/ppc/qemu: Rename root node for Macs to match Apple
Apple calls the root node of the device tree "device-tree" and MorphOS
relies on this to decide what properties to get. Make it happy.
Signed-off-by: BALATON Zoltan <balaton(a)eik.bme.hu>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/arch/ppc/qemu/tree.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/tree.fs
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/tree.fs Sun Aug 17 15:06:47 2014 (r1313)
+++ trunk/openbios-devel/arch/ppc/qemu/tree.fs Mon Aug 25 15:07:53 2014 (r1314)
@@ -12,7 +12,8 @@
\ -------------------------------------------------------------
" /" find-device
-
+\ Apple calls the root node device-tree
+" device-tree" device-name
[IFDEF] CONFIG_PPC64 2 [ELSE] 1 [THEN] encode-int " #address-cells" property
1 encode-int " #size-cells" property
h# 05f5e100 encode-int " clock-frequency" property
hello,
i tried latest qemu on illumos based platform Intel 64bit with SPARC64 boot and i can see:
root@infra-99-016:/myshare/builds2/sparc# ./qemu-system-sparc64 -cdrom OpenIndiana_Text_SPARC.iso -boot d -m 2048 -hda hda.img -nographic
OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.1 built on Jun 20 2014 22:57
Type 'help' for detailed information
Trying cdrom:f...
Not a bootable ELF image
Not a bootable a.out image
Loading FCode image...
Loaded 7120 bytes
entry point is 0x4000
Ignoring failed claim for va 10db4ec memsz 19!
Ignoring failed claim for va 1000000 memsz 1276ce!
Ignoring failed claim for va 1402000 memsz 346ca!
Ignoring failed claim for va 1800000 memsz 67750!
Jumping to entry point 0000000001007ad8 for type 0000000000000001...
switching to new context: entry point 0x1007ad8 stack 0x00000000ffe8aa09
warning:interpret: exception -13 caught
interpret warning @ warning off : sync %tl-c %tstate h# 18672e0 x! %g1 h# 18672e8 x! %g2 h# 18672f0 x! %g3 h# 18672f8 x! %g4 h# 1867300 x! %g5 h# 1867308 x! %g6 h# 1867310 x! %g7 h# 1867318 x! %o0 h# 1867320 x! %o1 h# 1867328 x! %o2 h# 1867330 x! %o3 h# 1867338 x! %o4 h# 1867340 x! %o5 h# 1867348 x! %o6 h# 1867350 x! %o7 h# 1867358 x! %tl-c %tpc h# 1867360 x! %tl-c %tnpc h# 1867368 x! %y h# 1867370 l! %tl-c %tt h# 1861618 x! sync ; warning ! failed with error ffffffffffffffed
OpenIndiana Build glasgall_oi_151a_prestable8 64-bit (illumos 7256a34efe)
SunOS Release 5.11 - Copyright 1983-2010 Oracle and/or its affiliates.
All rights reserved. Use is subject to license terms.
DEBUG enabled
spacex@:interpret: exception -13 caught
interpret h# d constant MMU_PAGESHIFT h# 0 constant TTE8K h# 20 constant SFHME_SIZE h# 0 constant SFHME_TTE h# 8 constant HMEBLK_TAG h# 0 constant HMEBLK_NEXT h# 2c constant HMEBLK_MISC h# 38 constant HMEBLK_HME1 h# 8 constant NHMENTS h# 7 constant HBLK_SZMASK h# 10 constant HBLK_RANGE_SHIFT h# 8 constant HMEBP_HBLK h# 1 constant HMEBLK_ENDPA h# 20 constant HMEBUCKET_SIZE h# 0 constant HTAG_SFMMUPSZ h# d constant HTAG_BSPAGE_SHIFT h# a constant HTAG_REHASH_SHIFT h# 3ff constant SFMMU_INVALID_SHMERID h# 3 cmisc/forthdebug (467615 bytes) could not find debugger-vocabulary-hook>threads:interpret: exception -13 caught
interpret \ ident "%Z%%M% %I% %E% SMI"
\ Copyright 2005 Sun Microsystems, Inc. All rights reserved.
\ Use is subject to license terms.
\
\ CDDL HEADER START
\
\ The contents of this file are subject to the terms of the
\ Common Development and Distribution License, Version 1.0 only
\ (the "License"). You may not use this file except in compliance
\ with the License.
\
\ You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
\ or http://www.opensolaris.org/os/licensing.
\ See the License for loaded
(Can't load tod module) EXIT
boot start, but failed.
—
Best regards,
Igor Kozhukhov
On 28/07/14 15:33, Artyom Tarasenko wrote:
> On Sun, Jul 27, 2014 at 10:44 PM, Mark Cave-Ayland
> <mark.cave-ayland(a)ilande.co.uk> wrote:
>> At the moment we are probably closest to an Ultra250 with an UltraSPARC-IIi
>> processor and PCI bus.
>
> Are we? I thought QEMU was targeting Ultra-5. Both Ultra-5 and
> Enterpise-250 have different serial ports, but Enterprise-250 may have
> multiple CPUs, whereas QEMU can't.
Yeah, it was something to do with the serial ports, although I suspect
given the hacking over the past weekend that Ultra5 is probably still
valid now.
>> This property is checked by NetBSD during boot.
>
> Does it have to be something existing? Since QEMU doesn't exactly
> match any real machine, I'd prefer something like "QEMU,sun4u", but
> maybe it's personal.
I'm not exactly sure? But sure, at the very least we should have
something there to prevent errors on the console during boot.
ATB,
Mark.