From owner-freebsd-sparc64@freebsd.org Sun Sep 13 02:39:20 2015 Return-Path: Delivered-To: freebsd-sparc64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E32F69CA33D for ; Sun, 13 Sep 2015 02:39:19 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8590513C8; Sun, 13 Sep 2015 02:39:19 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id t8D2dH75008534 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 13 Sep 2015 04:39:17 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id t8D2dG56008533; Sun, 13 Sep 2015 04:39:16 +0200 (CEST) (envelope-from marius) Date: Sun, 13 Sep 2015 04:39:16 +0200 From: Marius Strobl To: Mark Cave-Ayland Cc: Alexey Dokuchaev , "freebsd-sparc64@freebsd.org" Subject: Re: PCI range checking under qemu-system-sparc64 Message-ID: <20150913023916.GB7862@alchemy.franken.de> References: <557DA6D5.4070800@FreeBSD.org> <557DCF54.7020606@ilande.co.uk> <557DF887.20508@ilande.co.uk> <20150906110308.GA68829@FreeBSD.org> <55EC2E8D.4020803@ilande.co.uk> <20150906124859.GA14919@FreeBSD.org> <55EC3949.1020508@ilande.co.uk> <20150906134245.GA21410@FreeBSD.org> <55EC4C43.9050700@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55EC4C43.9050700@ilande.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Sun, 13 Sep 2015 04:39:17 +0200 (CEST) X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2015 02:39:20 -0000 On Sun, Sep 06, 2015 at 03:22:59PM +0100, Mark Cave-Ayland wrote: > On 06/09/15 14:42, Alexey Dokuchaev wrote: > > > On Sun, Sep 06, 2015 at 02:02:01PM +0100, Mark Cave-Ayland wrote: > >> I wonder if the problem is just that suitable console drivers can't > >> be found? > >> > >>> ebus0: addr 0x14000003f8-0x14000003ff irq 43 (no driver attached) > >>> ebus0: addr 0x1400000060-0x1400000067 (no driver attached) > >> > >> The QEMU hardware model is still a WIP and the serial port currently > >> uses a 16550A UART (su) device rather than ESCC found in real hardware, > >> while the keyboard is a simple PS2 keyboard. > >> > >> If you alter your kernel configuration to include building of the su and > >> ps2 driver modules, does this help with detection of the serial and > >> keyboard devices and if so, does boot progress any further at all? > > > > Hmm, I'm running GENERIC, so it looks like everything should be already > > there, no? At least by looking at ./conf/files.sparc64 I don't see what > > else ("device ???") should I add to it to get su/kb_ps2 support... > > I'm afraid I'm not really a BSD person, but a quick browse at the source > on github suggests you need these drivers: > > https://github.com/freebsd/freebsd/blob/master/sys/dev/uart/uart_bus_ebus.c > > https://github.com/freebsd/freebsd/blob/master/sys/dev/atkbdc/atkbdc_ebus.c > > It also looks like you'd need to hack atkbdc_ebus.c to allow "kb_ps2" as > a device name rather than just trying to match on "8042", although this > could potentially be fixed by renaming the device in OpenBIOS moving > forwards as long as it doesn't cause any regressions. > Simple renaming in OpenBIOS wouldn't be the right fix either and neither change would make things work. On real machines for PS/2 there's a "8042" node on the EBus and _beneath_ that "8042" node there's a "kb_ps2" as well as a "kdmouse" one. "8042" has _two_ _identical_ addresses assigned, which its children index via their "reg" properties. The interrupt also goes onto the "8042" node. See the example of a Sun AXe board below. *Please* emulate real machines with QEMU. This specifically also applies to ARM hardware. Marius Node 0xf008cf88: ebus interrupt-map: 00 00 00 14 00 38 03 f8 00 00 00 01 f0 08 a7 38 00 00 00 1c 00 00 00 14 00 30 00 60 00 00 00 01 f0 08 a7 38 00 00 00 29 00 00 00 14 00 30 00 60 00 00 00 02 f0 08 a7 38 00 00 00 2a 00 00 00 14 00 36 02 f8 00 00 00 01 f0 08 a7 38 00 00 00 1d 00 00 00 14 00 40 00 00 00 00 00 01 f0 08 a7 38 00 00 00 2b 00 00 00 14 00 34 02 78 00 00 00 01 f0 08 a7 38 00 00 00 22 00 00 00 14 00 72 40 00 00 00 00 01 f0 08 a7 38 00 00 00 25 00 00 00 14 00 30 00 2e 00 00 00 01 f0 08 a7 38 00 00 00 04 00 00 00 14 00 32 03 f0 00 00 00 01 f0 08 a7 38 00 00 00 27 00 00 00 14 00 20 00 00 00 00 00 01 f0 08 a7 38 00 00 00 23 00 00 00 14 00 20 00 00 00 00 00 02 f0 08 a7 38 00 00 00 24 00 00 00 14 00 60 00 00 00 00 00 01 f0 08 a7 38 00 00 00 28 00 00 00 14 00 60 00 00 00 00 00 02 f0 08 a7 38 00 00 00 1e 00 00 00 14 00 60 00 00 00 00 00 03 f0 08 a7 38 00 00 00 1f interrupt-map-mask: 00 00 00 1f 00 ff ff ff 00 00 00 03 #interrupt-cells: 00 00 00 01 ranges: 00 00 00 10 00 00 00 00 82 01 08 10 00 00 00 00 f0 00 00 00 01 00 00 00 00 00 00 14 00 00 00 00 82 01 08 14 00 00 00 00 f1 00 00 00 00 80 00 00 reg: 00 01 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 82 01 08 10 00 00 00 00 f0 00 00 00 00 00 00 00 01 00 00 00 82 01 08 14 00 00 00 00 f1 00 00 00 00 00 00 00 00 80 00 00 #size-cells: 00 00 00 01 #address-cells: 00 00 00 02 name: 65 62 75 73 00 'ebus' max-latency: 00 00 00 19 min-grant: 00 00 00 0a class-code: 00 06 80 00 revision-id: 00 00 00 01 devsel-speed: 00 00 00 01 fast-back-to-back: device-id: 00 00 10 00 vendor-id: 00 00 10 8e <...> Node 0xf008fb5c: 8042 interrupts: 00 00 00 01 00 00 00 02 #size-cells: 00 00 00 00 #address-cells: 00 00 00 01 reg: 00 00 00 14 00 30 00 60 00 00 00 08 00 00 00 14 00 30 00 60 00 00 00 08 device_type: 38 30 34 32 00 '8042' name: 38 30 34 32 00 '8042' model: 49 4e 54 43 2c 38 30 63 34 32 00 'INTC,80c42' Node 0xf00909a4: kb_ps2 reg: 00 00 00 00 language: 65 6e 00 'en' compatible: 70 6e 70 50 4e 50 2c 33 30 33 00 'pnpPNP,303' port-b-ignore-cd: port-a-ignore-cd: keyboard: device_type: 73 65 72 69 61 6c 00 'serial' name: 6b 62 5f 70 73 32 00 'kb_ps2' Node 0xf009314c: kdmouse reg: 00 00 00 01 compatible: 70 6e 70 50 4e 50 2c 66 30 33 00 'pnpPNP,f03' port-b-ignore-cd: port-a-ignore-cd: mouse: device_type: 73 65 72 69 61 6c 00 'serial' name: 6b 64 6d 6f 75 73 65 00 'kdmouse'