Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 076FFECE577 for ; Sat, 7 Sep 2024 23:17:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sn4fQ-0003m1-5A; Sat, 07 Sep 2024 19:16:32 -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 1sn4fG-0003dM-KU; Sat, 07 Sep 2024 19:16:22 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sn4fE-0005z8-OB; Sat, 07 Sep 2024 19:16:22 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so7675935e9.0; Sat, 07 Sep 2024 16:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725750977; x=1726355777; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zdUYCB5+/YQr+E0TUUm0Dw5lCY94glCNJFdQX81xI9k=; b=Mvuu6oXuRC7EzrlvkiILtI0CMltGgvsfWoZdMtgDdhgwKs1Vt9g2zkwwu0N4S9rpjb Qtz96QlK4FYgA/QdHm/L5v1sXOd2lqbMYUAGdYrv+nGKIspAHZNcfFytkL0TUJAxd0r6 my/G+rG2wKOR2Y+1FZoOyHa6IBZcqzilup/nfISl3T+iaiCEp/Wk2LNHNpQ9mSL79ACi FAhohXCVB1mXgstjS7K8610NhF8pLLp2sW8tr9Ug3HDQ23m0ef6uULtH+8ktFhEO8a4G 0xEuGbj2m+C7VBd3WRiiqfyD8eKrMfgVTs25qP4Sa3MWm4ZaKYX6Xvuipm3qVnNl98IU TIdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725750977; x=1726355777; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zdUYCB5+/YQr+E0TUUm0Dw5lCY94glCNJFdQX81xI9k=; b=JoCOWjFyb0nzk8cLTppyUa6flp3ooTTL30TCjX1knfW0888eOlr4c3eDXppMlFIl2L MnnqfXi44fN+oi7MlPE8jxe48NIbCyaaxjGAJLtxokHtiAiM+/HjN0kSlHcyAsYEVlHL z3fmXym8E9clChQo8bzD1DXQcV6n3QNT2mLLcZxQpcqwCnWAomske7T/anZI3dJHFp/U n0/fsiLO44i22+wuDUMlgEDxmZ+b2JCCuuOF63FkGNTBK5Yx/V7BLcWCC1OD4Dh3DUR1 N0aNz8WnhOkaEDPZwILVe+KuEy2N8sOO/a0WvcVVtfle9JH0dgIAPTjcWn0jso003FMi 0j2Q== X-Forwarded-Encrypted: i=1; AJvYcCUKDZyJLMZJ/kFb98En2eKkcwqKOweef1rgUYM/fjVxVqjGdLnGXvlT6DTQDARNvp9+l9t5J8yXLIsR4g==@nongnu.org, AJvYcCVkhZelyoLsmY0ZTA8RhQrSXhHtRl2vtO7vQ7rehgnwB87B2cnSZfUXa19+VduZcIiXdZXKNm+xIJo=@nongnu.org, AJvYcCWRcKDrMIWmZHaH+zjas89qkJyMc81ivHT0ipP780VOOhcK3oUoOEYQReBjbzuwkgGuPUwk/DatvQ==@nongnu.org X-Gm-Message-State: AOJu0YzfzJNvZRwBokcJvsIwk9rx7+KThMcbRwAMRYC7UGZsq9Ri3Z65 JO0uqbe7AVFiNgCJ1y1c2TXJwwH9cPQItlDoq2SysBfu8RR0kGIR X-Google-Smtp-Source: AGHT+IE3oPNtsLmeGhxgrRyUZTn7JO4U9vNi6p0bkRLny2KBsyBv3JWF4YxIrSRIE4hfdXOaUBgWJQ== X-Received: by 2002:a5d:5452:0:b0:374:c0cc:a1fb with SMTP id ffacd0b85a97d-378896573fbmr4733165f8f.39.1725750977217; Sat, 07 Sep 2024 16:16:17 -0700 (PDT) Received: from [127.0.0.1] ([185.238.219.7]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675bc9sm2223140f8f.56.2024.09.07.16.16.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2024 16:16:16 -0700 (PDT) Date: Sat, 07 Sep 2024 17:33:47 +0000 From: Bernhard Beschow To: BALATON Zoltan CC: qemu-devel@nongnu.org, Jamin Lin , Helge Deller , Song Gao , Stafford Horne , Daniel Henrique Barboza , Joel Stanley , Troy Lee , Nicholas Piggin , Bin Meng , Jiaxun Yang , Paolo Bonzini , Max Filippov , Richard Henderson , Artyom Tarasenko , Aurelien Jarno , qemu-riscv@nongnu.org, "Edgar E. Iglesias" , Weiwei Li , =?ISO-8859-1?Q?C=E9dric_Le_Goater?= , "Michael S. Tsirkin" , Hao Wu , Mark Cave-Ayland , Steven Lee , Marcel Apfelbaum , Andrew Jeffery , Alistair Francis , Beniamino Galvani , Subbaraya Sundeep , =?ISO-8859-1?Q?Fr=E9d=E9ric_Barrat?= , =?ISO-8859-1?Q?Marc-Andr=E9_Lureau?= , Peter Maydell , Tyrone Ting , Strahinja Jankovic , qemu-arm@nongnu.org, Sergio Lopez , Jan Kiszka , qemu-ppc@nongnu.org, Eduardo Habkost , =?ISO-8859-1?Q?Herv=E9_Poussineau?= , Alistair Francis , Aleksandar Rikalo , Jia Liu , Huacai Chen , Niek Linnenbank , Paul Burton , =?ISO-8859-1?Q?Philippe_Mathieu-Daud=E9?= , Liu Zhiwei , Palmer Dabbelt Subject: Re: [PATCH v2 3/3] hw/char: Extract serial-mm In-Reply-To: References: <20240905073832.16222-1-shentey@gmail.com> <20240905073832.16222-4-shentey@gmail.com> Message-ID: <859EB9E2-9101-4F01-AF40-B8A2E8FF1783@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=shentey@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_03_06=1.592, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@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-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Sender: qemu-riscv-bounces+qemu-riscv=archiver.kernel.org@nongnu.org Am 5=2E September 2024 12:26:35 UTC schrieb BALATON Zoltan : >On Thu, 5 Sep 2024, Bernhard Beschow wrote: >> hw/char/serial currently contains the implementation of both TYPE_SERIA= L and >> TYPE_SERIAL_MM=2E According to serial_class_init(), TYPE_SERIAL is an i= nternal >> class while TYPE_SERIAL_MM is used by numerous machine types directly= =2E Let's >> move the latter into its own module which makes the dependencies more o= bvious >> and the code more tidy=2E >>=20 >> The includes and the dependencies have been converted mechanically exce= pt in the >> hw/char directories which were updated manually=2E The result was compi= le-tested=2E >> Now, only hw/char makes direct use of TYPE_SERIAL: >>=20 >> # grep -r -e "select SERIAL" | grep -v SERIAL_ >> hw/char/Kconfig: select SERIAL >> hw/char/Kconfig: select SERIAL >> hw/char/Kconfig: select SERIAL >> hw/char/Kconfig: select SERIAL >> hw/char/Kconfig: select SERIAL >>=20 >> # grep -r -e "/serial\\=2Eh" >> include/hw/char/serial-mm=2Eh:#include "hw/char/serial=2Eh" >> hw/char/serial-pci-multi=2Ec:#include "hw/char/serial=2Eh" >> hw/char/serial=2Ec:#include "hw/char/serial=2Eh" >> hw/char/serial-isa=2Ec:#include "hw/char/serial=2Eh" >> hw/char/serial-pci=2Ec:#include "hw/char/serial=2Eh" >>=20 >> Tested-by: Andrew Jeffery >> Reviewed-by: Mark Cave-Ayland >> Signed-off-by: Bernhard Beschow >> --- >> include/hw/arm/aspeed_soc=2Eh | 2 +- >> include/hw/char/mchp_pfsoc_mmuart=2Eh | 2 +- >> include/hw/char/serial-mm=2Eh | 52 +++++++++ >> include/hw/char/serial=2Eh | 19 ---- >> hw/arm/allwinner-a10=2Ec | 2 +- >> hw/arm/allwinner-h3=2Ec | 2 +- >> hw/arm/allwinner-r40=2Ec | 2 +- >> hw/arm/aspeed_ast2400=2Ec | 2 +- >> hw/arm/aspeed_soc_common=2Ec | 2 +- >> hw/arm/kzm=2Ec | 2 +- >> hw/arm/msf2-soc=2Ec | 2 +- >> hw/arm/musicpal=2Ec | 2 +- >> hw/arm/npcm7xx=2Ec | 2 +- >> hw/arm/pxa2xx=2Ec | 2 +- >> hw/char/omap_uart=2Ec | 2 +- >> hw/char/serial-mm=2Ec | 157 +++++++++++++++++++++++++++= + >> hw/char/serial=2Ec | 126 ---------------------- >> hw/display/sm501=2Ec | 2 +- >> hw/hppa/machine=2Ec | 2 +- >> hw/loongarch/virt=2Ec | 2 +- >> hw/microblaze/petalogix_ml605_mmu=2Ec | 2 +- >> hw/mips/boston=2Ec | 2 +- >> hw/mips/jazz=2Ec | 2 +- >> hw/mips/loongson3_virt=2Ec | 2 +- >> hw/mips/malta=2Ec | 2 +- >> hw/mips/mipssim=2Ec | 2 +- >> hw/openrisc/openrisc_sim=2Ec | 2 +- >> hw/openrisc/virt=2Ec | 2 +- >> hw/ppc/e500=2Ec | 2 +- >> hw/ppc/ppc405_uc=2Ec | 2 +- >> hw/ppc/ppc440_bamboo=2Ec | 2 +- >> hw/ppc/sam460ex=2Ec | 2 +- >> hw/ppc/virtex_ml507=2Ec | 2 +- >> hw/riscv/virt=2Ec | 2 +- >> hw/sparc64/niagara=2Ec | 2 +- >> hw/sparc64/sun4u=2Ec | 2 +- >> hw/xtensa/xtfpga=2Ec | 2 +- >> hw/arm/Kconfig | 20 ++-- >> hw/char/Kconfig | 4 + >> hw/char/meson=2Ebuild | 1 + >> hw/display/Kconfig | 2 +- >> hw/hppa/Kconfig | 2 +- >> hw/loongarch/Kconfig | 2 +- >> hw/microblaze/Kconfig | 2 +- >> hw/mips/Kconfig | 10 +- >> hw/openrisc/Kconfig | 4 +- >> hw/ppc/Kconfig | 10 +- >> hw/riscv/Kconfig | 2 +- >> hw/sparc64/Kconfig | 1 + >> hw/xtensa/Kconfig | 2 +- >> 50 files changed, 276 insertions(+), 206 deletions(-) >> create mode 100644 include/hw/char/serial-mm=2Eh >> create mode 100644 hw/char/serial-mm=2Ec >>=20 >> diff --git a/include/hw/arm/aspeed_soc=2Eh b/include/hw/arm/aspeed_soc= =2Eh >> index 624d489e0d=2E=2E689f52dae8 100644 >> --- a/include/hw/arm/aspeed_soc=2Eh >> +++ b/include/hw/arm/aspeed_soc=2Eh >> @@ -39,7 +39,7 @@ >> #include "hw/misc/unimp=2Eh" >> #include "hw/misc/aspeed_peci=2Eh" >> #include "hw/fsi/aspeed_apb2opb=2Eh" >> -#include "hw/char/serial=2Eh" >> +#include "hw/char/serial-mm=2Eh" >> #include "hw/intc/arm_gicv3=2Eh" >>=20 >> #define ASPEED_SPIS_NUM 2 >> diff --git a/include/hw/char/mchp_pfsoc_mmuart=2Eh b/include/hw/char/mc= hp_pfsoc_mmuart=2Eh >> index b0e14ca355=2E=2Ea7b8b1b08b 100644 >> --- a/include/hw/char/mchp_pfsoc_mmuart=2Eh >> +++ b/include/hw/char/mchp_pfsoc_mmuart=2Eh >> @@ -29,7 +29,7 @@ >> #define HW_MCHP_PFSOC_MMUART_H >>=20 >> #include "hw/sysbus=2Eh" >> -#include "hw/char/serial=2Eh" >> +#include "hw/char/serial-mm=2Eh" >>=20 >> #define MCHP_PFSOC_MMUART_REG_COUNT 13 >>=20 >> diff --git a/include/hw/char/serial-mm=2Eh b/include/hw/char/serial-mm= =2Eh >> new file mode 100644 >> index 0000000000=2E=2E62a8489d69 >> --- /dev/null >> +++ b/include/hw/char/serial-mm=2Eh >> @@ -0,0 +1,52 @@ >> +/* >> + * QEMU 16550A UART emulation > >This is now only "memory mapped 16550A compatible UART emulation" or some= thing like that, the actual 16550A emulation is in serial=2Ec where this wa= s moved from=2E Maybe worth making it clear in this comment and in serial-m= m=2Ec as well=2E I'll send a v3 then=2E Best regards, Bernhard > >Regards, >BALATON Zoltan