From: John Crispin <blogic@openwrt.org>
To: David Daney <david.daney@cavium.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>
Subject: Re: [PATCH 02/14] MIPS: pci: parse memory ranges from devicetree
Date: Mon, 30 Apr 2012 19:02:48 +0200 [thread overview]
Message-ID: <4F9EC5B8.502@openwrt.org> (raw)
In-Reply-To: <4F9EC3FD.4010109@cavium.com>
Hi,
>
> No need for the #ifdef here.
>
i will fix this globally in the patch
>> +void __devinit pci_load_OF_ranges(struct pci_controller *hose,
>> + struct device_node *node)
>> +{
>
> s/load_OF/load_of/
ok, some other arch did _OF_ so i blindly copied it.
>> + const __be32 *ranges;
>> + int rlen;
>> + int pna = of_n_addr_cells(node);
>> + int np = pna + 5;
>> +
>> + pr_info("PCI host bridge %s ranges:\n", node->full_name);
>> + ranges = of_get_property(node, "ranges",&rlen);
>> + if (ranges == NULL)
>> + return;
>> + hose->of_node = node;
>> +
>> + while ((rlen -= np * 4)>= 0) {
>> + u32 pci_space;
>> + struct resource *res = 0;
>> + unsigned long long addr, size;
>> +
>> + pci_space = ranges[0];
>> + addr = of_translate_address(node, ranges + 3);
>> + size = of_read_number(ranges + pna + 3, 2);
>
> All of this should be able to be replaced with of_get_address();
>
> There is a bunch of of/pci related infrastructure. Can any of it be
> leveraged?
i look at it when i made the patch 3 months ago. the pci ranges are
mapped very differently to normal reg= <addr len>; properties. You can
find some info about this at the bottom of this link
http://devicetree.org/Device_Tree_Usage
next prev parent reply other threads:[~2012-04-30 17:04 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-30 11:32 [PATCH 01/14] MIPS: make oprofile use cp0_perfcount_irq if it is set John Crispin
2012-04-30 11:32 ` [PATCH 02/14] MIPS: pci: parse memory ranges from devicetree John Crispin
2012-04-30 16:55 ` David Daney
2012-04-30 17:02 ` John Crispin [this message]
2012-05-01 11:17 ` John Crispin
2012-04-30 11:32 ` [PATCH 03/14] MIPS: Provide pci_address_to_pio John Crispin
2012-04-30 11:32 ` [PATCH 04/14] MIPS: Add helper function to allow platforms to point at a DTB John Crispin
2012-04-30 16:50 ` David Daney
2012-04-30 22:58 ` Sergei Shtylyov
2012-04-30 11:33 ` [PATCH 05/14] MIPS: parse chosen node on boot John Crispin
2012-04-30 11:33 ` [PATCH 06/14] MIPS: add clkdev.h John Crispin
2012-04-30 11:33 ` [PATCH 07/14] MIPS: remove unused prototype kgdb_config John Crispin
2012-04-30 11:33 ` [PATCH 08/14] MIPS: lantiq: clear all irqs properly on boot John Crispin
2012-04-30 23:01 ` Sergei Shtylyov
2012-05-01 6:37 ` John Crispin
2012-04-30 11:33 ` [PATCH 09/14] MIPS: lantiq: enable oprofile support on lantiq targets John Crispin
2012-04-30 11:33 ` [PATCH 10/14] MIPS: lantiq: add ipi handlers to make vsmp work John Crispin
2012-04-30 11:33 ` [PATCH 11/14] MIPS: lantiq: fix early printk John Crispin
2012-04-30 11:33 ` [PATCH 12/14] MIPS: lantiq: fix cmdline parsing John Crispin
2012-04-30 11:33 ` [PATCH 13/14] MIPS: lantiq: add xway soc ids John Crispin
2012-04-30 11:33 ` [PATCH 14/14] MIPS: lantiq: cleanup reset code John Crispin
-- strict thread matches above, loose matches on Subject: below --
2012-05-03 17:42 [PATCH 02/14] MIPS: pci: parse memory ranges from devicetree John Crispin
2012-05-03 19:30 ` Geert Uytterhoeven
2012-05-03 19:39 ` John Crispin
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=4F9EC5B8.502@openwrt.org \
--to=blogic@openwrt.org \
--cc=david.daney@cavium.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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