Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp947923rdb; Tue, 19 Sep 2023 15:35:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1BJ8JPlHi8OLfIVBH220f/+8RW8PuNzu3mppzWSwTpI3dWuzXZRU3MAo76dI1CQ3TLBzP X-Received: by 2002:a17:902:e551:b0:1c3:2fc8:1305 with SMTP id n17-20020a170902e55100b001c32fc81305mr857631plf.47.1695162912055; Tue, 19 Sep 2023 15:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695162912; cv=none; d=google.com; s=arc-20160816; b=d3UNezyReFnqPaXMMg4KxW4jj8jxm24WbcWOAeIK7uM9TLNxr81ATj3WoiDosEpR/f pYNFKLSHac9BTAQ3sHw9OjLSIFP8O+825beUD2TUrX9AhkB/SEPB9YbVtYCtZlCRl40j a3sLvBR/4kV6reCcaF7YY0A8uMLRTEtPze25ReAJky8wHFvEfbk46R8g1SuIMcK3PHC2 bIfvalmKOIQUSIzW5q+2sOPmIeUq7E408q+zpEkpkwOTaXAZixnAK4xn/QXV/tl3Mb+F MDLCVfRNmrA6P+ilF0BZp4SlhguNdgWubsY3xNWah2uzSlY0TK5kusTgLdt5iXaUy+IB iCvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=DOMnIgJd/3qT7h/zUiPCrXuhex0Ht2z7/JDnNYL/tSk=; fh=9LMwxb8xXC2P8qOlEY1hXpNkfYHNdfudv+JqYxmmdjk=; b=luoIIJ2kHDZjQiqN/LF7A/HG8ec8aZGYBmjZgx2KjYL9SP3cg0SpO3GXGTuB/rLBeX RcxmytJxkMbDb/hjalRJMmA5PHVnU1fnH5tkUd28F2nmZUHssUbJ/uANHDTlYwaEWv7Q TPf29OgGvUvEpyZIjmC1iOIx2IWTjHCcf3ekxuG81PGaBTGu/3qW5nuK6LSWMv5JihkX 1rjtXbWiRNY74R9GTlQ9GJfz/5yVCVdfxvocjqwAX+qBZYiTXOjQOuDPHY/wX/67sTI/ Eh249MWWlMsKiedOjJsmcjsL2prvngozkWf18WY412Yu4X2o69/OiaZZhUTNmrEg936d DSwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lvEYMuPq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x12-20020a170902a38c00b001a6bb7b7a44si203682pla.307.2023.09.19.15.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 15:35:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lvEYMuPq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DDB4081121C9; Tue, 19 Sep 2023 08:56:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232582AbjISP4S (ORCPT + 99 others); Tue, 19 Sep 2023 11:56:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbjISP4R (ORCPT ); Tue, 19 Sep 2023 11:56:17 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06889D; Tue, 19 Sep 2023 08:56:09 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 38JFtxws064411; Tue, 19 Sep 2023 10:55:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1695138959; bh=DOMnIgJd/3qT7h/zUiPCrXuhex0Ht2z7/JDnNYL/tSk=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=lvEYMuPqxirMvq/YuQTLPE6rj/ZylQkE5iD4cOmb25m2P5/vFav7P+cHPddtRxIY8 /gKZUz6K8+5r7hCCzu0TYapuCZGvQ+m3ws/yfrggk2tRUSYGvo38FI8J6rWcGp2YX3 Gs3hG6wlxM4xc3f5CnjULM7jA0aYQB06csJFy3iw= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 38JFtxUt108188 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 19 Sep 2023 10:55:59 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 19 Sep 2023 10:55:59 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 19 Sep 2023 10:55:58 -0500 Received: from [10.249.135.225] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 38JFtsf7014484; Tue, 19 Sep 2023 10:55:55 -0500 Message-ID: <227c251c-6552-8067-3dfc-6595744affb4@ti.com> Date: Tue, 19 Sep 2023 21:25:54 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 2/3] arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support To: Andrew Davis , MD Danish Anwar , Vignesh Raghavendra , Nishanth Menon CC: Conor Dooley , Krzysztof Kozlowski , Rob Herring , Tero Kristo , , , , , References: <20230911071245.2173520-1-danishanwar@ti.com> <20230911071245.2173520-3-danishanwar@ti.com> <1e1577a5-fb01-c84b-ede0-38058387ec23@ti.com> <6503ca2b-c55a-ab26-6e0c-121aeb5c1c66@ti.com> <6cb40b09-8154-5ef4-cbbc-9dfc5994a031@ti.com> <5bbf0a9b-edd0-e591-0a1f-36016bd3f2a0@ti.com> Content-Language: en-US From: "Anwar, Md Danish" In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 19 Sep 2023 08:56:18 -0700 (PDT) On 9/19/2023 8:57 PM, Andrew Davis wrote: > On 9/19/23 1:52 AM, MD Danish Anwar wrote: >> On 15/09/23 21:36, Andrew Davis wrote: >>> On 9/13/23 1:05 AM, MD Danish Anwar wrote: >>>> On 12/09/23 20:28, Andrew Davis wrote: >>>>> On 9/12/23 3:29 AM, MD Danish Anwar wrote: >>>>>> Hi Andrew, >>>>>> >>>>>> On 11/09/23 18:35, Andrew Davis wrote: >>>>>>> On 9/11/23 2:12 AM, MD Danish Anwar wrote: >>>>>>>> ICSSG2 provides dual Gigabit Ethernet support. >>>>>>>> >>>>>>>> For support SR2.0 ICSSG Ethernet firmware: >>>>>>>> - provide different firmware blobs and use TX_PRU. >>>>>>>> - IEP0 is used as PTP Hardware Clock and can only be used for one >>>>>>>> port. >>>>>>>> - TX timestamp notification comes via INTC interrupt. >>>>>>>> >>>>>>>> Signed-off-by: MD Danish Anwar >>>>>>>> --- >>>>>>>>      .../arm64/boot/dts/ti/k3-am654-base-board.dts | 123 >>>>>>>> ++++++++++++++++++ >>>>>>> >>>>>>> Adding this to the base dts? What if I want to use my PRUs for >>>>>>> something >>>>>>> else? These "application nodes" define a single usecase out of many >>>>>>> possible, and should IMHO always be in overlays so users can select >>>>>>> which >>>>>>> they want easily. >>>>>>> >>>>>> >>>>>> The base board (AM654x-EVM) has two Ethernet ports dedicated for >>>>>> ICSSG. >>>>>> The expectation is that when a user boots up AM654x-EVM, ICSSG is >>>>>> supported on those two ports by default. If the icssg nodes are not >>>>>> added to base dts then by default the two Ethernet ports will have no >>>>>> functionality. >>>>>> >>>>> >>>>> This is *your* default use-case for these PRUs, mine might be >>>>> different. >>>>> I can agree that most might want this use-case too and this is the one >>>>> intended as the demo for these ports on this board. What I am >>>>> saying is >>>>> that when one wants to use these PRUs for something else, having this >>>>> one application baked into the base DTB makes it very difficult to >>>>> switch. >>>>> >>>> >>>> This is the intended use case. The base board has two ICSSG Ethernet >>>> ports. My understanding is that device trees describe the hardware. >>>> >>> >>> Correct, but you are not describing hardware here, you are describing >>> software. Yes it is software that uses hardware so you are listing a >>> bunch of hardware too, but the core is a firmware. >>> >>>> The base board dts should describe the base board hardware which has >>>> the >>>> two ICSSG ports. So the base board dts should contain nodes to enable >>>> those two ports. >>>> >>>> Any hardware component that is not present in the base board should be >>>> applied as an overlay. >>>> >>> >>> Correct again, the firmware is not baked into the base board, that is >>> loaded by U-Boot/Linux at runtime and can be selected. >>> >>>> For example in the AM654x-IDK, we have extra IDK card applied on the >>>> base board. This IDK card contains 4 ICSSG Ethernet ports. The nodes >>>> for >>>> these 4 ICSSG port should go in an overlay i.e. k3-am654-idk.dtso which >>>> I am doing as part of the patch 3 of this series. >>>> >>>> My understanding is that any hardware component that is part of the >>>> base >>>> board should be described in base-board.dts. Any hardware component >>>> that >>>> is not part of the base board and is added by extra cards should be >>>> described in overlays. >>>> >>>>>> The primary use case is that ICSSG should support on those two >>>>>> ports in >>>>>> AM654x-EVM by default. The user should not need to apply any >>>>>> overlay to >>>>>> get the two ports working. So In order to achieve that I think it >>>>>> is OK >>>>>> to add the ICSSG nodes in the base board dts file. >>>>>> >>>>> >>>>> A user does not need to apply an overlay to use these, this >>>>> application >>>>> node overlay can be applied at build time. You can even rename the >>>>> base >>>>> .dtb to be the one that has this overlay applied by default. >>>>> >>>>> Take a look at k3-am654-gp-evm.dtb, it is a composite DTB built from >>>>> the "base-board" DTB and the "rocktech-rk101-panel" DTBO applied on >>>>> top. >>>>> This combination is what we call and sell as the "GP EVM", and you >>>>> can use it by booting the "k3-am654-gp-evm.dtb". Now let's say you >>>>> want to use a different panel, all you need to do is take the base- >>>>> board and apply a different panel overlay. Had we hard-coded the >>>>> "default" panel into the base-board DTS then a user with a different >>>>> panel would have to go and edit the DTS to remove all the rk101-panel >>>>> bits. >>>>> >>>> >>>> This is one way to do it. But I still think the best way to do this is >>>> to have the ICSSG nodes in base board dts as the ICSSG hardware is >>>> present on the base board. >>>> >>> >>> So again, you are not describing the hardware, you are describing a >>> *use of* the hardware. This node describes what firmware to load and >>> what bits of hardware that firmware should use to get some end result, >>> but I could just as easily use a different firmware and give it >>> different >>> links to different hardware bits and make it into something else. No >>> physical changes to the hardware needed. >>> >>>>>> If user wants to use PRUs for something else, we can have overlay for >>>>>> those. But we should not need to apply any overlay to achieve the >>>>>> primary functionality i.e. ICSSG working in the two dedicated ICSSG >>>>>> Ethernet ports. >>>>>> >>>>> >>>>> They could *not* simply add a different overlay for their usecase as >>>>> you have baked your usecase into the base DTB. Their overlay would >>>>> have to have a bunch of /delete-node/ junk to remove your "defaults". >>>>> >>>> >>>> This patch adds one node "icssg2-eth" which uses six PRUs. If user >>>> wants >>>> to use PRUs for something else they can add "/delete-node/ &icssg2_eth" >>>> in the overlay. >>>> >>> >>> /delete-node/ is usually an indication some layering was done wrong, >>> it shouldn't be needed in most cases to delete nodes. And that is >>> my point here, I don't want to have to delete your use-case in >>> every overlay file that uses the PRUs differently than you. Your >>> use-case should simply be an overlay too, then all I have to do is >>> apply my overlay instead of yours without deletes. >>> >> >> Sure I understand this. But my expectation is as soon as you boot gp-evm >> or base-board, you should be able to see the two ICSSG ports and they >> should be working properly. >> >> If I move the ICSSG2 nodes from k3-am654-base-board.dtb to some overlay >> and make k3-am654-gp-evm-dtb to have this overlay applied by default >> using below then it will require to change u-boot as well. >> >> The only reason I am adding these ICSSG nodes to k3-am654-base-board.dtb >> is because k3-am654-base-board.dtb is used by default to boot the board. > > Seems we are making an ABI around the names of dtb files, guess that > has always been kinda true. > >> If I move ICSSG2 nodes to some dtbo and generate k3-am654-gp-evm-dtb >> with that dtbo then we will need to use k3-am654-gp-evm-dtb as default >> while booting AM65x GP EVM >> >> diff --git a/board/ti/am65x/am65x.env b/board/ti/am65x/am65x.env >> index 755bff2707..f9249cb7f2 100644 >> --- a/board/ti/am65x/am65x.env >> +++ b/board/ti/am65x/am65x.env >> @@ -6,7 +6,7 @@ >>   #endif >> >>   findfdt= >> -       setenv name_fdt ti/k3-am654-base-board.dtb; >> +       setenv name_fdt ti/k3-am654-gp-evm-dtb; >>          setenv fdtfile ${name_fdt} >>   name_kern=Image >>   console=ttyS2,115200n8 >> >> If this is okay with you, I can go ahead and move ICSSG2 nodes to some >> overlay. >> > > That is fine with me, booting the raw -base-board dtb by default > in u-boot always seemed wrong to me anyway. > > Another option is to rename the dts file and have the file called > k3-am654-base-board.dtb be made from that + this new overlay, > that way no change is needed in u-boot. > So these are our options. 1. Create k3-am654-icssg2.dtso, have k3-am654-gp-evm-dtbs := k3-am654-base-board.dtb k3-am654-icssg2.dtbo and change the default dtb in uboot. 2. Create k3-am654-icssg2.dtso, Rename k3-am654-base-board.dts to k3-am654-evm.dts or something else. and have k3-am654-base-board.dtbs := k3-am654-evm.dtb k3-am654-icssg2.dtbo No change needed in uboot. I am fine with both of these options. Option 2 makes more sense to me as we won't need to change uboot in this case. @Vignesh, Can you please let me know which one should I go ahead with. Does option 2 looks OK to you? > Andrew > >> The ICSSG2 node will be part of k3-am654-icssg2.dtso >> The ICSSG0 and ICSSG1 nodes will be part of k3-am654-idk.dtso >> >> Let me know if this looks OK to you. >> >>> Andrew >>> >>>>> As above, if this is the "primary functionality" then have this >>>>> overlay applied by default: >>>>> >>>>> --- a/arch/arm64/boot/dts/ti/Makefile >>>>> +++ b/arch/arm64/boot/dts/ti/Makefile >>>>> @@ -42,7 +42,7 @@ dtb-$(CONFIG_ARCH_K3) += >>>>> k3-am642-tqma64xxl-mbax4xxl-sdcard.dtb >>>>>    dtb-$(CONFIG_ARCH_K3) += k3-am642-tqma64xxl-mbax4xxl-wlan.dtb >>>>>      # Boards with AM65x SoC >>>>> -k3-am654-gp-evm-dtbs := k3-am654-base-board.dtb >>>>> k3-am654-base-board-rocktech-rk101-panel.dtbo >>>>> +k3-am654-gp-evm-dtbs := k3-am654-base-board.dtb >>>>> k3-am654-base-board-rocktech-rk101-panel.dtbo >>>>> k3-am654-base-board-prueth.dtbo >>>>>    dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic.dtb >>>>>    dtb-$(CONFIG_ARCH_K3) += k3-am6528-iot2050-basic-pg2.dtb >>>>>    dtb-$(CONFIG_ARCH_K3) += k3-am6548-iot2050-advanced.dtb >>>>> >>>>> Andrew >>>>> >>>>>> >>>>>>> Andrew >>>>>>> >>>>>>>>      1 file changed, 123 insertions(+) >>>>>>>> >>>>>>>> diff --git a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts >>>>>>>> b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts >>>>>>>> index f5c26e9fba98..5cf9546ff9f7 100644 >>>>>>>> --- a/arch/arm64/boot/dts/ti/k3-am654-base-board.dts >>>>>>>> +++ b/arch/arm64/boot/dts/ti/k3-am654-base-board.dts >>>>>>>> @@ -25,6 +25,8 @@ aliases { >>>>>>>>              ethernet0 = &cpsw_port1; >>>>>>>>              mmc0 = &sdhci0; >>>>>>>>              mmc1 = &sdhci1; >>>>>>>> +        ethernet1 = &icssg2_emac0; >>>>>>>> +        ethernet2 = &icssg2_emac1; >>>>>>>>          }; >>>>>>>>            chosen { >>>>>>>> @@ -144,6 +146,72 @@ vtt_supply: regulator-3 { >>>>>>>>              vin-supply = <&vcc3v3_io>; >>>>>>>>              gpio = <&wkup_gpio0 28 GPIO_ACTIVE_HIGH>; >>>>>>>>          }; >>>>>>>> + >>>>>>>> +    /* Dual Ethernet application node on PRU-ICSSG2 */ >>>>>>>> +    icssg2_eth: icssg2-eth { >>>>>>>> +        compatible = "ti,am654-icssg-prueth"; -- Thanks and Regards, Md Danish Anwar