From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:505:70c3:b0:1be9:327d:8ee3 with SMTP id lw3csp1101413njc; Mon, 30 Sep 2024 01:54:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV77kKucHpWly0hoS09Q/JgyTzNBYKg2I/h1Lr8o3MtXi1MjuO0GW6HYffC2rdCFXyyUiuWD+N147BROg==@linaro.org X-Google-Smtp-Source: AGHT+IHMX/9mxB/D2DkSQJggQWX/Qsz577BixHhI6i7kMnXXOF7YkEavkZDwzPPBDb76HbVXeWQA X-Received: by 2002:a05:622a:47c7:b0:45c:a605:1dae with SMTP id d75a77b69052e-45ca6052053mr131271981cf.46.1727686447012; Mon, 30 Sep 2024 01:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727686446; cv=none; d=google.com; s=arc-20240605; b=gZY4ad4zhNP4VGIR3zaEKm3fV5PjjUzvdgc/Wql947oZuzgbt80qPMxbhnKypi5vGs TfV2eeJJExsZagm27rgEsc+8oMa6sheCvIGAXX5/V6OtreXvymgLsdtLlBFIXOXGgViZ 5iHs/rMl1sUyeC3d/Qe7qfbFk+kq56ZvD2OP34en3CTZC4ytm48L1s/yR86aV3WIH6IY dCpyCj2VvExLXrBWR5c5TUJI50cNrfI0bps9GXIqH//+DGXba+UKCt10UGZTOgkjOuxQ n+i7FIgozJ2ACCyU+VHsQ6k83Itl/24q41XjUAjj6GyQmMkTtAlLsA9aghRrPzGxF+zL /99w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:from:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to; bh=E1aJgTapTGKh1ov4anz8/SwyvJUiyZJ0KxVT5UqB6y8=; fh=bfdvnURtAD34fQ77QeZnvwdM4/zSvHk1Doa+KIkv0v8=; b=YZAmBbi7XDrIcDGHkUGhLJbO93gBw45E6iwRh7UG4Y4lz+yDu90Xzx+3+sMCxMRtSr Z9ceYjsYMpggq+UwPiu4Ui2PnbqZu0ah/uDlSWp8bFjgcDhsD/uHLHxDWLkfcqUKdMQB n13NTLPRCdqwIuYrQ12OcFZCRijd3/+2Rf+Ln8RXDj8XVSVOzW7z1Yyp7TEN6kUSbm8A BUJcbeAIaq7pwqtEiEFOYicKTCvKaEA2E3VWeQegCA17ZdZQbrZOerxncVQnu3FRzxxT 2u1HujVamMVKTekZefUauGbij9uxnVYf0MNjjJnR8BzJrZcaJ4KL+CUaqZG1f34KJmFC OEYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-45caab156c1si62565651cf.86.2024.09.30.01.54.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Sep 2024 01:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svC9o-0005ba-7r; Mon, 30 Sep 2024 04:53:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svC9V-0003zF-HN; Mon, 30 Sep 2024 04:53:10 -0400 Received: from mail.aspeedtech.com ([211.20.114.72] helo=TWMBX01.aspeed.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svC9U-00025U-2g; Mon, 30 Sep 2024 04:53:09 -0400 Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Mon, 30 Sep 2024 16:52:41 +0800 Received: from localhost.localdomain (192.168.10.10) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Mon, 30 Sep 2024 16:52:41 +0800 To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Peter Maydell , Steven Lee , Troy Lee , Andrew Jeffery , "Joel Stanley" , Thomas Huth , Laurent Vivier , Paolo Bonzini , "open list:ASPEED BMCs" , "open list:All patches CC here" CC: , , Subject: [PATCH v6 7/8] aspeed/soc: Support GPIO for AST2700 Date: Mon, 30 Sep 2024 16:52:38 +0800 Message-ID: <20240930085239.3089901-8-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930085239.3089901-1-jamin_lin@aspeedtech.com> References: <20240930085239.3089901-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Received-SPF: pass client-ip=211.20.114.72; envelope-from=jamin_lin@aspeedtech.com; helo=TWMBX01.aspeed.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_FAIL=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jamin Lin From: Jamin Lin via Errors-To: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-devel-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: IYvAKJuuMyhY Add GPIO model for AST2700 GPIO support. The GPIO controller registers base address is start at 0x14C0_B000 and its address space is 0x1000. Signed-off-by: Jamin Lin --- hw/arm/aspeed_ast27x0.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c index 99135edc1e..dca660eb6b 100644 --- a/hw/arm/aspeed_ast27x0.c +++ b/hw/arm/aspeed_ast27x0.c @@ -62,6 +62,7 @@ static const hwaddr aspeed_soc_ast2700_memmap[] = { [ASPEED_GIC_REDIST] = 0x12280000, [ASPEED_DEV_ADC] = 0x14C00000, [ASPEED_DEV_I2C] = 0x14C0F000, + [ASPEED_DEV_GPIO] = 0x14C0B000, }; #define AST2700_MAX_IRQ 288 @@ -372,6 +373,9 @@ static void aspeed_soc_ast2700_init(Object *obj) snprintf(typename, sizeof(typename), "aspeed.i2c-%s", socname); object_initialize_child(obj, "i2c", &s->i2c, typename); + + snprintf(typename, sizeof(typename), "aspeed.gpio-%s", socname); + object_initialize_child(obj, "gpio", &s->gpio, typename); } /* @@ -657,6 +661,15 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c.busses[i]), 0, irq); } + /* GPIO */ + if (!sysbus_realize(SYS_BUS_DEVICE(&s->gpio), errp)) { + return; + } + aspeed_mmio_map(s, SYS_BUS_DEVICE(&s->gpio), 0, + sc->memmap[ASPEED_DEV_GPIO]); + sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0, + aspeed_soc_get_irq(s, ASPEED_DEV_GPIO)); + create_unimplemented_device("ast2700.dpmcu", 0x11000000, 0x40000); create_unimplemented_device("ast2700.iomem0", 0x12000000, 0x01000000); create_unimplemented_device("ast2700.iomem1", 0x14000000, 0x01000000); -- 2.34.1