linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] ARM: zynq: Move common.h to generic location
@ 2014-10-20 13:25 Michal Simek
  2014-10-20 13:25 ` [PATCH v2 2/3] ARM: zynq: Enable generic allocator Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-20 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

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>
---

Changes in v2:
- Update pm.c added in 3.17 too - Soren pointed on it

 arch/arm/mach-zynq/common.c                       |  2 +-
 arch/arm/mach-zynq/hotplug.c                      | 14 --------------
 arch/arm/mach-zynq/platsmp.c                      |  2 +-
 arch/arm/mach-zynq/pm.c                           |  2 +-
 arch/arm/mach-zynq/slcr.c                         |  2 +-
 {arch/arm/mach-zynq => include/soc/zynq}/common.h |  0
 6 files changed, 4 insertions(+), 18 deletions(-)
 delete mode 100644 arch/arm/mach-zynq/hotplug.c
 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 26f92c28d22b..c488eb264072 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
deleted file mode 100644
index b685c89f11e4..000000000000
--- a/arch/arm/mach-zynq/hotplug.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright (C) 2012-2013 Xilinx
- *
- * based on linux/arch/arm/mach-realview/hotplug.c
- *
- * Copyright (C) 2002 ARM Ltd.
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#include <asm/proc-fns.h>
-
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index 52d768ff7857..bfb1315b04ea 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/pm.c b/arch/arm/mach-zynq/pm.c
index 911fcf865be8..31df24ce1ce5 100644
--- a/arch/arm/mach-zynq/pm.c
+++ b/arch/arm/mach-zynq/pm.c
@@ -22,7 +22,7 @@
 #include <linux/io.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
-#include "common.h"
+#include <soc/zynq/common.h>

 /* register offsets */
 #define DDRC_CTRL_REG1_OFFS		0x60
diff --git a/arch/arm/mach-zynq/slcr.c b/arch/arm/mach-zynq/slcr.c
index d4cb50cf97c0..22d9d54d2333 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141020/67503471/attachment-0001.sig>

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

* [PATCH v2 2/3] ARM: zynq: Enable generic allocator
  2014-10-20 13:25 [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Michal Simek
@ 2014-10-20 13:25 ` Michal Simek
  2014-10-20 13:34   ` Arnd Bergmann
  2014-10-20 13:25 ` [PATCH v2 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
  2014-10-20 13:36 ` [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Arnd Bergmann
  2 siblings, 1 reply; 7+ messages in thread
From: Michal Simek @ 2014-10-20 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

Changes in v2: None

 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141020/2fd06fa8/attachment-0001.sig>

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

* [PATCH v2 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration
  2014-10-20 13:25 [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Michal Simek
  2014-10-20 13:25 ` [PATCH v2 2/3] ARM: zynq: Enable generic allocator Michal Simek
@ 2014-10-20 13:25 ` Michal Simek
  2014-10-20 13:36 ` [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Arnd Bergmann
  2 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-20 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

Get OCM configuration from SLCR.

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

Changes in v2: None

 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 22d9d54d2333..3f65e2027875 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 2bc71273c73c..3d0b9a6d76ab 100644
--- a/include/soc/zynq/common.h
+++ b/include/soc/zynq/common.h
@@ -27,6 +27,7 @@ extern void zynq_slcr_cpu_start(int cpu);
 extern bool zynq_slcr_cpu_state_read(int cpu);
 extern void zynq_slcr_cpu_state_write(int cpu, bool die);
 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141020/649e2708/attachment.sig>

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

* [PATCH v2 2/3] ARM: zynq: Enable generic allocator
  2014-10-20 13:25 ` [PATCH v2 2/3] ARM: zynq: Enable generic allocator Michal Simek
@ 2014-10-20 13:34   ` Arnd Bergmann
  2014-10-20 14:10     ` Michal Simek
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2014-10-20 13:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 20 October 2014 15:25:32 Michal Simek wrote:
> Enable generic allocator by default because it is used by OCMC driver.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>


Why doesn't the driver select this then?

	Arnd

> 
> 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
> 

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

* [PATCH v2 1/3] ARM: zynq: Move common.h to generic location
  2014-10-20 13:25 [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Michal Simek
  2014-10-20 13:25 ` [PATCH v2 2/3] ARM: zynq: Enable generic allocator Michal Simek
  2014-10-20 13:25 ` [PATCH v2 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
@ 2014-10-20 13:36 ` Arnd Bergmann
  2014-10-20 19:07   ` Michal Simek
  2 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2014-10-20 13:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 20 October 2014 15:25:31 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>
> ---
> 
> Changes in v2:
> - Update pm.c added in 3.17 too - Soren pointed on it
> 
>  arch/arm/mach-zynq/common.c                       |  2 +-
>  arch/arm/mach-zynq/hotplug.c                      | 14 --------------
>  arch/arm/mach-zynq/platsmp.c                      |  2 +-
>  arch/arm/mach-zynq/pm.c                           |  2 +-
>  arch/arm/mach-zynq/slcr.c                         |  2 +-
>  {arch/arm/mach-zynq => include/soc/zynq}/common.h |  0
>  6 files changed, 4 insertions(+), 18 deletions(-)
>  delete mode 100644 arch/arm/mach-zynq/hotplug.c
>  rename {arch/arm/mach-zynq => include/soc/zynq}/common.h (100%)
> 

NAK

Most (if not all) of that header should not be visible to drivers.
If you need to share some symbols, make a proper header file for those,
not one called 'common.h'.

	Arnd

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

* [PATCH v2 2/3] ARM: zynq: Enable generic allocator
  2014-10-20 13:34   ` Arnd Bergmann
@ 2014-10-20 14:10     ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-20 14:10 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/20/2014 03:34 PM, Arnd Bergmann wrote:
> On Monday 20 October 2014 15:25:32 Michal Simek wrote:
>> Enable generic allocator by default because it is used by OCMC driver.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> 
> 
> Why doesn't the driver select this then?

It can but currently OCM driver is enabled by default without Kconfig entry.

Appreciate your input on driver itself.
http://lists.openwall.net/linux-kernel/2014/10/06/196

Thanks,
Michal

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

* [PATCH v2 1/3] ARM: zynq: Move common.h to generic location
  2014-10-20 13:36 ` [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Arnd Bergmann
@ 2014-10-20 19:07   ` Michal Simek
  0 siblings, 0 replies; 7+ messages in thread
From: Michal Simek @ 2014-10-20 19:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 10/20/2014 03:36 PM, Arnd Bergmann wrote:
> On Monday 20 October 2014 15:25:31 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>
>> ---
>>
>> Changes in v2:
>> - Update pm.c added in 3.17 too - Soren pointed on it
>>
>>  arch/arm/mach-zynq/common.c                       |  2 +-
>>  arch/arm/mach-zynq/hotplug.c                      | 14 --------------
>>  arch/arm/mach-zynq/platsmp.c                      |  2 +-
>>  arch/arm/mach-zynq/pm.c                           |  2 +-
>>  arch/arm/mach-zynq/slcr.c                         |  2 +-
>>  {arch/arm/mach-zynq => include/soc/zynq}/common.h |  0
>>  6 files changed, 4 insertions(+), 18 deletions(-)
>>  delete mode 100644 arch/arm/mach-zynq/hotplug.c
>>  rename {arch/arm/mach-zynq => include/soc/zynq}/common.h (100%)
>>
> 
> NAK
> 
> Most (if not all) of that header should not be visible to drivers.
> If you need to share some symbols, make a proper header file for those,
> not one called 'common.h'.

Ok. I will split it to more files - no problem to do it.

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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141020/a5a4c926/attachment.sig>

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 13:25 [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Michal Simek
2014-10-20 13:25 ` [PATCH v2 2/3] ARM: zynq: Enable generic allocator Michal Simek
2014-10-20 13:34   ` Arnd Bergmann
2014-10-20 14:10     ` Michal Simek
2014-10-20 13:25 ` [PATCH v2 3/3] ARM: zynq: Extend SLCR driver to read OCM configuration Michal Simek
2014-10-20 13:36 ` [PATCH v2 1/3] ARM: zynq: Move common.h to generic location Arnd Bergmann
2014-10-20 19:07   ` 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).