From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CB042EB64DD for ; Wed, 12 Jul 2023 19:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h+janXNvQHt9cBPVs2iZhzNa+kOHF7eGdlB3ikhnmpU=; b=xWbzc4oz+JbgJ5 3xFEkjWPixSs9uxPNy7Bi8Ro5jb3Z+/kBN/UmEK127YHTYnpfUllB5nSmdCliTtwfFVjTinNpWYsv 7H4U5IpByi6ygRn8IZKMQoqGbwb3wmIcMugZ6Trer8e7wYRKfGYUl2ov0cVk6I8an5sfL31sTvLQl gn8OkIHKbUBqRKnezGc0mE2brL5sJY/7VT2PGsIS2QteHkjXeTbiu+WxrXnE3DFuNFZCdZKJh2UhW DYDhIjzojQSLDyddVoayh4GEHAIYaOznBOmC87fPfgXEp6XBc/YQa8elgCpScCcXMzrxODRnnYmHp OpOvA3nnHKdPod8gQzTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJfXx-000zp8-0c; Wed, 12 Jul 2023 19:30:45 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJfXt-000znU-0t for linux-arm-kernel@lists.infradead.org; Wed, 12 Jul 2023 19:30:43 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 99402E0002; Wed, 12 Jul 2023 19:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1689190237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oQi7H3c3nk4JZA7oSDJR3Dio4GsnvuYaaMgfNSDzDLI=; b=n/gz+p3zPYElbLusrTKvwGPoD0fyDRH1ZG9dINhPcFeVB9CVGFLlzwOGafXDh1hvlVjaKo Aqh1slY+fMjJG9kHCAfnMLMb+uB0qBbLQAPtF3tn7WZzpb1rcIXR+Bwi2StUwQSa9tqKnA 1IlEiW7Mnty1JWJWTqNkT4sjVE6dr5/eqL+AM5N0wmVgoYL6ckqX9Dpa5VKw9ZyzCVUe5a K8fmi41fZR/oTh2rexjy3BKSnM0UFvMZMIdu0oA+4Ttc2dqYCMZWlUt8bqtuTRZBBWrUR8 KtQTRCzaegQt36ssaqyj0KGT5Jbw4eMEUey2sETb19jHAwgI7DFZKPYtp97rdQ== Date: Wed, 12 Jul 2023 21:30:33 +0200 From: Alexandre Belloni To: Conor Dooley Subject: Re: [PATCH] ARM: dts: at91: sam9x60: fix the SOC detection Message-ID: <202307121930333019a9d5@mail.local> References: <20230712100042.317856-1-durai.manickamkr@microchip.com> <20230712-dweeb-suspend-27d0f7292a2d@spud> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230712-dweeb-suspend-27d0f7292a2d@spud> X-GND-Sasl: alexandre.belloni@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230712_123041_752120_8B363572 X-CRM114-Status: GOOD ( 32.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrew@lunn.ch, jerry.ray@microchip.com, devicetree@vger.kernel.org, Hari.PrasathGE@microchip.com, varshini.rajendran@microchip.com, Horatiu.Vultur@microchip.com, manikandan.m@microchip.com, jesper.nilsson@axis.com, balamanikandan.gunasundar@microchip.com, michael@walle.cc, dharma.b@microchip.com, cristian.birsan@microchip.com, nayabbasha.sayed@microchip.com, conor+dt@kernel.org, arnd@arndb.de, andre.przywara@arm.com, soc@kernel.org, robh+dt@kernel.org, Durai Manickam KR , sergiu.moga@microchip.com, linux-arm-kernel@lists.infradead.org, balakrishnan.s@microchip.com, ada@thorsis.com, linux-kernel@vger.kernel.org, krzysztof.kozlowski@linaro.org, Kavyasree.Kotagiri@microchip.com, olof@lixom.net, davem@davemloft.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 12/07/2023 19:43:51+0100, Conor Dooley wrote: > Hey, > > On Wed, Jul 12, 2023 at 03:30:42PM +0530, Durai Manickam KR wrote: > > Remove the dbgu compatible strings in the UART submodule of the > > flexcom for the proper SOC detection. > > I am afraid that I do not understand what this means. The first > compatible, before and after your patch, is a sam9x60 one, so I don't > see how the SoC comes into it. Grepping to try and understand: > rg microchip,sam9x60-usart drivers/ > > rg microchip,sam9x60-dbgu drivers/ > > rg atmel,at91sam9260-dbgu drivers/ > drivers/soc/atmel/soc.c > 259: "atmel,at91sam9260-dbgu"); > > rg atmel,at91sam9260-usart drivers/ > drivers/tty/serial/atmel_serial.c > 2723:OF_EARLYCON_DECLARE(atmel_serial, "atmel,at91sam9260-usart", > > drivers/mfd/at91-usart.c > 50: { .compatible = "atmel,at91sam9260-usart" }, > > It looks like you are trying to avoid the atmel soc driver from > detecting the atmel,at91sam9260-dbgu compatible? > Is this not actually compatible with the sam9260's debug uart? > > Please try to explain things in more detail so that people unfamiliar > with at91 hardware are not confused. As an outsider, removing > compatibles to fix detection seems like it would not work - the sam9x60 > compatibles are first in the list. To me it seems like this removes, > rather than fixes detection, and to fix detection you would need to > make some changes to the driver? > > Also, the binding says: > - items: > - const: microchip,sam9x60-dbgu > - const: microchip,sam9x60-usart > - const: atmel,at91sam9260-dbgu > - const: atmel,at91sam9260-usart > > Your patch here makes the dts non-compliant with the bindings, as far as > I can tell, so you will need to go and modify the bindings to do this > either way. There can be only one dbgu on a SoC and it has the chipid register. It has always been wrong to have a dbgu compatible on the flexcom uart as they are not dbgu. Anyway, my advice has always been that you must not do chipid detection on at91 because there is no point in doing it because you need to have a correct dts to be able to find the dbgu chipid register so you either you already know what you are running on or you are going to read bogus registers anyway. > > Thanks, > Conor. > > > > > Fixes: 99c808335877 (ARM: dts: at91: sam9x60: Add missing flexcom definitions) > > Signed-off-by: Durai Manickam KR > > --- > > arch/arm/boot/dts/microchip/sam9x60.dtsi | 26 ++++++++++++------------ > > 1 file changed, 13 insertions(+), 13 deletions(-) > > > > diff --git a/arch/arm/boot/dts/microchip/sam9x60.dtsi b/arch/arm/boot/dts/microchip/sam9x60.dtsi > > index 8b53997675e7..73d570a17269 100644 > > --- a/arch/arm/boot/dts/microchip/sam9x60.dtsi > > +++ b/arch/arm/boot/dts/microchip/sam9x60.dtsi > > @@ -172,7 +172,7 @@ flx4: flexcom@f0000000 { > > status = "disabled"; > > > > uart4: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <13 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -240,7 +240,7 @@ flx5: flexcom@f0004000 { > > status = "disabled"; > > > > uart5: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > atmel,usart-mode = ; > > interrupts = <14 IRQ_TYPE_LEVEL_HIGH 7>; > > @@ -370,7 +370,7 @@ flx11: flexcom@f0020000 { > > status = "disabled"; > > > > uart11: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <32 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -419,7 +419,7 @@ flx12: flexcom@f0024000 { > > status = "disabled"; > > > > uart12: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <33 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -576,7 +576,7 @@ flx6: flexcom@f8010000 { > > status = "disabled"; > > > > uart6: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <9 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -625,7 +625,7 @@ flx7: flexcom@f8014000 { > > status = "disabled"; > > > > uart7: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <10 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -674,7 +674,7 @@ flx8: flexcom@f8018000 { > > status = "disabled"; > > > > uart8: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <11 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -723,7 +723,7 @@ flx0: flexcom@f801c000 { > > status = "disabled"; > > > > uart0: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <5 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -791,7 +791,7 @@ flx1: flexcom@f8020000 { > > status = "disabled"; > > > > uart1: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <6 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -859,7 +859,7 @@ flx2: flexcom@f8024000 { > > status = "disabled"; > > > > uart2: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <7 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -927,7 +927,7 @@ flx3: flexcom@f8028000 { > > status = "disabled"; > > > > uart3: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <8 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -1050,7 +1050,7 @@ flx9: flexcom@f8040000 { > > status = "disabled"; > > > > uart9: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <15 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > @@ -1099,7 +1099,7 @@ flx10: flexcom@f8044000 { > > status = "disabled"; > > > > uart10: serial@200 { > > - compatible = "microchip,sam9x60-dbgu", "microchip,sam9x60-usart", "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; > > + compatible = "microchip,sam9x60-usart", "atmel,at91sam9260-usart"; > > reg = <0x200 0x200>; > > interrupts = <16 IRQ_TYPE_LEVEL_HIGH 7>; > > dmas = <&dma0 > > -- > > 2.25.1 > > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel