Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5457012pxb; Wed, 26 Jan 2022 12:24:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIisX0pfUqU9TFfuYU8+VeJYWsoUpt9rRcES2Vx/oKP82tOW3Dvj2JdgQkKqgg8Z+87Mcn X-Received: by 2002:a63:81c6:: with SMTP id t189mr390987pgd.417.1643228693561; Wed, 26 Jan 2022 12:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643228693; cv=none; d=google.com; s=arc-20160816; b=Oc58gjpMNBQ6wVUq2WBiYTUjdqtx5yeCMVDQfQFQxcaeiXiLxJt/I9iDy6Na6WzmIm BKbNHVuP5/eG2XNV5Md7R6EEMiZUQGk4Ngah9aKNI3OdIxf3O8Wt38SIuRdYf87Q+hp9 Ol9QW0HGeaRYMFH104u//TfyG8bA61/bhjHZnoj/JvdEChnCYPBWn47gxfkT/bewIT1V ki/OXCPBNohJN0w9JOv/Tu7+veiNTO6HPVMb7DiYKbafIm3fsQ5yo2aiiqgi7ii9LPMY BpCAKRzzhTz4f2s4t2bypflAdI/9TKzQmjUZ6uYc8shg/PUUf3YEC4lUgomNGQZYq/bC Ta/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oqO6dtiE6SFqjyuDwPOHij0D0jk+zA1/V0XqvbZDrw0=; b=nIN4MNDKzPnCHTvlu3l4bA04KWVUDhujKNtgvLuJHeyhdxn08Al1meOFv1+zDS0WNZ JMuE4lLDj1l+mkGaZm48aTuVkiaCvwdQ44jWqTxUdATWZiNV0jcpsk/efmbsODY32jTV COtX6/rD+A86ZqJGv98lJiOH5n2okb+y/P0Hq6+nVXn7D8Ti2jFoI4A+MZ+Obs6xv9p8 NJYcreG1kE4dKQtYqTfXqUQMUivXF2SFmCvP1NDzIwKRkRiNhauZEmcHdh4ca8lAz6MI goH8CojGDUsWplBFsSoJb3USgNmXlbNHW9o1s8fiSqgbLOKURuFgkCzUSmNQHTrPtvGC r4Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JHMlhykQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si158842plg.179.2022.01.26.12.24.41; Wed, 26 Jan 2022 12:24:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JHMlhykQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238031AbiAZHom (ORCPT + 99 others); Wed, 26 Jan 2022 02:44:42 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:49340 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiAZHol (ORCPT ); Wed, 26 Jan 2022 02:44:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 93354B81B7D; Wed, 26 Jan 2022 07:44:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 722BCC340E3; Wed, 26 Jan 2022 07:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643183079; bh=vtPURswq1do/5958Qsa3FJW0cYlaVmXbhfDTYeU+OH4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JHMlhykQSTpMDY9BR/P6/EVFcCO5+WXfKtFcxPg6oEu2Uje+HF1ShNlhHxK+2Uc0r UZnFaEtebexA08W5OtXlZTsGTPPyXSinP7HLuZGQx3bvNYXtkECHYk254FYQvpRvcD WsMIIJWk9SG94/a/lzLZU/2HPh2i1awWLXVAMM6qmyT5apTO2MGiuWe2O6dtK5ttd3 tfwXoxJxe9CNjESfsQNdUHiffW6nKI1sTvrZMqIDKzOXSwB9fd7PCoiJiyGfd9eOl2 HLj6KKZ13hiIJ0h8fOU6NI6KwKEpIL4FdkYvL9T6/I6ivvxrja/05mol41kyKveDSy Ibi/gNTdqPaxw== Date: Wed, 26 Jan 2022 15:44:32 +0800 From: Shawn Guo To: Alexander Stein Cc: Tim Harvey , Rob Herring , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Device Tree Mailing List , open list , Linux ARM Mailing List Subject: Re: (EXT) Re: (EXT) Re: [PATCH] arm64: dts: imx8mm-venice-gw73xx-0x: add dt overlays for serial modes Message-ID: <20220126074432.GF4686@dragon> References: <20211214213630.14819-1-tharvey@gateworks.com> <2226437.ElGaqSPkdT@steina-w> <6686721.lOV4Wx5bFT@steina-w> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6686721.lOV4Wx5bFT@steina-w> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 12, 2022 at 07:58:00AM +0100, Alexander Stein wrote: > Am Dienstag, 11. Januar 2022, 18:53:29 CET schrieb Tim Harvey: > > On Mon, Jan 10, 2022 at 11:20 PM Alexander Stein > > > > wrote: > > > Am Dienstag, 11. Januar 2022, 01:00:21 CET schrieb Tim Harvey: > > > > [SNIP] > > > > > > > > > diff --git a/arch/arm64/boot/dts/freescale/Makefile > > > > > b/arch/arm64/boot/dts/freescale/Makefile index > > > > > a14a6173b765..5ec8d59347b6 > > > > > 100644 > > > > > --- a/arch/arm64/boot/dts/freescale/Makefile > > > > > +++ b/arch/arm64/boot/dts/freescale/Makefile > > > > > @@ -44,6 +44,9 @@ dtb-$(CONFIG_ARCH_MXC) += > > > > > imx8mm-var-som-symphony.dtb > > > > > > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw71xx-0x.dtb > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x.dtb > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x.dtb > > > > > > > > > > +dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs232-rts.dtbo > > > > > +dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs422.dtbo > > > > > +dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw73xx-0x-rs485.dtbo > > > > > > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7901.dtb > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw7902.dtb > > > > > dtb-$(CONFIG_ARCH_MXC) += imx8mn-beacon-kit.dtb > > > > > > > > [SNIP] > > > > I'm mostly interested to see if my approach to dt fragments here and > > > > the naming of the files makes sense to others. > > > > > > > > This patch causes the kernel to build dtbo files for: > > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs232-rts.dtbo > > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs422.dtbo > > > > arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx-0x-rs485.dtbo > > > > > > > > The intention is that these files are used by boot firmware (U-Boot) > > > > to adjust the dtb before passing it to the kernel. > > > > > > Hi Tim, > > > > > > do these dtbo actually work? I'm wondering because I was trying to > > > useoverlays myself and noticed that the had to be compiled with -@ for > > > u-boot to be able > > > to apply them. Apparently there are 2 possibilities: > > Alexander, > > > > Yes, they work, but I do manually set DTC_FLAGS=-@ when building > > kernel dtbs to make them work. > > I see, I expected something like this. That's why I responded to you. > > > > * Set "DTC_FLAGS_[dtb] := -@" yourself > > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > > > commit/?id=e426d63e752bdbe7d5ba2d872319dde9ab844a07 > > > > > > * Use dedicated overlay target > > > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ > > > commit/?id=15d16d6dadf6947ac7f9a686c615995c5a426ce2 > > > > > > You use neither of them. IIRC just naming the target file .dtbo will not > > > apply symbols (-Q) during dtc call. Can you verify using 'V=1' > > > Also I'm wondering which way is the best to go. > > > > I wasn't aware there was a way to do this via Makefiles. It seems that > > perhaps Rob's approach with 'kbuild: Add generic rule to apply > > fdtoverlay' is a way to avoid having to add them all manually in the > > first approach? I must admit I'm not sure how to use that. > > I tried using this myself for my custom board. I feel it is a bit cumbersome > to get it right. > See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/ > arch/arm64/boot/dts/xilinx/Makefile for an example. > > Essentially you define your .dtb as before and add another target (e.g. sm- > k26-revA-sck-kv-g-revA-dtbs) where you add your .dtbo _after_ the original > .dtb. This target needs to be added to 'dtb-y' as before. > > I suspect this way is needed to check the .dtbo against the base .dtb if it > actually matches. Yeah, I like this check. Tim, could you update your patch to follow this pattern? Shawn