From: "lorenzo@kernel.org" <lorenzo@kernel.org>
To: "Jianjun Wang (王建军)" <Jianjun.Wang@mediatek.com>
Cc: "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"nbd@nbd.name" <nbd@nbd.name>, "dd@embedd.com" <dd@embedd.com>,
"robh@kernel.org" <robh@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"krzysztof.kozlowski+dt@linaro.org"
<krzysztof.kozlowski+dt@linaro.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
Ryder Lee <Ryder.Lee@mediatek.com>,
"lorenzo.bianconi83@gmail.com" <lorenzo.bianconi83@gmail.com>,
upstream <upstream@airoha.com>
Subject: Re: [PATCH v3 4/4] PCI: mediatek-gen3: Add Airoha EN7581 support
Date: Wed, 3 Jul 2024 17:41:02 +0200 [thread overview]
Message-ID: <ZoVxDgxqH9pxlcjN@lore-desk> (raw)
In-Reply-To: <d04c396556612307b690c07a9b3fda7f0d4238ee.camel@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 3877 bytes --]
> On Sat, 2024-06-29 at 15:51 +0200, Lorenzo Bianconi wrote:
> >
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> > Introduce support for Airoha EN7581 PCIe controller to mediatek-gen3
> > PCIe controller driver.
> >
> > Reviewed-by: AngeloGioacchino Del Regno <
> > angelogioacchino.delregno@collabora.com>
> > Tested-by: Zhengping Zhang <zhengping.zhang@airoha.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/pci/controller/Kconfig | 2 +-
> > drivers/pci/controller/pcie-mediatek-gen3.c | 108
> > +++++++++++++++++++-
> > 2 files changed, 108 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pci/controller/Kconfig
> > b/drivers/pci/controller/Kconfig
> > index e534c02ee34f..3bd6c9430010 100644
> > --- a/drivers/pci/controller/Kconfig
> > +++ b/drivers/pci/controller/Kconfig
> > @@ -196,7 +196,7 @@ config PCIE_MEDIATEK
> >
> > config PCIE_MEDIATEK_GEN3
> > tristate "MediaTek Gen3 PCIe controller"
> > - depends on ARCH_MEDIATEK || COMPILE_TEST
> > + depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST
> > depends on PCI_MSI
> > help
> > Adds support for PCIe Gen3 MAC controller for MediaTek SoCs.
> > diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c
> > b/drivers/pci/controller/pcie-mediatek-gen3.c
> > index 438a5222d986..f3f76d1bfd4c 100644
> > --- a/drivers/pci/controller/pcie-mediatek-gen3.c
> > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
> > @@ -7,6 +7,7 @@
> > */
> >
> > #include <linux/clk.h>
> > +#include <linux/clk-provider.h>
> > #include <linux/delay.h>
> > #include <linux/iopoll.h>
> > #include <linux/irq.h>
> > @@ -15,6 +16,8 @@
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> > #include <linux/msi.h>
> > +#include <linux/of_device.h>
> > +#include <linux/of_pci.h>
> > #include <linux/pci.h>
> > #include <linux/phy/phy.h>
> > #include <linux/platform_device.h>
> > @@ -29,6 +32,12 @@
> > #define PCI_CLASS(class) (class << 8)
> > #define PCIE_RC_MODE BIT(0)
> >
> > +#define PCIE_EQ_PRESET_01_REG 0x100
> > +#define PCIE_VAL_LN0_DOWNSTREAM GENMASK(6, 0)
> > +#define PCIE_VAL_LN0_UPSTREAM GENMASK(14, 8)
> > +#define PCIE_VAL_LN1_DOWNSTREAM GENMASK(22, 16)
> > +#define PCIE_VAL_LN1_UPSTREAM GENMASK(30, 24)
> > +
> > #define PCIE_CFGNUM_REG 0x140
> > #define PCIE_CFG_DEVFN(devfn) ((devfn) & GENMASK(7,
> > 0))
> > #define PCIE_CFG_BUS(bus) (((bus) << 8) & GENMASK(15, 8))
> > @@ -68,6 +77,14 @@
> > #define PCIE_MSI_SET_ENABLE_REG 0x190
> > #define PCIE_MSI_SET_ENABLE GENMASK(PCIE_MSI_SET_NUM - 1,
> > 0)
> >
> > +#define PCIE_PIPE4_PIE8_REG 0x338
> > +#define PCIE_K_FINETUNE_MAX GENMASK(5, 0)
> > +#define PCIE_K_FINETUNE_ERR GENMASK(7, 6)
> > +#define PCIE_K_PRESET_TO_USE GENMASK(18, 8)
> > +#define PCIE_K_PHYPARAM_QUERY BIT(19)
> > +#define PCIE_K_QUERY_TIMEOUT BIT(20)
> > +#define PCIE_K_PRESET_TO_USE_16G GENMASK(31, 21)
> > +
> > #define PCIE_MSI_SET_BASE_REG 0xc00
> > #define PCIE_MSI_SET_OFFSET 0x10
> > #define PCIE_MSI_SET_STATUS_OFFSET 0x04
> > @@ -100,7 +117,13 @@
> > #define PCIE_ATR_TLP_TYPE_MEM PCIE_ATR_TLP_TYPE(0)
> > #define PCIE_ATR_TLP_TYPE_IO PCIE_ATR_TLP_TYPE(2)
> >
> > -#define MAX_NUM_PHY_RESETS 1
> > +#define MAX_NUM_PHY_RESETS 3
> > +
> > +/* EN7581 */
> > +/* PCIe-PHY initialization delay in ms */
> > +#define PHY_INIT_TIME_MS 30
>
> Since we have already moved the PHY related settings to the PHY driver,
> can we also move this init time to the PHY driver?
>
> Thanks.
ack, I will do in the next revision.
Regards,
Lorenzo
>
> > +/* PCIe reset line delay in ms */
> > +#define PCIE_RESET_TIME_MS 100
> >
> > struct mtk_gen3_pcie;
> >
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2024-07-03 15:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 13:51 [PATCH v3 0/4] Add Airoha EN7581 PCIe support Lorenzo Bianconi
2024-06-29 13:51 ` [PATCH v3 1/4] dt-bindings: PCI: mediatek-gen3: add support for Airoha EN7581 Lorenzo Bianconi
2024-06-30 14:10 ` Conor Dooley
2024-06-29 13:51 ` [PATCH v3 2/4] PCI: mediatek-gen3: Add mtk_gen3_pcie_pdata data structure Lorenzo Bianconi
2024-06-29 13:51 ` [PATCH v3 3/4] PCI: mediatek-gen3: Rely on reset_bulk APIs for PHY reset lines Lorenzo Bianconi
2024-06-29 13:51 ` [PATCH v3 4/4] PCI: mediatek-gen3: Add Airoha EN7581 support Lorenzo Bianconi
2024-07-01 15:46 ` kernel test robot
2024-07-01 20:21 ` Bjorn Helgaas
2024-07-02 9:12 ` Lorenzo Bianconi
2024-07-02 16:34 ` Bjorn Helgaas
2024-07-03 15:26 ` Lorenzo Bianconi
2024-07-03 20:47 ` Bjorn Helgaas
2024-07-02 9:28 ` Jianjun Wang (王建军)
2024-07-03 15:41 ` lorenzo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZoVxDgxqH9pxlcjN@lore-desk \
--to=lorenzo@kernel.org \
--cc=Jianjun.Wang@mediatek.com \
--cc=Ryder.Lee@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bhelgaas@google.com \
--cc=dd@embedd.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.bianconi83@gmail.com \
--cc=lpieralisi@kernel.org \
--cc=nbd@nbd.name \
--cc=robh@kernel.org \
--cc=upstream@airoha.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.