[RFC 2/2] powerpc: use the device tree for the iSeries vio bus probe

Michael Ellerman michael at ellerman.id.au
Tue Apr 25 23:22:46 EST 2006


On Tue, 2006-04-25 at 21:59 +1000, Stephen Rothwell wrote:
> As an added bonus, since every vio_dev now has a device_node
> associated with it, hotplug now works.
> 
> Signed-off-by: Stephen Rothwell <sfr at canb.auug.org.au>

> diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
> index 9ce2afc..af5609a 100644
> --- a/arch/powerpc/platforms/iseries/setup.c
> +++ b/arch/powerpc/platforms/iseries/setup.c
> @@ -54,6 +54,7 @@ #include <asm/iseries/mf.h>
>  #include <asm/iseries/it_exp_vpd_panel.h>
>  #include <asm/iseries/hv_lp_event.h>
>  #include <asm/iseries/lpar_map.h>
> +#include <asm/iseries/vio.h>
>  #include <asm/udbg.h>
>  #include <asm/irq.h>
>  
> @@ -939,6 +940,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  	dt_end_node(dt);
>  	reg++;
>  
> +	vio_first_vlan_unit = reg;
>  	vlan_map = HvLpConfig_getVirtualLanIndexMap();
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++) {
>  		unsigned char mac_addr[6];
> @@ -964,6 +966,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALLANS;
>  
> +	vio_first_viodasd_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALDISKS; i++) {
>  		snprintf(buf, 32, "viodasd@%08x", reg + i);
>  		dt_start_node(dt, buf);
> @@ -973,6 +976,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  		dt_end_node(dt);
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALDISKS;
> +	vio_first_viocd_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALCDROMS; i++) {
>  		snprintf(buf, 32, "viocd@%08x", reg + i);
>  		dt_start_node(dt, buf);
> @@ -982,6 +986,7 @@ void dt_vdevices(struct iseries_flat_dt 
>  		dt_end_node(dt);
>  	}
>  	reg += HVMAXARCHITECTEDVIRTUALCDROMS;
> +	vio_first_viotape_unit = reg;
>  	for (i = 0; i < HVMAXARCHITECTEDVIRTUALTAPES; i++) {
>  		snprintf(buf, 32, "viotape@%08x", reg + i);
>  		dt_start_node(dt, buf);
> diff --git a/arch/powerpc/platforms/iseries/vio.c b/arch/powerpc/platforms/iseries/vio.c
> index 22045a2..5cd197b 100644
> --- a/arch/powerpc/platforms/iseries/vio.c
> +++ b/arch/powerpc/platforms/iseries/vio.c
> @@ -24,6 +24,15 @@ #include <asm/iseries/hv_call_xm.h>
>  
>  #include "iommu.h"
>  
> +int vio_first_vlan_unit;
> +EXPORT_SYMBOL(vio_first_vlan_unit);
> +int vio_first_viodasd_unit;
> +EXPORT_SYMBOL(vio_first_viodasd_unit);
> +int vio_first_viocd_unit;
> +EXPORT_SYMBOL(vio_first_viocd_unit);
> +int vio_first_viotape_unit;
> +EXPORT_SYMBOL(vio_first_viotape_unit);

Why do we need these guys? If we have to have them then I'd rather they
were in the device tree, rather than have the "bootloader" passing info
to the kernel via globals.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20060425/071fc2e3/attachment.pgp>


More information about the Linuxppc-dev mailing list