From nobody Mon Feb 9 01:26:55 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1511734440308113.3149925384813; Sun, 26 Nov 2017 14:14:00 -0800 (PST) Received: from localhost ([::1]:58225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ5BT-0002kO-7C for importer@patchew.org; Sun, 26 Nov 2017 17:13:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJ4xx-0007AO-Gp for qemu-devel@nongnu.org; Sun, 26 Nov 2017 16:59:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJ4xw-0002ye-LW for qemu-devel@nongnu.org; Sun, 26 Nov 2017 16:59:57 -0500 Received: from mail-io0-x241.google.com ([2607:f8b0:4001:c06::241]:40552) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eJ4xw-0002y4-F1; Sun, 26 Nov 2017 16:59:56 -0500 Received: by mail-io0-x241.google.com with SMTP id d21so12098612ioe.7; Sun, 26 Nov 2017 13:59:56 -0800 (PST) Received: from localhost.localdomain (173-29-146-33.client.mchsi.com. [173.29.146.33]) by smtp.gmail.com with ESMTPSA id n184sm6517218itg.9.2017.11.26.13.59.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Nov 2017 13:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=JN9e7QU5+Myvn+318HquTAq4+YYP+TFzyDd/cmWdAUM=; b=RMUkdT0QwSkqYgTZyHOiymdvEUOpp8h4peJ5k9LV5WrOVUSLi6Iww8wZYoEr2C7dcK /DizbkxSu3TgberTtiuQ1fnXhQtTK9OBXORFOVM2zjdxzaOEzFpD0hEnP6anaKh6DYtb V7dOad424A5lGGWMFyuubmdtiMUZr7/hTFLoxJT3sg6qu6wCQpGjL9uirree5CSc10eb mfikfIpCOGwF08KPHVG+B6EtuS8W5msK4zv4yPll+DYTCaC/ebl/i8h04ait7idNy1UV DQDnFbow/b9E4H4dlQBJoaeQQR7HjsHdpriaTssbhH7auLExhiBMGdNONtZCaKw56Cmp /yAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=JN9e7QU5+Myvn+318HquTAq4+YYP+TFzyDd/cmWdAUM=; b=mRELrHwuGWpYpMBcz0WLxSSlxRrGo0BZoDiAYqFKFsexw73ykD33gxLy2ZfkxLA+PY 0vUglGVkDuuh4nZKKf+ea1iPA6h1d1StnoKZd04kS3Sh/H4oi618B7M+oxmK5iv/lh8e YPt6WnjZNlyBTpWsIBp1Hjgwxt7mmZG8ZOhzBGpHYV7LGzTbTXNxKZ0REQiuTI8KVG22 ipNPOC6688kFSrsvPw7jqS8XH+XRLQrOTReOnJoxMkyL68bD4ESB8LmJSqC+kt8ndm2m FfKL/gNG0DLKRUKobI3uF/oHb/6TDP4dQ32yVZZkWcgFW3CjICSnCZopLYOQoyHuLkNQ GpwA== X-Gm-Message-State: AJaThX7K/smUemeiUWAe3Q/p+8x+jF4vmjB7RNbcAyTR0SkYia7yxQFE BHh6sJw/2fSB5E6gsC+TTOs= X-Google-Smtp-Source: AGs4zMbCG/w9Oqhm+wKZEXHEwq8Uy494fC//kb0M6T2x+YMCtQUyVaA9M/hOkzIYf0CNe3FroZBhyw== X-Received: by 10.107.144.198 with SMTP id s189mr38209972iod.223.1511733595826; Sun, 26 Nov 2017 13:59:55 -0800 (PST) From: Michael Davidsaver To: Alexander Graf , David Gibson Date: Sun, 26 Nov 2017 15:59:10 -0600 Message-Id: <6cafcb638eb9c002b16e2459475d8ef7a2440849.1511731946.git.mdavidsaver@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c06::241 Subject: [Qemu-devel] [PATCH 12/17] e500: add i2c controller to CCSR 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: Michael Davidsaver , qemu-ppc@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add i2c controller found on mpc8540, mpc8544, and P2010 (newer ppc, unmodeled). Signed-off-by: Michael Davidsaver --- hw/ppc/e500_ccsr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/ppc/e500_ccsr.c b/hw/ppc/e500_ccsr.c index c479ed91ee..cd8216daaf 100644 --- a/hw/ppc/e500_ccsr.c +++ b/hw/ppc/e500_ccsr.c @@ -46,6 +46,8 @@ #define E500_ERR_DETECT (0x2e40) #define E500_ERR_DISABLE (0x2e44) =20 +#define E500_I2C_OFFSET (0x3000) + #define E500_DUART_OFFSET(N) (0x4500 + (N) * 0x100) =20 #define E500_PORPLLSR (0xE0000) @@ -72,6 +74,7 @@ typedef struct { uint32_t ccb_freq; =20 DeviceState *pic; + DeviceState *i2c; } CCSRState; =20 #define TYPE_E500_CCSR "e500-ccsr" @@ -272,6 +275,18 @@ static void e500_ccsr_realize(DeviceState *dev, Error = **errp) sysbus_mmio_get_region(pic, 0)); /* Note: MPIC internal interrupts are offset by 16 */ =20 + /* attach I2C controller */ + ccsr->i2c =3D qdev_create(NULL, "mpc8540-i2c"); + object_property_add_child(qdev_get_machine(), "i2c[*]", + OBJECT(ccsr->i2c), NULL); + qdev_init_nofail(ccsr->i2c); + memory_region_add_subregion(&ccsr->iomem, E500_I2C_OFFSET, + sysbus_mmio_get_region( + SYS_BUS_DEVICE(ccsr->i2c), 0)); + sysbus_connect_irq(SYS_BUS_DEVICE(ccsr->i2c), 0, + qdev_get_gpio_in(ccsr->pic, 16 + 27)); + + /* DUARTS */ /* for mpc8540, mpc8544, and P2010 (unmodeled), the DUART reference cl= ock * is the CCB clock divided by 16. --=20 2.11.0