diff options
author | Magnus Damm <damm@opensource.se> | 2011-12-09 12:14:27 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-12-09 18:07:15 +0900 |
commit | b0e10211cba1629e2e534ca9cb3d87cfc7e389ea (patch) | |
tree | f545599adeabd07c3dc76a4d90860599fea800b0 /include/linux/sh_pfc.h | |
parent | 883381d9f1c5a6329bbb796e23ae52c939940310 (diff) | |
download | op-kernel-dev-b0e10211cba1629e2e534ca9cb3d87cfc7e389ea.zip op-kernel-dev-b0e10211cba1629e2e534ca9cb3d87cfc7e389ea.tar.gz |
sh: pfc: ioremap() support
Add support for non-entity mapped PFC registers through
the use of struct resource and ioremap()/iounmap().
The PFC main data structure gets updated with a pointer
to a struct resources array that point out all register
windows used by the PFC instance. The register definitions
are kept as physical addresses but the PFC code will do
transparent conversion into virtual addresses whenever
register windows are specified using with struct resource.
To introduce as little performance penalty as possible the
virtual address of each data register is cached in memory.
The virtual address of each configuration register is however
calculated during run time. This because the configuration
is considered slow path so focus is instead put on keeping
memory foot print as small as possible.
The PFC register access code is in this patch updated from
__raw_readN() / __raw_writeN() into ioreadN() / iowriteN().
This patch is needed to support the PFC block in r8a7779.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/linux/sh_pfc.h')
-rw-r--r-- | include/linux/sh_pfc.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h index 8446789..91666a5 100644 --- a/include/linux/sh_pfc.h +++ b/include/linux/sh_pfc.h @@ -55,6 +55,7 @@ struct pinmux_cfg_reg { struct pinmux_data_reg { unsigned long reg, reg_width, reg_shadow; pinmux_enum_t *enum_ids; + void __iomem *mapped_reg; }; #define PINMUX_DATA_REG(name, r, r_width) \ @@ -75,6 +76,12 @@ struct pinmux_range { pinmux_enum_t force; }; +struct pfc_window { + phys_addr_t phys; + void __iomem *virt; + unsigned long size; +}; + struct pinmux_info { char *name; pinmux_enum_t reserved_id; @@ -98,6 +105,10 @@ struct pinmux_info { struct pinmux_irq *gpio_irq; unsigned int gpio_irq_size; + struct resource *resource; + unsigned int num_resources; + struct pfc_window *window; + struct gpio_chip chip; }; |