[Fwd: [PATCH Resend 01/02] Add Linux ASMP support for MPC8641D]
Milton Miller
miltonm at bga.com
Fri Mar 23 14:55:30 EST 2007
On Fri Mar 23 01:25:24 EST 2007, Jon Loeliger wrote:
> + cpus {
> + #cpus = <1>;
> + #address-cells = <1>;
> +
#cpus is not needed, please remove.
> + mpic: pic at 40000 {
..
> + compatible = "chrp,open-pic";
> + device_type = "open-pic";
Since its shared, we could add another type here to let us know.
[and yes, the interrupts property here needs to become something else,
probably with ranges in its name].
>
> /* Alloc mpic structure and per isu has 16 INT entries. */
> mpic1 = mpic_alloc(np, res.start,
> +#ifdef CONFIG_ASMP
> + MPIC_PRIMARY | MPIC_BIG_ENDIAN,
> +#else
> MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
> +#endif
How about:
+#ifndef CONFIG_ASMP
+ MPIC_WANTS_RESET |
+#endif
MPIC_PRIMARY | MPIC_BIG_ENDIAN,
Just a suggestion.
> diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
> index bcfb900..739d8bf 100644
> --- a/arch/powerpc/sysdev/mpic.c
> +++ b/arch/powerpc/sysdev/mpic.c
> @@ -707,9 +707,15 @@ static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
> cpumask_t tmp;
>
> cpus_and(tmp, cpumask, cpu_online_map);
> -
> +#ifdef CONFIG_ASMP
> + unsigned int pir;
> + pir = mfspr(SPRN_PIR);
> + mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION),
> + 1 << pir);
> +#else
> mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION),
> - mpic_physmask(cpus_addr(tmp)[0]));
> + mpic_physmask(cpus_addr(tmp)[0]));
> +#endif
NAK.
Don't use mfspr in mpic.c.
set hard_smp_processor_id() instead, mpic_physmask already uses it.
> diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
> index 1f83988..7ec67d9 100644
> --- a/drivers/net/gianfar.c
> +++ b/drivers/net/gianfar.c
> @@ -692,11 +692,21 @@ int startup_gfar(struct net_device *dev)
>
> priv->tx_bd_base = (struct txbd8 *) vaddr;
>
> +#ifdef CONFIG_ASMP
> + unsigned int pir;
> + pir = mfspr(SPRN_PIR);
> + /* enet DMA only understands physical addresses */
> + gfar_write(®s->tbase0, ((unsigned int)addr + 0x10000000 * pir));
> +
> + /* Start the rx descriptor ring where the tx ring leaves off */
> + addr = addr + sizeof (struct txbd8) * priv->tx_ring_size + 0x10000000 * pir;
> +#else
Hard coded memory layout? In a driver? Really?
Use the dma_mapping api.
Store your kernel to physical offset in a memory location.
Have the dma_mapping api add this offset.
milton
More information about the Linuxppc-dev
mailing list