Re: [PATCH v2 01/13] mfd: pruss mfd driver.

From: Wolfgang Grandegger
Date: Tue Feb 22 2011 - 11:25:56 EST


On 02/22/2011 01:49 PM, Subhasish Ghosh wrote:
> I am not sure if I understood you correctly, but the current sizeof the
> structure da8xx_prusscore_regs is 0x500.
>
> Here is a link to the PRUSS memory map:
> http://processors.wiki.ti.com/index.php/PRUSS_Memory_Map
>
> The offset 0x00007000 is the PRU0 reg offset and 0x00007800 is the PRU1
> reg offset.
> We cannot have a register file larger than this, but lot of space is
> left out, possibly for future development.

What do you mean with "larger than this"? You ioremap the whole space
and unsued space could be filled with padding bytes:

struct pruss_regs {
u8 ram0[0x0200];
u8 res0[0x1e00];
u8 ram1[0x0200];
u8 res1[0x1e00];
struct pruss_intc_regs intc;
struct pruss_core_regs core[2];
};

Then:

pruss_dev->regs = ioremap(pruss_dev->res->start,
resource_size(pruss_dev->res));

__raw_writel(DA8XX_PRUCORE_CONTROL_RESETVAL,
&pruss_dev->regs.core[pruss_num].control);

That's simple, transparent and save without magic offset handling.

Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/