From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:504:959a:b0:1be9:327d:8ee3 with SMTP id e26csp210347njl; Tue, 1 Oct 2024 07:14:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUuNsMxR1RyDwhEMq4T/U5mDuZSlwlxNMXwHrX2U/VmeytQRKyTiY730WSHHtH4Xiontl8iz8iqxxU+Qg==@linaro.org X-Google-Smtp-Source: AGHT+IGorXxDUOCy6/DqZZ+ozv//kUWvwgrFdaxA19sbBsxq806C2suGSOy0FkMoPhtHH4BDiK4+ X-Received: by 2002:a05:622a:10f:b0:458:5e19:b3a4 with SMTP id d75a77b69052e-45c9f284e48mr219890311cf.38.1727792078258; Tue, 01 Oct 2024 07:14:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727792078; cv=none; d=google.com; s=arc-20240605; b=RI6a9PF7FMI/cfmXBG9m3X62ClsHk7dnnKQISUTNrI9W3nlbPA2fB/wjqGMJV/xnJp HCFkJ/iTcVg0K6ctdRD5aD4aQToW+H18lTyl9YlQ0az4nn5LUebFgx5c+5aKzOol+I+o 7fAnhc+SL/kqYB2NNX9S7asIA72DO6mKupXf1cLPZ1E/3wc4Yq7HYc5Ppbl1ebJTIgFZ WyjARtTl5S3eTQp9qx594srUHfLiCWClpzu5qTRzd05lFAEpJA1PFLRMNekw5Nv3TOwN GNX3//ZFF5dddAJO+Gim4Bd8CxspNxUWYC05NPrDe65Djs2X3YYd6VYO4ZJ+fLpBj2dZ AGiQ== 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=RnpqMoJ6tWN50wkjDhj0i0ot0T3+tZ4VIy3HeQNmMBs=; fh=RdJersRTvVIU6GkG8yrSEUovA6vfgZWQMb4aw2HkXSs=; b=kW1bx9vdxXC5CwbWucD+8e65yv45MFjh2pI8zxwmtCECKKgPaSelh3RbwU0VCoGdtE vUvTdQ8HyTi4HNI8ItgfMCcYDSajiaicBVBhDFaHOvz7aztAGf4t35YnE9i1lNVd5z4m wrNJ8vz0jSa06UlLsTRgV/SSRL6PWkzjZhaVTQSYtB1AbeOHHCOv3RENXjocI4JEw2dZ sVJQFz81nLWYWhbkAvEy37KDke0Y8rCwKYeBTkk9cc4SIlP3VMvVC31BJ98Hxxxl+tuf qJueItV7UinSzR5toeVPERF4Iuc4FRYEXqwDUny/qkh5nViAUiPulfJzc3blW1CGm6GA 9W8w==; 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-45c9f28ece4si110009691cf.37.2024.10.01.07.14.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Oct 2024 07:14:38 -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 1svdcG-0008VW-6P; Tue, 01 Oct 2024 10:12:40 -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 1svdc6-0007uH-70; Tue, 01 Oct 2024 10:12:31 -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 1svdc2-0003Bx-Rn; Tue, 01 Oct 2024 10:12:29 -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; Tue, 1 Oct 2024 10:43:36 +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; Tue, 1 Oct 2024 10:43:36 +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: , , , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v7 7/8] aspeed/soc: Support GPIO for AST2700 Date: Tue, 1 Oct 2024 10:43:33 +0800 Message-ID: <20241001024334.834807-8-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241001024334.834807-1-jamin_lin@aspeedtech.com> References: <20241001024334.834807-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: 7UMnRilfFJpV 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 Reviewed-by: Cédric Le Goater --- 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