All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 09/10] pci: Add driver for Broadcom STB PCIe controller
Date: Fri, 8 May 2020 07:08:12 -0600	[thread overview]
Message-ID: <CAPnjgZ18oqiGebFYOqAHApv2i0Wz9gjJSOYxKa5ioWQhm1CABA@mail.gmail.com> (raw)
In-Reply-To: <f4e3342b-4a84-6bb7-c065-7a63c5456902@samsung.com>

Hi Sylwester,

On Fri, 8 May 2020 at 05:46, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
>
> Hi Simon,
>
> On 06.05.2020 16:47, Simon Glass wrote:
> > On Mon, 4 May 2020 at 06:45, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
>
> >> ---
> >>  drivers/pci/Kconfig        |   6 +
> >>  drivers/pci/Makefile       |   1 +
> >>  drivers/pci/pcie_brcmstb.c | 594 +++++++++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 601 insertions(+)
> >>  create mode 100644 drivers/pci/pcie_brcmstb.c
> >
> > A few small comments.
>
> Thank you for time and a valuable review.
>
> >> diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
>
> >> +config PCI_BRCMSTB
> >> +       bool "Broadcom STB PCIe controller"
> >> +       depends on DM_PCI
> >> +       depends on ARCH_BCM283X
> >> +       help
> >> +         Say Y here if you want to enable Broadcom STB PCIe controller support.
> >
> > What is STB? What features does this support? You should get a warning
> > here to write at least three lines.
>
> I'm going to change that help text to something along the lines of:
>
>   Say Y here if you want to enable support for PCIe controller
>   on Broadcom set-top-box (STB) SoCs.
>   This driver currently supports only BCM2711 SoC and RC mode
>   of the controller.
>
> >> diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c
> >> new file mode 100644
> >> index 0000000..c6ddf92
> >> --- /dev/null
> >> +++ b/drivers/pci/pcie_brcmstb.c
> >> @@ -0,0 +1,594 @@
>
> >> +#include <asm/io.h>
> >> +#include <common.h>
> >> +#include <dm.h>
> >> +#include <dm/ofnode.h>
> >> +#include <errno.h>
> >> +#include <linux/bitfield.h>
> >> +#include <linux/log2.h>
> >> +#include <pci.h>
> >
> > Check ordering of include files:
> >
> > https://protect2.fireeye.com/url?k=c3a0292d-9e737093-c3a1a262-0cc47a31ba82-690f9f10b3970f9d&q=1&u=https%3A%2F%2Fwww.denx.de%2Fwiki%2FU-Boot%2FCodingStyle
>
> Thanks for the hint, it felt there was something wrong with the ordering.
>
> >> +#define PCIE_MISC_MISC_CTRL                            0x4008
> >> +#define  PCIE_MISC_MISC_CTRL_SCB_ACCESS_EN_MASK                0x1000
> >> +#define  PCIE_MISC_MISC_CTRL_CFG_READ_UR_MODE_MASK     0x2000
> >> +#define  PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_MASK       0x300000
> >> +#define  PCIE_MISC_MISC_CTRL_MAX_BURST_SIZE_128                0x0
> >> +#define  PCIE_MISC_MISC_CTRL_SCB0_SIZE_MASK            0xf8000000
> >
> > If you have a _MASK, don't you need a _SHIFT to allow you to read from
> > the field?
>
> I had shift definitions originally but these got removed when we started to
> use the FIELD_GET macro and similar. Shifts are retrieved there from a mask
> by ffs() call (find first bit set in a word). If that's not preferred in
> u-boot I will switch back to using explicit shift definitions.

+Tom Rini

We've had a policy of avoiding these for some time, but now that Linux
has them, should we pull this in and start using it? It is not that
widely used in Linux but has been there for a few years.

Regards,
Simon

  reply	other threads:[~2020-05-08 13:08 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200504124532eucas1p1603b3576c1e938a0bc0d11c075b289e0@eucas1p1.samsung.com>
2020-05-04 12:45 ` [PATCH v2 00/10] USB host support for Raspberry Pi 4 board Sylwester Nawrocki
     [not found]   ` <CGME20200504124540eucas1p13de235cf0014249e420eaa6502d57e93@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 01/10] usb: xhci: Add missing cache flush in the scratchpad array initialization Sylwester Nawrocki
     [not found]   ` <CGME20200504124543eucas1p12dd4bca4b6b65593027c63485c659191@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 02/10] usb: xhci: Use only 32-bit accesses in xhci_writeq/xhci_readq Sylwester Nawrocki
     [not found]   ` <CGME20200504124544eucas1p1dff0bc65bd0cdab0de2662c2671d49b3@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 03/10] pci: Move some PCIe register offset definitions to a common header Sylwester Nawrocki
     [not found]   ` <CGME20200504124544eucas1p2e7763e292144e3f8a7828f014209c770@eucas1p2.samsung.com>
2020-05-04 12:45     ` [PATCH v2 04/10] rpi4: shorten a mapping for the DRAM Sylwester Nawrocki
     [not found]   ` <CGME20200504124545eucas1p1532613e2c1558cb043f3b32946c748ea@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 05/10] rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 64bit) Sylwester Nawrocki
2020-05-05 14:00       ` Matthias Brugger
2020-05-05 14:07         ` Matthias Brugger
2020-05-05 14:10         ` Marek Szyprowski
2020-05-05 14:13           ` Matthias Brugger
     [not found]   ` <CGME20200504124545eucas1p2d8fcb6cfbd2204d171dad747cb6f9cd1@eucas1p2.samsung.com>
2020-05-04 12:45     ` [PATCH v2 06/10] rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit) Sylwester Nawrocki
2020-05-05 14:25       ` Matthias Brugger
2020-05-05 14:43         ` Marek Szyprowski
2020-05-08 21:26       ` Matthias Brugger
2020-05-11 19:44         ` Tom Rini
2020-05-11 19:47           ` Matthias Brugger
2020-05-12 10:25             ` Sylwester Nawrocki
2020-05-12 12:04         ` Marek Szyprowski
     [not found]         ` <CGME20200512131806eucas1p2b526ab4ef030c1460696cfef380e77c3@eucas1p2.samsung.com>
2020-05-12 13:17           ` [RFC PATCH 0/2] ARM: arbitrary virtual-physical mappings for RPi4 XHCI support Marek Szyprowski
     [not found]             ` <CGME20200512131806eucas1p1c093915ecfeda5da49cc8d944b7801a8@eucas1p1.samsung.com>
2020-05-12 13:17               ` [RFC PATCH 1/2] arm: provide a function for boards init code to modify MMU virtual-physical map Marek Szyprowski
2020-05-12 15:11                 ` Sylwester Nawrocki
     [not found]             ` <CGME20200512131807eucas1p23959715b10a4e7ab36b60fd9791dae87@eucas1p2.samsung.com>
2020-05-12 13:17               ` [RFC PATCH 2/2] rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit) Marek Szyprowski
     [not found]         ` <CGME20200515112029eucas1p2ac42672aa804e0f2b7e8143ebb618b33@eucas1p2.samsung.com>
2020-05-15 11:20           ` [RFC PATCH v2 0/2] ARM: arbitrary virtual-physical mappings for RPi4 XHCI support Marek Szyprowski
     [not found]             ` <CGME20200515112033eucas1p29c631060556949761d0c7c06c2088374@eucas1p2.samsung.com>
2020-05-15 11:20               ` [RFC PATCH v2 1/2] arm: provide a function for boards init code to modify MMU virtual-physical map Marek Szyprowski
     [not found]             ` <CGME20200515112033eucas1p1cd20ecf4b87ae37a056eadb87b5b48be@eucas1p1.samsung.com>
2020-05-15 11:20               ` [RFC PATCH v2 2/2] rpi4: add a mapping for the PCIe XHCI controller MMIO registers (ARM 32bit) Marek Szyprowski
     [not found]   ` <CGME20200504124546eucas1p186af18875a3f6acb19b06880efefee30@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 07/10] linux/bitfield.h: Add primitives for manipulating bitfields both in host- and fixed-endian Sylwester Nawrocki
2020-05-05 11:10       ` Bin Meng
     [not found]   ` <CGME20200504124546eucas1p19294ad098a72837a08ce74cb00b99253@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 08/10] pci: Add some PCI Express capability register offset definitions Sylwester Nawrocki
     [not found]   ` <CGME20200504124546eucas1p2bf8a243666eee66b1ef480558113a740@eucas1p2.samsung.com>
2020-05-04 12:45     ` [PATCH v2 09/10] pci: Add driver for Broadcom STB PCIe controller Sylwester Nawrocki
2020-05-05 14:13       ` Nicolas Saenz Julienne
2020-05-06  8:36         ` Sylwester Nawrocki
2020-05-05 15:45       ` Nicolas Saenz Julienne
2020-05-06  8:59         ` Sylwester Nawrocki
2020-05-06 14:47       ` Simon Glass
2020-05-08  9:50         ` Nicolas Saenz Julienne
2020-05-08 14:25           ` Jim Quinlan
2020-05-08 14:54             ` Nicolas Saenz Julienne
2020-05-08 18:33             ` Simon Glass
2020-05-12 16:42             ` Sylwester Nawrocki
2020-05-12 16:46               ` Jim Quinlan
2020-05-08 11:46         ` Sylwester Nawrocki
2020-05-08 13:08           ` Simon Glass [this message]
     [not found]   ` <CGME20200504124547eucas1p12650f3069a692bcbfae1080b1cda060e@eucas1p1.samsung.com>
2020-05-04 12:45     ` [PATCH v2 10/10] config: Enable support for the XHCI controller on RPI4 board Sylwester Nawrocki
2020-05-05 11:15       ` Bin Meng
2020-05-05 11:18         ` Nicolas Saenz Julienne
2020-05-05 11:19         ` Marek Szyprowski
2020-05-05 14:09   ` [PATCH v2 00/10] USB host support for Raspberry Pi 4 board Nicolas Saenz Julienne

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=CAPnjgZ18oqiGebFYOqAHApv2i0Wz9gjJSOYxKa5ioWQhm1CABA@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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.