Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Gabor Juhos <juhosg@openwrt.org>
To: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver
Date: Sat, 02 Feb 2013 15:27:34 +0100	[thread overview]
Message-ID: <510D2256.4000703@openwrt.org> (raw)
In-Reply-To: <510D2012.8070408@phrozen.org>

2013.02.02. 15:17 keltezéssel, John Crispin írta:
> On 02/02/13 13:40, Gabor Juhos wrote:
>> +static int ar724x_pci_probe(struct platform_device *pdev)
>> +{
>> +    struct resource *res;
>> +    int irq;
>> +
>> +    res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl_base");
>> +    if (!res)
>> +        return -EINVAL;
>> +
>> +    ar724x_pci_ctrl_base = devm_request_and_ioremap(&pdev->dev, res);
>> +    if (ar724x_pci_ctrl_base == NULL)
>> +        return -EBUSY;
>> +
>> +    res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
>> +    if (!res)
>> +        return -EINVAL;
> 
> 
> Hi,
> 
> maybe better use platform_get_resource(pdev, IORESOURCE_MEM, 0/1) ... you will
> otherwise have to patch this again when you convert to OF

I will not have to convert that. The node can have a reg-names property like this:

> 	pci0: pcie@180f0000 {
> 		#address-cells = <3>;
> 		#size-cells = <2>;
> 		#interrupt-cells = <1>;
> 		device_type = "pci";
> 		interrupt-controller;
> 		compatible = "qca,qca9558-pcie", "qca,ar7240-pcie";
> 		bus-range = <0 255>;
> 		ranges = <0x02000000 0 0x00000000 0x10000000 0 0x02000000   /* pci memory */
> 				0x01000000 0 0x00000000 0x00000000 0 0x00000001>; /* io space */
> 		reg = <0x180f0000 0x0100	/* controller base */
> 			0x14000000 0x1000	/* config space */
> 			0x180c0000 0x1000>;	/* CRP base */
> 		reg-names = "ctrl_base", "cfg_base", "crp_base";
> 
> 		interrupt-map-mask = <0xf800 0 0 7>;
> 		interrupt-map = <0 0 0 1 &pci0 0
> 					0 0 0 2 &pci0 0
> 					0 0 0 3 &pci0 0
> 					0 0 0 4 &pci0 0>;
> 
> 		interrupt-parent = <&EINTC>;
> 		interrupts = <0>;
> 	};



-Gabor

      reply	other threads:[~2013-02-02 14:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 12:40 [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver Gabor Juhos
2013-02-02 12:40 ` [PATCH 2/5] MIPS: pci-ar71xx: " Gabor Juhos
2013-02-02 12:44 ` [PATCH 3/5] MIPS: ath79: move global PCI defines into a common header Gabor Juhos
2013-02-02 12:44   ` [PATCH 4/5] MIPS: ath79: register platform devices for the PCI controllers Gabor Juhos
2013-02-02 12:45 ` [PATCH 5/5] MIPS: ath79: remove unused ar7{1x,24}x_pcibios_init functions Gabor Juhos
2013-02-02 14:17 ` [PATCH 1/5] MIPS: pci-ar724x: convert into a platform driver John Crispin
2013-02-02 14:27   ` Gabor Juhos [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=510D2256.4000703@openwrt.org \
    --to=juhosg@openwrt.org \
    --cc=john@phrozen.org \
    --cc=linux-mips@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