[PATCH 12/14] 85xx/mpc85xx_ds,ads,cds: move .pci_exclude_device setting to machine definitions

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Sat Jul 23 06:08:42 EST 2011


On 7/19/11, Kumar Gala <galak at kernel.crashing.org> wrote:
>
> On Jul 19, 2011, at 3:53 AM, Dmitry Eremin-Solenikov wrote:
>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
>> ---
>> arch/powerpc/platforms/85xx/mpc85xx_ads.c |    5 +++--
>> arch/powerpc/platforms/85xx/mpc85xx_cds.c |    5 ++---
>> arch/powerpc/platforms/85xx/mpc85xx_ds.c  |    5 +++--
>> 3 files changed, 8 insertions(+), 7 deletions(-)
>
> I believe these are done this way for a reason (its been some time).  I
> can't remember if it maters or not, but having pci_exclude_device() means
> that any code in fsl_add_bridge() would not be impacted by the exclude
> function.

Hmm. I have to check this.

BTW: what is the point in disabling access to bus == 0 && PCI_SLOT == 0 on some
of those boards (esp. ads)? Other boards lack this check/exclude. Does it mean
something historical (and so can be dropped), is it some workaround/bugfix
(then it should be propagated to other boards??) or something else?

>
> Not sure what value making this change has at this point.

One of my big goals is to drop most of differencies from setup_arch functions
(one simple function can handle all things like PCI, SWIOTLB, etc).
Not yet ready
for submission though (not enough time to clean all the things). And moving
this assignment to static code would allow me to drop setup_arch()
function completely
(more or less) on these boards.

>
> - k
>
>>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> index 3b2c9bb..2483929 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
>> @@ -200,8 +200,6 @@ static void __init mpc85xx_ads_setup_arch(void)
>> #ifdef CONFIG_PCI
>> 	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
>> 		fsl_add_bridge(np, 1);
>> -
>> -	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -254,6 +252,9 @@ define_machine(mpc85xx_ads) {
>> 	.probe			= mpc85xx_ads_probe,
>> 	.setup_arch		= mpc85xx_ads_setup_arch,
>> 	.init_IRQ		= mpc85xx_ads_pic_init,
>> +#ifdef CONFIG_PCI
>> +	.pci_exclude_device	= mpc85xx_exclude_device,
>> +#endif
>> 	.show_cpuinfo		= mpc85xx_ads_show_cpuinfo,
>> 	.get_irq		= mpic_get_irq,
>> 	.restart		= fsl_rstcr_restart,
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> index 6299a2a..e209c23 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
>> @@ -297,9 +297,6 @@ static void __init mpc85xx_cds_setup_arch(void)
>> 				fsl_add_bridge(np, 0);
>> 		}
>> 	}
>> -
>> -	ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
>> -	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>> }
>>
>> @@ -355,6 +352,8 @@ define_machine(mpc85xx_cds) {
>> #ifdef CONFIG_PCI
>> 	.restart	= mpc85xx_cds_restart,
>> 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
>> +	.pci_irq_fixup	= mpc85xx_cds_pci_irq_fixup,
>> +	.pci_exclude_device	= mpc85xx_exclude_device,
>> #else
>> 	.restart	= fsl_rstcr_restart,
>> #endif
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> index c7b97f7..53bf07d 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
>> @@ -182,8 +182,6 @@ static void __init mpc85xx_ds_setup_arch(void)
>> 					hose->dma_window_size);
>> 		}
>> 	}
>> -
>> -	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
>> #endif
>>
>> #ifdef CONFIG_SMP
>> @@ -279,6 +277,7 @@ define_machine(mpc8544_ds) {
>> 	.init_IRQ		= mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
>> +	.pci_exclude_device	= mpc85xx_exclude_device,
>> #endif
>> 	.get_irq		= mpic_get_irq,
>> 	.restart		= fsl_rstcr_restart,
>> @@ -293,6 +292,7 @@ define_machine(mpc8572_ds) {
>> 	.init_IRQ		= mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
>> +	.pci_exclude_device	= mpc85xx_exclude_device,
>> #endif
>> 	.get_irq		= mpic_get_irq,
>> 	.restart		= fsl_rstcr_restart,
>> @@ -307,6 +307,7 @@ define_machine(p2020_ds) {
>> 	.init_IRQ		= mpc85xx_ds_pic_init,
>> #ifdef CONFIG_PCI
>> 	.pcibios_fixup_bus	= fsl_pcibios_fixup_bus,
>> +	.pci_exclude_device	= mpc85xx_exclude_device,
>> #endif
>> 	.get_irq		= mpic_get_irq,
>> 	.restart		= fsl_rstcr_restart,
>> --
>> 1.7.2.5
>
>


-- 
With best wishes
Dmitry


More information about the Linuxppc-dev mailing list