All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	Imre Kaloz <kaloz@openwrt.org>,
	Krzysztof Halasa <khalasa@piap.pl>,
	Zoltan HERPAI <wigyori@uid0.hu>,
	Raylynn Knight <rayknight@me.com>
Subject: Re: [PATCH 4/4] PCI: ixp4xx: Add a new driver for IXP4xx
Date: Tue, 4 May 2021 09:12:07 +0200	[thread overview]
Message-ID: <CAK8P3a1XtmYAfstfhRzv-y73od3u+fYkvED5LuJ5TNMOS19zZg@mail.gmail.com> (raw)
In-Reply-To: <20210503211649.4109334-5-linus.walleij@linaro.org>

On Mon, May 3, 2021 at 11:16 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This adds a new PCI controller driver for the Intel IXP4xx
> (IX425, IXP435 etc), based on the XScale microarchitecture.
>
> This replaces the old driver in arch/arm/mach-ixp4xx/common-pci.c
> which utilized the ARM-specific BIOS32 PCI framework,
> and all parameterization for such things as memory and
> IO space as well as interrupt swizzling is done from the
> device tree.

Nice work!

> The __raw_writel() and __raw_readl() are used for accessing
> the PCI controller for the same reason that these accessors
> are used in the timer, IRQ and GPIO drivers: the platform
> will alter its address bus pattern based on whether the
> system is booted in big- or little-endian mode. For this
> reason all register on IXP4xx must always be accessed in
> native (CPU) endianness.

Can you add a pair of inline function that wraps these into
a driver specific helper with a comment?

> This driver supports 64MB of PCI memory space, but not the
> indirect access of 1GB that is available in the old driver.
> We can address that later if and only if there are users
> that need all 1GB of PCI address space.

> +
> +       ret = pci_scan_root_bus_bridge(host);
> +       if (ret) {
> +               dev_err(dev, "failed to scan host: %d\n", ret);
> +               return ret;
> +       }
> +
> +       p->bus = host->bus;

I don't think you need to store the bus separately, just use
host->bus everywhere.

> +       pci_bus_assign_resources(p->bus);
> +       pci_bus_add_devices(p->bus);

Can you call pci_host_probe() instead of open-coding it here?

> +
> +static struct platform_driver ixp4xx_pci_driver = {
> +       .driver = {
> +               .name = "ixp4xx-pci",
> +               .of_match_table = of_match_ptr(ixp4xx_pci_of_match),
> +               .suppress_bind_attrs = true,
> +       },
> +       .probe  = ixp4xx_pci_probe,
> +};
> +builtin_platform_driver(ixp4xx_pci_driver);

It should be possible to make it a loadable module, after Rob Herring
fixed some of the bugs around that.

        Arnd

      parent reply	other threads:[~2021-05-04  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 21:16 [PATCH 0/4] IXP4xx PCI rework Linus Walleij
2021-05-03 21:16 ` [PATCH 1/4] ARM/ixp4xx: Move the UART and exp bus virtbases Linus Walleij
2021-05-04  7:38   ` Arnd Bergmann
2021-05-03 21:16 ` [PATCH 2/4] ARM/ixp4xx: Make NEED_MACH_IO_H optional Linus Walleij
2021-05-03 21:16 ` [PATCH 3/4] PCI: ixp4xx: Add device tree bindings for IXP4xx Linus Walleij
2021-05-04 12:54   ` Arnd Bergmann
2021-05-09 21:31     ` Linus Walleij
2021-05-06 20:24   ` Rob Herring
2021-05-03 21:16 ` [PATCH 4/4] PCI: ixp4xx: Add a new driver " Linus Walleij
2021-05-04  0:40   ` kernel test robot
2021-05-04  0:40     ` kernel test robot
2021-05-04  4:59   ` kernel test robot
2021-05-04  7:12   ` Arnd Bergmann [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=CAK8P3a1XtmYAfstfhRzv-y73od3u+fYkvED5LuJ5TNMOS19zZg@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=kaloz@openwrt.org \
    --cc=khalasa@piap.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rayknight@me.com \
    --cc=wigyori@uid0.hu \
    /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.