linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: integrator: delete some auxdata
@ 2016-08-30 13:59 Linus Walleij
  2016-08-30 13:59 ` [PATCH 2/3] ARM: integrator: cut down on static maps Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Linus Walleij @ 2016-08-30 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

There is just a few auxdata entries still needed on the Integrators:

- UART RTS/CTS callbacks for Integrator/AP
- MMC/SD special card detect quirk for Integrator/CP

Delete the rest.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-integrator/integrator_ap.c |  6 ------
 arch/arm/mach-integrator/integrator_cp.c | 12 ------------
 2 files changed, 18 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index ae9aa3caeb0b..b17c68ff1b3e 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -205,16 +205,10 @@ static void __init ap_init_irq_of(void)
 
 /* For the Device Tree, add in the UART callbacks as AUXDATA */
 static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = {
-	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE,
-		"rtc", NULL),
 	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE,
 		"uart0", &ap_uart_data),
 	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE,
 		"uart1", &ap_uart_data),
-	OF_DEV_AUXDATA("arm,primecell", KMI0_BASE,
-		"kmi0", NULL),
-	OF_DEV_AUXDATA("arm,primecell", KMI1_BASE,
-		"kmi1", NULL),
 	{ /* sentinel */ },
 };
 
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index a9e3cb511fcb..1742bc76ccef 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -140,20 +140,8 @@ static void __init intcp_init_irq_of(void)
  * and enforce the bus names since these are used for clock lookups.
  */
 static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = {
-	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_RTC_BASE,
-		"rtc", NULL),
-	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART0_BASE,
-		"uart0", NULL),
-	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_UART1_BASE,
-		"uart1", NULL),
-	OF_DEV_AUXDATA("arm,primecell", KMI0_BASE,
-		"kmi0", NULL),
-	OF_DEV_AUXDATA("arm,primecell", KMI1_BASE,
-		"kmi1", NULL),
 	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_MMC_BASE,
 		"mmci", &mmc_data),
-	OF_DEV_AUXDATA("arm,primecell", INTEGRATOR_CP_AACI_BASE,
-		"aaci", &mmc_data),
 	{ /* sentinel */ },
 };
 
-- 
2.7.4

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

* [PATCH 2/3] ARM: integrator: cut down on static maps
  2016-08-30 13:59 [PATCH 1/3] ARM: integrator: delete some auxdata Linus Walleij
@ 2016-08-30 13:59 ` Linus Walleij
  2016-08-30 13:59 ` [PATCH 3/3] ARM: integrator: read counter using syscon/regmap Linus Walleij
  2016-08-30 14:41 ` [PATCH 1/3] ARM: integrator: delete some auxdata Arnd Bergmann
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2016-08-30 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

This removes all the unused static maps on the Integrator/AP
and Integrator/CP and also take this opportunity to strip down
a big list of unused #includes from each boardfile.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-integrator/integrator_ap.c | 30 -----------------------------
 arch/arm/mach-integrator/integrator_cp.c | 33 --------------------------------
 2 files changed, 63 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index b17c68ff1b3e..a1af634f8709 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -17,35 +17,21 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/list.h>
-#include <linux/platform_device.h>
-#include <linux/slab.h>
-#include <linux/string.h>
 #include <linux/syscore_ops.h>
 #include <linux/amba/bus.h>
-#include <linux/amba/kmi.h>
 #include <linux/io.h>
 #include <linux/irqchip.h>
-#include <linux/platform_data/clk-integrator.h>
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
-#include <linux/stat.h>
 #include <linux/termios.h>
 #include <linux/mfd/syscon.h>
 #include <linux/regmap.h>
 
-#include <asm/setup.h>
-#include <asm/param.h>		/* HZ */
-#include <asm/mach-types.h>
-
 #include <asm/mach/arch.h>
-#include <asm/mach/irq.h>
 #include <asm/mach/map.h>
-#include <asm/mach/time.h>
 
 #include "hardware.h"
 #include "cm.h"
@@ -67,14 +53,8 @@ static struct regmap *ap_syscon_map;
 
 /*
  * Logical      Physical
- * ef000000			Cache flush
- * f1100000	11000000	System controller registers
- * f1300000	13000000	Counter/Timer
  * f1400000	14000000	Interrupt controller
  * f1600000	16000000	UART 0
- * f1700000	17000000	UART 1
- * f1a00000	1a000000	Debug LEDs
- * f1b00000	1b000000	GPIO
  */
 
 static struct map_desc ap_io_desc[] __initdata __maybe_unused = {
@@ -88,16 +68,6 @@ static struct map_desc ap_io_desc[] __initdata __maybe_unused = {
 		.pfn		= __phys_to_pfn(INTEGRATOR_UART0_BASE),
 		.length		= SZ_4K,
 		.type		= MT_DEVICE
-	}, {
-		.virtual	= IO_ADDRESS(INTEGRATOR_DBG_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_DBG_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
-	}, {
-		.virtual	= IO_ADDRESS(INTEGRATOR_AP_GPIO_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_AP_GPIO_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
 	}
 };
 
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 1742bc76ccef..8db029fa6052 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -7,31 +7,17 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License.
  */
-#include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/list.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/string.h>
-#include <linux/device.h>
-#include <linux/amba/bus.h>
-#include <linux/amba/kmi.h>
 #include <linux/amba/mmci.h>
 #include <linux/io.h>
 #include <linux/irqchip.h>
-#include <linux/gfp.h>
 #include <linux/of_irq.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/sched_clock.h>
 
-#include <asm/setup.h>
-#include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <asm/mach/irq.h>
 #include <asm/mach/map.h>
-#include <asm/mach/time.h>
 
 #include "hardware.h"
 #include "cm.h"
@@ -43,12 +29,8 @@ static void __iomem *intcp_con_base;
 /*
  * Logical      Physical
  * f1000000	10000000	Core module registers
- * f1300000	13000000	Counter/Timer
  * f1400000	14000000	Interrupt controller
  * f1600000	16000000	UART 0
- * f1700000	17000000	UART 1
- * f1a00000	1a000000	Debug LEDs
- * fc900000	c9000000	GPIO
  * fca00000	ca000000	SIC
  */
 
@@ -59,11 +41,6 @@ static struct map_desc intcp_io_desc[] __initdata __maybe_unused = {
 		.length		= SZ_4K,
 		.type		= MT_DEVICE
 	}, {
-		.virtual	= IO_ADDRESS(INTEGRATOR_CT_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_CT_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
-	}, {
 		.virtual	= IO_ADDRESS(INTEGRATOR_IC_BASE),
 		.pfn		= __phys_to_pfn(INTEGRATOR_IC_BASE),
 		.length		= SZ_4K,
@@ -74,16 +51,6 @@ static struct map_desc intcp_io_desc[] __initdata __maybe_unused = {
 		.length		= SZ_4K,
 		.type		= MT_DEVICE
 	}, {
-		.virtual	= IO_ADDRESS(INTEGRATOR_DBG_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_DBG_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
-	}, {
-		.virtual	= IO_ADDRESS(INTEGRATOR_CP_GPIO_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_CP_GPIO_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
-	}, {
 		.virtual	= IO_ADDRESS(INTEGRATOR_CP_SIC_BASE),
 		.pfn		= __phys_to_pfn(INTEGRATOR_CP_SIC_BASE),
 		.length		= SZ_4K,
-- 
2.7.4

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

* [PATCH 3/3] ARM: integrator: read counter using syscon/regmap
  2016-08-30 13:59 [PATCH 1/3] ARM: integrator: delete some auxdata Linus Walleij
  2016-08-30 13:59 ` [PATCH 2/3] ARM: integrator: cut down on static maps Linus Walleij
@ 2016-08-30 13:59 ` Linus Walleij
  2016-08-30 14:41 ` [PATCH 1/3] ARM: integrator: delete some auxdata Arnd Bergmann
  2 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2016-08-30 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

Look up the core module base address from the device tree and
register a sched_clock() using the regmap to the core module
on the Integrator/CP.

MFD_SYSCON is selected by the arch so it is always available.

This further makes it possible to remove one more static map.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-integrator/integrator_cp.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 8db029fa6052..772a7cf2010e 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -15,6 +15,8 @@
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/sched_clock.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -23,12 +25,15 @@
 #include "cm.h"
 #include "common.h"
 
+/* Base address to the core module header */
+static struct regmap *cm_map;
 /* Base address to the CP controller */
 static void __iomem *intcp_con_base;
 
+#define CM_COUNTER_OFFSET 0x28
+
 /*
  * Logical      Physical
- * f1000000	10000000	Core module registers
  * f1400000	14000000	Interrupt controller
  * f1600000	16000000	UART 0
  * fca00000	ca000000	SIC
@@ -36,11 +41,6 @@ static void __iomem *intcp_con_base;
 
 static struct map_desc intcp_io_desc[] __initdata __maybe_unused = {
 	{
-		.virtual	= IO_ADDRESS(INTEGRATOR_HDR_BASE),
-		.pfn		= __phys_to_pfn(INTEGRATOR_HDR_BASE),
-		.length		= SZ_4K,
-		.type		= MT_DEVICE
-	}, {
 		.virtual	= IO_ADDRESS(INTEGRATOR_IC_BASE),
 		.pfn		= __phys_to_pfn(INTEGRATOR_IC_BASE),
 		.length		= SZ_4K,
@@ -84,15 +84,20 @@ static struct mmci_platform_data mmc_data = {
 	.gpio_cd	= -1,
 };
 
-#define REFCOUNTER (__io_address(INTEGRATOR_HDR_BASE) + 0x28)
-
 static u64 notrace intcp_read_sched_clock(void)
 {
-	return readl(REFCOUNTER);
+	unsigned int val;
+
+	/* MMIO so discard return code */
+	regmap_read(cm_map, CM_COUNTER_OFFSET, &val);
+	return val;
 }
 
 static void __init intcp_init_early(void)
 {
+	cm_map = syscon_regmap_lookup_by_compatible("arm,core-module-integrator");
+	if (IS_ERR(cm_map))
+		return;
 	sched_clock_register(intcp_read_sched_clock, 32, 24000000);
 }
 
-- 
2.7.4

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

* [PATCH 1/3] ARM: integrator: delete some auxdata
  2016-08-30 13:59 [PATCH 1/3] ARM: integrator: delete some auxdata Linus Walleij
  2016-08-30 13:59 ` [PATCH 2/3] ARM: integrator: cut down on static maps Linus Walleij
  2016-08-30 13:59 ` [PATCH 3/3] ARM: integrator: read counter using syscon/regmap Linus Walleij
@ 2016-08-30 14:41 ` Arnd Bergmann
  2016-08-30 21:11   ` Linus Walleij
  2 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2016-08-30 14:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 30 August 2016, Linus Walleij wrote:
> There is just a few auxdata entries still needed on the Integrators:
> 
> - UART RTS/CTS callbacks for Integrator/AP
> - MMC/SD special card detect quirk for Integrator/CP
> 
> Delete the rest.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Nice patches! I've had a look over them and they all seem reasonable,
and I didn't see any obvious other parts that can be as easily removed
here (I thought I did at first, but they all ended up being
slightly trickier).

	Arnd

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

* [PATCH 1/3] ARM: integrator: delete some auxdata
  2016-08-30 14:41 ` [PATCH 1/3] ARM: integrator: delete some auxdata Arnd Bergmann
@ 2016-08-30 21:11   ` Linus Walleij
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2016-08-30 21:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 30, 2016 at 4:41 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 30 August 2016, Linus Walleij wrote:
>> There is just a few auxdata entries still needed on the Integrators:
>>
>> - UART RTS/CTS callbacks for Integrator/AP
>> - MMC/SD special card detect quirk for Integrator/CP
>>
>> Delete the rest.
>>
>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
>
> Nice patches! I've had a look over them and they all seem reasonable,
> and I didn't see any obvious other parts that can be as easily removed
> here (I thought I did at first, but they all ended up being
> slightly trickier).

Yeah I will stack them all up and send as a combined cleanup+DTS
pull request, it has to be like that since the display patch and
some others can only be bisectable if code is removed from the
board files and added to the DTS at the same time.

Yours,
Linus Walleij

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

end of thread, other threads:[~2016-08-30 21:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 13:59 [PATCH 1/3] ARM: integrator: delete some auxdata Linus Walleij
2016-08-30 13:59 ` [PATCH 2/3] ARM: integrator: cut down on static maps Linus Walleij
2016-08-30 13:59 ` [PATCH 3/3] ARM: integrator: read counter using syscon/regmap Linus Walleij
2016-08-30 14:41 ` [PATCH 1/3] ARM: integrator: delete some auxdata Arnd Bergmann
2016-08-30 21:11   ` Linus Walleij

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