All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Quinlan <james.quinlan@broadcom.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Jim Quinlan" <jim2101024@gmail.com>,
	"open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS"
	<linux-pci@vger.kernel.org>,
	linux-mips@vger.kernel.org,
	"Nicolas Saenz Julienne" <nsaenz@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Kevin Cernekee" <cernekee@gmail.com>,
	"maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-rpi-kernel@lists.infradead.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v1 4/4] PCI: brcmstb: Augment driver for MIPs SOCs
Date: Fri, 8 Jul 2022 09:37:13 -0400	[thread overview]
Message-ID: <CA+-6iNyViHVgdmvhzTEMWDdaP7mm-38iqhdyknyq0z8Au2gWBg@mail.gmail.com> (raw)
In-Reply-To: <20220706214200.GA224369@bhelgaas>

[-- Attachment #1: Type: text/plain, Size: 2743 bytes --]

On Wed, Jul 6, 2022 at 5:42 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Thu, Dec 09, 2021 at 03:47:25PM -0500, Jim Quinlan wrote:
> > The current brcmstb driver works for Arm and Arm64.  A few things are
> > modified here for us to support MIPs as well.
> >
> >   o There are four outbound range register groups and each directs a window
> >     of up to 128MB.  Even though there are four 128MB DT "ranges" in the
> >     bmips PCIe DT node, these ranges are contiguous and are collapsed into
> >     a single range by the OF range parser.  Now the driver assumes a single
> >     range -- for MIPs only -- and splits it back into 128MB sizes.
> >
> >   o For bcm7425, the config space accesses must be 32-bit reads or
> >     writes.  In addition, the 4k config space register array is missing
> >     and not used.
> >
> >   o The registers for the upper 32-bits of the outbound window address do
> >     not exist.
> >
> >   o Burst size must be set to 256 (this refers to an internal bus).
> > ...
>
> > @@ -118,6 +118,7 @@
> >  #define PCIE_MISC_HARD_PCIE_HARD_DEBUG                                       0x4204
> >  #define  PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK     0x2
> >  #define  PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK             0x08000000
> > +#define  PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK               0x00800000
>
> > @@ -883,7 +937,10 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
> >       pcie->bridge_sw_init_set(pcie, 0);
> >
> >       tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
> > -     tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> > +     if (is_bmips(pcie))
> > +             tmp &= ~PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> > +     else
> > +             tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> >       writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
> >       /* Wait for SerDes to be stable */
> >       usleep_range(100, 200);
>
> brcm_pcie_resume() has similar code that updates
> PCIE_MISC_HARD_PCIE_HARD_DEBUG [1]:
>
>   tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
>   u32p_replace_bits(&tmp, 0, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK);
>   writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
>
>   /* wait for serdes to be stable */
>   udelay(100);
>
> This patch didn't change brcm_pcie_resume() to check is_bmips().
> Should it?
>
> If so, it would be nice to use the same method for updating the value
> (either u32p_replace_bits or plain C bitops) in both places.

Will send a patch to fix this, thanks.

Jim Quinlan
Broadcom STB

>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/pcie-brcmstb.c?id=v5.18#n1452

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4210 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Jim Quinlan <james.quinlan@broadcom.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Jim Quinlan" <jim2101024@gmail.com>,
	"open list:PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS"
	<linux-pci@vger.kernel.org>,
	linux-mips@vger.kernel.org,
	"Nicolas Saenz Julienne" <nsaenz@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Kevin Cernekee" <cernekee@gmail.com>,
	"maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-rpi-kernel@lists.infradead.org>,
	"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v1 4/4] PCI: brcmstb: Augment driver for MIPs SOCs
Date: Fri, 8 Jul 2022 09:37:13 -0400	[thread overview]
Message-ID: <CA+-6iNyViHVgdmvhzTEMWDdaP7mm-38iqhdyknyq0z8Au2gWBg@mail.gmail.com> (raw)
In-Reply-To: <20220706214200.GA224369@bhelgaas>


[-- Attachment #1.1: Type: text/plain, Size: 2743 bytes --]

On Wed, Jul 6, 2022 at 5:42 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> On Thu, Dec 09, 2021 at 03:47:25PM -0500, Jim Quinlan wrote:
> > The current brcmstb driver works for Arm and Arm64.  A few things are
> > modified here for us to support MIPs as well.
> >
> >   o There are four outbound range register groups and each directs a window
> >     of up to 128MB.  Even though there are four 128MB DT "ranges" in the
> >     bmips PCIe DT node, these ranges are contiguous and are collapsed into
> >     a single range by the OF range parser.  Now the driver assumes a single
> >     range -- for MIPs only -- and splits it back into 128MB sizes.
> >
> >   o For bcm7425, the config space accesses must be 32-bit reads or
> >     writes.  In addition, the 4k config space register array is missing
> >     and not used.
> >
> >   o The registers for the upper 32-bits of the outbound window address do
> >     not exist.
> >
> >   o Burst size must be set to 256 (this refers to an internal bus).
> > ...
>
> > @@ -118,6 +118,7 @@
> >  #define PCIE_MISC_HARD_PCIE_HARD_DEBUG                                       0x4204
> >  #define  PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK     0x2
> >  #define  PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK             0x08000000
> > +#define  PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK               0x00800000
>
> > @@ -883,7 +937,10 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie)
> >       pcie->bridge_sw_init_set(pcie, 0);
> >
> >       tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
> > -     tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> > +     if (is_bmips(pcie))
> > +             tmp &= ~PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> > +     else
> > +             tmp &= ~PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK;
> >       writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
> >       /* Wait for SerDes to be stable */
> >       usleep_range(100, 200);
>
> brcm_pcie_resume() has similar code that updates
> PCIE_MISC_HARD_PCIE_HARD_DEBUG [1]:
>
>   tmp = readl(base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
>   u32p_replace_bits(&tmp, 0, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK);
>   writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
>
>   /* wait for serdes to be stable */
>   udelay(100);
>
> This patch didn't change brcm_pcie_resume() to check is_bmips().
> Should it?
>
> If so, it would be nice to use the same method for updating the value
> (either u32p_replace_bits or plain C bitops) in both places.

Will send a patch to fix this, thanks.

Jim Quinlan
Broadcom STB

>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pci/controller/pcie-brcmstb.c?id=v5.18#n1452

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4210 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-07-08 13:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 20:47 [PATCH v1 0/4] PCI: brcmstb: Augment driver for MIPs SOCs Jim Quinlan
2021-12-09 20:47 ` Jim Quinlan
2021-12-09 20:47 ` [PATCH v1 1/4] dt-bindings: PCI: Add compatible string for Brcmstb 74[23]5 " Jim Quinlan
2021-12-09 20:47   ` Jim Quinlan
2021-12-09 21:29   ` Florian Fainelli
2021-12-09 21:29     ` Florian Fainelli
2021-12-15 19:50   ` Rob Herring
2021-12-15 19:50     ` Rob Herring
2021-12-09 20:47 ` [PATCH v1 2/4] MIPS: bmips: Add support PCIe controller device nodes Jim Quinlan
2021-12-09 21:30   ` Florian Fainelli
2021-12-09 20:47 ` [PATCH v1 3/4] MIPS: bmips: Remove obsolete DMA mapping support Jim Quinlan
2021-12-09 21:31   ` Florian Fainelli
2021-12-13  8:28     ` Christoph Hellwig
2022-02-08 10:34   ` nicolas saenz julienne
2021-12-09 20:47 ` [PATCH v1 4/4] PCI: brcmstb: Augment driver for MIPs SOCs Jim Quinlan
2021-12-09 20:47   ` Jim Quinlan
2021-12-09 21:32   ` Florian Fainelli
2021-12-09 21:32     ` Florian Fainelli
2022-07-06 21:42   ` Bjorn Helgaas
2022-07-06 21:42     ` Bjorn Helgaas
2022-07-08 13:37     ` Jim Quinlan [this message]
2022-07-08 13:37       ` Jim Quinlan
2022-01-05 10:42 ` [PATCH v1 0/4] " Thomas Bogendoerfer
2022-01-05 10:42   ` Thomas Bogendoerfer
2022-01-07 22:36   ` Jim Quinlan
2022-01-07 22:36     ` Jim Quinlan
2022-01-11 15:18 ` Thomas Bogendoerfer
2022-01-11 15:18   ` Thomas Bogendoerfer

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=CA+-6iNyViHVgdmvhzTEMWDdaP7mm-38iqhdyknyq0z8Au2gWBg@mail.gmail.com \
    --to=james.quinlan@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=cernekee@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=jim2101024@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nsaenz@kernel.org \
    --cc=robh@kernel.org \
    /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.