linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: zynq: Move common.h to generic location
@ 2014-10-06 11:44 Michal Simek
  2014-10-06 11:44 ` [PATCH 2/3] ARM: zynq: Enable generic allocator Michal Simek
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-06 11:44 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: monstr, Josh Cartwright, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

include/soc/zynq/ is the right location for this header
to be able to share information from this header with other
drivers which require it.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynq/common.c                       | 2 +-
 arch/arm/mach-zynq/hotplug.c                      | 2 +-
 arch/arm/mach-zynq/platsmp.c                      | 2 +-
 arch/arm/mach-zynq/slcr.c                         | 2 +-
 {arch/arm/mach-zynq => include/soc/zynq}/common.h | 0
 5 files changed, 4 insertions(+), 4 deletions(-)
 rename {arch/arm/mach-zynq => include/soc/zynq}/common.h (100%)

diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 31a6fa40ba37..ead1935aac79 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -42,7 +42,7 @@
 #include <asm/system_info.h>
 #include <asm/hardware/cache-l2x0.h>

-#include "common.h"
+#include <soc/zynq/common.h>

 #define ZYNQ_DEVCFG_MCTRL		0x80
 #define ZYNQ_DEVCFG_PS_VERSION_SHIFT	28
diff --git a/arch/arm/mach-zynq/hotplug.c b/arch/arm/mach-zynq/hotplug.c
index 5052c70326e4..95d74f68032a 100644
--- a/arch/arm/mach-zynq/hotplug.c
+++ b/arch/arm/mach-zynq/hotplug.c
@@ -16,7 +16,7 @@

 #include <asm/cacheflush.h>
 #include <asm/cp15.h>
-#include "common.h"
+#include <soc/zynq/common.h>

 static inline void zynq_cpu_enter_lowpower(void)
 {
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index abc82ef085c1..56581ccd7c14 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -25,7 +25,7 @@
 #include <asm/cacheflush.h>
 #include <asm/smp_scu.h>
 #include <linux/irqchip/arm-gic.h>
-#include "common.h"
+#include <soc/zynq/common.h>

 /*
  * Store number of cores in the system
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index c43a2d16e223..cb7c46165728 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -19,7 +19,7 @@
 #include <linux/of_address.h>
 #include <linux/regmap.h>
 #include <linux/clk/zynq.h>
-#include "common.h"
+#include <soc/zynq/common.h>

 /* register offsets */
 #define SLCR_UNLOCK_OFFSET		0x8   /* SCLR unlock register */
diff --git a/arch/arm/mach-zynq/common.h b/include/soc/zynq/common.h
similarity index 100%
rename from arch/arm/mach-zynq/common.h
rename to include/soc/zynq/common.h
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] ARM: zynq: Enable generic allocator
  2014-10-06 11:44 [PATCH 1/3] ARM: zynq: Move common.h to generic location Michal Simek
@ 2014-10-06 11:44 ` Michal Simek
  2014-10-06 11:44 ` [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-06 11:44 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: monstr, Josh Cartwright, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

Enable generic allocator by default because it is used by OCMC driver.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynq/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-zynq/Kconfig b/arch/arm/mach-zynq/Kconfig
index aaa5162c1509..d447adefd397 100644
--- a/arch/arm/mach-zynq/Kconfig
+++ b/arch/arm/mach-zynq/Kconfig
@@ -5,6 +5,7 @@ config ARCH_ZYNQ
 	select ARM_GIC
 	select ARM_GLOBAL_TIMER if !CPU_FREQ
 	select CADENCE_TTC_TIMER
+	select GENERIC_ALLOCATOR
 	select HAVE_ARM_SCU if SMP
 	select HAVE_ARM_TWD if SMP
 	select ICST
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration
  2014-10-06 11:44 [PATCH 1/3] ARM: zynq: Move common.h to generic location Michal Simek
  2014-10-06 11:44 ` [PATCH 2/3] ARM: zynq: Enable generic allocator Michal Simek
@ 2014-10-06 11:44 ` Michal Simek
  2014-10-06 15:59   ` Sören Brinkmann
  2014-10-13 20:24 ` [PATCH 1/3] ARM: zynq: Move common.h to generic location Sören Brinkmann
       [not found] ` <20141013202453.GQ13679@xsjandreislx>
  3 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2014-10-06 11:44 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: monstr, Josh Cartwright, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, Soren Brinkmann, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

Get OCM configuration from SLCR.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynq/slcr.c | 15 +++++++++++++++
 include/soc/zynq/common.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index cb7c46165728..0c3e45090c09 100644
--- a/arch/arm/mach-zynq/slcr.c
+++ b/arch/arm/mach-zynq/slcr.c
@@ -27,6 +27,7 @@
 #define SLCR_A9_CPU_RST_CTRL_OFFSET	0x244 /* CPU Software Reset Control */
 #define SLCR_REBOOT_STATUS_OFFSET	0x258 /* PS Reboot Status */
 #define SLCR_PSS_IDCODE			0x530 /* PS IDCODE */
+#define SLCR_OCM_CFG_OFFSET		0x910 /* OCM Address Mapping */

 #define SLCR_UNLOCK_MAGIC		0xDF0D
 #define SLCR_A9_CPU_CLKSTOP		0x10
@@ -126,6 +127,20 @@ void zynq_slcr_system_reset(void)
 }

 /**
+ * zynq_slcr_get_ocm_config - Get SLCR OCM config
+ *
+ * Return:	OCM config bits
+ */
+u32 zynq_slcr_get_ocm_config(void)
+{
+	u32 val;
+
+	zynq_slcr_read(&val, SLCR_OCM_CFG_OFFSET);
+
+	return val;
+}
+
+/**
  * zynq_slcr_cpu_start - Start cpu
  * @cpu:	cpu number
  */
diff --git a/include/soc/zynq/common.h b/include/soc/zynq/common.h
index f652f0a884a6..fc6b1ed37455 100644
--- a/include/soc/zynq/common.h
+++ b/include/soc/zynq/common.h
@@ -25,6 +25,7 @@ extern void zynq_slcr_system_reset(void);
 extern void zynq_slcr_cpu_stop(int cpu);
 extern void zynq_slcr_cpu_start(int cpu);
 extern u32 zynq_slcr_get_device_id(void);
+extern u32 zynq_slcr_get_ocm_config(void);

 #ifdef CONFIG_SMP
 extern void secondary_startup(void);
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration
  2014-10-06 11:44 ` [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
@ 2014-10-06 15:59   ` Sören Brinkmann
  2014-10-06 17:54     ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Sören Brinkmann @ 2014-10-06 15:59 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-arm-kernel, monstr, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

Hi Michal,

On Mon, 2014-10-06 at 01:44PM +0200, Michal Simek wrote:
> Get OCM configuration from SLCR.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>  arch/arm/mach-zynq/slcr.c | 15 +++++++++++++++
>  include/soc/zynq/common.h |  1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
> index cb7c46165728..0c3e45090c09 100644
> --- a/arch/arm/mach-zynq/slcr.c
> +++ b/arch/arm/mach-zynq/slcr.c
> @@ -27,6 +27,7 @@
>  #define SLCR_A9_CPU_RST_CTRL_OFFSET	0x244 /* CPU Software Reset Control */
>  #define SLCR_REBOOT_STATUS_OFFSET	0x258 /* PS Reboot Status */
>  #define SLCR_PSS_IDCODE			0x530 /* PS IDCODE */
> +#define SLCR_OCM_CFG_OFFSET		0x910 /* OCM Address Mapping */
> 
>  #define SLCR_UNLOCK_MAGIC		0xDF0D
>  #define SLCR_A9_CPU_CLKSTOP		0x10
> @@ -126,6 +127,20 @@ void zynq_slcr_system_reset(void)
>  }
> 
>  /**
> + * zynq_slcr_get_ocm_config - Get SLCR OCM config
> + *
> + * Return:	OCM config bits
> + */
> +u32 zynq_slcr_get_ocm_config(void)
> +{
> +	u32 val;
> +
> +	zynq_slcr_read(&val, SLCR_OCM_CFG_OFFSET);
> +
> +	return val;
> +}

a different idea would be, instead of creating this specific API call
for the OCMC to let the OCMC driver use regmap and making git a subnode
of the SLCR.
In the long run that might be a better option otherwise we'll end up
with a whole bunch of zynq_slcr_get_foo() calls for each driver that
needs to read an SLCR register.

	Thanks,
	Sören

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration
  2014-10-06 15:59   ` Sören Brinkmann
@ 2014-10-06 17:54     ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-06 17:54 UTC (permalink / raw)
  To: Sören Brinkmann, Michal Simek
  Cc: linux-arm-kernel, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

Hi Soren,

On 10/06/2014 05:59 PM, Sören Brinkmann wrote:
> Hi Michal,
> 
> On Mon, 2014-10-06 at 01:44PM +0200, Michal Simek wrote:
>> Get OCM configuration from SLCR.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>  arch/arm/mach-zynq/slcr.c | 15 +++++++++++++++
>>  include/soc/zynq/common.h |  1 +
>>  2 files changed, 16 insertions(+)
>>
>> diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
>> index cb7c46165728..0c3e45090c09 100644
>> --- a/arch/arm/mach-zynq/slcr.c
>> +++ b/arch/arm/mach-zynq/slcr.c
>> @@ -27,6 +27,7 @@
>>  #define SLCR_A9_CPU_RST_CTRL_OFFSET	0x244 /* CPU Software Reset Control */
>>  #define SLCR_REBOOT_STATUS_OFFSET	0x258 /* PS Reboot Status */
>>  #define SLCR_PSS_IDCODE			0x530 /* PS IDCODE */
>> +#define SLCR_OCM_CFG_OFFSET		0x910 /* OCM Address Mapping */
>>
>>  #define SLCR_UNLOCK_MAGIC		0xDF0D
>>  #define SLCR_A9_CPU_CLKSTOP		0x10
>> @@ -126,6 +127,20 @@ void zynq_slcr_system_reset(void)
>>  }
>>
>>  /**
>> + * zynq_slcr_get_ocm_config - Get SLCR OCM config
>> + *
>> + * Return:	OCM config bits
>> + */
>> +u32 zynq_slcr_get_ocm_config(void)
>> +{
>> +	u32 val;
>> +
>> +	zynq_slcr_read(&val, SLCR_OCM_CFG_OFFSET);
>> +
>> +	return val;
>> +}
> 
> a different idea would be, instead of creating this specific API call
> for the OCMC to let the OCMC driver use regmap and making git a subnode
> of the SLCR.
> In the long run that might be a better option otherwise we'll end up
> with a whole bunch of zynq_slcr_get_foo() calls for each driver that
> needs to read an SLCR register.

yes using regmap is also possible and I know that.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] ARM: zynq: Move common.h to generic location
  2014-10-06 11:44 [PATCH 1/3] ARM: zynq: Move common.h to generic location Michal Simek
  2014-10-06 11:44 ` [PATCH 2/3] ARM: zynq: Enable generic allocator Michal Simek
  2014-10-06 11:44 ` [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
@ 2014-10-13 20:24 ` Sören Brinkmann
       [not found] ` <20141013202453.GQ13679@xsjandreislx>
  3 siblings, 0 replies; 7+ messages in thread
From: Sören Brinkmann @ 2014-10-13 20:24 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-arm-kernel, monstr, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

On Mon, 2014-10-06 at 01:44PM +0200, Michal Simek wrote:
> include/soc/zynq/ is the right location for this header
> to be able to share information from this header with other
> drivers which require it.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>  arch/arm/mach-zynq/common.c                       | 2 +-
>  arch/arm/mach-zynq/hotplug.c                      | 2 +-
>  arch/arm/mach-zynq/platsmp.c                      | 2 +-
>  arch/arm/mach-zynq/slcr.c                         | 2 +-

In the 3.18 merge window arch/arm/mach-zynq/pm.c had been added which is
not covered in this version of the patch.

	Sören

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] ARM: zynq: Move common.h to generic location
       [not found] ` <20141013202453.GQ13679@xsjandreislx>
@ 2014-10-20 13:14   ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-20 13:14 UTC (permalink / raw)
  To: Sören Brinkmann, Michal Simek
  Cc: linux-arm-kernel, monstr, Steffen Trumtrar, Rob Herring,
	Peter Crosthwaite, Russell King, linux-kernel

On 10/13/2014 10:24 PM, Sören Brinkmann wrote:
> On Mon, 2014-10-06 at 01:44PM +0200, Michal Simek wrote:
>> include/soc/zynq/ is the right location for this header
>> to be able to share information from this header with other
>> drivers which require it.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>  arch/arm/mach-zynq/common.c                       | 2 +-
>>  arch/arm/mach-zynq/hotplug.c                      | 2 +-
>>  arch/arm/mach-zynq/platsmp.c                      | 2 +-
>>  arch/arm/mach-zynq/slcr.c                         | 2 +-
> 
> In the 3.18 merge window arch/arm/mach-zynq/pm.c had been added which is
> not covered in this version of the patch.

Thanks will send v2.
Michal


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-20 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 11:44 [PATCH 1/3] ARM: zynq: Move common.h to generic location Michal Simek
2014-10-06 11:44 ` [PATCH 2/3] ARM: zynq: Enable generic allocator Michal Simek
2014-10-06 11:44 ` [PATCH 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
2014-10-06 15:59   ` Sören Brinkmann
2014-10-06 17:54     ` Michal Simek
2014-10-13 20:24 ` [PATCH 1/3] ARM: zynq: Move common.h to generic location Sören Brinkmann
     [not found] ` <20141013202453.GQ13679@xsjandreislx>
2014-10-20 13:14   ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).