Patchwork [v2] powerpc/83xx: don't probe broken PCI on mpc837x_mds boards

login
register
mail settings
Submitter Anton Vorontsov
Date Oct. 3, 2008, 4:08 p.m.
Message ID <20081003160814.GA26115@oksana.dev.rtsoft.ru>
Download mbox | patch
Permalink /patch/2592/
State Changes Requested, archived
Delegated to: Kumar Gala
Headers show

Comments

Anton Vorontsov - Oct. 3, 2008, 4:08 p.m.
In the standalone setup the board's CPLD disables the PCI internal
arbiter, thus any access to the PCI bus will hang the board.

When there is no PCI arbiter on the bus the u-boot adds
status = "broken (no arbiter)" property into the PCI controller's
node, and so marks the PCI controller as unavailable.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---

On Thu, Oct 02, 2008 at 02:48:44PM -0500, Kumar Gala wrote:
> Can you add to the commit message something about using the 'status  
> field in the device tree to determine if the pci controller is  
> available'

Something like this?

Thanks,

 arch/powerpc/platforms/83xx/mpc837x_mds.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
Kumar Gala - Oct. 3, 2008, 4:14 p.m.
On Oct 3, 2008, at 11:08 AM, Anton Vorontsov wrote:

> In the standalone setup the board's CPLD disables the PCI internal
> arbiter, thus any access to the PCI bus will hang the board.
>
> When there is no PCI arbiter on the bus the u-boot adds
> status = "broken (no arbiter)" property into the PCI controller's
> node, and so marks the PCI controller as unavailable.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
>
> On Thu, Oct 02, 2008 at 02:48:44PM -0500, Kumar Gala wrote:
>> Can you add to the commit message something about using the 'status
>> field in the device tree to determine if the pci controller is
>> available'
>
> Something like this?
>
> Thanks,

yes, but should we just have "status = disabled" since that is the  
effect?

- k
Anton Vorontsov - Oct. 3, 2008, 4:27 p.m.
On Fri, Oct 03, 2008 at 11:14:18AM -0500, Kumar Gala wrote:
>
> On Oct 3, 2008, at 11:08 AM, Anton Vorontsov wrote:
>
>> In the standalone setup the board's CPLD disables the PCI internal
>> arbiter, thus any access to the PCI bus will hang the board.
>>
>> When there is no PCI arbiter on the bus the u-boot adds
>> status = "broken (no arbiter)" property into the PCI controller's
>> node, and so marks the PCI controller as unavailable.
>>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>>
>> On Thu, Oct 02, 2008 at 02:48:44PM -0500, Kumar Gala wrote:
>>> Can you add to the commit message something about using the 'status
>>> field in the device tree to determine if the pci controller is
>>> available'
>>
>> Something like this?
>>
>> Thanks,
>
> yes, but should we just have "status = disabled" since that is the  
> effect?

I don't know, should we? For the unavailable/disabled case the status
can be anything but not 'ok' or 'okay' (the only status values for the
available devices). So if we can encode the reason, why not do this?
Kumar Gala - Oct. 3, 2008, 5:51 p.m.
On Oct 3, 2008, at 11:27 AM, Anton Vorontsov wrote:

> On Fri, Oct 03, 2008 at 11:14:18AM -0500, Kumar Gala wrote:
>>
>> On Oct 3, 2008, at 11:08 AM, Anton Vorontsov wrote:
>>
>>> In the standalone setup the board's CPLD disables the PCI internal
>>> arbiter, thus any access to the PCI bus will hang the board.
>>>
>>> When there is no PCI arbiter on the bus the u-boot adds
>>> status = "broken (no arbiter)" property into the PCI controller's
>>> node, and so marks the PCI controller as unavailable.
>>>
>>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>>> ---
>>>
>>> On Thu, Oct 02, 2008 at 02:48:44PM -0500, Kumar Gala wrote:
>>>> Can you add to the commit message something about using the 'status
>>>> field in the device tree to determine if the pci controller is
>>>> available'
>>>
>>> Something like this?
>>>
>>> Thanks,
>>
>> yes, but should we just have "status = disabled" since that is the
>> effect?
>
> I don't know, should we? For the unavailable/disabled case the status
> can be anything but not 'ok' or 'okay' (the only status values for the
> available devices). So if we can encode the reason, why not do this?

that works for me, just add the fact to the commit msg that the "valid  
status's are 'ok' and 'okay' and everything else is treated as "not  
available or disabled"

- k

Patch

diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index be62de2..8bb13c8 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -85,8 +85,14 @@  static void __init mpc837x_mds_setup_arch(void)
 		ppc_md.progress("mpc837x_mds_setup_arch()", 0);
 
 #ifdef CONFIG_PCI
-	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
+	for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") {
+		if (!of_device_is_available(np)) {
+			pr_warning("%s: disabled by the firmware.\n",
+				   np->full_name);
+			continue;
+		}
 		mpc83xx_add_bridge(np);
+	}
 #endif
 	mpc837xmds_usb_cfg();
 }