From nobody Sun Apr 28 11:53:58 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=fb.com ARC-Seal: i=1; a=rsa-sha256; t=1652682549; cv=none; d=zohomail.com; s=zohoarc; b=gxQjM8GBWBgULvuV8mgj0aqkEPGeu7XRMdTBXgIRUyPb3R9sVyj3AxZrorxm+qdPXMawPp88ck8cRz65bzeDeMhiMSEbcN0X1exKRdBAwCQRaUl2jFpAHN8S8Cixw70GaxMNB2Kovyc4zG0t6QoQLS4DBEnxlGQSXCUEFIatLwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652682549; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=ohna0kSQZNJYA8/UiEi0oGFEMePnigdNLHozp+5/CjM=; b=J2+JWyBRPfGv2F7DjMTJ3aph4D1/hhPDh62Yo1uo/uGwCqVGHJgsuzTWFlSHmYr9PHs2uRRk+gqw66H3KavGkOpTaKG2X+v1FUC0xxOwhfCkyA3mqLa5TUc/WW2vQVpVegaoHQ+aPeCbvh8zK6OgDMluDXWfvXETbm4AV64Ju/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652682549304507.9888062134669; Sun, 15 May 2022 23:29:09 -0700 (PDT) Received: from localhost ([::1]:32802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqUE8-0002Fm-9B for importer2@patchew.org; Mon, 16 May 2022 02:29:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU8u-00074N-Aw for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:44 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:65298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU8q-0007OX-DD for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:44 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24FNv5Px030649 for ; Sun, 15 May 2022 23:23:38 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3g2br3y1rg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 15 May 2022 23:23:38 -0700 Received: from twshared31479.05.prn5.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 15 May 2022 23:23:36 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 0684264DCAC4; Sun, 15 May 2022 23:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=ohna0kSQZNJYA8/UiEi0oGFEMePnigdNLHozp+5/CjM=; b=phJ7f7esmezM2QgQ8KV5+McWHflr3z5bNqBa70QFuO2Y6dWmQd2MtD5PVjM0MybOl03n xIklh44Lif1/4rEo5TQ0dzFtQNwhPTFnCQM/pzp6ab7KXbAoXYLex03H7jICs6dejQNk tmy6dznE+Nzsp51PRXPt+04VfSjiAM1TAt8= From: Peter Delevoryas To: CC: , , , , , , , , , Subject: [PATCH v2 1/5] hw: aspeed: Add missing UART's Date: Sun, 15 May 2022 23:23:24 -0700 Message-ID: <20220516062328.298336-2-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516062328.298336-1-pdel@fb.com> References: <20220516062328.298336-1-pdel@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe X-Proofpoint-GUID: ejJTXAd7rku0UGxJiKEZSdiuI3ZiIUVT X-Proofpoint-ORIG-GUID: ejJTXAd7rku0UGxJiKEZSdiuI3ZiIUVT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-15_11,2022-05-13_01,2022-02-23_01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=67.231.145.42; envelope-from=prvs=6135bb9a91=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @fb.com) X-ZM-MESSAGEID: 1652682550421100001 Content-Type: text/plain; charset="utf-8" This adds the missing UART memory and IRQ mappings for the AST2400, AST2500, AST2600, and AST1030. This also includes the new UART interfaces added in the AST2600 and AST1030 from UART6 to UART13. The addresses and interrupt numbers for these two later chips are identical. Signed-off-by: Peter Delevoryas Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast10x0.c | 24 ++++++++++++++++++++++++ hw/arm/aspeed_ast2600.c | 19 +++++++++++++++++++ hw/arm/aspeed_soc.c | 6 ++++++ include/hw/arm/aspeed_soc.h | 8 ++++++++ 4 files changed, 57 insertions(+) diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index 9ae9efaac1..fa2cc4406c 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -33,14 +33,38 @@ static const hwaddr aspeed_soc_ast1030_memmap[] =3D { [ASPEED_DEV_SBC] =3D 0x7E6F2000, [ASPEED_DEV_GPIO] =3D 0x7E780000, [ASPEED_DEV_TIMER1] =3D 0x7E782000, + [ASPEED_DEV_UART1] =3D 0x7E783000, + [ASPEED_DEV_UART2] =3D 0x7E78D000, + [ASPEED_DEV_UART3] =3D 0x7E78E000, + [ASPEED_DEV_UART4] =3D 0x7E78F000, [ASPEED_DEV_UART5] =3D 0x7E784000, + [ASPEED_DEV_UART6] =3D 0x7E790000, + [ASPEED_DEV_UART7] =3D 0x7E790100, + [ASPEED_DEV_UART8] =3D 0x7E790200, + [ASPEED_DEV_UART9] =3D 0x7E790300, + [ASPEED_DEV_UART10] =3D 0x7E790400, + [ASPEED_DEV_UART11] =3D 0x7E790500, + [ASPEED_DEV_UART12] =3D 0x7E790600, + [ASPEED_DEV_UART13] =3D 0x7E790700, [ASPEED_DEV_WDT] =3D 0x7E785000, [ASPEED_DEV_LPC] =3D 0x7E789000, [ASPEED_DEV_I2C] =3D 0x7E7B0000, }; =20 static const int aspeed_soc_ast1030_irqmap[] =3D { + [ASPEED_DEV_UART1] =3D 47, + [ASPEED_DEV_UART2] =3D 48, + [ASPEED_DEV_UART3] =3D 49, + [ASPEED_DEV_UART4] =3D 50, [ASPEED_DEV_UART5] =3D 8, + [ASPEED_DEV_UART6] =3D 57, + [ASPEED_DEV_UART7] =3D 58, + [ASPEED_DEV_UART8] =3D 59, + [ASPEED_DEV_UART9] =3D 60, + [ASPEED_DEV_UART10] =3D 61, + [ASPEED_DEV_UART11] =3D 62, + [ASPEED_DEV_UART12] =3D 63, + [ASPEED_DEV_UART13] =3D 64, [ASPEED_DEV_GPIO] =3D 11, [ASPEED_DEV_TIMER1] =3D 16, [ASPEED_DEV_TIMER2] =3D 17, diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 4161a0cc4b..f3ecc0f3b7 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -61,7 +61,18 @@ static const hwaddr aspeed_soc_ast2600_memmap[] =3D { [ASPEED_DEV_IBT] =3D 0x1E789140, [ASPEED_DEV_I2C] =3D 0x1E78A000, [ASPEED_DEV_UART1] =3D 0x1E783000, + [ASPEED_DEV_UART2] =3D 0x1E78D000, + [ASPEED_DEV_UART3] =3D 0x1E78E000, + [ASPEED_DEV_UART4] =3D 0x1E78F000, [ASPEED_DEV_UART5] =3D 0x1E784000, + [ASPEED_DEV_UART6] =3D 0x1E790000, + [ASPEED_DEV_UART7] =3D 0x1E790100, + [ASPEED_DEV_UART8] =3D 0x1E790200, + [ASPEED_DEV_UART9] =3D 0x1E790300, + [ASPEED_DEV_UART10] =3D 0x1E790400, + [ASPEED_DEV_UART11] =3D 0x1E790500, + [ASPEED_DEV_UART12] =3D 0x1E790600, + [ASPEED_DEV_UART13] =3D 0x1E790700, [ASPEED_DEV_VUART] =3D 0x1E787000, [ASPEED_DEV_I3C] =3D 0x1E7A0000, [ASPEED_DEV_SDRAM] =3D 0x80000000, @@ -78,6 +89,14 @@ static const int aspeed_soc_ast2600_irqmap[] =3D { [ASPEED_DEV_UART3] =3D 49, [ASPEED_DEV_UART4] =3D 50, [ASPEED_DEV_UART5] =3D 8, + [ASPEED_DEV_UART6] =3D 57, + [ASPEED_DEV_UART7] =3D 58, + [ASPEED_DEV_UART8] =3D 59, + [ASPEED_DEV_UART9] =3D 60, + [ASPEED_DEV_UART10] =3D 61, + [ASPEED_DEV_UART11] =3D 62, + [ASPEED_DEV_UART12] =3D 63, + [ASPEED_DEV_UART13] =3D 64, [ASPEED_DEV_VUART] =3D 8, [ASPEED_DEV_FMC] =3D 39, [ASPEED_DEV_SDMC] =3D 0, diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index c339b5c74d..96bc060680 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -48,6 +48,9 @@ static const hwaddr aspeed_soc_ast2400_memmap[] =3D { [ASPEED_DEV_ETH1] =3D 0x1E660000, [ASPEED_DEV_ETH2] =3D 0x1E680000, [ASPEED_DEV_UART1] =3D 0x1E783000, + [ASPEED_DEV_UART2] =3D 0x1E78D000, + [ASPEED_DEV_UART3] =3D 0x1E78E000, + [ASPEED_DEV_UART4] =3D 0x1E78F000, [ASPEED_DEV_UART5] =3D 0x1E784000, [ASPEED_DEV_VUART] =3D 0x1E787000, [ASPEED_DEV_SDRAM] =3D 0x40000000, @@ -80,6 +83,9 @@ static const hwaddr aspeed_soc_ast2500_memmap[] =3D { [ASPEED_DEV_ETH1] =3D 0x1E660000, [ASPEED_DEV_ETH2] =3D 0x1E680000, [ASPEED_DEV_UART1] =3D 0x1E783000, + [ASPEED_DEV_UART2] =3D 0x1E78D000, + [ASPEED_DEV_UART3] =3D 0x1E78E000, + [ASPEED_DEV_UART4] =3D 0x1E78F000, [ASPEED_DEV_UART5] =3D 0x1E784000, [ASPEED_DEV_VUART] =3D 0x1E787000, [ASPEED_DEV_SDRAM] =3D 0x80000000, diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 3789f38603..709a78285b 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -105,6 +105,14 @@ enum { ASPEED_DEV_UART3, ASPEED_DEV_UART4, ASPEED_DEV_UART5, + ASPEED_DEV_UART6, + ASPEED_DEV_UART7, + ASPEED_DEV_UART8, + ASPEED_DEV_UART9, + ASPEED_DEV_UART10, + ASPEED_DEV_UART11, + ASPEED_DEV_UART12, + ASPEED_DEV_UART13, ASPEED_DEV_VUART, ASPEED_DEV_FMC, ASPEED_DEV_SPI1, --=20 2.30.2 From nobody Sun Apr 28 11:53:58 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=fb.com ARC-Seal: i=1; a=rsa-sha256; t=1652683069; cv=none; d=zohomail.com; s=zohoarc; b=InwjB34nsRcckhn1/HsYiPRBlwvuDOtQy9FMIob60JptajT28e0U5MHaTVW5Hl5P3KoDDh7oII7RQfxalA92XhSjd3uQt4ooB4Ph+eUDQjaAff4A86EY+aHJ5ZjkbxEg2/ooHX6AV8HR6vlQnyNQdwiqhMYqZwgB4grshnD7h1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652683069; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=MhV2WzQFftexu84+S3Sz45mHbW9FTIjUzPcUF4rPqx8=; b=IuegYLDTIwe0ix0KFdtAh3ppjtEr5P+0zA2Tn8SbpZgI5xCGRIJ2VI/Dn/VRqJR0mF09CmvPFrKEMB0mqIORlc4ByIKFUPrb0WIgLsrKrE/jCl+HI4DkgZKubLdG9alr705WsxA98ME9XN2g38Ba3UzXX04ne7lymIV5KgFzv7o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165268306966382.66595763745204; Sun, 15 May 2022 23:37:49 -0700 (PDT) Received: from localhost ([::1]:40114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqUMW-0007Qx-BF for importer2@patchew.org; Mon, 16 May 2022 02:37:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU94-0007It-2h for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:56 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:42036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU92-0007RS-D3 for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:53 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24G0QTe8028791 for ; Sun, 15 May 2022 23:23:51 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3g28fk7mdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 15 May 2022 23:23:51 -0700 Received: from twshared31479.05.prn5.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 15 May 2022 23:23:49 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 0CDC764DCAC6; Sun, 15 May 2022 23:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=MhV2WzQFftexu84+S3Sz45mHbW9FTIjUzPcUF4rPqx8=; b=nmPPW2Wj5Js2ejrFTyIapeFUNOmSdAE8gkDlsNn//8AX62VyZp3puMU6StWh/eId23g7 rs3eRhPoxwQhYnpZbnAHQzVPSqT8LFHBkc3EcWrVE+uTEpUceV4+lYJKcHCIZspNGtJK ZBpHSyOPGe7dnZMt/FayY95HI4zWAR0rZ88= From: Peter Delevoryas To: CC: , , , , , , , , , Subject: [PATCH v2 2/5] hw: aspeed: Add uarts_num SoC attribute Date: Sun, 15 May 2022 23:23:25 -0700 Message-ID: <20220516062328.298336-3-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516062328.298336-1-pdel@fb.com> References: <20220516062328.298336-1-pdel@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: jJ4-n3vLZI2tXMcSmjy91zpOIjw6HGuX X-Proofpoint-GUID: jJ4-n3vLZI2tXMcSmjy91zpOIjw6HGuX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-15_11,2022-05-13_01,2022-02-23_01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=67.231.145.42; envelope-from=prvs=6135bb9a91=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @fb.com) X-ZM-MESSAGEID: 1652683070972100001 Content-Type: text/plain; charset="utf-8" AST2400 and AST2500 have 5 UART's, while the AST2600 and AST1030 have 13. Signed-off-by: Peter Delevoryas Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast10x0.c | 1 + hw/arm/aspeed_ast2600.c | 1 + hw/arm/aspeed_soc.c | 2 ++ include/hw/arm/aspeed_soc.h | 1 + 4 files changed, 5 insertions(+) diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index fa2cc4406c..bb8177e86c 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -301,6 +301,7 @@ static void aspeed_soc_ast1030_class_init(ObjectClass *= klass, void *data) sc->ehcis_num =3D 0; sc->wdts_num =3D 4; sc->macs_num =3D 1; + sc->uarts_num =3D 13; sc->irqmap =3D aspeed_soc_ast1030_irqmap; sc->memmap =3D aspeed_soc_ast1030_memmap; sc->num_cpus =3D 1; diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index f3ecc0f3b7..a9523074a0 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -588,6 +588,7 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *= oc, void *data) sc->ehcis_num =3D 2; sc->wdts_num =3D 4; sc->macs_num =3D 4; + sc->uarts_num =3D 13; sc->irqmap =3D aspeed_soc_ast2600_irqmap; sc->memmap =3D aspeed_soc_ast2600_memmap; sc->num_cpus =3D 2; diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index 96bc060680..7008cd1af7 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -490,6 +490,7 @@ static void aspeed_soc_ast2400_class_init(ObjectClass *= oc, void *data) sc->ehcis_num =3D 1; sc->wdts_num =3D 2; sc->macs_num =3D 2; + sc->uarts_num =3D 5; sc->irqmap =3D aspeed_soc_ast2400_irqmap; sc->memmap =3D aspeed_soc_ast2400_memmap; sc->num_cpus =3D 1; @@ -516,6 +517,7 @@ static void aspeed_soc_ast2500_class_init(ObjectClass *= oc, void *data) sc->ehcis_num =3D 2; sc->wdts_num =3D 3; sc->macs_num =3D 2; + sc->uarts_num =3D 5; sc->irqmap =3D aspeed_soc_ast2500_irqmap; sc->memmap =3D aspeed_soc_ast2500_memmap; sc->num_cpus =3D 1; diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 709a78285b..669bc49855 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -91,6 +91,7 @@ struct AspeedSoCClass { int ehcis_num; int wdts_num; int macs_num; + int uarts_num; const int *irqmap; const hwaddr *memmap; uint32_t num_cpus; --=20 2.30.2 From nobody Sun Apr 28 11:53:58 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=fb.com ARC-Seal: i=1; a=rsa-sha256; t=1652682561; cv=none; d=zohomail.com; s=zohoarc; b=YlEP7APlEnIfyunzHZCjFE5YmAxECrfjVkI6jjdVTNuAIC0dlXvw8whLPZt3U7goQ6R/OXj4YFVVnZWxcWJkzxtwA+qsCl5k1cYdCyIj/Qy/48b73tPyCGfh3wEmOF51vfC1gh3ux0nppRDXsZ9cuRlns469qkQ2xRBQgM8DMa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652682561; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=x4FXEitBRDcPcuntXgCai+9tBY2HrXWzc+iu8zmQfKE=; b=FsDVEmYDhItT6y0oKsLQ7cjz+EbjHrAnuKIEQ4WraGdxPnWm2ADlFEkO5j1Z/xGKvn65o0M6TI3KRjcSj17PUq0MKVqmh9/qpz8RWtp38AyeG3WYWcIPIpyZfSqkCwXC9QTNvp5fZrYZtJzODgLtI2hD+C95EBt6ce/d332H4Yc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165268256120784.26927546339402; Sun, 15 May 2022 23:29:21 -0700 (PDT) Received: from localhost ([::1]:32940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqUEK-0002LH-4L for importer2@patchew.org; Mon, 16 May 2022 02:29:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU8v-00075T-LF for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:45 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:22766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU8s-0007Ok-R3 for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:45 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24FMaBnI018359 for ; Sun, 15 May 2022 23:23:41 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3g28fk7mdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 15 May 2022 23:23:41 -0700 Received: from twshared6447.05.prn5.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::c) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 15 May 2022 23:23:39 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 1373B64DCAC8; Sun, 15 May 2022 23:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=x4FXEitBRDcPcuntXgCai+9tBY2HrXWzc+iu8zmQfKE=; b=BajbWczbaut8DgTgRjLXODOFpyDpejY41h9ntFHVvxt/3FtwytLoRNl//DqsWjBJRum+ DUKKkEbvEtS6yDjGhJFqHIE70S1SXYOIdwUjwySMGu8NyfdVF9LhlqRKdWhcV9C4VElO 8HNyffh1gKRd09KoWF9Evv+YrYsuIPe1r+g= From: Peter Delevoryas To: CC: , , , , , , , , , Subject: [PATCH v2 3/5] hw: aspeed: Ensure AST1030 respects uart-default Date: Sun, 15 May 2022 23:23:26 -0700 Message-ID: <20220516062328.298336-4-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516062328.298336-1-pdel@fb.com> References: <20220516062328.298336-1-pdel@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: 2CzuV1PDPZ7_5c7460njDH5G3XnDTg3T X-Proofpoint-GUID: 2CzuV1PDPZ7_5c7460njDH5G3XnDTg3T X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-15_11,2022-05-13_01,2022-02-23_01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=67.231.145.42; envelope-from=prvs=6135bb9a91=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @fb.com) X-ZM-MESSAGEID: 1652682562343100001 Content-Type: text/plain; charset="utf-8" The AST1030 machine initialization was not respecting the Aspeed SoC property "uart-default", which specifies which UART should be connected to the first serial device, it was just always connecting UART5. This doesn't change any behavior, because the default value for "uart-default" is UART5, but it makes it possible to override this in new machine definitions using the AST1030. Signed-off-by: Peter Delevoryas Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast10x0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index bb8177e86c..faafb800f3 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -215,9 +215,9 @@ static void aspeed_soc_ast1030_realize(DeviceState *dev= _soc, Error **errp) qdev_get_gpio_in(DEVICE(&s->armv7m), sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kc= s_4)); =20 - /* UART5 - attach an 8250 to the IO space as our UART */ - serial_mm_init(get_system_memory(), sc->memmap[ASPEED_DEV_UART5], 2, - aspeed_soc_get_irq(s, ASPEED_DEV_UART5), + /* UART - attach an 8250 to the IO space as our UART */ + serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, + aspeed_soc_get_irq(s, s->uart_default), 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); =20 /* Timer */ --=20 2.30.2 From nobody Sun Apr 28 11:53:58 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=fb.com ARC-Seal: i=1; a=rsa-sha256; t=1652682494; cv=none; d=zohomail.com; s=zohoarc; b=YDBOfvPVc+8KK52dXdjtxzhlwbefTZJcFbd+JXfgdLz/eJfz0dC0UBcPI1jXdL6bWJ7eQ/gGtGmYl8lca7BREaJfFOCx4D6gb01xBn1OvjTzKRCxQMGk9G4dcdNV7PCjQN+DRHO+LdW9N7GsoSH1r3VrwGjgOpWWpp1xTEvrTpM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652682494; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=kDV6iV5F7fBqFLCXnJIhHkzMTp2lToozwCevtU/G/aw=; b=j7HNExrmyRO74rI92+a7Ah5kBmAcwKwXxxiYGwsmdOQuG6pkjlHbMyfU+abRiUzPoFs0vOTdJ+LDxespE5jetlPbdgu+E/Ays3+yitw0i8bsZa+/if5rphTkRmd5k7a5qXFAxS39DDWsxbm4mXCSPiGpKpWSHFkS1KwC8Vpbmys= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652682494260216.2168367812261; Sun, 15 May 2022 23:28:14 -0700 (PDT) Received: from localhost ([::1]:60360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqUDF-0001ok-44 for importer2@patchew.org; Mon, 16 May 2022 02:28:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU92-0007Gf-2i for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:52 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:24834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU90-0007R3-DG for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:51 -0400 Received: from pps.filterd (m0148460.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24G2dm6X023330 for ; Sun, 15 May 2022 23:23:49 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3g29xxf9ys-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 15 May 2022 23:23:49 -0700 Received: from twshared3657.05.prn5.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:21d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 15 May 2022 23:23:42 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 1A49964DCACC; Sun, 15 May 2022 23:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=kDV6iV5F7fBqFLCXnJIhHkzMTp2lToozwCevtU/G/aw=; b=ZAXiWRAqaEXz7mr6Q7btcPxjNe4m5HpMQULsqhfX06PxAsZlZ68AVQfFFTyao06L8GCi lwuPlVC2DVahwv9zSS1hwVASvWV7GU2En14ATTSEZRav9FoE6CD8XB+1nH8p7rOpVS6N qukuqKSuR88NdUWzTQ87HcDWpbuafbrwHJQ= From: Peter Delevoryas To: CC: , , , , , , , , , Subject: [PATCH v2 4/5] hw: aspeed: Introduce common UART init function Date: Sun, 15 May 2022 23:23:27 -0700 Message-ID: <20220516062328.298336-5-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516062328.298336-1-pdel@fb.com> References: <20220516062328.298336-1-pdel@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-FB-Internal: Safe X-Proofpoint-GUID: lMu_RtQ4tP9aEu_AjbZO9mQYVN50TMfD X-Proofpoint-ORIG-GUID: lMu_RtQ4tP9aEu_AjbZO9mQYVN50TMfD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-15_11,2022-05-13_01,2022-02-23_01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=67.231.153.30; envelope-from=prvs=6135bb9a91=pdel@fb.com; helo=mx0b-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @fb.com) X-ZM-MESSAGEID: 1652682496450100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Delevoryas Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_ast10x0.c | 7 ++----- hw/arm/aspeed_ast2600.c | 7 ++----- hw/arm/aspeed_soc.c | 16 ++++++++++++---- include/hw/arm/aspeed_soc.h | 1 + 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c index faafb800f3..938615d55f 100644 --- a/hw/arm/aspeed_ast10x0.c +++ b/hw/arm/aspeed_ast10x0.c @@ -15,7 +15,6 @@ #include "sysemu/sysemu.h" #include "hw/qdev-clock.h" #include "hw/misc/unimp.h" -#include "hw/char/serial.h" #include "hw/arm/aspeed_soc.h" =20 #define ASPEED_SOC_IOMEM_SIZE 0x00200000 @@ -215,10 +214,8 @@ static void aspeed_soc_ast1030_realize(DeviceState *de= v_soc, Error **errp) qdev_get_gpio_in(DEVICE(&s->armv7m), sc->irqmap[ASPEED_DEV_KCS] + aspeed_lpc_kc= s_4)); =20 - /* UART - attach an 8250 to the IO space as our UART */ - serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, - aspeed_soc_get_irq(s, s->uart_default), - 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); + /* UART */ + aspeed_soc_uart_init(s); =20 /* Timer */ object_property_set_link(OBJECT(&s->timerctrl), "scu", OBJECT(&s->scu), diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index a9523074a0..b0a4199b69 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -11,7 +11,6 @@ #include "qapi/error.h" #include "hw/misc/unimp.h" #include "hw/arm/aspeed_soc.h" -#include "hw/char/serial.h" #include "qemu/module.h" #include "qemu/error-report.h" #include "hw/i2c/aspeed_i2c.h" @@ -372,10 +371,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *de= v, Error **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, aspeed_soc_get_irq(s, ASPEED_DEV_ADC)); =20 - /* UART - attach an 8250 to the IO space as our UART */ - serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, - aspeed_soc_get_irq(s, s->uart_default), 38400, - serial_hd(0), DEVICE_LITTLE_ENDIAN); + /* UART */ + aspeed_soc_uart_init(s); =20 /* I2C */ object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr), diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index 7008cd1af7..912798a9c9 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -303,10 +303,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error= **errp) sysbus_connect_irq(SYS_BUS_DEVICE(&s->adc), 0, aspeed_soc_get_irq(s, ASPEED_DEV_ADC)); =20 - /* UART - attach an 8250 to the IO space as our UART */ - serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, - aspeed_soc_get_irq(s, s->uart_default), 38400, - serial_hd(0), DEVICE_LITTLE_ENDIAN); + /* UART */ + aspeed_soc_uart_init(s); =20 /* I2C */ object_property_set_link(OBJECT(&s->i2c), "dram", OBJECT(s->dram_mr), @@ -544,3 +542,13 @@ qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev) { return ASPEED_SOC_GET_CLASS(s)->get_irq(s, dev); } + +void aspeed_soc_uart_init(AspeedSoCState *s) +{ + AspeedSoCClass *sc =3D ASPEED_SOC_GET_CLASS(s); + + /* Attach an 8250 to the IO space as our UART */ + serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, + aspeed_soc_get_irq(s, s->uart_default), 38400, + serial_hd(0), DEVICE_LITTLE_ENDIAN); +} diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 669bc49855..02a5a9ffcb 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -164,5 +164,6 @@ enum { }; =20 qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev); +void aspeed_soc_uart_init(AspeedSoCState *s); =20 #endif /* ASPEED_SOC_H */ --=20 2.30.2 From nobody Sun Apr 28 11:53:58 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=fb.com ARC-Seal: i=1; a=rsa-sha256; t=1652683226; cv=none; d=zohomail.com; s=zohoarc; b=V4mBZsDHkKQpN31MH0NQ8oo6e30wsEolYMtZBfdvGm8gGGmFuSaihAC0M3UQYGgLXe3uG2rigMXhkPuQvIzNVnAn5Jf9HKkg1f5DqoLp9WCAtQ5pQKuWIYxI50+rFJoDd+mJpYXU1Q2+2F5/pHuASqBisKgUbQNkHkI/HLA/BR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652683226; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject; bh=6CL1/KK/2w9upNeYwoETLMMDFnfRyRFpi+VsWJsj4s4=; b=CQxfUeRpA8nPWki82YF4wEZdfYdTQaTNJI6CGeC2Z9/RyluHM/hKK9UCO46Zetx1v0r5qJGPfdP6IbdjEZZbznhs3Th16uEVbV6qG0cejNzAzSkjX5wSt9z0XaFiVtT4c5k4/ZgqKJrQNkAAAkIiXsukelGficp6vJ0EDX7YcSI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652683226959238.0676356642307; Sun, 15 May 2022 23:40:26 -0700 (PDT) Received: from localhost ([::1]:41244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqUP3-0008T3-FD for importer2@patchew.org; Mon, 16 May 2022 02:40:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU96-0007Iy-IF for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:56 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:2936) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqU94-0007Rq-H3 for qemu-devel@nongnu.org; Mon, 16 May 2022 02:23:56 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24FNMkGt031036 for ; Sun, 15 May 2022 23:23:53 -0700 Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 3g2br3y1s7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sun, 15 May 2022 23:23:52 -0700 Received: from twshared6447.05.prn5.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:83::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 15 May 2022 23:23:51 -0700 Received: by devvm9194.prn0.facebook.com (Postfix, from userid 385188) id 20A9564DCACE; Sun, 15 May 2022 23:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=facebook; bh=6CL1/KK/2w9upNeYwoETLMMDFnfRyRFpi+VsWJsj4s4=; b=pGlttGHUD+q3VXr7p6+x0fgcPAvfHlaBAxXhTN2AnB/dEVSViXm0+3B5k9ZI+KesNiDV hUVU20vqSvybd6Ia8TDQjevcgwynN41aClRRP5iY5cndS2IxDi+Kxivv/5fxjzg6wt7X Y9JCfa3z1NXDd9P/U5Y64IwCTAJJWslgfJs= From: Peter Delevoryas To: CC: , , , , , , , , , Subject: [PATCH v2 5/5] hw: aspeed: Init all UART's with serial devices Date: Sun, 15 May 2022 23:23:28 -0700 Message-ID: <20220516062328.298336-6-pdel@fb.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220516062328.298336-1-pdel@fb.com> References: <20220516062328.298336-1-pdel@fb.com> X-FB-Internal: Safe X-Proofpoint-GUID: B1se35HB9VC1S2DzpdD7Jg5uO58KbNIZ X-Proofpoint-ORIG-GUID: B1se35HB9VC1S2DzpdD7Jg5uO58KbNIZ Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-15_11,2022-05-13_01,2022-02-23_01 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=67.231.145.42; envelope-from=prvs=6135bb9a91=pdel@fb.com; helo=mx0a-00082601.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @fb.com) X-ZM-MESSAGEID: 1652683227949100001 Content-Type: text/plain; charset="utf-8" Background: AspeedMachineClass.uart_default specifies the serial console UART, which usually corresponds to the "stdout-path" in the device tree. The default value is UART5, since most boards use UART5 for this: amc->uart_default =3D ASPEED_DEV_UART5; Users can override AspeedMachineClass.uart_default in their board's machine class init to specify something besides UART5. For example, for fuji-bmc: amc->uart_default =3D ASPEED_DEV_UART1; We only connect this one UART, of the 5 UART's on the AST2400 and AST2500 and the 13 UART's on the AST2600 and AST1030, to a serial device that QEMU users can use. None of the other UART's are initialized, and the only way to override this attribute is by creating a specialized board definition, requiring QEMU source code changes and rebuilding. The result of this is that if you want to get serial console output on a board that uses UART3, you need to add a board definition. This was encountered by Zev in OpenBMC. [1] Changes: This commit initializes all of the UART's present on each Aspeed chip with serial devices and allows the QEMU user to connect as many or few as they like to serial devices. For example, you can still run QEMU and just connect stdout to the machine's default UART, without specifying any additional serial devices: qemu-system-arm -machine fuji-bmc \ -drive file=3Dfuji.mtd,format=3Draw,if=3Dmtd \ -nographic However, if you don't want to add a special machine definition, you can now manually configure UART1 to connect to stdout and get serial console output, even if the machine's default is UART5: qemu-system-arm -machine ast2600-evb \ -drive file=3Dfuji.mtd,format=3Draw,if=3Dmtd \ -serial null -serial mon:stdio -display none In the example above, the first "-serial null" argument is connected to UART5, and "-serial mon:stdio" is connected to UART1. Another example: you can get serial console output from Wedge100, which uses UART3, by reusing the palmetto AST2400 machine and rewiring the serial device arguments: qemu-system-arm -machine palmetto-bmc \ -drive file=3Dwedge100.mtd,format=3Draw,if=3Dmtd \ -serial null -serial null -serial null \ -serial mon:stdio -display none There is a slight change in behavior introduced with this change: now, each UART's memory-mapped IO region will have a serial device model connected to it. Previously, all reads and writes to those regions would be ineffective and return zero values, but now some values will be nonzero, even when the user doesn't connect a serial device backend (like a socket, file, etc). For example, the line status register might indicate that the transmit buffer is empty now, whereas previously it might have always indicated it was full. [1] https://lore.kernel.org/openbmc/YnzGnWjkYdMUUNyM@hatter.bewilderbeest.n= et/ [2] https://github.com/facebook/openbmc/releases/download/v2021.49.0/fuji.m= td [3] https://github.com/facebook/openbmc/releases/download/v2021.49.0/wedge1= 00.mtd Signed-off-by: Peter Delevoryas Reviewed-by: C=C3=A9dric Le Goater --- hw/arm/aspeed_soc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index 912798a9c9..30574d4276 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -546,9 +546,18 @@ qemu_irq aspeed_soc_get_irq(AspeedSoCState *s, int dev) void aspeed_soc_uart_init(AspeedSoCState *s) { AspeedSoCClass *sc =3D ASPEED_SOC_GET_CLASS(s); + int i, uart; =20 /* Attach an 8250 to the IO space as our UART */ serial_mm_init(get_system_memory(), sc->memmap[s->uart_default], 2, aspeed_soc_get_irq(s, s->uart_default), 38400, serial_hd(0), DEVICE_LITTLE_ENDIAN); + for (i =3D 1, uart =3D ASPEED_DEV_UART1; i < sc->uarts_num; i++, uart+= +) { + if (uart =3D=3D s->uart_default) { + uart++; + } + serial_mm_init(get_system_memory(), sc->memmap[uart], 2, + aspeed_soc_get_irq(s, uart), 38400, + serial_hd(i), DEVICE_LITTLE_ENDIAN); + } } --=20 2.30.2