From: Lorenzo Bianconi <lorenzo@kernel.org>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: linux-pci@vger.kernel.org, ryder.lee@mediatek.com,
lpieralisi@kernel.org, kw@linux.com, robh@kernel.org,
bhelgaas@google.com, linux-mediatek@lists.infradead.org,
lorenzo.bianconi83@gmail.com,
linux-arm-kernel@lists.infradead.org,
krzysztof.kozlowski+dt@linaro.org, devicetree@vger.kernel.org,
nbd@nbd.name, dd@embedd.com, upstream@airoha.com
Subject: Re: [PATCH 2/4] PCI: mediatek-gen3: Add mtk_pcie_soc data structure
Date: Thu, 27 Jun 2024 08:50:25 +0200 [thread overview]
Message-ID: <Zn0LsfE9xlwuEvuf@lore-desk> (raw)
In-Reply-To: <c63ed7fc-f568-48b1-ad5d-a37b4b475016@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 2590 bytes --]
> Il 21/06/24 16:48, Lorenzo Bianconi ha scritto:
> > Introduce mtk_pcie_soc data structure in order to define multiple
> > callbacks for each supported SoC. This is a preliminary patch to
> > introduce EN7581 pcie support.
> >
> > Tested-by: Zhengping Zhang <zhengping.zhang@airoha.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/pci/controller/pcie-mediatek-gen3.c | 24 ++++++++++++++++++---
> > 1 file changed, 21 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c b/drivers/pci/controller/pcie-mediatek-gen3.c
> > index 975b3024fb08..4859bd875bc4 100644
> > --- a/drivers/pci/controller/pcie-mediatek-gen3.c
> > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
> > @@ -100,6 +100,16 @@
> > #define PCIE_ATR_TLP_TYPE_MEM PCIE_ATR_TLP_TYPE(0)
> > #define PCIE_ATR_TLP_TYPE_IO PCIE_ATR_TLP_TYPE(2)
> > +struct mtk_gen3_pcie;
> > +
> > +/**
> > + * struct mtk_pcie_soc - differentiate between host generations
>
> mtk_gen3_pcie_pdata ?
ack, I will fix it in v2.
>
> > + * @power_up: pcie power_up callback
> > + */
> > +struct mtk_pcie_soc {
> > + int (*power_up)(struct mtk_gen3_pcie *pcie);
> > +};
> > +
> > /**
> > * struct mtk_msi_set - MSI information for each set
> > * @base: IO mapped register base
> > @@ -131,6 +141,7 @@ struct mtk_msi_set {
> > * @msi_sets: MSI sets information
> > * @lock: lock protecting IRQ bit map
> > * @msi_irq_in_use: bit map for assigned MSI IRQ
> > + * @soc: pointer to SoC-dependent operations
> > */
> > struct mtk_gen3_pcie {
> > struct device *dev;
> > @@ -151,6 +162,8 @@ struct mtk_gen3_pcie {
> > struct mtk_msi_set msi_sets[PCIE_MSI_SET_NUM];
> > struct mutex lock;
> > DECLARE_BITMAP(msi_irq_in_use, PCIE_MSI_IRQS_NUM);
> > +
> > + const struct mtk_pcie_soc *soc;
> > };
> > /* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */
> > @@ -904,7 +917,7 @@ static int mtk_pcie_setup(struct mtk_gen3_pcie *pcie)
> > usleep_range(10, 20);
> > /* Don't touch the hardware registers before power up */
> > - err = mtk_pcie_power_up(pcie);
> > + err = pcie->soc->power_up(pcie);
> > if (err)
> > return err;
> > @@ -939,6 +952,7 @@ static int mtk_pcie_probe(struct platform_device *pdev)
> > pcie = pci_host_bridge_priv(host);
> > pcie->dev = dev;
> > + pcie->soc = of_device_get_match_data(dev);
>
> device_get_match_data() can also be used here :-)
ack, I will fix it in v2.
Regards,
Lorenzo
>
> Cheers,
> Angelo
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-06-27 6:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 14:48 [PATCH 0/4] Add Airoha EN7581 PCIE support Lorenzo Bianconi
2024-06-21 14:48 ` [PATCH 1/4] dt-bindings: PCI: mediatek-gen3: add support for Airoha EN7581 Lorenzo Bianconi
2024-06-22 12:04 ` Conor Dooley
2024-06-23 9:31 ` Lorenzo Bianconi
2024-06-21 14:48 ` [PATCH 2/4] PCI: mediatek-gen3: Add mtk_pcie_soc data structure Lorenzo Bianconi
2024-06-24 7:57 ` AngeloGioacchino Del Regno
2024-06-27 6:50 ` Lorenzo Bianconi [this message]
2024-06-21 14:48 ` [PATCH 3/4] PCI: mediatek-gen3: rely on reset_bulk APIs for phy reset lines Lorenzo Bianconi
2024-06-21 17:51 ` Bjorn Helgaas
2024-06-21 21:43 ` Lorenzo Bianconi
2024-06-24 8:01 ` AngeloGioacchino Del Regno
2024-06-27 7:03 ` Lorenzo Bianconi
2024-06-21 14:48 ` [PATCH 4/4] PCI: mediatek-gen3: Add Airoha EN7581 support Lorenzo Bianconi
2024-06-21 18:02 ` Bjorn Helgaas
2024-06-21 22:03 ` Lorenzo Bianconi
2024-06-24 7:55 ` AngeloGioacchino Del Regno
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=Zn0LsfE9xlwuEvuf@lore-desk \
--to=lorenzo@kernel.org \
--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=ryder.lee@mediatek.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).