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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B814C433F5 for ; Mon, 13 Sep 2021 18:35:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48C23610E7 for ; Mon, 13 Sep 2021 18:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347158AbhIMSgp (ORCPT ); Mon, 13 Sep 2021 14:36:45 -0400 Received: from sibelius.xs4all.nl ([83.163.83.176]:51929 "EHLO sibelius.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241450AbhIMSgn (ORCPT ); Mon, 13 Sep 2021 14:36:43 -0400 Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id 452b42da; Mon, 13 Sep 2021 20:35:23 +0200 (CEST) Date: Mon, 13 Sep 2021 20:35:23 +0200 (CEST) From: Mark Kettenis To: Marc Zyngier Cc: devicetree@vger.kernel.org, alyssa@rosenzweig.io, kettenis@openbsd.org, tglx@linutronix.de, robh+dt@kernel.org, marcan@marcan.st, bhelgaas@google.com, nsaenz@kernel.org, jim2101024@gmail.com, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, daire.mcnamara@microchip.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org In-Reply-To: <871r5tcwhp.wl-maz@kernel.org> (message from Marc Zyngier on Sun, 12 Sep 2021 22:30:42 +0100) Subject: Re: [PATCH v4 4/4] arm64: apple: Add PCIe node References: <20210827171534.62380-1-mark.kettenis@xs4all.nl> <20210827171534.62380-5-mark.kettenis@xs4all.nl> <871r5tcwhp.wl-maz@kernel.org> Message-ID: <5614581066cc67fa@bloch.sibelius.xs4all.nl> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Date: Sun, 12 Sep 2021 22:30:42 +0100 > From: Marc Zyngier Hi Marc, > On Fri, 27 Aug 2021 18:15:29 +0100, > Mark Kettenis wrote: > > > > From: Mark Kettenis > > > > Add node corresponding to the apcie,t8103 node in the > > Apple device tree for the Mac mini (M1, 2020). > > > > Clock references and DART (IOMMU) references are left out at the > > moment and will be added once the appropriate bindings have been > > settled upon. > > > > Signed-off-by: Mark Kettenis > > --- > > arch/arm64/boot/dts/apple/t8103.dtsi | 63 ++++++++++++++++++++++++++++ > > 1 file changed, 63 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi > > index 503a76fc30e6..6e4677bdef44 100644 > > --- a/arch/arm64/boot/dts/apple/t8103.dtsi > > +++ b/arch/arm64/boot/dts/apple/t8103.dtsi > > @@ -214,5 +214,68 @@ pinctrl_smc: pinctrl@23e820000 { > > , > > ; > > }; > > + > > + pcie0: pcie@690000000 { > > + compatible = "apple,t8103-pcie", "apple,pcie"; > > + device_type = "pci"; > > + > > + reg = <0x6 0x90000000 0x0 0x1000000>, > > + <0x6 0x80000000 0x0 0x4000>, > > Only exposing 16kB for the 'rc' crashes the Linux driver as it tries > to configure the port ref-clock configurations, which live much > higher: > > #define CORE_LANE_CFG(port) (0x84000 + 0x4000 * (port)) > > Previous versions of the binding had this region as 1MB, which made > things work. Oops. When I formalized the binding, I looked at the Apple DT and used the sizes from there. And didn't notice that this wasn't sufficient since U-Boot doesn't actually use the size of the region to create a mapping like an actual OS would do. It is somewhat unclear how big the regions really are, but as marcan noted at some point in the past the sizes in the Apple DT seem to be somewhat inconsistent so religiously following what is done there may not make sense. So I'll fix this in v5 (also in the example in the DT binding). Corellium uses 1MB, which makes more sense unless we break up the block into multiple ranges. > > + <0x6 0x81000000 0x0 0x8000>, > > + <0x6 0x82000000 0x0 0x8000>, > > + <0x6 0x83000000 0x0 0x8000>; > > These used to be 16kB, and are now twice as much. Didn't cause any > issue with the Linux driver, but I wonder what trigger either change. 0x8000 is what the Apple DT uses. Since we don't have authorative documentation for the chip we have to make some guesses here. I suspect we should try to keep the sizes as small as possible while sticking to sizes of 2^n? Then it probably makes sense to use 0x4000 for these ranges. Cheers, Mark 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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DB72C433FE for ; Mon, 13 Sep 2021 18:38:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id F2C456108B for ; Mon, 13 Sep 2021 18:38:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F2C456108B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xs4all.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Message-ID:References:Subject :In-Reply-To:Cc: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=m/CnOJPh9F+lWl8GrIrSWY6q7xDiLw7NpH/FnR4jDIY=; b=mGaoc+N9bUfM+n Yij/i0rckXHK/d6iQpyMvcCOz1Yjp2HlsumgJnof9HxeN3P0gaxTIKooxNhiEkdIw1QRmPNDm+CtA CkSl0wDX4Ml7m0Zb5nPcHh5oN+/mx36wzlNH5PKC0JK1Bh2FbKGyxi//u7+aNozjTvgU/Gj77j2jb oF7aZYdplv+JMcCBXdfKPZeEPMXPRCxvXMBeHy6gqxo1Yq8dA1bUu699eR7OpkY7Ex2xYJKoVYeZ8 SXdaGO1yAU0SmddWXZgIaJ/R6JenRe5+0r8WyKPyYyoXlRk3fPST2wKG8FPsFaX2z1XejGAsDxBXL b3QHfFn6Elat9UUnjUsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPqoN-002yb4-7u; Mon, 13 Sep 2021 18:36:12 +0000 Received: from sibelius.xs4all.nl ([83.163.83.176]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mPqnm-002yKe-GQ; Mon, 13 Sep 2021 18:35:37 +0000 Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id 452b42da; Mon, 13 Sep 2021 20:35:23 +0200 (CEST) Date: Mon, 13 Sep 2021 20:35:23 +0200 (CEST) From: Mark Kettenis To: Marc Zyngier Cc: devicetree@vger.kernel.org, alyssa@rosenzweig.io, kettenis@openbsd.org, tglx@linutronix.de, robh+dt@kernel.org, marcan@marcan.st, bhelgaas@google.com, nsaenz@kernel.org, jim2101024@gmail.com, f.fainelli@gmail.com, bcm-kernel-feedback-list@broadcom.com, daire.mcnamara@microchip.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org In-Reply-To: <871r5tcwhp.wl-maz@kernel.org> (message from Marc Zyngier on Sun, 12 Sep 2021 22:30:42 +0100) Subject: Re: [PATCH v4 4/4] arm64: apple: Add PCIe node References: <20210827171534.62380-1-mark.kettenis@xs4all.nl> <20210827171534.62380-5-mark.kettenis@xs4all.nl> <871r5tcwhp.wl-maz@kernel.org> Message-ID: <5614581066cc67fa@bloch.sibelius.xs4all.nl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210913_113534_920115_D439A9F6 X-CRM114-Status: GOOD ( 25.51 ) 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: , MIME-Version: 1.0 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 > Date: Sun, 12 Sep 2021 22:30:42 +0100 > From: Marc Zyngier Hi Marc, > On Fri, 27 Aug 2021 18:15:29 +0100, > Mark Kettenis wrote: > > > > From: Mark Kettenis > > > > Add node corresponding to the apcie,t8103 node in the > > Apple device tree for the Mac mini (M1, 2020). > > > > Clock references and DART (IOMMU) references are left out at the > > moment and will be added once the appropriate bindings have been > > settled upon. > > > > Signed-off-by: Mark Kettenis > > --- > > arch/arm64/boot/dts/apple/t8103.dtsi | 63 ++++++++++++++++++++++++++++ > > 1 file changed, 63 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi > > index 503a76fc30e6..6e4677bdef44 100644 > > --- a/arch/arm64/boot/dts/apple/t8103.dtsi > > +++ b/arch/arm64/boot/dts/apple/t8103.dtsi > > @@ -214,5 +214,68 @@ pinctrl_smc: pinctrl@23e820000 { > > , > > ; > > }; > > + > > + pcie0: pcie@690000000 { > > + compatible = "apple,t8103-pcie", "apple,pcie"; > > + device_type = "pci"; > > + > > + reg = <0x6 0x90000000 0x0 0x1000000>, > > + <0x6 0x80000000 0x0 0x4000>, > > Only exposing 16kB for the 'rc' crashes the Linux driver as it tries > to configure the port ref-clock configurations, which live much > higher: > > #define CORE_LANE_CFG(port) (0x84000 + 0x4000 * (port)) > > Previous versions of the binding had this region as 1MB, which made > things work. Oops. When I formalized the binding, I looked at the Apple DT and used the sizes from there. And didn't notice that this wasn't sufficient since U-Boot doesn't actually use the size of the region to create a mapping like an actual OS would do. It is somewhat unclear how big the regions really are, but as marcan noted at some point in the past the sizes in the Apple DT seem to be somewhat inconsistent so religiously following what is done there may not make sense. So I'll fix this in v5 (also in the example in the DT binding). Corellium uses 1MB, which makes more sense unless we break up the block into multiple ranges. > > + <0x6 0x81000000 0x0 0x8000>, > > + <0x6 0x82000000 0x0 0x8000>, > > + <0x6 0x83000000 0x0 0x8000>; > > These used to be 16kB, and are now twice as much. Didn't cause any > issue with the Linux driver, but I wonder what trigger either change. 0x8000 is what the Apple DT uses. Since we don't have authorative documentation for the chip we have to make some guesses here. I suspect we should try to keep the sizes as small as possible while sticking to sizes of 2^n? Then it probably makes sense to use 0x4000 for these ranges. Cheers, Mark _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel