From patchwork Tue Sep 6 03:40:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9315473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4346F60760 for ; Tue, 6 Sep 2016 04:02:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 345DE28B34 for ; Tue, 6 Sep 2016 04:02:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28EFA28B3D; Tue, 6 Sep 2016 04:02:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B559728B34 for ; Tue, 6 Sep 2016 04:02:31 +0000 (UTC) Received: from localhost ([::1]:58238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7ag-0004Ee-HU for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 00:02:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7EE-00010p-TQ for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:39:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh7E7-0007Be-8c for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:39:18 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:58954) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7E6-0006zv-Mc; Mon, 05 Sep 2016 23:39:11 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sSslR1KK1z9vGR; Tue, 6 Sep 2016 13:38:57 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1473133139; bh=54PeIlMYxZjrXFE3oo7t+eMe0Ss9WSklZuShic1hdPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GHH/uyL571nl4/E2Kbjxo7UMSIAqopBzJCzZbY9D2AmAVin5/N8hgxNityp9qeB33 jjPfceJInOvdYK0eafN2q8pHZ71lqcJZJyF6r63C18Lyq79SglwWmvb7Fvn2p4HcyD 43hZ4cu5ZDC/olzgfuao4Rg9Jm3MWKgOaKayMDZ0= From: David Gibson To: peter.maydell@linearo.org Date: Tue, 6 Sep 2016 13:40:44 +1000 Message-Id: <1473133253-17598-58-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473133253-17598-1-git-send-email-david@gibson.dropbear.id.au> References: <1473133253-17598-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 57/66] ppc: Fix macio ESCC legacy mapping X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson , qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Benjamin Herrenschmidt The current mapping, while correct for the base ports (which is all the driver uses these days), is wrong for the extended registers. I suspect the bugs come from incorrect tables in the CHRP IO Ref document, I have verified the new values here match Apple's MacTech.pdf. Note: Nothing that I know of actually uses these registers so it's not a huge deal, but this patch has the added advantage of adding comments to document what the registers are. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: David Gibson --- hw/misc/macio/macio.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index be03926..5d57f45 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -89,22 +89,16 @@ static void macio_escc_legacy_setup(MacIOState *macio_state) MemoryRegion *bar = &macio_state->bar; int i; static const int maps[] = { - 0x00, 0x00, - 0x02, 0x20, - 0x04, 0x10, - 0x06, 0x30, - 0x08, 0x40, - 0x0A, 0x50, - 0x60, 0x60, - 0x70, 0x70, - 0x80, 0x70, - 0x90, 0x80, - 0xA0, 0x90, - 0xB0, 0xA0, - 0xC0, 0xB0, - 0xD0, 0xC0, - 0xE0, 0xD0, - 0xF0, 0xE0, + 0x00, 0x00, /* Command B */ + 0x02, 0x20, /* Command A */ + 0x04, 0x10, /* Data B */ + 0x06, 0x30, /* Data A */ + 0x08, 0x40, /* Enhancement B */ + 0x0A, 0x50, /* Enhancement A */ + 0x80, 0x80, /* Recovery count */ + 0x90, 0x90, /* Start A */ + 0xa0, 0xa0, /* Start B */ + 0xb0, 0xb0, /* Detect AB */ }; memory_region_init(escc_legacy, OBJECT(macio_state), "escc-legacy", 256);