From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] ARM: NUC900: Add PCI driver support for NUC960
Date: Tue, 15 Nov 2011 17:30:23 +0000 [thread overview]
Message-ID: <20111115173023.GC9581@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4EC0BF9B.2050300@gmail.com>
On Mon, Nov 14, 2011 at 03:13:31PM +0800, Wan ZongShun wrote:
> +#define NUC900_PCI_MEM_BASE 0xC0000000
> +#define NUC900_PCI_MEM_END 0xDFFFEFFFF
> +#define NUC900_PCI_MEM_SIZE 0x20000000
NUC900_PCI_MEM_END has more than 32 bits.
> +#define NUC900_PCI_IO_BASE 0xE0000000
> +#define NUC900_PCI_IO_END 0xE000FFFF
> +#define NUC900_PCI_IO_SIZE 0x10000
...
> +static struct resource pci_io = {
> + .name = "NUC900 PCI IO",
> + .start = NUC900_PCI_IO_BASE,
> + .end = NUC900_PCI_IO_BASE + NUC900_PCI_IO_SIZE - 1,
> + .flags = IORESOURCE_IO,
> +};
...
> +static int __init pci_nuc900_setup_resources(struct resource **resource)
> +{
> + int ret = 0;
> +
> + ret = request_resource(&ioport_resource, &pci_io);
> + if (ret) {
> + pr_err("%s: failed to request resources: %d\n", __func__, ret);
> + goto out;
> + }
...
> + /*
> + * bus->resource[0] is the IO resource for this bus
> + * bus->resource[1] is the mem resource for this bus
> + * bus->resource[2] is the prefetch mem resource for this bus
> + */
> + resource[0] = &pci_io;
> + resource[1] = &pci_mem;
> + resource[2] = NULL;
This is better, but still not correct.
1. in mach/io.h:
-#define IO_SPACE_LIMIT 0xffffffff
+#define IO_SPACE_LIMIT 0xffff
-#define __io(a) __typesafe_io(a)
+#define __io(a) ((void __iomem __force *)(a) + VA_OF_IO_SPACE)
where VA_OF_IO_SPACE is correctly named and typed.
2. set resource[0] = &ioport_resource and get rid of pci_io entirely.
3. if (!request_mem_region(PA_OF_IO_SPACE, 64K, "PCI IO emulation space"))
pr_warn("Unable to request PCI IO space\n");
in your pre-init function.
next prev parent reply other threads:[~2011-11-15 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-12 16:04 [PATCH] ARM: NUC900: Add PCI driver support for NUC960 Wan ZongShun
2011-11-12 23:14 ` Russell King - ARM Linux
2011-11-14 7:13 ` [PATCH V2] " Wan ZongShun
2011-11-14 11:44 ` Marek Vasut
2011-11-15 17:30 ` Russell King - ARM Linux [this message]
2011-11-15 20:54 ` Arnd Bergmann
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=20111115173023.GC9581@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 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).