Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1119458rdb; Fri, 1 Dec 2023 07:32:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKCoo5luU/ArEZ3r7CMXpzOwim6WrRhc523Gnh5OO/CdfG/qv0DtWk+yymGl4ydeRsG7zS X-Received: by 2002:a05:6a00:21c8:b0:690:f877:aa1e with SMTP id t8-20020a056a0021c800b00690f877aa1emr34327471pfj.12.1701444757929; Fri, 01 Dec 2023 07:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701444757; cv=none; d=google.com; s=arc-20160816; b=Cz93DohvHz1wTIcNZqKO+L17K6ppNHHh/pRwwpPK7aupXH3H07pTCKOsGB3ji3bF6z CIRQbTNUoZO2ryJ1aNvMm83a+T+Nf72MDS2dk/MPwcUzNtPQCTKB9se4prV/zRbtoPPe jD2aMvOOO0BNOb0zHubUCGzCUuilrJ/E85guxKy6AXY7CjLYiZo54VZ5MHr0WmLhTVc0 0/yijCxHoqs6XmajsMAoW6EA8BmUHnPZe6o4naxoo2Ui/O2nx+ge3/DpRId+aNZPi5JW nT+gw/md518Uq2+qCEIdkeKcxZwj7Yl52t3mtqkZtTx3E8ME0uMZHQ9eoq8kXcavECcz ilsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=q3KsEv2cVoEftyN++WY2K2fr8jr0i0yk0+SwSXCnFyU=; fh=edLK6CrLZnoyngH4Z0tRvVYoYKorJO0VIuKCSDp0nUE=; b=KM7fIXKanAcHOb4s/qJxjNu3RxtkCtm9qjPLO1tehVah8F/BgUEOn5Kl4JppJ69CWZ 4z9VVVg3VSgsKpMgfCG1gb7yXsyrQOVYe1jwHDegAdpfPJ8/4L0rfn1Z5rzlDHQ4ihJ/ 4uI9Vm9ozKedrggRPIufo2ffrUJsU1/kDrBMl0ASjMdr9w6QI4IltW3LsR3eIU0dwSMX Pv2NPqQUAIT1CKOSlJtEnoVSqHBZWe+AyUn4lzRpZr/U2xCFAexmaJhifR4q8L7na1xW v13Ff4V3adcMLv4vSmK+387kegCv0WAf9oI0fwqMNq4JbZs7cvsyR7Mca0I7blJFfIlv fLig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@riscv-rocks.de header.s=google header.b=LeVZu0U5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c21-20020a056a000ad500b006c98123e8acsi3561309pfl.24.2023.12.01.07.32.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 07:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@riscv-rocks.de header.s=google header.b=LeVZu0U5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6290780FA866; Fri, 1 Dec 2023 07:32:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379470AbjLAPcM (ORCPT + 99 others); Fri, 1 Dec 2023 10:32:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379398AbjLAPcJ (ORCPT ); Fri, 1 Dec 2023 10:32:09 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2289A10DF for ; Fri, 1 Dec 2023 07:32:14 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a19067009d2so243773266b.3 for ; Fri, 01 Dec 2023 07:32:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscv-rocks.de; s=google; t=1701444732; x=1702049532; darn=vger.kernel.org; h=organization:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=q3KsEv2cVoEftyN++WY2K2fr8jr0i0yk0+SwSXCnFyU=; b=LeVZu0U5B9W7JvKFjt3dIl0VtsnfkonsfsU4mLiYw0liF3cWHc8mCVAnS3mZENmJLE PkOSdsBFz/0UjUxm7zsYYCZeeJgTw422Nl010Bsy+ybHR672HnFJVtI87ojJf3prZj4J MaX9UGfXPYiyuwLOpbRxhsOiS8w5g7DHBaTvXfQ3fgPTeIaK8bNSO9hzck8CVN3RTBCq I+2fwttM5sM0gi+ZQRLPQai97rp5G3GZvB5asoL7OsaNYWGfpHWW2EDch6Y+KPVMnejf LoUFHpdr/01u1n9w+o0ti/Wr85yz4Xspzp9EAP2McYTNnAeGN7HQ0/1j30x+ZO45UCxm hGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701444732; x=1702049532; h=organization:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q3KsEv2cVoEftyN++WY2K2fr8jr0i0yk0+SwSXCnFyU=; b=W1tANeTBAs1oHNnN3IcbrBjx9INZOWczmwYW6ygxjQ6uKx6/4DXk/6WNs5mLeqb0TT C6yxqGkQRQ3AI/jdv4UugvF86O9gdJlXPschIpSRD9yJ7YjRYpP+5prNqsUlfW8+PjFt LBPhJvc5WeY3TUxtbHNRXXpI22HGYVTYeSJsy6THXl7ID96CyUOWUCHhO6sy0WAlcFJn AJPsrakqIH2CpSPfn09jcpXho9g2rllQNakbOeuH0gP3qpr/MhtRoyWcK/5fqk1Nf+f3 12xXl6Tmo8U7CrIl7KiZ1Wj3bKnpQ2QPUiE2TfNfwFa5E6hJxO3Q3Jxy16EjNMhWzL+H A37A== X-Gm-Message-State: AOJu0YxZFhRhijNMAe9AArtJLlAZYY8xJFawpvTdndOfcz7czPRZn2wv B+ITpus52xt0LO0fjcqlcUTAFg== X-Received: by 2002:a17:906:74ca:b0:a18:48ec:a6bf with SMTP id z10-20020a17090674ca00b00a1848eca6bfmr1004857ejl.56.1701444732258; Fri, 01 Dec 2023 07:32:12 -0800 (PST) Received: from fedora.fritz.box (p549451cc.dip0.t-ipconnect.de. [84.148.81.204]) by smtp.gmail.com with ESMTPSA id h18-20020a170906111200b00a0d02cfa48bsm2002367eja.213.2023.12.01.07.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 07:32:11 -0800 (PST) Date: Fri, 1 Dec 2023 16:32:09 +0100 From: Damian Tometzki To: Minda Chen Cc: Conor Dooley , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie Subject: Re: [PATCH v11 0/20] Refactoring Microchip PCIe driver and add StarFive PCIe Message-ID: Reply-To: Damian Tometzki Mail-Followup-To: Minda Chen , Conor Dooley , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie References: <20231115114912.71448-1-minda.chen@starfivetech.com> <1168e373-b049-4c17-9cbd-c588bf913bbb@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1168e373-b049-4c17-9cbd-c588bf913bbb@starfivetech.com> User-Agent: Mutt X-Operating-System: Linux Fedora release 39 (Thirty Nine) (Kernel 6.6.2-201.fc39.x86_64) Organization: Linux hacker X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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]); Fri, 01 Dec 2023 07:32:24 -0800 (PST) On Fri, 01. Dec 15:15, Minda Chen wrote: > > > On 2023/11/29 19:32, Damian Tometzki wrote: > > On Wed, 29. Nov 07:39, Damian Tometzki wrote: > >> Hello Minda, > >> > >> i tried this Patchset on Linux-6.6.3 but boot with nvme doesnt work. Linux doesnt find > >> /root partition /dev/nvme0n1p4. > >> I dont know if it has anything to do with this patchset ? > >> Best regards > >> Damian > > Hi, > > some additional information: > > Begin: Running /scripts/local-block ... done. > > Begin: Running /scripts/local-block ... done. > > [ 11.097653] /soc/pcie@940000000: Failed to get clk index: 1 ret: -517 > > [ 11.104147] pcie-starfive 940000000.pcie: error -ENODEV: failed to get pcie clocks > > [ 11.111981] /soc/pcie@9c0000000: Failed to get clk index: 1 ret: -517 > > [ 11.118451] pcie-starfive 9c0000000.pcie: error -ENODEV: failed to get pcie clocks > > [ 11.126371] platform 17020000.pinctrl: deferred probe pending > > [ 11.132145] platform 16010000.mmc: deferred probe pending > > Begin: Running /scripts/local-block ... done. > > Begin: Running /scripts/local-block ... done. > > > > Damian > > > It is get stg clk failed. Did you enable CONFIG_CLK_STARFIVE_JH7110_STG=y? Hi, it is now a little bit better now i get: Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... done. Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. [ 13.916056] platform 940000000.pcie: deferred probe pending [ 13.921668] platform 9c0000000.pcie: deferred probe pending [ 13.927259] platform 16010000.mmc: deferred probe pending Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Begin: Running /scripts/local-block ... done. Damian > >> > >> On Wed, 15. Nov 19:48, Minda Chen wrote: > >> > This patchset final purpose is add PCIe driver for StarFive JH7110 SoC. > >> > JH7110 using PLDA XpressRICH PCIe IP. Microchip PolarFire Using the > >> > same IP and have commit their codes, which are mixed with PLDA > >> > controller codes and Microchip platform codes. > >> > > >> > For re-use the PLDA controller codes, I request refactoring microchip > >> > codes, move PLDA common codes to PLDA files. > >> > Desigware and Cadence is good example for refactoring codes. > >> > > >> > ---------------------------------------------------------- > >> > The refactoring patches total number is 16,(patch 1-16) > >> > which do NOT contain changing logic of codes. > >> > > >> > These patches just contain three type basic operations. > >> > (rename, modify codes to support starfive platform, and moving to common file) > >> > If these patched are all be reviewed. They can be accepted first. > >> > > >> > Refactoring patches can be devided to different groups > >> > 1. (patch 1- 3 is the prepare work of refactoring) > >> > patch1 is move PLDA XpressRICH PCIe host common properties dt-binding > >> > docs from microchip,pcie-host.yaml > >> > patch2 is move PolarFire codes to PLDA directory. > >> > patch3 is move PLDA IP register macros to plda-pcie.h > >> > > >> > 2. (patch4 - 6 is processing and re-use PCIe host instance) > >> > patch4 is add bridge_addr field to PCIe host instance. > >> > patch5 is rename data structure in microchip codes. > >> > patch6 is moving two data structures to head file > >> > > >> > 3. (patch 7 - 9 are for re-use two PCIe setup function) > >> > patch7 is rename two setup functions in microchip codes, prepare to move > >> > to common file. > >> > patch8 is change the arguments of plda_pcie_setup_iomems() > >> > patch9 is move the two setup functions to common file pcie-plda-host.c > >> > > >> > 4.(patch 10 - 16 are for re-use interupt processing codes) > >> > patch10 is rename the IRQ related functions, prepare to move to > >> > pcie-plda-host.c > >> > patch 11 - 15 is modify the interrupt event codes, preparing for support starfive > >> > and microchip two platforms. > >> > patch16 is move IRQ related functions to pcie-plda-host.c > >> > > >> > ------------------------------------------------------------ > >> > The remainder patches (patch 17 -20) are not refactoring patch. > >> > They are for adding StarFive codes and dont modify the microchip's > >> > codes. > >> > > >> > patch17 is Add PLDA event interrupt codes and host init/deinit functions. > >> > patch18 is add StarFive JH7110 PCIe dt-binding doc. > >> > patch19 is add StarFive JH7110 Soc PCIe codes. > >> > patch20 is Starfive dts config > >> > > >> > This patchset is base on v6.7-rc1 > >> > > >> > previous version: > >> > v6:https://patchwork.kernel.org/project/linux-pci/cover/20230915102243.59775-1-minda.chen@starfivetech.com/ > >> > v7:https://patchwork.kernel.org/project/linux-pci/cover/20230927100802.46620-1-minda.chen@starfivetech.com/ > >> > v8:https://patchwork.kernel.org/project/linux-pci/cover/20231011110514.107528-1-minda.chen@starfivetech.com/ > >> > v9:https://patchwork.kernel.org/project/linux-pci/cover/20231020104341.63157-1-minda.chen@starfivetech.com/ > >> > v10:https://patchwork.kernel.org/project/linux-pci/cover/20231031115430.113586-1-minda.chen@starfivetech.com/ > >> > > >> > change: > >> > v11: > >> > check and modify some commit messages again. > >> > All the codes are the same with v10. > >> > > >> > v10: > >> > All the commit message set to fit in 75 columns. > >> > All the codes fit in less than 80 colunms. > >> > patch 14: > >> > Commit message changes suggested by Conor. > >> > patch 19: > >> > Add 100 ms delay macro to pci.h > >> > generic phy pointer related codes moving to pcie-starfive.c > >> > This patch Change pcie-starfive only, bus_ops move to patch 16. > >> > Some Codes changes suggested by Bjorn. > >> > > >> > v9: > >> > v8 patch 10 squash to v9 patch 12, v8 patch 18 squash to v9 patch 16. > >> > patch 4 - 16: Add new review tags and add more accurate commit messages. > >> > patch 17: move the plda_pcie_host_init/deinit from patch 19. Make > >> > plda driver become to whole driver. > >> > > >> > v8: > >> > The patch description in cover-letter has been changed. > >> > > >> > v7 patch 4 split to v8 patch 4 - 6. > >> > (It is patches about re-use pcie host data structure, new patches just contain one > >> > function modification. It is more reguluar and easier to review). > >> > > >> > patch 7- 9: modify the commit messages and add reason of > >> > modifcation. > >> > patch10- 16 : > >> > Add review tag and add more commit messages to declear the > >> > reason of modifying the codes. > >> > patch17: plda_handle_events() using bit mask macro. The function are > >> > easier to read. > >> > > >> > v7: > >> > patch17: fix the build warning. > >> > patch19: Some format changes (Emil's comment) > >> > patch20: change the pcie node sequences by alphabetical > >> > delete the "interupt-parent" in pcie node. > >> > > >> > v6: > >> > v5 patch 4 split to patch 4 -9. New patches just contain one function modification. It is more reguluar. > >> > > >> > patch 9: Just move the two setup functions only > >> > patch 19 : draw a graph of PLDA local register, make it easier to > >> > review the codes. > >> > v5 patch 7 split to patch 10- 16. Each patch just contain one > >> > function modification. It is more regular. > >> > patch 10: rename IRQ related functions. > >> > patch 11 - 15 : modify the events codes, total five patch. > >> > patch 16: move IRQ related functions to pcie-plda-host.c > >> > patch 19- 20 using "linux,pci-domain" dts setting. > >> > > >> > Minda Chen (20): > >> > dt-bindings: PCI: Add PLDA XpressRICH PCIe host common properties > >> > PCI: microchip: Move pcie-microchip-host.c to plda directory > >> > PCI: microchip: Move PLDA IP register macros to pcie-plda.h > >> > PCI: microchip: Add bridge_addr field to struct mc_pcie > >> > PCI: microchip: Rename two PCIe data structures > >> > PCI: microchip: Move PCIe host data structures to plda-pcie.h > >> > PCI: microchip: Rename two setup functions > >> > PCI: microchip: Change the argument of plda_pcie_setup_iomems() > >> > PCI: microchip: Move setup functions to pcie-plda-host.c > >> > PCI: microchip: Rename interrupt related functions > >> > PCI: microchip: Add num_events field to struct plda_pcie_rp > >> > PCI: microchip: Add request_event_irq() callback function > >> > PCI: microchip: Add INTx and MSI event num to struct plda_event > >> > PCI: microchip: Add get_events() callback function > >> > PCI: microchip: Add event IRQ domain ops to struct plda_event > >> > PCI: microchip: Move IRQ functions to pcie-plda-host.c > >> > PCI: plda: Add event interrupt codes and host init/deinit functions > >> > dt-bindings: PCI: Add StarFive JH7110 PCIe controller > >> > PCI: starfive: Add JH7110 PCIe controller > >> > riscv: dts: starfive: add PCIe dts configuration for JH7110 > >> > > >> > .../bindings/pci/microchip,pcie-host.yaml | 55 +- > >> > .../pci/plda,xpressrich3-axi-common.yaml | 75 ++ > >> > .../bindings/pci/starfive,jh7110-pcie.yaml | 120 ++++ > >> > MAINTAINERS | 19 +- > >> > .../jh7110-starfive-visionfive-2.dtsi | 64 ++ > >> > arch/riscv/boot/dts/starfive/jh7110.dtsi | 86 +++ > >> > drivers/pci/controller/Kconfig | 9 +- > >> > drivers/pci/controller/Makefile | 2 +- > >> > drivers/pci/controller/plda/Kconfig | 29 + > >> > drivers/pci/controller/plda/Makefile | 4 + > >> > .../{ => plda}/pcie-microchip-host.c | 602 ++-------------- > >> > drivers/pci/controller/plda/pcie-plda-host.c | 657 ++++++++++++++++++ > >> > drivers/pci/controller/plda/pcie-plda.h | 266 +++++++ > >> > drivers/pci/controller/plda/pcie-starfive.c | 460 ++++++++++++ > >> > drivers/pci/pci.h | 7 + > >> > 15 files changed, 1851 insertions(+), 604 deletions(-) > >> > create mode 100644 Documentation/devicetree/bindings/pci/plda,xpressrich3-axi-common.yaml > >> > create mode 100644 Documentation/devicetree/bindings/pci/starfive,jh7110-pcie.yaml > >> > create mode 100644 drivers/pci/controller/plda/Kconfig > >> > create mode 100644 drivers/pci/controller/plda/Makefile > >> > rename drivers/pci/controller/{ => plda}/pcie-microchip-host.c (54%) > >> > create mode 100644 drivers/pci/controller/plda/pcie-plda-host.c > >> > create mode 100644 drivers/pci/controller/plda/pcie-plda.h > >> > create mode 100644 drivers/pci/controller/plda/pcie-starfive.c > >> > > >> > > >> > base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 > >> > -- > >> > 2.17.1 > >> >