diff mbox

[3/7] ARM: zynq: Hang iomapped slcr address on device_node

Message ID ae4583176ee5c9d8a8a2d53c000b86711eb66287.1389018985.git.michal.simek@xilinx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Simek Jan. 6, 2014, 2:36 p.m. UTC
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>

For later usage by zynq clk driver.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
 arch/arm/mach-zynq/slcr.c | 2 ++
 1 file changed, 2 insertions(+)

--
1.8.2.3

Comments

Olof Johansson March 11, 2014, 9:26 p.m. UTC | #1
On Mon, Jan 6, 2014 at 6:36 AM, Michal Simek <michal.simek@xilinx.com> wrote:
> From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
>
> For later usage by zynq clk driver.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>  arch/arm/mach-zynq/slcr.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> index 9746de7..2891dcf 100644
> --- a/arch/arm/mach-zynq/slcr.c
> +++ b/arch/arm/mach-zynq/slcr.c
> @@ -121,6 +121,8 @@ int __init zynq_early_slcr_init(void)
>                 BUG();
>         }
>
> +       np->data = (__force void *)zynq_slcr_base;


This is quite unusual, we normally remap again if needed. Is there a
reason you can't just have the driver request the resource and map it
like most other ones do?


-Olof
Michal Simek March 12, 2014, 11:51 a.m. UTC | #2
On 03/11/2014 10:26 PM, Olof Johansson wrote:
> On Mon, Jan 6, 2014 at 6:36 AM, Michal Simek <michal.simek@xilinx.com> wrote:
>> From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
>>
>> For later usage by zynq clk driver.
>>
>> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>  arch/arm/mach-zynq/slcr.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
>> index 9746de7..2891dcf 100644
>> --- a/arch/arm/mach-zynq/slcr.c
>> +++ b/arch/arm/mach-zynq/slcr.c
>> @@ -121,6 +121,8 @@ int __init zynq_early_slcr_init(void)
>>                 BUG();
>>         }
>>
>> +       np->data = (__force void *)zynq_slcr_base;
> 
> 
> This is quite unusual, we normally remap again if needed. Is there a
> reason you can't just have the driver request the resource and map it
> like most other ones do?

I took this patch from Steffen because remapping slcr again in clock
driver is another mapping for the same IP. Use one ioremap region
seems to me better if there is a way. Of course if this is strictly
prohibited we can do another mapping in clock driver.

Here is the RFC I have sent after my discussion with Arnd
that we should use early syscon initialization and regmap.
This is just RFC to show slcr cleaning up.
http://permalink.gmane.org/gmane.linux.kernel/1651213
(Here is broken CLK part because clk subsystem uses clk_readl/clk_writel
- changing this is discussed in other threads)

From v1 - regmap device separation was applied by Mark
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/nodev

From v2 - "mfd: syscon: Support early initialization"
I expected to get any comment from Arnd but I will respin this
based on Lee's comments

To summarize this for future I would like to use access with regmap
with one ioremap.

Thanks,
Michal
diff mbox

Patch

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index 9746de7..2891dcf 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -121,6 +121,8 @@  int __init zynq_early_slcr_init(void)
 		BUG();
 	}

+	np->data = (__force void *)zynq_slcr_base;
+
 	/* unlock the SLCR so that registers can be changed */
 	writel(SLCR_UNLOCK_MAGIC, zynq_slcr_base + SLCR_UNLOCK_OFFSET);