All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-16 23:22 ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: Hartley Sweeten, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Move the common code for ts72xx and BK3 to ts72xx-common.c - this
  code can be reused by other designs build around ts72xx
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c

Lukasz Majewski (4):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 arch/arm/mach-ep93xx/Kconfig         |  11 +++
 arch/arm/mach-ep93xx/Makefile        |   2 +
 arch/arm/mach-ep93xx/bk3.c           |  88 +++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx-common.c | 158 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.c        | 136 ++----------------------------
 arch/arm/mach-ep93xx/ts72xx.h        |  14 ++++
 arch/arm/tools/mach-types            |   1 +
 7 files changed, 279 insertions(+), 131 deletions(-)
 create mode 100644 arch/arm/mach-ep93xx/bk3.c
 create mode 100644 arch/arm/mach-ep93xx/ts72xx-common.c

-- 
2.11.0

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

* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-16 23:22 ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Move the common code for ts72xx and BK3 to ts72xx-common.c - this
  code can be reused by other designs build around ts72xx
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c

Lukasz Majewski (4):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 arch/arm/mach-ep93xx/Kconfig         |  11 +++
 arch/arm/mach-ep93xx/Makefile        |   2 +
 arch/arm/mach-ep93xx/bk3.c           |  88 +++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx-common.c | 158 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.c        | 136 ++----------------------------
 arch/arm/mach-ep93xx/ts72xx.h        |  14 ++++
 arch/arm/tools/mach-types            |   1 +
 7 files changed, 279 insertions(+), 131 deletions(-)
 create mode 100644 arch/arm/mach-ep93xx/bk3.c
 create mode 100644 arch/arm/mach-ep93xx/ts72xx-common.c

-- 
2.11.0

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

* [PATCH 1/4] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-16 23:22   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: Hartley Sweeten, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH 1/4] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
@ 2017-11-16 23:22   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH 2/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-16 23:22   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: Hartley Sweeten, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 2255ba29fdd6..d67f203f769a 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -11,6 +11,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -85,3 +88,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH 2/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-11-16 23:22   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 2255ba29fdd6..d67f203f769a 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -11,6 +11,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -85,3 +88,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH 3/4] ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-16 23:22   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: Hartley Sweeten, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit creates a new file ts72xx-common.c [1], which consists
of code being potentially re-usable by other clones of reference
ts72xx design.

To achieve this goal, a new symbol - TS72XX_COMMON has been introduced.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/Kconfig         |   4 +
 arch/arm/mach-ep93xx/Makefile        |   1 +
 arch/arm/mach-ep93xx/ts72xx-common.c | 158 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.c        | 122 +--------------------------
 arch/arm/mach-ep93xx/ts72xx.h        |   5 ++
 5 files changed, 172 insertions(+), 118 deletions(-)
 create mode 100644 arch/arm/mach-ep93xx/ts72xx-common.c

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..16c5d6eedf45 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -131,10 +131,14 @@ config MACH_SNAPPER_CL15
 
 config MACH_TS72XX
 	bool "Support Technologic Systems TS-72xx SBC"
+	select TS72XX_COMMON
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Technologic Systems TS-72xx board.
 
+config TS72XX_COMMON
+	bool
+
 config MACH_VISION_EP9307
 	bool "Support Vision Engraving Systems EP9307 SoM"
 	help
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index b7ae4345ac08..f2692a072864 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -16,3 +16,4 @@ obj-$(CONFIG_MACH_SIM_ONE)	+= simone.o
 obj-$(CONFIG_MACH_SNAPPER_CL15)	+= snappercl15.o
 obj-$(CONFIG_MACH_TS72XX)	+= ts72xx.o
 obj-$(CONFIG_MACH_VISION_EP9307)+= vision_ep9307.o
+obj-$(CONFIG_TS72XX_COMMON)	+= ts72xx-common.o
diff --git a/arch/arm/mach-ep93xx/ts72xx-common.c b/arch/arm/mach-ep93xx/ts72xx-common.c
new file mode 100644
index 000000000000..6d8b3896a75b
--- /dev/null
+++ b/arch/arm/mach-ep93xx/ts72xx-common.c
@@ -0,0 +1,158 @@
+/*
+ * ts72xx - common platform code (like NAND access)
+ *
+ * Copyright (C) 2017
+ * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/mtd/rawnand.h>
+#include <linux/mtd/partitions.h>
+
+#include <mach/hardware.h>
+
+#include <asm/mach/map.h>
+
+#include "soc.h"
+#include "ts72xx.h"
+
+/*************************************************************************
+ * IO map
+ *************************************************************************/
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
+{
+	ep93xx_map_io();
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
+}
+
+/*************************************************************************
+ * NAND flash
+ *************************************************************************/
+#define TS72XX_NAND_CONTROL_ADDR_LINE	22	/* 0xN0400000 */
+#define TS72XX_NAND_BUSY_ADDR_LINE	23	/* 0xN0800000 */
+
+static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
+				  int cmd, unsigned int ctrl)
+{
+	struct nand_chip *chip = mtd_to_nand(mtd);
+
+	if (ctrl & NAND_CTRL_CHANGE) {
+		void __iomem *addr = chip->IO_ADDR_R;
+		unsigned char bits;
+
+		addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
+
+		bits = __raw_readb(addr) & ~0x07;
+		bits |= (ctrl & NAND_NCE) << 2;	/* bit 0 -> bit 2 */
+		bits |= (ctrl & NAND_CLE);	/* bit 1 -> bit 1 */
+		bits |= (ctrl & NAND_ALE) >> 2;	/* bit 2 -> bit 0 */
+
+		__raw_writeb(bits, addr);
+	}
+
+	if (cmd != NAND_CMD_NONE)
+		__raw_writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int ts72xx_nand_device_ready(struct mtd_info *mtd)
+{
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	void __iomem *addr = chip->IO_ADDR_R;
+
+	addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
+
+	return !!(__raw_readb(addr) & 0x20);
+}
+
+static struct platform_nand_data ts72xx_nand_data = {
+	.chip = {
+		.nr_chips	= 1,
+		.chip_offset	= 0,
+		.chip_delay	= 15,
+	},
+	.ctrl = {
+		.cmd_ctrl	= ts72xx_nand_hwcontrol,
+		.dev_ready	= ts72xx_nand_device_ready,
+	},
+};
+
+static struct resource ts72xx_nand_resource[] = {
+	DEFINE_RES_MEM(EP93XX_CS6_PHYS_BASE, SZ_16M),
+};
+
+static struct platform_device ts72xx_nand_flash = {
+	.name			= "gen_nand",
+	.id			= -1,
+	.dev.platform_data	= &ts72xx_nand_data,
+	.resource		= ts72xx_nand_resource,
+	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
+};
+
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n)
+{
+	/*
+	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
+	 */
+	if (board_is_ts7200()) {
+		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
+	} else {
+		resource_size_t start;
+
+		if (is_ts9420_installed())
+			start = EP93XX_CS7_PHYS_BASE;
+		else
+			start = EP93XX_CS6_PHYS_BASE;
+
+		ts72xx_nand_resource[0].start = start;
+		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
+
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
+		platform_device_register(&ts72xx_nand_flash);
+	}
+}
+
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
+static struct resource ts72xx_wdt_resources[] = {
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
+};
+
+static struct platform_device ts72xx_wdt_device = {
+	.name		= "ts72xx-wdt",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
+	.resource	= ts72xx_wdt_resources,
+};
+
+void __init ts72xx_register_watchdog(void)
+{
+	platform_device_register(&ts72xx_wdt_device);
+}
+
+/*************************************************************************
+ * ETH
+ *************************************************************************/
+static struct ep93xx_eth_data ts72xx_eth_data = {
+	.phy_id		= 1,
+};
+
+void __init ts72xx_register_eth(void)
+{
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+}
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..d8bb352a5422 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -49,50 +44,10 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 
 static void __init ts72xx_map_io(void)
 {
-	ep93xx_map_io();
+	ts72xx_common_map_io();
 	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
 }
 
-
-/*************************************************************************
- * NAND flash
- *************************************************************************/
-#define TS72XX_NAND_CONTROL_ADDR_LINE	22	/* 0xN0400000 */
-#define TS72XX_NAND_BUSY_ADDR_LINE	23	/* 0xN0800000 */
-
-static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
-				  int cmd, unsigned int ctrl)
-{
-	struct nand_chip *chip = mtd_to_nand(mtd);
-
-	if (ctrl & NAND_CTRL_CHANGE) {
-		void __iomem *addr = chip->IO_ADDR_R;
-		unsigned char bits;
-
-		addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
-
-		bits = __raw_readb(addr) & ~0x07;
-		bits |= (ctrl & NAND_NCE) << 2;	/* bit 0 -> bit 2 */
-		bits |= (ctrl & NAND_CLE);	/* bit 1 -> bit 1 */
-		bits |= (ctrl & NAND_ALE) >> 2;	/* bit 2 -> bit 0 */
-
-		__raw_writeb(bits, addr);
-	}
-
-	if (cmd != NAND_CMD_NONE)
-		__raw_writeb(cmd, chip->IO_ADDR_W);
-}
-
-static int ts72xx_nand_device_ready(struct mtd_info *mtd)
-{
-	struct nand_chip *chip = mtd_to_nand(mtd);
-	void __iomem *addr = chip->IO_ADDR_R;
-
-	addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
-
-	return !!(__raw_readb(addr) & 0x20);
-}
-
 #define TS72XX_BOOTROM_PART_SIZE	(SZ_16K)
 #define TS72XX_REDBOOT_PART_SIZE	(SZ_2M + SZ_1M)
 
@@ -115,59 +70,6 @@ static struct mtd_partition ts72xx_nand_parts[] = {
 	},
 };
 
-static struct platform_nand_data ts72xx_nand_data = {
-	.chip = {
-		.nr_chips	= 1,
-		.chip_offset	= 0,
-		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
-	},
-	.ctrl = {
-		.cmd_ctrl	= ts72xx_nand_hwcontrol,
-		.dev_ready	= ts72xx_nand_device_ready,
-	},
-};
-
-static struct resource ts72xx_nand_resource[] = {
-	{
-		.start		= 0,			/* filled in later */
-		.end		= 0,			/* filled in later */
-		.flags		= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device ts72xx_nand_flash = {
-	.name			= "gen_nand",
-	.id			= -1,
-	.dev.platform_data	= &ts72xx_nand_data,
-	.resource		= ts72xx_nand_resource,
-	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
-};
-
-
-static void __init ts72xx_register_flash(void)
-{
-	/*
-	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
-	 */
-	if (board_is_ts7200()) {
-		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
-	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
-		ts72xx_nand_resource[0].start = start;
-		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
-
-		platform_device_register(&ts72xx_nand_flash);
-	}
-}
-
 /*************************************************************************
  * RTC M48T86
  *************************************************************************/
@@ -186,22 +88,6 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
-static struct resource ts72xx_wdt_resources[] = {
-	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
-	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
-};
-
-static struct platform_device ts72xx_wdt_device = {
-	.name		= "ts72xx-wdt",
-	.id		= -1,
-	.num_resources 	= ARRAY_SIZE(ts72xx_wdt_resources),
-	.resource	= ts72xx_wdt_resources,
-};
-
-static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
-	.phy_id		= 1,
-};
-
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
@@ -223,11 +109,11 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts));
 	platform_device_register(&ts72xx_rtc_device);
-	platform_device_register(&ts72xx_wdt_device);
+	ts72xx_register_watchdog();
+	ts72xx_register_eth();
 
-	ep93xx_register_eth(&ts72xx_eth_data, 1);
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 	if (board_is_ts7300())
 		platform_device_register(&ts73xx_fpga_device);
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d67f203f769a..a9d3bb49f666 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -87,5 +87,10 @@ static inline int is_ts9420_installed(void)
 	return !!(__raw_readb(TS72XX_OPTIONS2_VIRT_BASE) &
 					TS72XX_OPTIONS2_TS9420);
 }
+
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n);
+void __init ts72xx_register_watchdog(void);
+void __init ts72xx_common_map_io(void);
+void __init ts72xx_register_eth(void);
 #endif
 #endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH 3/4] ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
@ 2017-11-16 23:22   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

This commit creates a new file ts72xx-common.c [1], which consists
of code being potentially re-usable by other clones of reference
ts72xx design.

To achieve this goal, a new symbol - TS72XX_COMMON has been introduced.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/Kconfig         |   4 +
 arch/arm/mach-ep93xx/Makefile        |   1 +
 arch/arm/mach-ep93xx/ts72xx-common.c | 158 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.c        | 122 +--------------------------
 arch/arm/mach-ep93xx/ts72xx.h        |   5 ++
 5 files changed, 172 insertions(+), 118 deletions(-)
 create mode 100644 arch/arm/mach-ep93xx/ts72xx-common.c

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..16c5d6eedf45 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -131,10 +131,14 @@ config MACH_SNAPPER_CL15
 
 config MACH_TS72XX
 	bool "Support Technologic Systems TS-72xx SBC"
+	select TS72XX_COMMON
 	help
 	  Say 'Y' here if you want your kernel to support the
 	  Technologic Systems TS-72xx board.
 
+config TS72XX_COMMON
+	bool
+
 config MACH_VISION_EP9307
 	bool "Support Vision Engraving Systems EP9307 SoM"
 	help
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index b7ae4345ac08..f2692a072864 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -16,3 +16,4 @@ obj-$(CONFIG_MACH_SIM_ONE)	+= simone.o
 obj-$(CONFIG_MACH_SNAPPER_CL15)	+= snappercl15.o
 obj-$(CONFIG_MACH_TS72XX)	+= ts72xx.o
 obj-$(CONFIG_MACH_VISION_EP9307)+= vision_ep9307.o
+obj-$(CONFIG_TS72XX_COMMON)	+= ts72xx-common.o
diff --git a/arch/arm/mach-ep93xx/ts72xx-common.c b/arch/arm/mach-ep93xx/ts72xx-common.c
new file mode 100644
index 000000000000..6d8b3896a75b
--- /dev/null
+++ b/arch/arm/mach-ep93xx/ts72xx-common.c
@@ -0,0 +1,158 @@
+/*
+ * ts72xx - common platform code (like NAND access)
+ *
+ * Copyright (C) 2017
+ * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/mtd/rawnand.h>
+#include <linux/mtd/partitions.h>
+
+#include <mach/hardware.h>
+
+#include <asm/mach/map.h>
+
+#include "soc.h"
+#include "ts72xx.h"
+
+/*************************************************************************
+ * IO map
+ *************************************************************************/
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
+{
+	ep93xx_map_io();
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
+}
+
+/*************************************************************************
+ * NAND flash
+ *************************************************************************/
+#define TS72XX_NAND_CONTROL_ADDR_LINE	22	/* 0xN0400000 */
+#define TS72XX_NAND_BUSY_ADDR_LINE	23	/* 0xN0800000 */
+
+static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
+				  int cmd, unsigned int ctrl)
+{
+	struct nand_chip *chip = mtd_to_nand(mtd);
+
+	if (ctrl & NAND_CTRL_CHANGE) {
+		void __iomem *addr = chip->IO_ADDR_R;
+		unsigned char bits;
+
+		addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
+
+		bits = __raw_readb(addr) & ~0x07;
+		bits |= (ctrl & NAND_NCE) << 2;	/* bit 0 -> bit 2 */
+		bits |= (ctrl & NAND_CLE);	/* bit 1 -> bit 1 */
+		bits |= (ctrl & NAND_ALE) >> 2;	/* bit 2 -> bit 0 */
+
+		__raw_writeb(bits, addr);
+	}
+
+	if (cmd != NAND_CMD_NONE)
+		__raw_writeb(cmd, chip->IO_ADDR_W);
+}
+
+static int ts72xx_nand_device_ready(struct mtd_info *mtd)
+{
+	struct nand_chip *chip = mtd_to_nand(mtd);
+	void __iomem *addr = chip->IO_ADDR_R;
+
+	addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
+
+	return !!(__raw_readb(addr) & 0x20);
+}
+
+static struct platform_nand_data ts72xx_nand_data = {
+	.chip = {
+		.nr_chips	= 1,
+		.chip_offset	= 0,
+		.chip_delay	= 15,
+	},
+	.ctrl = {
+		.cmd_ctrl	= ts72xx_nand_hwcontrol,
+		.dev_ready	= ts72xx_nand_device_ready,
+	},
+};
+
+static struct resource ts72xx_nand_resource[] = {
+	DEFINE_RES_MEM(EP93XX_CS6_PHYS_BASE, SZ_16M),
+};
+
+static struct platform_device ts72xx_nand_flash = {
+	.name			= "gen_nand",
+	.id			= -1,
+	.dev.platform_data	= &ts72xx_nand_data,
+	.resource		= ts72xx_nand_resource,
+	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
+};
+
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n)
+{
+	/*
+	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
+	 */
+	if (board_is_ts7200()) {
+		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
+	} else {
+		resource_size_t start;
+
+		if (is_ts9420_installed())
+			start = EP93XX_CS7_PHYS_BASE;
+		else
+			start = EP93XX_CS6_PHYS_BASE;
+
+		ts72xx_nand_resource[0].start = start;
+		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
+
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
+		platform_device_register(&ts72xx_nand_flash);
+	}
+}
+
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
+static struct resource ts72xx_wdt_resources[] = {
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
+};
+
+static struct platform_device ts72xx_wdt_device = {
+	.name		= "ts72xx-wdt",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
+	.resource	= ts72xx_wdt_resources,
+};
+
+void __init ts72xx_register_watchdog(void)
+{
+	platform_device_register(&ts72xx_wdt_device);
+}
+
+/*************************************************************************
+ * ETH
+ *************************************************************************/
+static struct ep93xx_eth_data ts72xx_eth_data = {
+	.phy_id		= 1,
+};
+
+void __init ts72xx_register_eth(void)
+{
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+}
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..d8bb352a5422 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -49,50 +44,10 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 
 static void __init ts72xx_map_io(void)
 {
-	ep93xx_map_io();
+	ts72xx_common_map_io();
 	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
 }
 
-
-/*************************************************************************
- * NAND flash
- *************************************************************************/
-#define TS72XX_NAND_CONTROL_ADDR_LINE	22	/* 0xN0400000 */
-#define TS72XX_NAND_BUSY_ADDR_LINE	23	/* 0xN0800000 */
-
-static void ts72xx_nand_hwcontrol(struct mtd_info *mtd,
-				  int cmd, unsigned int ctrl)
-{
-	struct nand_chip *chip = mtd_to_nand(mtd);
-
-	if (ctrl & NAND_CTRL_CHANGE) {
-		void __iomem *addr = chip->IO_ADDR_R;
-		unsigned char bits;
-
-		addr += (1 << TS72XX_NAND_CONTROL_ADDR_LINE);
-
-		bits = __raw_readb(addr) & ~0x07;
-		bits |= (ctrl & NAND_NCE) << 2;	/* bit 0 -> bit 2 */
-		bits |= (ctrl & NAND_CLE);	/* bit 1 -> bit 1 */
-		bits |= (ctrl & NAND_ALE) >> 2;	/* bit 2 -> bit 0 */
-
-		__raw_writeb(bits, addr);
-	}
-
-	if (cmd != NAND_CMD_NONE)
-		__raw_writeb(cmd, chip->IO_ADDR_W);
-}
-
-static int ts72xx_nand_device_ready(struct mtd_info *mtd)
-{
-	struct nand_chip *chip = mtd_to_nand(mtd);
-	void __iomem *addr = chip->IO_ADDR_R;
-
-	addr += (1 << TS72XX_NAND_BUSY_ADDR_LINE);
-
-	return !!(__raw_readb(addr) & 0x20);
-}
-
 #define TS72XX_BOOTROM_PART_SIZE	(SZ_16K)
 #define TS72XX_REDBOOT_PART_SIZE	(SZ_2M + SZ_1M)
 
@@ -115,59 +70,6 @@ static struct mtd_partition ts72xx_nand_parts[] = {
 	},
 };
 
-static struct platform_nand_data ts72xx_nand_data = {
-	.chip = {
-		.nr_chips	= 1,
-		.chip_offset	= 0,
-		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
-	},
-	.ctrl = {
-		.cmd_ctrl	= ts72xx_nand_hwcontrol,
-		.dev_ready	= ts72xx_nand_device_ready,
-	},
-};
-
-static struct resource ts72xx_nand_resource[] = {
-	{
-		.start		= 0,			/* filled in later */
-		.end		= 0,			/* filled in later */
-		.flags		= IORESOURCE_MEM,
-	},
-};
-
-static struct platform_device ts72xx_nand_flash = {
-	.name			= "gen_nand",
-	.id			= -1,
-	.dev.platform_data	= &ts72xx_nand_data,
-	.resource		= ts72xx_nand_resource,
-	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
-};
-
-
-static void __init ts72xx_register_flash(void)
-{
-	/*
-	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
-	 */
-	if (board_is_ts7200()) {
-		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
-	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
-		ts72xx_nand_resource[0].start = start;
-		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
-
-		platform_device_register(&ts72xx_nand_flash);
-	}
-}
-
 /*************************************************************************
  * RTC M48T86
  *************************************************************************/
@@ -186,22 +88,6 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
-static struct resource ts72xx_wdt_resources[] = {
-	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
-	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
-};
-
-static struct platform_device ts72xx_wdt_device = {
-	.name		= "ts72xx-wdt",
-	.id		= -1,
-	.num_resources 	= ARRAY_SIZE(ts72xx_wdt_resources),
-	.resource	= ts72xx_wdt_resources,
-};
-
-static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
-	.phy_id		= 1,
-};
-
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
@@ -223,11 +109,11 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts));
 	platform_device_register(&ts72xx_rtc_device);
-	platform_device_register(&ts72xx_wdt_device);
+	ts72xx_register_watchdog();
+	ts72xx_register_eth();
 
-	ep93xx_register_eth(&ts72xx_eth_data, 1);
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 	if (board_is_ts7300())
 		platform_device_register(&ts73xx_fpga_device);
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d67f203f769a..a9d3bb49f666 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -87,5 +87,10 @@ static inline int is_ts9420_installed(void)
 	return !!(__raw_readb(TS72XX_OPTIONS2_VIRT_BASE) &
 					TS72XX_OPTIONS2_TS9420);
 }
+
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n);
+void __init ts72xx_register_watchdog(void);
+void __init ts72xx_common_map_io(void);
+void __init ts72xx_register_eth(void);
 #endif
 #endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-16 23:22   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: Hartley Sweeten, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The BK3 board is a derivative of the ts72xx reference design. Hence, it
can re-use code from the ts72xx-common.c file.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/Kconfig  |  7 ++++
 arch/arm/mach-ep93xx/Makefile |  1 +
 arch/arm/mach-ep93xx/bk3.c    | 88 +++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |  5 +++
 arch/arm/tools/mach-types     |  1 +
 5 files changed, 102 insertions(+)
 create mode 100644 arch/arm/mach-ep93xx/bk3.c

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 16c5d6eedf45..18a93b404d5e 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select TS72XX_COMMON
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index f2692a072864..fb5bdb7cb944 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_CRUNCH)		+= crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o		:= -Wa,-mcpu=ep9312
 
 obj-$(CONFIG_MACH_ADSSPHERE)	+= adssphere.o
+obj-$(CONFIG_MACH_BK3)          += bk3.o
 obj-$(CONFIG_MACH_EDB93XX)	+= edb93xx.o
 obj-$(CONFIG_MACH_GESBC9312)	+= gesbc9312.o
 obj-$(CONFIG_MACH_MICRO9)	+= micro9.o
diff --git a/arch/arm/mach-ep93xx/bk3.c b/arch/arm/mach-ep93xx/bk3.c
new file mode 100644
index 000000000000..6fb4b72500ee
--- /dev/null
+++ b/arch/arm/mach-ep93xx/bk3.c
@@ -0,0 +1,88 @@
+/*
+ * arch/arm/mach-ep93xx/bk3.c
+ * Liebherr HVAC controller bk3.1
+ *
+ * based on arch/arm/mach-ep93xx/ts72xx.c
+ *
+ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
+ * Copyright (C) 2017
+ * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <linux/mtd/rawnand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/map.h>
+#include <asm/mach/arch.h>
+
+#include "soc.h"
+#include "ts72xx.h"
+
+/* NAND definition */
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
+		       { IRQ_EP93XX_SAI }, NULL);
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts));
+	ts72xx_register_watchdog();
+	ts72xx_register_eth();
+
+	amba_device_register(&i2s1_device, &iomem_resource);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index a9d3bb49f666..07f6491f35ea 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -44,6 +44,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* [PATCH 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-16 23:22   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-16 23:22 UTC (permalink / raw)
  To: linux-arm-kernel

The BK3 board is a derivative of the ts72xx reference design. Hence, it
can re-use code from the ts72xx-common.c file.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/mach-ep93xx/Kconfig  |  7 ++++
 arch/arm/mach-ep93xx/Makefile |  1 +
 arch/arm/mach-ep93xx/bk3.c    | 88 +++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |  5 +++
 arch/arm/tools/mach-types     |  1 +
 5 files changed, 102 insertions(+)
 create mode 100644 arch/arm/mach-ep93xx/bk3.c

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 16c5d6eedf45..18a93b404d5e 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select TS72XX_COMMON
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index f2692a072864..fb5bdb7cb944 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -9,6 +9,7 @@ obj-$(CONFIG_CRUNCH)		+= crunch.o crunch-bits.o
 AFLAGS_crunch-bits.o		:= -Wa,-mcpu=ep9312
 
 obj-$(CONFIG_MACH_ADSSPHERE)	+= adssphere.o
+obj-$(CONFIG_MACH_BK3)          += bk3.o
 obj-$(CONFIG_MACH_EDB93XX)	+= edb93xx.o
 obj-$(CONFIG_MACH_GESBC9312)	+= gesbc9312.o
 obj-$(CONFIG_MACH_MICRO9)	+= micro9.o
diff --git a/arch/arm/mach-ep93xx/bk3.c b/arch/arm/mach-ep93xx/bk3.c
new file mode 100644
index 000000000000..6fb4b72500ee
--- /dev/null
+++ b/arch/arm/mach-ep93xx/bk3.c
@@ -0,0 +1,88 @@
+/*
+ * arch/arm/mach-ep93xx/bk3.c
+ * Liebherr HVAC controller bk3.1
+ *
+ * based on arch/arm/mach-ep93xx/ts72xx.c
+ *
+ * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
+ * Copyright (C) 2017
+ * Lukasz Majewski, DENX Software Engineering, lukma at denx.de
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+#include <linux/mtd/rawnand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
+
+#include <mach/hardware.h>
+#include <mach/irqs.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/map.h>
+#include <asm/mach/arch.h>
+
+#include "soc.h"
+#include "ts72xx.h"
+
+/* NAND definition */
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
+		       { IRQ_EP93XX_SAI }, NULL);
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts));
+	ts72xx_register_watchdog();
+	ts72xx_register_eth();
+
+	amba_device_register(&i2s1_device, &iomem_resource);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index a9d3bb49f666..07f6491f35ea 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -44,6 +44,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* Re: [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-19 21:28   ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-19 21:28 UTC (permalink / raw)
  To: Lukasz Majewski, Hartley Sweeten, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hello Lukasz!

On 17/11/17 00:22, Lukasz Majewski wrote:
> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
> 
> This patchset consists of following patches:
> 
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
>   code can be reused by other designs build around ts72xx
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c
> 
> Lukasz Majewski (4):
>   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable

The patch 3/4 deletes everything added by patch 1/4, so I don't really see the point of it.

>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

I tend to agree with Hartley, if you'd just add all BK3-related extras to ts72xx.c it would
be less than 60 LoCs, you probably even do not need new Kconfig options.

Alex.

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

* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-19 21:28   ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-19 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Lukasz!

On 17/11/17 00:22, Lukasz Majewski wrote:
> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
> 
> This patchset consists of following patches:
> 
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
>   code can be reused by other designs build around ts72xx
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c
> 
> Lukasz Majewski (4):
>   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable

The patch 3/4 deletes everything added by patch 1/4, so I don't really see the point of it.

>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

I tend to agree with Hartley, if you'd just add all BK3-related extras to ts72xx.c it would
be less than 60 LoCs, you probably even do not need new Kconfig options.

Alex.

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

* Re: [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-19 21:28   ` Alexander Sverdlin
@ 2017-11-19 23:23     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-19 23:23 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Hartley Sweeten, Arnd Bergmann, arndbergmann, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

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

Hi Alexander,

> Hello Lukasz!
> 
> On 17/11/17 00:22, Lukasz Majewski wrote:
> > This patch series adds support for Liebherr's BK3 board, being
> > a derivative of TS72XX design.
> > 
> > This patchset consists of following patches:
> > 
> > - ts72xx.[c|h] cosmetic cleanup/improvement
> > - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
> >   code can be reused by other designs build around ts72xx
> > - The Liebherr's BK3 board has been added with re-using code of
> >   ts72xx.c
> > 
> > Lukasz Majewski (4):
> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable  
> 
> The patch 3/4 deletes everything added by patch 1/4, so I don't
> really see the point of it.

I wanted to first clean up things.

> 
> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
> > derivative  
> 
> I tend to agree with Hartley, if you'd just add all BK3-related
> extras to ts72xx.c it would be less than 60 LoCs, you probably even
> do not need new Kconfig options.

Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out that I
do need to adjust some things later (like change HAMMING NAND ECC to BCH
for plat_nand driver).

The separate bk3.c file is more appealing (for me) in terms of extending
the code latter.


> 
> Alex.



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-19 23:23     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-19 23:23 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexander,

> Hello Lukasz!
> 
> On 17/11/17 00:22, Lukasz Majewski wrote:
> > This patch series adds support for Liebherr's BK3 board, being
> > a derivative of TS72XX design.
> > 
> > This patchset consists of following patches:
> > 
> > - ts72xx.[c|h] cosmetic cleanup/improvement
> > - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
> >   code can be reused by other designs build around ts72xx
> > - The Liebherr's BK3 board has been added with re-using code of
> >   ts72xx.c
> > 
> > Lukasz Majewski (4):
> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable  
> 
> The patch 3/4 deletes everything added by patch 1/4, so I don't
> really see the point of it.

I wanted to first clean up things.

> 
> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
> > derivative  
> 
> I tend to agree with Hartley, if you'd just add all BK3-related
> extras to ts72xx.c it would be less than 60 LoCs, you probably even
> do not need new Kconfig options.

Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out that I
do need to adjust some things later (like change HAMMING NAND ECC to BCH
for plat_nand driver).

The separate bk3.c file is more appealing (for me) in terms of extending
the code latter.


> 
> Alex.



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171120/d0ce35fc/attachment.sig>

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

* Re: [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-19 23:23     ` Lukasz Majewski
@ 2017-11-20 13:23       ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-20 13:23 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson, Linus Walleij

On Mon, Nov 20, 2017 at 12:23 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Alexander,
>
>> Hello Lukasz!
>>
>> On 17/11/17 00:22, Lukasz Majewski wrote:
>> > This patch series adds support for Liebherr's BK3 board, being
>> > a derivative of TS72XX design.
>> >
>> > This patchset consists of following patches:
>> >
>> > - ts72xx.[c|h] cosmetic cleanup/improvement
>> > - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
>> >   code can be reused by other designs build around ts72xx
>> > - The Liebherr's BK3 board has been added with re-using code of
>> >   ts72xx.c
>> >
>> > Lukasz Majewski (4):
>> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
>>
>> The patch 3/4 deletes everything added by patch 1/4, so I don't
>> really see the point of it.
>
> I wanted to first clean up things.

Cleaning it up first is the right approach, a patch that moves code around
should not contain any other changes.

>> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
>> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
>> > derivative
>>
>> I tend to agree with Hartley, if you'd just add all BK3-related
>> extras to ts72xx.c it would be less than 60 LoCs, you probably even
>> do not need new Kconfig options.
>
> Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out that I
> do need to adjust some things later (like change HAMMING NAND ECC to BCH
> for plat_nand driver).
>
> The separate bk3.c file is more appealing (for me) in terms of extending
> the code latter.

I think keeping everything in one file, but adding a new Kconfig option that
uses 'select MACH_TS72XX' to enable the existing board would be simpler,
we can split it out later once we think it gets too big.

      Arnd

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

* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-20 13:23       ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-20 13:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 20, 2017 at 12:23 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Alexander,
>
>> Hello Lukasz!
>>
>> On 17/11/17 00:22, Lukasz Majewski wrote:
>> > This patch series adds support for Liebherr's BK3 board, being
>> > a derivative of TS72XX design.
>> >
>> > This patchset consists of following patches:
>> >
>> > - ts72xx.[c|h] cosmetic cleanup/improvement
>> > - Move the common code for ts72xx and BK3 to ts72xx-common.c - this
>> >   code can be reused by other designs build around ts72xx
>> > - The Liebherr's BK3 board has been added with re-using code of
>> >   ts72xx.c
>> >
>> > Lukasz Majewski (4):
>> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
>>
>> The patch 3/4 deletes everything added by patch 1/4, so I don't
>> really see the point of it.
>
> I wanted to first clean up things.

Cleaning it up first is the right approach, a patch that moves code around
should not contain any other changes.

>> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
>> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
>> > derivative
>>
>> I tend to agree with Hartley, if you'd just add all BK3-related
>> extras to ts72xx.c it would be less than 60 LoCs, you probably even
>> do not need new Kconfig options.
>
> Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out that I
> do need to adjust some things later (like change HAMMING NAND ECC to BCH
> for plat_nand driver).
>
> The separate bk3.c file is more appealing (for me) in terms of extending
> the code latter.

I think keeping everything in one file, but adding a new Kconfig option that
uses 'select MACH_TS72XX' to enable the existing board would be simpler,
we can split it out later once we think it gets too big.

      Arnd

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

* Re: [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-20 13:23       ` Arnd Bergmann
@ 2017-11-20 14:44         ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-20 14:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Sverdlin, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson, Linus Walleij

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

Hi Arnd,

> On Mon, Nov 20, 2017 at 12:23 AM, Lukasz Majewski <lukma@denx.de>
> wrote:
> > Hi Alexander,
> >  
> >> Hello Lukasz!
> >>
> >> On 17/11/17 00:22, Lukasz Majewski wrote:  
> >> > This patch series adds support for Liebherr's BK3 board, being
> >> > a derivative of TS72XX design.
> >> >
> >> > This patchset consists of following patches:
> >> >
> >> > - ts72xx.[c|h] cosmetic cleanup/improvement
> >> > - Move the common code for ts72xx and BK3 to ts72xx-common.c -
> >> > this code can be reused by other designs build around ts72xx
> >> > - The Liebherr's BK3 board has been added with re-using code of
> >> >   ts72xx.c
> >> >
> >> > Lukasz Majewski (4):
> >> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where
> >> > applicable  
> >>
> >> The patch 3/4 deletes everything added by patch 1/4, so I don't
> >> really see the point of it.  
> >
> > I wanted to first clean up things.  
> 
> Cleaning it up first is the right approach, a patch that moves code
> around should not contain any other changes.
> 
> >> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
> >> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
> >> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
> >> > derivative  
> >>
> >> I tend to agree with Hartley, if you'd just add all BK3-related
> >> extras to ts72xx.c it would be less than 60 LoCs, you probably even
> >> do not need new Kconfig options.  
> >
> > Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out
> > that I do need to adjust some things later (like change HAMMING
> > NAND ECC to BCH for plat_nand driver).
> >
> > The separate bk3.c file is more appealing (for me) in terms of
> > extending the code latter.  
> 
> I think keeping everything in one file, but adding a new Kconfig
> option that uses 'select MACH_TS72XX' to enable the existing board
> would be simpler, we can split it out later once we think it gets too
> big.

Ok. Thanks for the suggestion. I will prepare v2.

> 
>       Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-20 14:44         ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-20 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> On Mon, Nov 20, 2017 at 12:23 AM, Lukasz Majewski <lukma@denx.de>
> wrote:
> > Hi Alexander,
> >  
> >> Hello Lukasz!
> >>
> >> On 17/11/17 00:22, Lukasz Majewski wrote:  
> >> > This patch series adds support for Liebherr's BK3 board, being
> >> > a derivative of TS72XX design.
> >> >
> >> > This patchset consists of following patches:
> >> >
> >> > - ts72xx.[c|h] cosmetic cleanup/improvement
> >> > - Move the common code for ts72xx and BK3 to ts72xx-common.c -
> >> > this code can be reused by other designs build around ts72xx
> >> > - The Liebherr's BK3 board has been added with re-using code of
> >> >   ts72xx.c
> >> >
> >> > Lukasz Majewski (4):
> >> >   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where
> >> > applicable  
> >>
> >> The patch 3/4 deletes everything added by patch 1/4, so I don't
> >> really see the point of it.  
> >
> > I wanted to first clean up things.  
> 
> Cleaning it up first is the right approach, a patch that moves code
> around should not contain any other changes.
> 
> >> >   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
> >> >   ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board
> >> >   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx
> >> > derivative  
> >>
> >> I tend to agree with Hartley, if you'd just add all BK3-related
> >> extras to ts72xx.c it would be less than 60 LoCs, you probably even
> >> do not need new Kconfig options.  
> >
> > Some Kconfig option would be welcome (MACH_BK3 ?) if it turns out
> > that I do need to adjust some things later (like change HAMMING
> > NAND ECC to BCH for plat_nand driver).
> >
> > The separate bk3.c file is more appealing (for me) in terms of
> > extending the code latter.  
> 
> I think keeping everything in one file, but adding a new Kconfig
> option that uses 'select MACH_TS72XX' to enable the existing board
> would be simpler, we can split it out later once we think it gets too
> big.

Ok. Thanks for the suggestion. I will prepare v2.

> 
>       Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171120/aceeacbd/attachment.sig>

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

* [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-21 14:31   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:31 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c

This series applies on top of v4.14

Lukasz Majewski (6):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 arch/arm/mach-ep93xx/Kconfig  |   7 +++
 arch/arm/mach-ep93xx/ts72xx.c | 137 +++++++++++++++++++++++++++++++-----------
 arch/arm/mach-ep93xx/ts72xx.h |   9 +++
 arch/arm/tools/mach-types     |   1 +
 4 files changed, 120 insertions(+), 34 deletions(-)

-- 
2.11.0

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

* [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-21 14:31   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c

This series applies on top of v4.14

Lukasz Majewski (6):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 arch/arm/mach-ep93xx/Kconfig  |   7 +++
 arch/arm/mach-ep93xx/ts72xx.c | 137 +++++++++++++++++++++++++++++++-----------
 arch/arm/mach-ep93xx/ts72xx.h |   9 +++
 arch/arm/tools/mach-types     |   1 +
 4 files changed, 120 insertions(+), 34 deletions(-)

-- 
2.11.0

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

* [PATCH v2 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:31     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:31 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH v2 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
@ 2017-11-21 14:31     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH v2 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:32     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index b89850f1a965..d9ff04db3221 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v2 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-11-21 14:32     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index b89850f1a965..d9ff04db3221 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v2 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:32     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..00e0e5b8babf 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v2 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-11-21 14:32     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..00e0e5b8babf 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:32     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 00e0e5b8babf..a6e473b3dcf6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
@ 2017-11-21 14:32     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>

---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 00e0e5b8babf..a6e473b3dcf6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v2 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:32     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index a6e473b3dcf6..2e8fcc6e87b6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -28,6 +28,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -189,6 +192,9 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
 static struct resource ts72xx_wdt_resources[] = {
 	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
 	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
@@ -201,10 +207,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.resource	= ts72xx_wdt_resources,
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v2 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-11-21 14:32     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index a6e473b3dcf6..2e8fcc6e87b6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -28,6 +28,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -189,6 +192,9 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
 static struct resource ts72xx_wdt_resources[] = {
 	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
 	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
@@ -201,10 +207,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.resource	= ts72xx_wdt_resources,
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-21 14:32     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
---
 arch/arm/mach-ep93xx/Kconfig  |  7 +++++
 arch/arm/mach-ep93xx/ts72xx.c | 64 +++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
 arch/arm/tools/mach-types     |  1 +
 4 files changed, 77 insertions(+)

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 2e8fcc6e87b6..0de19b136ad0 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,8 +18,10 @@
 #include <linux/io.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
 
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
+		       { IRQ_EP93XX_SAI }, NULL);
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	platform_device_register(&ts72xx_wdt_device);
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	amba_device_register(&i2s1_device, &iomem_resource);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d9ff04db3221..d3165bb9ee78 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -45,6 +45,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-21 14:32     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-21 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
---
 arch/arm/mach-ep93xx/Kconfig  |  7 +++++
 arch/arm/mach-ep93xx/ts72xx.c | 64 +++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
 arch/arm/tools/mach-types     |  1 +
 4 files changed, 77 insertions(+)

diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 2e8fcc6e87b6..0de19b136ad0 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,8 +18,10 @@
 #include <linux/io.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
 
 #include <mach/hardware.h>
+#include <mach/irqs.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
+		       { IRQ_EP93XX_SAI }, NULL);
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	platform_device_register(&ts72xx_wdt_device);
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	amba_device_register(&i2s1_device, &iomem_resource);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d9ff04db3221..d3165bb9ee78 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -45,6 +45,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* Re: [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-21 14:31   ` Lukasz Majewski
@ 2017-11-29  9:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-29  9:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

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

Dear All,

> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
> 
> This patchset consists of following patches:
> 
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c
> 
> This series applies on top of v4.14

Do you have any comments regarding this patch series?

> 
> Lukasz Majewski (6):
>   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
> 
>  arch/arm/mach-ep93xx/Kconfig  |   7 +++
>  arch/arm/mach-ep93xx/ts72xx.c | 137
> +++++++++++++++++++++++++++++++-----------
> arch/arm/mach-ep93xx/ts72xx.h |   9 +++ arch/arm/tools/mach-types
> |   1 + 4 files changed, 120 insertions(+), 34 deletions(-)
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-29  9:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-29  9:45 UTC (permalink / raw)
  To: linux-arm-kernel

Dear All,

> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
> 
> This patchset consists of following patches:
> 
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c
> 
> This series applies on top of v4.14

Do you have any comments regarding this patch series?

> 
> Lukasz Majewski (6):
>   ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
> 
>  arch/arm/mach-ep93xx/Kconfig  |   7 +++
>  arch/arm/mach-ep93xx/ts72xx.c | 137
> +++++++++++++++++++++++++++++++-----------
> arch/arm/mach-ep93xx/ts72xx.h |   9 +++ arch/arm/tools/mach-types
> |   1 + 4 files changed, 120 insertions(+), 34 deletions(-)
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171129/72d37d17/attachment.sig>

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

* Re: [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-29  9:45     ` Lukasz Majewski
@ 2017-11-29 12:48       ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-29 12:48 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson, Linus Walleij

On Wed, Nov 29, 2017 at 10:45 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Dear All,
>
>> This patch series adds support for Liebherr's BK3 board, being
>> a derivative of TS72XX design.
>>
>> This patchset consists of following patches:
>>
>> - ts72xx.[c|h] cosmetic cleanup/improvement
>> - Rewrite ts72xx.c to be reusable by bk3
>> - The Liebherr's BK3 board has been added with re-using code of
>>   ts72xx.c
>>
>> This series applies on top of v4.14
>
> Do you have any comments regarding this patch series?

Looks all good to me.

      Arnd

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

* [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-29 12:48       ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-29 12:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 29, 2017 at 10:45 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Dear All,
>
>> This patch series adds support for Liebherr's BK3 board, being
>> a derivative of TS72XX design.
>>
>> This patchset consists of following patches:
>>
>> - ts72xx.[c|h] cosmetic cleanup/improvement
>> - Rewrite ts72xx.c to be reusable by bk3
>> - The Liebherr's BK3 board has been added with re-using code of
>>   ts72xx.c
>>
>> This series applies on top of v4.14
>
> Do you have any comments regarding this patch series?

Looks all good to me.

      Arnd

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

* Re: [PATCH v2 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  2017-11-21 14:31     ` Lukasz Majewski
@ 2017-11-29 20:33       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:33 UTC (permalink / raw)
  To: Lukasz Majewski, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hi!

On 21/11/17 15:31, Lukasz Majewski wrote:
> This commit cleans up the code by using dedicated macros instead of
> full definitions.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> Changes for v2:
> - None
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 8745162ec05d..06345b85f27c 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
>  };
>  
>  static struct resource ts72xx_wdt_resources[] = {
> -	{
> -		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
> -		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	{
> -		.start	= TS72XX_WDT_FEED_PHYS_BASE,
> -		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
> +	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
>  };
>  
>  static struct platform_device ts72xx_wdt_device = {
> @@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
>  #define TS73XX_FPGA_LOADER_BASE		0x03c00000
>  
>  static struct resource ts73xx_fpga_resources[] = {
> -	{
> -		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
> -		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
>  };
>  
>  static struct platform_device ts73xx_fpga_device = {

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

* [PATCH v2 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
@ 2017-11-29 20:33       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On 21/11/17 15:31, Lukasz Majewski wrote:
> This commit cleans up the code by using dedicated macros instead of
> full definitions.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> Changes for v2:
> - None
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
>  1 file changed, 3 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 8745162ec05d..06345b85f27c 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
>  };
>  
>  static struct resource ts72xx_wdt_resources[] = {
> -	{
> -		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
> -		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	{
> -		.start	= TS72XX_WDT_FEED_PHYS_BASE,
> -		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
> +	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
>  };
>  
>  static struct platform_device ts72xx_wdt_device = {
> @@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
>  #define TS73XX_FPGA_LOADER_BASE		0x03c00000
>  
>  static struct resource ts73xx_fpga_resources[] = {
> -	{
> -		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
> -		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
>  };
>  
>  static struct platform_device ts73xx_fpga_device = {

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

* Re: [PATCH v2 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-11-21 14:32     ` Lukasz Majewski
@ 2017-11-29 20:34       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:34 UTC (permalink / raw)
  To: Lukasz Majewski, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> This commit adds include file guards to ts72xx.h
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> Changes for v2:
> - None
> ---
>  arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
> index b89850f1a965..d9ff04db3221 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.h
> +++ b/arch/arm/mach-ep93xx/ts72xx.h
> @@ -12,6 +12,9 @@
>   * febfd000	22800000	4K	options register #2
>   */
>  
> +#ifndef __TS72XX_H_
> +#define __TS72XX_H_
> +
>  #define TS72XX_MODEL_PHYS_BASE		0x22000000
>  #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
>  #define TS72XX_MODEL_SIZE		0x00001000
> @@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
>  					TS72XX_OPTIONS2_TS9420);
>  }
>  #endif
> +#endif /* __TS72XX_H_ */

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

* [PATCH v2 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-11-29 20:34       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> This commit adds include file guards to ts72xx.h
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> Changes for v2:
> - None
> ---
>  arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
> index b89850f1a965..d9ff04db3221 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.h
> +++ b/arch/arm/mach-ep93xx/ts72xx.h
> @@ -12,6 +12,9 @@
>   * febfd000	22800000	4K	options register #2
>   */
>  
> +#ifndef __TS72XX_H_
> +#define __TS72XX_H_
> +
>  #define TS72XX_MODEL_PHYS_BASE		0x22000000
>  #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
>  #define TS72XX_MODEL_SIZE		0x00001000
> @@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
>  					TS72XX_OPTIONS2_TS9420);
>  }
>  #endif
> +#endif /* __TS72XX_H_ */

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

* Re: [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  2017-11-21 14:32     ` Lukasz Majewski
@ 2017-11-29 20:36       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:36 UTC (permalink / raw)
  To: Lukasz Majewski, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> The map IO common code has been excluded to be reused by other ts72xx
> clones.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> 
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 00e0e5b8babf..a6e473b3dcf6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -30,11 +30,6 @@
>  
>  static struct map_desc ts72xx_io_desc[] __initdata = {
>  	{
> -		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> -		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> -		.length		= TS72XX_MODEL_SIZE,
> -		.type		= MT_DEVICE,
> -	}, {
>  		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
>  		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
>  		.length		= TS72XX_OPTIONS_SIZE,
> @@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
>  	}
>  };
>  
> -static void __init ts72xx_map_io(void)
> +static struct map_desc ts72xx_common_io_desc[] __initdata = {
> +	{
> +		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> +		.length		= TS72XX_MODEL_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +void __init ts72xx_common_map_io(void)
>  {
>  	ep93xx_map_io();
> -	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
>  }
>  
> +static void __init ts72xx_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +}
>  
>  /*************************************************************************
>   * NAND flash

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

* [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
@ 2017-11-29 20:36       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> The map IO common code has been excluded to be reused by other ts72xx
> clones.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> 
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 00e0e5b8babf..a6e473b3dcf6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -30,11 +30,6 @@
>  
>  static struct map_desc ts72xx_io_desc[] __initdata = {
>  	{
> -		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> -		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> -		.length		= TS72XX_MODEL_SIZE,
> -		.type		= MT_DEVICE,
> -	}, {
>  		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
>  		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
>  		.length		= TS72XX_OPTIONS_SIZE,
> @@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
>  	}
>  };
>  
> -static void __init ts72xx_map_io(void)
> +static struct map_desc ts72xx_common_io_desc[] __initdata = {
> +	{
> +		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> +		.length		= TS72XX_MODEL_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +void __init ts72xx_common_map_io(void)
>  {
>  	ep93xx_map_io();
> -	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
>  }
>  
> +static void __init ts72xx_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +}
>  
>  /*************************************************************************
>   * NAND flash

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

* Re: [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-21 14:32     ` Lukasz Majewski
@ 2017-11-29 20:48       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:48 UTC (permalink / raw)
  To: Lukasz Majewski, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hello Lukasz,

some nitpicking below...

On 21/11/17 15:32, Lukasz Majewski wrote:
> The BK3 board is a derivative of the ts72xx reference design.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - Place bk3 support code to the ts72xx.c file
> ---
>  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
>  arch/arm/mach-ep93xx/ts72xx.c | 64 +++++++++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
>  arch/arm/tools/mach-types     |  1 +
>  4 files changed, 77 insertions(+)
> 
> diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
> index 61a75ca3684e..c095236d7ff8 100644
> --- a/arch/arm/mach-ep93xx/Kconfig
> +++ b/arch/arm/mach-ep93xx/Kconfig
> @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
>  	  Say 'Y' here if you want your kernel to support the ADS
>  	  Sphere board.
>  
> +config MACH_BK3
> +	bool "Support Liebherr BK3.1"
> +	select MACH_TS72XX
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Liebherr controller BK3.1.
> +
>  config MACH_EDB93XX
>  	bool
>  
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 2e8fcc6e87b6..0de19b136ad0 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -18,8 +18,10 @@
>  #include <linux/io.h>
>  #include <linux/mtd/rawnand.h>
>  #include <linux/mtd/partitions.h>
> +#include <linux/amba/bus.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/irqs.h>
>  
>  #include <asm/mach-types.h>
>  #include <asm/mach/map.h>
> @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
>  	.init_late	= ep93xx_init_late,
>  	.restart	= ep93xx_restart,
>  MACHINE_END
> +
> +/*************************************************************************
> + * BK3 support code
> + *************************************************************************/
> +static struct mtd_partition bk3_nand_parts[] = {
> +	{
> +		.name		= "System",
> +		.offset	= 0x00000000,

I see the above and below lines as unaligned

> +		.size		= 0x01e00000,
> +	}, {
> +		.name		= "Data",
> +		.offset	= 0x01e00000,

same here

> +		.size		= 0x05f20000
> +	}, {
> +		.name		= "RedBoot",
> +		.offset	= 0x07d20000,

same here

> +		.size		= 0x002e0000,
> +		.mask_flags	= MTD_WRITEABLE,	/* force RO */
> +	},
> +};
> +
> +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> +		       { IRQ_EP93XX_SAI }, NULL);
> +
> +static struct map_desc bk3_io_desc[] __initdata = {
> +	{
> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> +		.length	= BK3_CPLDVER_SIZE,

same here

> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +static void __init bk3_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> +}
> +
> +static void __init bk3_init_machine(void)
> +{
> +	ep93xx_init_devices();
> +
> +	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
> +			      EP93XX_CS6_PHYS_BASE);
> +
> +	platform_device_register(&ts72xx_wdt_device);
> +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> +
> +	amba_device_register(&i2s1_device, &iomem_resource);
> +}
> +
> +MACHINE_START(BK3, "Liebherr controller BK3.1")
> +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */

Don't you want to add an entry to the MAINTAINERS file instead?
Then get_maintainer.pl would be able to suggest your email.

> +	.atag_offset	= 0x100,
> +	.map_io	= bk3_map_io,

again, inconsistent alignment...

> +	.init_irq	= ep93xx_init_irq,
> +	.init_time	= ep93xx_timer_init,
> +	.init_machine	= bk3_init_machine,
> +	.init_late	= ep93xx_init_late,
> +	.restart	= ep93xx_restart,
> +MACHINE_END
> diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
> index d9ff04db3221..d3165bb9ee78 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.h
> +++ b/arch/arm/mach-ep93xx/ts72xx.h
> @@ -45,6 +45,11 @@
>  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
>  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
>  
> +/* BK3 specific defines */
> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> +#define BK3_CPLDVER_SIZE		0x00001000
> +
>  #ifndef __ASSEMBLY__
>  
>  static inline int ts72xx_model(void)
> diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> index a9313b66f770..4eac94c1eb6f 100644
> --- a/arch/arm/tools/mach-types
> +++ b/arch/arm/tools/mach-types
> @@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
>  linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
>  afeb9260		MACH_AFEB9260		AFEB9260		1859
>  imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
> +bk3			MACH_BK3		BK3			1880
>  rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
>  realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
>  realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-29 20:48       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Lukasz,

some nitpicking below...

On 21/11/17 15:32, Lukasz Majewski wrote:
> The BK3 board is a derivative of the ts72xx reference design.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - Place bk3 support code to the ts72xx.c file
> ---
>  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
>  arch/arm/mach-ep93xx/ts72xx.c | 64 +++++++++++++++++++++++++++++++++++++++++++
>  arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
>  arch/arm/tools/mach-types     |  1 +
>  4 files changed, 77 insertions(+)
> 
> diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
> index 61a75ca3684e..c095236d7ff8 100644
> --- a/arch/arm/mach-ep93xx/Kconfig
> +++ b/arch/arm/mach-ep93xx/Kconfig
> @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
>  	  Say 'Y' here if you want your kernel to support the ADS
>  	  Sphere board.
>  
> +config MACH_BK3
> +	bool "Support Liebherr BK3.1"
> +	select MACH_TS72XX
> +	help
> +	  Say 'Y' here if you want your kernel to support the
> +	  Liebherr controller BK3.1.
> +
>  config MACH_EDB93XX
>  	bool
>  
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 2e8fcc6e87b6..0de19b136ad0 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -18,8 +18,10 @@
>  #include <linux/io.h>
>  #include <linux/mtd/rawnand.h>
>  #include <linux/mtd/partitions.h>
> +#include <linux/amba/bus.h>
>  
>  #include <mach/hardware.h>
> +#include <mach/irqs.h>
>  
>  #include <asm/mach-types.h>
>  #include <asm/mach/map.h>
> @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
>  	.init_late	= ep93xx_init_late,
>  	.restart	= ep93xx_restart,
>  MACHINE_END
> +
> +/*************************************************************************
> + * BK3 support code
> + *************************************************************************/
> +static struct mtd_partition bk3_nand_parts[] = {
> +	{
> +		.name		= "System",
> +		.offset	= 0x00000000,

I see the above and below lines as unaligned

> +		.size		= 0x01e00000,
> +	}, {
> +		.name		= "Data",
> +		.offset	= 0x01e00000,

same here

> +		.size		= 0x05f20000
> +	}, {
> +		.name		= "RedBoot",
> +		.offset	= 0x07d20000,

same here

> +		.size		= 0x002e0000,
> +		.mask_flags	= MTD_WRITEABLE,	/* force RO */
> +	},
> +};
> +
> +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> +		       { IRQ_EP93XX_SAI }, NULL);
> +
> +static struct map_desc bk3_io_desc[] __initdata = {
> +	{
> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> +		.length	= BK3_CPLDVER_SIZE,

same here

> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +static void __init bk3_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> +}
> +
> +static void __init bk3_init_machine(void)
> +{
> +	ep93xx_init_devices();
> +
> +	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
> +			      EP93XX_CS6_PHYS_BASE);
> +
> +	platform_device_register(&ts72xx_wdt_device);
> +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> +
> +	amba_device_register(&i2s1_device, &iomem_resource);
> +}
> +
> +MACHINE_START(BK3, "Liebherr controller BK3.1")
> +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */

Don't you want to add an entry to the MAINTAINERS file instead?
Then get_maintainer.pl would be able to suggest your email.

> +	.atag_offset	= 0x100,
> +	.map_io	= bk3_map_io,

again, inconsistent alignment...

> +	.init_irq	= ep93xx_init_irq,
> +	.init_time	= ep93xx_timer_init,
> +	.init_machine	= bk3_init_machine,
> +	.init_late	= ep93xx_init_late,
> +	.restart	= ep93xx_restart,
> +MACHINE_END
> diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
> index d9ff04db3221..d3165bb9ee78 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.h
> +++ b/arch/arm/mach-ep93xx/ts72xx.h
> @@ -45,6 +45,11 @@
>  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
>  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
>  
> +/* BK3 specific defines */
> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> +#define BK3_CPLDVER_SIZE		0x00001000
> +
>  #ifndef __ASSEMBLY__
>  
>  static inline int ts72xx_model(void)
> diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> index a9313b66f770..4eac94c1eb6f 100644
> --- a/arch/arm/tools/mach-types
> +++ b/arch/arm/tools/mach-types
> @@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
>  linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
>  afeb9260		MACH_AFEB9260		AFEB9260		1859
>  imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
> +bk3			MACH_BK3		BK3			1880
>  rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
>  realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
>  realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901

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

* Re: [PATCH v2 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-11-21 14:32     ` Lukasz Majewski
@ 2017-11-29 20:54       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:54 UTC (permalink / raw)
  To: Lukasz Majewski, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> This commit extend the ts72xx_register_flash() to accept passed parameters,
> which makes it more reusable.
> 
> Now it is possible to accept ep93xx flash start address and partitions.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> 
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 06345b85f27c..00e0e5b8babf 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
>  		.nr_chips	= 1,
>  		.chip_offset	= 0,
>  		.chip_delay	= 15,
> -		.partitions	= ts72xx_nand_parts,
> -		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
>  	},
>  	.ctrl = {
>  		.cmd_ctrl	= ts72xx_nand_hwcontrol,
> @@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
>  	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
>  };
>  
> -
> -static void __init ts72xx_register_flash(void)
> +void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
> +				  resource_size_t start)
>  {
>  	/*
>  	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
> @@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
>  	if (board_is_ts7200()) {
>  		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
>  	} else {
> -		resource_size_t start;
> -
> -		if (is_ts9420_installed())
> -			start = EP93XX_CS7_PHYS_BASE;
> -		else
> -			start = EP93XX_CS6_PHYS_BASE;
> -
>  		ts72xx_nand_resource[0].start = start;
>  		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
>  
> +		ts72xx_nand_data.chip.partitions = parts;
> +		ts72xx_nand_data.chip.nr_partitions = n;
> +
>  		platform_device_register(&ts72xx_nand_flash);
>  	}
>  }
> @@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
>  static void __init ts72xx_init_machine(void)
>  {
>  	ep93xx_init_devices();
> -	ts72xx_register_flash();
> +	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
> +			      is_ts9420_installed() ?
> +			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
>  	platform_device_register(&ts72xx_rtc_device);
>  	platform_device_register(&ts72xx_wdt_device);
>  

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

* [PATCH v2 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-11-29 20:54       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-29 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On 21/11/17 15:32, Lukasz Majewski wrote:
> This commit extend the ts72xx_register_flash() to accept passed parameters,
> which makes it more reusable.
> 
> Now it is possible to accept ep93xx flash start address and partitions.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> 
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
> index 06345b85f27c..00e0e5b8babf 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
>  		.nr_chips	= 1,
>  		.chip_offset	= 0,
>  		.chip_delay	= 15,
> -		.partitions	= ts72xx_nand_parts,
> -		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
>  	},
>  	.ctrl = {
>  		.cmd_ctrl	= ts72xx_nand_hwcontrol,
> @@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
>  	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
>  };
>  
> -
> -static void __init ts72xx_register_flash(void)
> +void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
> +				  resource_size_t start)
>  {
>  	/*
>  	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
> @@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
>  	if (board_is_ts7200()) {
>  		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
>  	} else {
> -		resource_size_t start;
> -
> -		if (is_ts9420_installed())
> -			start = EP93XX_CS7_PHYS_BASE;
> -		else
> -			start = EP93XX_CS6_PHYS_BASE;
> -
>  		ts72xx_nand_resource[0].start = start;
>  		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
>  
> +		ts72xx_nand_data.chip.partitions = parts;
> +		ts72xx_nand_data.chip.nr_partitions = n;
> +
>  		platform_device_register(&ts72xx_nand_flash);
>  	}
>  }
> @@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
>  static void __init ts72xx_init_machine(void)
>  {
>  	ep93xx_init_devices();
> -	ts72xx_register_flash();
> +	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
> +			      is_ts9420_installed() ?
> +			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
>  	platform_device_register(&ts72xx_rtc_device);
>  	platform_device_register(&ts72xx_wdt_device);
>  

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

* Re: [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-29 20:48       ` Alexander Sverdlin
@ 2017-11-29 22:07         ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-29 22:07 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Arnd Bergmann, arndbergmann, Hartley Sweeten, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

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

Hi Alexander,

> Hello Lukasz,
> 
> some nitpicking below...
> 
> On 21/11/17 15:32, Lukasz Majewski wrote:
> > The BK3 board is a derivative of the ts72xx reference design.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > Changes for v2:
> > - Place bk3 support code to the ts72xx.c file
> > ---
> >  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
> >  arch/arm/mach-ep93xx/ts72xx.c | 64
> > +++++++++++++++++++++++++++++++++++++++++++
> > arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
> > arch/arm/tools/mach-types     |  1 + 4 files changed, 77
> > insertions(+)
> > 
> > diff --git a/arch/arm/mach-ep93xx/Kconfig
> > b/arch/arm/mach-ep93xx/Kconfig index 61a75ca3684e..c095236d7ff8
> > 100644 --- a/arch/arm/mach-ep93xx/Kconfig
> > +++ b/arch/arm/mach-ep93xx/Kconfig
> > @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
> >  	  Say 'Y' here if you want your kernel to support the ADS
> >  	  Sphere board.
> >  
> > +config MACH_BK3
> > +	bool "Support Liebherr BK3.1"
> > +	select MACH_TS72XX
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Liebherr controller BK3.1.
> > +
> >  config MACH_EDB93XX
> >  	bool
> >  
> > diff --git a/arch/arm/mach-ep93xx/ts72xx.c
> > b/arch/arm/mach-ep93xx/ts72xx.c index 2e8fcc6e87b6..0de19b136ad0
> > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c
> > +++ b/arch/arm/mach-ep93xx/ts72xx.c
> > @@ -18,8 +18,10 @@
> >  #include <linux/io.h>
> >  #include <linux/mtd/rawnand.h>
> >  #include <linux/mtd/partitions.h>
> > +#include <linux/amba/bus.h>
> >  
> >  #include <mach/hardware.h>
> > +#include <mach/irqs.h>
> >  
> >  #include <asm/mach-types.h>
> >  #include <asm/mach/map.h>
> > @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems
> > TS-72xx SBC") .init_late	= ep93xx_init_late,
> >  	.restart	= ep93xx_restart,
> >  MACHINE_END
> > +
> > +/*************************************************************************
> > + * BK3 support code
> > +
> > *************************************************************************/
> > +static struct mtd_partition bk3_nand_parts[] = {
> > +	{
> > +		.name		= "System",
> > +		.offset	= 0x00000000,  
> 
> I see the above and below lines as unaligned

This is strange.... I'm using emacs with extension to have coding style
for kernel.

Probably tabs get unaligned...

> 
> > +		.size		= 0x01e00000,
> > +	}, {
> > +		.name		= "Data",
> > +		.offset	= 0x01e00000,  
> 
> same here
> 
> > +		.size		= 0x05f20000
> > +	}, {
> > +		.name		= "RedBoot",
> > +		.offset	= 0x07d20000,  
> 
> same here
> 
> > +		.size		= 0x002e0000,
> > +		.mask_flags	= MTD_WRITEABLE,	/*
> > force RO */
> > +	},
> > +};
> > +
> > +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> > +		       { IRQ_EP93XX_SAI }, NULL);
> > +
> > +static struct map_desc bk3_io_desc[] __initdata = {
> > +	{
> > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > +		.pfn		=
> > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > +		.length	= BK3_CPLDVER_SIZE,  
> 
> same here
> 
> > +		.type		= MT_DEVICE,
> > +	}
> > +};
> > +
> > +static void __init bk3_map_io(void)
> > +{
> > +	ts72xx_common_map_io();
> > +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> > +}
> > +
> > +static void __init bk3_init_machine(void)
> > +{
> > +	ep93xx_init_devices();
> > +
> > +	ts72xx_register_flash(bk3_nand_parts,
> > ARRAY_SIZE(bk3_nand_parts),
> > +			      EP93XX_CS6_PHYS_BASE);
> > +
> > +	platform_device_register(&ts72xx_wdt_device);
> > +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> > +
> > +	amba_device_register(&i2s1_device, &iomem_resource);
> > +}
> > +
> > +MACHINE_START(BK3, "Liebherr controller BK3.1")
> > +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */  
> 
> Don't you want to add an entry to the MAINTAINERS file instead?
> Then get_maintainer.pl would be able to suggest your email.

Yes. This would be a good idea (I've followed the "style" of other
boards in the mach-ep93xx directory).

I will fix that ....... and send v3 with included some extra code - as
I've found and fixed several issues since last posting.

Anyway, many thanks for review. 

> 
> > +	.atag_offset	= 0x100,
> > +	.map_io	= bk3_map_io,  
> 
> again, inconsistent alignment...

Even more..... checkpatch.pl did not complained....

> 
> > +	.init_irq	= ep93xx_init_irq,
> > +	.init_time	= ep93xx_timer_init,
> > +	.init_machine	= bk3_init_machine,
> > +	.init_late	= ep93xx_init_late,
> > +	.restart	= ep93xx_restart,
> > +MACHINE_END
> > diff --git a/arch/arm/mach-ep93xx/ts72xx.h
> > b/arch/arm/mach-ep93xx/ts72xx.h index d9ff04db3221..d3165bb9ee78
> > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.h
> > +++ b/arch/arm/mach-ep93xx/ts72xx.h
> > @@ -45,6 +45,11 @@
> >  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
> >  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
> >  
> > +/* BK3 specific defines */
> > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > +#define BK3_CPLDVER_SIZE		0x00001000
> > +
> >  #ifndef __ASSEMBLY__
> >  
> >  static inline int ts72xx_model(void)
> > diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> > index a9313b66f770..4eac94c1eb6f 100644
> > --- a/arch/arm/tools/mach-types
> > +++ b/arch/arm/tools/mach-types
> > @@ -345,6 +345,7 @@ mxlads
> > MACH_MXLADS		MXLADS			1851
> > linkstation_mini	MACH_LINKSTATION_MINI
> > LINKSTATION_MINI	1858 afeb9260
> > MACH_AFEB9260		AFEB9260		1859
> > imx27ipcam		MACH_IMX27IPCAM
> > IMX27IPCAM		1871 +bk3
> > MACH_BK3		BK3			1880
> > rd88f6183ap_ge		MACH_RD88F6183AP_GE
> > RD88F6183AP_GE		1894 realview_pba8
> > MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
> > realview_pbx		MACH_REALVIEW_PBX
> > REALVIEW_PBX		1901  



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-29 22:07         ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-29 22:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexander,

> Hello Lukasz,
> 
> some nitpicking below...
> 
> On 21/11/17 15:32, Lukasz Majewski wrote:
> > The BK3 board is a derivative of the ts72xx reference design.
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> > Changes for v2:
> > - Place bk3 support code to the ts72xx.c file
> > ---
> >  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
> >  arch/arm/mach-ep93xx/ts72xx.c | 64
> > +++++++++++++++++++++++++++++++++++++++++++
> > arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
> > arch/arm/tools/mach-types     |  1 + 4 files changed, 77
> > insertions(+)
> > 
> > diff --git a/arch/arm/mach-ep93xx/Kconfig
> > b/arch/arm/mach-ep93xx/Kconfig index 61a75ca3684e..c095236d7ff8
> > 100644 --- a/arch/arm/mach-ep93xx/Kconfig
> > +++ b/arch/arm/mach-ep93xx/Kconfig
> > @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
> >  	  Say 'Y' here if you want your kernel to support the ADS
> >  	  Sphere board.
> >  
> > +config MACH_BK3
> > +	bool "Support Liebherr BK3.1"
> > +	select MACH_TS72XX
> > +	help
> > +	  Say 'Y' here if you want your kernel to support the
> > +	  Liebherr controller BK3.1.
> > +
> >  config MACH_EDB93XX
> >  	bool
> >  
> > diff --git a/arch/arm/mach-ep93xx/ts72xx.c
> > b/arch/arm/mach-ep93xx/ts72xx.c index 2e8fcc6e87b6..0de19b136ad0
> > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c
> > +++ b/arch/arm/mach-ep93xx/ts72xx.c
> > @@ -18,8 +18,10 @@
> >  #include <linux/io.h>
> >  #include <linux/mtd/rawnand.h>
> >  #include <linux/mtd/partitions.h>
> > +#include <linux/amba/bus.h>
> >  
> >  #include <mach/hardware.h>
> > +#include <mach/irqs.h>
> >  
> >  #include <asm/mach-types.h>
> >  #include <asm/mach/map.h>
> > @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems
> > TS-72xx SBC") .init_late	= ep93xx_init_late,
> >  	.restart	= ep93xx_restart,
> >  MACHINE_END
> > +
> > +/*************************************************************************
> > + * BK3 support code
> > +
> > *************************************************************************/
> > +static struct mtd_partition bk3_nand_parts[] = {
> > +	{
> > +		.name		= "System",
> > +		.offset	= 0x00000000,  
> 
> I see the above and below lines as unaligned

This is strange.... I'm using emacs with extension to have coding style
for kernel.

Probably tabs get unaligned...

> 
> > +		.size		= 0x01e00000,
> > +	}, {
> > +		.name		= "Data",
> > +		.offset	= 0x01e00000,  
> 
> same here
> 
> > +		.size		= 0x05f20000
> > +	}, {
> > +		.name		= "RedBoot",
> > +		.offset	= 0x07d20000,  
> 
> same here
> 
> > +		.size		= 0x002e0000,
> > +		.mask_flags	= MTD_WRITEABLE,	/*
> > force RO */
> > +	},
> > +};
> > +
> > +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> > +		       { IRQ_EP93XX_SAI }, NULL);
> > +
> > +static struct map_desc bk3_io_desc[] __initdata = {
> > +	{
> > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > +		.pfn		=
> > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > +		.length	= BK3_CPLDVER_SIZE,  
> 
> same here
> 
> > +		.type		= MT_DEVICE,
> > +	}
> > +};
> > +
> > +static void __init bk3_map_io(void)
> > +{
> > +	ts72xx_common_map_io();
> > +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> > +}
> > +
> > +static void __init bk3_init_machine(void)
> > +{
> > +	ep93xx_init_devices();
> > +
> > +	ts72xx_register_flash(bk3_nand_parts,
> > ARRAY_SIZE(bk3_nand_parts),
> > +			      EP93XX_CS6_PHYS_BASE);
> > +
> > +	platform_device_register(&ts72xx_wdt_device);
> > +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> > +
> > +	amba_device_register(&i2s1_device, &iomem_resource);
> > +}
> > +
> > +MACHINE_START(BK3, "Liebherr controller BK3.1")
> > +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */  
> 
> Don't you want to add an entry to the MAINTAINERS file instead?
> Then get_maintainer.pl would be able to suggest your email.

Yes. This would be a good idea (I've followed the "style" of other
boards in the mach-ep93xx directory).

I will fix that ....... and send v3 with included some extra code - as
I've found and fixed several issues since last posting.

Anyway, many thanks for review. 

> 
> > +	.atag_offset	= 0x100,
> > +	.map_io	= bk3_map_io,  
> 
> again, inconsistent alignment...

Even more..... checkpatch.pl did not complained....

> 
> > +	.init_irq	= ep93xx_init_irq,
> > +	.init_time	= ep93xx_timer_init,
> > +	.init_machine	= bk3_init_machine,
> > +	.init_late	= ep93xx_init_late,
> > +	.restart	= ep93xx_restart,
> > +MACHINE_END
> > diff --git a/arch/arm/mach-ep93xx/ts72xx.h
> > b/arch/arm/mach-ep93xx/ts72xx.h index d9ff04db3221..d3165bb9ee78
> > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.h
> > +++ b/arch/arm/mach-ep93xx/ts72xx.h
> > @@ -45,6 +45,11 @@
> >  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
> >  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
> >  
> > +/* BK3 specific defines */
> > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > +#define BK3_CPLDVER_SIZE		0x00001000
> > +
> >  #ifndef __ASSEMBLY__
> >  
> >  static inline int ts72xx_model(void)
> > diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> > index a9313b66f770..4eac94c1eb6f 100644
> > --- a/arch/arm/tools/mach-types
> > +++ b/arch/arm/tools/mach-types
> > @@ -345,6 +345,7 @@ mxlads
> > MACH_MXLADS		MXLADS			1851
> > linkstation_mini	MACH_LINKSTATION_MINI
> > LINKSTATION_MINI	1858 afeb9260
> > MACH_AFEB9260		AFEB9260		1859
> > imx27ipcam		MACH_IMX27IPCAM
> > IMX27IPCAM		1871 +bk3
> > MACH_BK3		BK3			1880
> > rd88f6183ap_ge		MACH_RD88F6183AP_GE
> > RD88F6183AP_GE		1894 realview_pba8
> > MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
> > realview_pbx		MACH_REALVIEW_PBX
> > REALVIEW_PBX		1901  



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171129/1e13ddbe/attachment.sig>

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

* Re: [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-29 22:07         ` Lukasz Majewski
@ 2017-11-30  0:26           ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:26 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Arnd Bergmann, arndbergmann, Hartley Sweeten, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

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

On Wed, 29 Nov 2017 23:07:04 +0100
Lukasz Majewski <lukma@denx.de> wrote:

> Hi Alexander,
> 
> > Hello Lukasz,
> > 
> > some nitpicking below...
> > 
> > On 21/11/17 15:32, Lukasz Majewski wrote:  
> > > The BK3 board is a derivative of the ts72xx reference design.
> > > 
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > > Changes for v2:
> > > - Place bk3 support code to the ts72xx.c file
> > > ---
> > >  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
> > >  arch/arm/mach-ep93xx/ts72xx.c | 64
> > > +++++++++++++++++++++++++++++++++++++++++++
> > > arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
> > > arch/arm/tools/mach-types     |  1 + 4 files changed, 77
> > > insertions(+)
> > > 
> > > diff --git a/arch/arm/mach-ep93xx/Kconfig
> > > b/arch/arm/mach-ep93xx/Kconfig index 61a75ca3684e..c095236d7ff8
> > > 100644 --- a/arch/arm/mach-ep93xx/Kconfig
> > > +++ b/arch/arm/mach-ep93xx/Kconfig
> > > @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
> > >  	  Say 'Y' here if you want your kernel to support the ADS
> > >  	  Sphere board.
> > >  
> > > +config MACH_BK3
> > > +	bool "Support Liebherr BK3.1"
> > > +	select MACH_TS72XX
> > > +	help
> > > +	  Say 'Y' here if you want your kernel to support the
> > > +	  Liebherr controller BK3.1.
> > > +
> > >  config MACH_EDB93XX
> > >  	bool
> > >  
> > > diff --git a/arch/arm/mach-ep93xx/ts72xx.c
> > > b/arch/arm/mach-ep93xx/ts72xx.c index 2e8fcc6e87b6..0de19b136ad0
> > > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c
> > > +++ b/arch/arm/mach-ep93xx/ts72xx.c
> > > @@ -18,8 +18,10 @@
> > >  #include <linux/io.h>
> > >  #include <linux/mtd/rawnand.h>
> > >  #include <linux/mtd/partitions.h>
> > > +#include <linux/amba/bus.h>
> > >  
> > >  #include <mach/hardware.h>
> > > +#include <mach/irqs.h>
> > >  
> > >  #include <asm/mach-types.h>
> > >  #include <asm/mach/map.h>
> > > @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems
> > > TS-72xx SBC") .init_late	= ep93xx_init_late,
> > >  	.restart	= ep93xx_restart,
> > >  MACHINE_END
> > > +
> > > +/*************************************************************************
> > > + * BK3 support code
> > > +
> > > *************************************************************************/
> > > +static struct mtd_partition bk3_nand_parts[] = {
> > > +	{
> > > +		.name		= "System",
> > > +		.offset	= 0x00000000,    
> > 
> > I see the above and below lines as unaligned  
> 
> This is strange.... I'm using emacs with extension to have coding
> style for kernel.
> 
> Probably tabs get unaligned...
> 
> >   
> > > +		.size		= 0x01e00000,
> > > +	}, {
> > > +		.name		= "Data",
> > > +		.offset	= 0x01e00000,    
> > 
> > same here
> >   
> > > +		.size		= 0x05f20000
> > > +	}, {
> > > +		.name		= "RedBoot",
> > > +		.offset	= 0x07d20000,    
> > 
> > same here
> >   
> > > +		.size		= 0x002e0000,
> > > +		.mask_flags	= MTD_WRITEABLE,	/*
> > > force RO */
> > > +	},
> > > +};
> > > +
> > > +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> > > +		       { IRQ_EP93XX_SAI }, NULL);
> > > +
> > > +static struct map_desc bk3_io_desc[] __initdata = {
> > > +	{
> > > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > > +		.pfn		=
> > > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > > +		.length	= BK3_CPLDVER_SIZE,    
> > 
> > same here
> >   
> > > +		.type		= MT_DEVICE,
> > > +	}
> > > +};
> > > +
> > > +static void __init bk3_map_io(void)
> > > +{
> > > +	ts72xx_common_map_io();
> > > +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> > > +}
> > > +
> > > +static void __init bk3_init_machine(void)
> > > +{
> > > +	ep93xx_init_devices();
> > > +
> > > +	ts72xx_register_flash(bk3_nand_parts,
> > > ARRAY_SIZE(bk3_nand_parts),
> > > +			      EP93XX_CS6_PHYS_BASE);
> > > +
> > > +	platform_device_register(&ts72xx_wdt_device);
> > > +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> > > +
> > > +	amba_device_register(&i2s1_device, &iomem_resource);
> > > +}
> > > +
> > > +MACHINE_START(BK3, "Liebherr controller BK3.1")
> > > +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */    
> > 
> > Don't you want to add an entry to the MAINTAINERS file instead?
> > Then get_maintainer.pl would be able to suggest your email.  
> 
> Yes. This would be a good idea (I've followed the "style" of other
> boards in the mach-ep93xx directory).
> 
> I will fix that ....... and send v3 with included some extra code - as
> I've found and fixed several issues since last posting.
> 
> Anyway, many thanks for review. 
> 
> >   
> > > +	.atag_offset	= 0x100,
> > > +	.map_io	= bk3_map_io,    
> > 
> > again, inconsistent alignment...  
> 
> Even more..... checkpatch.pl did not complained....

I've double checked - this misalignment seems to be only in e-mail.

In the ts72xx.c file it is all "tabifi'ed".

(and no checkpatch errors).

> 
> >   
> > > +	.init_irq	= ep93xx_init_irq,
> > > +	.init_time	= ep93xx_timer_init,
> > > +	.init_machine	= bk3_init_machine,
> > > +	.init_late	= ep93xx_init_late,
> > > +	.restart	= ep93xx_restart,
> > > +MACHINE_END
> > > diff --git a/arch/arm/mach-ep93xx/ts72xx.h
> > > b/arch/arm/mach-ep93xx/ts72xx.h index d9ff04db3221..d3165bb9ee78
> > > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.h
> > > +++ b/arch/arm/mach-ep93xx/ts72xx.h
> > > @@ -45,6 +45,11 @@
> > >  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
> > >  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
> > >  
> > > +/* BK3 specific defines */
> > > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > > +#define BK3_CPLDVER_SIZE		0x00001000
> > > +
> > >  #ifndef __ASSEMBLY__
> > >  
> > >  static inline int ts72xx_model(void)
> > > diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> > > index a9313b66f770..4eac94c1eb6f 100644
> > > --- a/arch/arm/tools/mach-types
> > > +++ b/arch/arm/tools/mach-types
> > > @@ -345,6 +345,7 @@ mxlads
> > > MACH_MXLADS		MXLADS			1851
> > > linkstation_mini	MACH_LINKSTATION_MINI
> > > LINKSTATION_MINI	1858 afeb9260
> > > MACH_AFEB9260		AFEB9260		1859
> > > imx27ipcam		MACH_IMX27IPCAM
> > > IMX27IPCAM		1871 +bk3
> > > MACH_BK3		BK3			1880
> > > rd88f6183ap_ge		MACH_RD88F6183AP_GE
> > > RD88F6183AP_GE		1894 realview_pba8
> > > MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
> > > realview_pbx		MACH_REALVIEW_PBX
> > > REALVIEW_PBX		1901    
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-30  0:26           ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 29 Nov 2017 23:07:04 +0100
Lukasz Majewski <lukma@denx.de> wrote:

> Hi Alexander,
> 
> > Hello Lukasz,
> > 
> > some nitpicking below...
> > 
> > On 21/11/17 15:32, Lukasz Majewski wrote:  
> > > The BK3 board is a derivative of the ts72xx reference design.
> > > 
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > > Changes for v2:
> > > - Place bk3 support code to the ts72xx.c file
> > > ---
> > >  arch/arm/mach-ep93xx/Kconfig  |  7 +++++
> > >  arch/arm/mach-ep93xx/ts72xx.c | 64
> > > +++++++++++++++++++++++++++++++++++++++++++
> > > arch/arm/mach-ep93xx/ts72xx.h |  5 ++++
> > > arch/arm/tools/mach-types     |  1 + 4 files changed, 77
> > > insertions(+)
> > > 
> > > diff --git a/arch/arm/mach-ep93xx/Kconfig
> > > b/arch/arm/mach-ep93xx/Kconfig index 61a75ca3684e..c095236d7ff8
> > > 100644 --- a/arch/arm/mach-ep93xx/Kconfig
> > > +++ b/arch/arm/mach-ep93xx/Kconfig
> > > @@ -21,6 +21,13 @@ config MACH_ADSSPHERE
> > >  	  Say 'Y' here if you want your kernel to support the ADS
> > >  	  Sphere board.
> > >  
> > > +config MACH_BK3
> > > +	bool "Support Liebherr BK3.1"
> > > +	select MACH_TS72XX
> > > +	help
> > > +	  Say 'Y' here if you want your kernel to support the
> > > +	  Liebherr controller BK3.1.
> > > +
> > >  config MACH_EDB93XX
> > >  	bool
> > >  
> > > diff --git a/arch/arm/mach-ep93xx/ts72xx.c
> > > b/arch/arm/mach-ep93xx/ts72xx.c index 2e8fcc6e87b6..0de19b136ad0
> > > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c
> > > +++ b/arch/arm/mach-ep93xx/ts72xx.c
> > > @@ -18,8 +18,10 @@
> > >  #include <linux/io.h>
> > >  #include <linux/mtd/rawnand.h>
> > >  #include <linux/mtd/partitions.h>
> > > +#include <linux/amba/bus.h>
> > >  
> > >  #include <mach/hardware.h>
> > > +#include <mach/irqs.h>
> > >  
> > >  #include <asm/mach-types.h>
> > >  #include <asm/mach/map.h>
> > > @@ -261,3 +263,65 @@ MACHINE_START(TS72XX, "Technologic Systems
> > > TS-72xx SBC") .init_late	= ep93xx_init_late,
> > >  	.restart	= ep93xx_restart,
> > >  MACHINE_END
> > > +
> > > +/*************************************************************************
> > > + * BK3 support code
> > > +
> > > *************************************************************************/
> > > +static struct mtd_partition bk3_nand_parts[] = {
> > > +	{
> > > +		.name		= "System",
> > > +		.offset	= 0x00000000,    
> > 
> > I see the above and below lines as unaligned  
> 
> This is strange.... I'm using emacs with extension to have coding
> style for kernel.
> 
> Probably tabs get unaligned...
> 
> >   
> > > +		.size		= 0x01e00000,
> > > +	}, {
> > > +		.name		= "Data",
> > > +		.offset	= 0x01e00000,    
> > 
> > same here
> >   
> > > +		.size		= 0x05f20000
> > > +	}, {
> > > +		.name		= "RedBoot",
> > > +		.offset	= 0x07d20000,    
> > 
> > same here
> >   
> > > +		.size		= 0x002e0000,
> > > +		.mask_flags	= MTD_WRITEABLE,	/*
> > > force RO */
> > > +	},
> > > +};
> > > +
> > > +static AMBA_APB_DEVICE(i2s1, "apb:i2s", 1, EP93XX_I2S_PHYS_BASE,
> > > +		       { IRQ_EP93XX_SAI }, NULL);
> > > +
> > > +static struct map_desc bk3_io_desc[] __initdata = {
> > > +	{
> > > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > > +		.pfn		=
> > > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > > +		.length	= BK3_CPLDVER_SIZE,    
> > 
> > same here
> >   
> > > +		.type		= MT_DEVICE,
> > > +	}
> > > +};
> > > +
> > > +static void __init bk3_map_io(void)
> > > +{
> > > +	ts72xx_common_map_io();
> > > +	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
> > > +}
> > > +
> > > +static void __init bk3_init_machine(void)
> > > +{
> > > +	ep93xx_init_devices();
> > > +
> > > +	ts72xx_register_flash(bk3_nand_parts,
> > > ARRAY_SIZE(bk3_nand_parts),
> > > +			      EP93XX_CS6_PHYS_BASE);
> > > +
> > > +	platform_device_register(&ts72xx_wdt_device);
> > > +	ep93xx_register_eth(&ts72xx_eth_data, 1);
> > > +
> > > +	amba_device_register(&i2s1_device, &iomem_resource);
> > > +}
> > > +
> > > +MACHINE_START(BK3, "Liebherr controller BK3.1")
> > > +	/* Maintainer: Lukasz Majewski <lukma@denx.de> */    
> > 
> > Don't you want to add an entry to the MAINTAINERS file instead?
> > Then get_maintainer.pl would be able to suggest your email.  
> 
> Yes. This would be a good idea (I've followed the "style" of other
> boards in the mach-ep93xx directory).
> 
> I will fix that ....... and send v3 with included some extra code - as
> I've found and fixed several issues since last posting.
> 
> Anyway, many thanks for review. 
> 
> >   
> > > +	.atag_offset	= 0x100,
> > > +	.map_io	= bk3_map_io,    
> > 
> > again, inconsistent alignment...  
> 
> Even more..... checkpatch.pl did not complained....

I've double checked - this misalignment seems to be only in e-mail.

In the ts72xx.c file it is all "tabifi'ed".

(and no checkpatch errors).

> 
> >   
> > > +	.init_irq	= ep93xx_init_irq,
> > > +	.init_time	= ep93xx_timer_init,
> > > +	.init_machine	= bk3_init_machine,
> > > +	.init_late	= ep93xx_init_late,
> > > +	.restart	= ep93xx_restart,
> > > +MACHINE_END
> > > diff --git a/arch/arm/mach-ep93xx/ts72xx.h
> > > b/arch/arm/mach-ep93xx/ts72xx.h index d9ff04db3221..d3165bb9ee78
> > > 100644 --- a/arch/arm/mach-ep93xx/ts72xx.h
> > > +++ b/arch/arm/mach-ep93xx/ts72xx.h
> > > @@ -45,6 +45,11 @@
> > >  #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
> > >  #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
> > >  
> > > +/* BK3 specific defines */
> > > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > > +#define BK3_CPLDVER_SIZE		0x00001000
> > > +
> > >  #ifndef __ASSEMBLY__
> > >  
> > >  static inline int ts72xx_model(void)
> > > diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
> > > index a9313b66f770..4eac94c1eb6f 100644
> > > --- a/arch/arm/tools/mach-types
> > > +++ b/arch/arm/tools/mach-types
> > > @@ -345,6 +345,7 @@ mxlads
> > > MACH_MXLADS		MXLADS			1851
> > > linkstation_mini	MACH_LINKSTATION_MINI
> > > LINKSTATION_MINI	1858 afeb9260
> > > MACH_AFEB9260		AFEB9260		1859
> > > imx27ipcam		MACH_IMX27IPCAM
> > > IMX27IPCAM		1871 +bk3
> > > MACH_BK3		BK3			1880
> > > rd88f6183ap_ge		MACH_RD88F6183AP_GE
> > > RD88F6183AP_GE		1894 realview_pba8
> > > MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
> > > realview_pbx		MACH_REALVIEW_PBX
> > > REALVIEW_PBX		1901    
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171130/1b620095/attachment.sig>

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

* [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-30  0:45   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 6/6)

This series applies on top of v4.14

Lukasz Majewski (6):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 222 +++++++++++++++++++++++++++++++++++-------
 arch/arm/mach-ep93xx/ts72xx.h |   9 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 211 insertions(+), 34 deletions(-)

-- 
2.11.0

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

* [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-30  0:45   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 6/6)

This series applies on top of v4.14

Lukasz Majewski (6):
  ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 222 +++++++++++++++++++++++++++++++++++-------
 arch/arm/mach-ep93xx/ts72xx.h |   9 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 211 insertions(+), 34 deletions(-)

-- 
2.11.0

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

* [PATCH v3 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH v3 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

This commit cleans up the code by using dedicated macros instead of
full definitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 8745162ec05d..06345b85f27c 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {
 };
 
 static struct resource ts72xx_wdt_resources[] = {
-	{
-		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
-		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= TS72XX_WDT_FEED_PHYS_BASE,
-		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
+	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
 };
 
 static struct platform_device ts72xx_wdt_device = {
@@ -216,11 +208,7 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 #define TS73XX_FPGA_LOADER_BASE		0x03c00000
 
 static struct resource ts73xx_fpga_resources[] = {
-	{
-		.start	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE,
-		.end	= EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE + 1,
-		.flags	= IORESOURCE_MEM,
-	},
+	DEFINE_RES_MEM(EP93XX_CS1_PHYS_BASE + TS73XX_FPGA_LOADER_BASE, 0x01),
 };
 
 static struct platform_device ts73xx_fpga_device = {
-- 
2.11.0

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

* [PATCH v3 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index b89850f1a965..d9ff04db3221 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v3 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index b89850f1a965..d9ff04db3221 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -86,3 +89,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v3 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..00e0e5b8babf 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v3 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 06345b85f27c..00e0e5b8babf 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -120,8 +120,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -145,8 +143,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -154,16 +152,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v3 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 00e0e5b8babf..a6e473b3dcf6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v3 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 00e0e5b8babf..a6e473b3dcf6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -30,11 +30,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index a6e473b3dcf6..2e8fcc6e87b6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -28,6 +28,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -189,6 +192,9 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
 static struct resource ts72xx_wdt_resources[] = {
 	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
 	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
@@ -201,10 +207,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.resource	= ts72xx_wdt_resources,
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
---
 arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index a6e473b3dcf6..2e8fcc6e87b6 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -28,6 +28,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -189,6 +192,9 @@ static struct platform_device ts72xx_rtc_device = {
 	.num_resources 	= ARRAY_SIZE(ts72xx_rtc_resources),
 };
 
+/*************************************************************************
+ * WATCHDOG
+ *************************************************************************/
 static struct resource ts72xx_wdt_resources[] = {
 	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
 	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
@@ -201,10 +207,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.resource	= ts72xx_wdt_resources,
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v3 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  0:45     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file

Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 149 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 168 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2811a211632c..470856b74832 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1255,6 +1255,12 @@ L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 2e8fcc6e87b6..54704858a072 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,8 +18,16 @@
 #include <linux/io.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
+#include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -215,6 +223,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -261,3 +332,81 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+				ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d9ff04db3221..d3165bb9ee78 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -45,6 +45,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* [PATCH v3 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-30  0:45     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30  0:45 UTC (permalink / raw)
  To: linux-arm-kernel

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file

Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 149 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 168 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2811a211632c..470856b74832 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1255,6 +1255,12 @@ L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 2e8fcc6e87b6..54704858a072 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -18,8 +18,16 @@
 #include <linux/io.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
+#include <linux/amba/bus.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
+#include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -215,6 +223,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -261,3 +332,81 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+				ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index d9ff04db3221..d3165bb9ee78 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -45,6 +45,11 @@
 #define TS72XX_WDT_CONTROL_PHYS_BASE	0x23800000
 #define TS72XX_WDT_FEED_PHYS_BASE	0x23c00000
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* Re: [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-29 22:07         ` Lukasz Majewski
@ 2017-11-30  7:07           ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-30  7:07 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Arnd Bergmann, arndbergmann, Hartley Sweeten, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

Hello Lukasz,

On Wed, 29 Nov 2017 23:07:04 +0100
Lukasz Majewski <lukma@denx.de> wrote:

> > > +/*************************************************************************
> > > + * BK3 support code
> > > +
> > > *************************************************************************/
> > > +static struct mtd_partition bk3_nand_parts[] = {
> > > +	{
> > > +		.name		= "System",
> > > +		.offset	= 0x00000000,  
> > 
> > I see the above and below lines as unaligned
> 
> This is strange.... I'm using emacs with extension to have coding style
> for kernel.
> 
> Probably tabs get unaligned...

Yes, seems that they are.

[...]

> > 
> > > +	.atag_offset	= 0x100,
> > > +	.map_io	= bk3_map_io,  
> > 
> > again, inconsistent alignment...
> 
> Even more..... checkpatch.pl did not complained....

checkpatch.pl wouldn't complain, as there are basically two styles,
some people do not align the individual assignments in the structures at all.
But I was quite confident in the beginning and now even applied your v3 to
the code. And indeed it's unaligned... I even checked with emacs. Still
unaligned.

-- 
Alexander Sverdlin.

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

* [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-30  7:07           ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-30  7:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Lukasz,

On Wed, 29 Nov 2017 23:07:04 +0100
Lukasz Majewski <lukma@denx.de> wrote:

> > > +/*************************************************************************
> > > + * BK3 support code
> > > +
> > > *************************************************************************/
> > > +static struct mtd_partition bk3_nand_parts[] = {
> > > +	{
> > > +		.name		= "System",
> > > +		.offset	= 0x00000000,  
> > 
> > I see the above and below lines as unaligned
> 
> This is strange.... I'm using emacs with extension to have coding style
> for kernel.
> 
> Probably tabs get unaligned...

Yes, seems that they are.

[...]

> > 
> > > +	.atag_offset	= 0x100,
> > > +	.map_io	= bk3_map_io,  
> > 
> > again, inconsistent alignment...
> 
> Even more..... checkpatch.pl did not complained....

checkpatch.pl wouldn't complain, as there are basically two styles,
some people do not align the individual assignments in the structures at all.
But I was quite confident in the beginning and now even applied your v3 to
the code. And indeed it's unaligned... I even checked with emacs. Still
unaligned.

-- 
Alexander Sverdlin.

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

* Re: [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-30  0:45   ` Lukasz Majewski
@ 2017-11-30  9:02     ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-30  9:02 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson, Linus Walleij

On Thu, Nov 30, 2017 at 1:45 AM, Lukasz Majewski <lukma@denx.de> wrote:
> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>
> This series applies on top of v4.14

Can we clarify who is picking up ep93xx patches these days? The
last time I think Linus Walleij offered to do it for the 4.14 merge window,
as neither Hartley nor Alexander had a git tree.

I don't care too much who does it in the end, between Hartley, Alexander,
Linus and even Lukasz directly, but I'd like whoever feels responsible
for the platform to be listed in the MAINTAINERS file and pick up
the patches from everyone else to forward them to me as either
pull requests or separate patches to arm@kernel.org when the
patches are ready, so I don't have to make a decision about when to
pick them up from the list.

        Arnd

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

* [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-30  9:02     ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-30  9:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 30, 2017 at 1:45 AM, Lukasz Majewski <lukma@denx.de> wrote:
> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>
> This series applies on top of v4.14

Can we clarify who is picking up ep93xx patches these days? The
last time I think Linus Walleij offered to do it for the 4.14 merge window,
as neither Hartley nor Alexander had a git tree.

I don't care too much who does it in the end, between Hartley, Alexander,
Linus and even Lukasz directly, but I'd like whoever feels responsible
for the platform to be listed in the MAINTAINERS file and pick up
the patches from everyone else to forward them to me as either
pull requests or separate patches to arm at kernel.org when the
patches are ready, so I don't have to make a decision about when to
pick them up from the list.

        Arnd

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

* [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-30  9:02     ` Arnd Bergmann
  (?)
@ 2017-11-30  9:57     ` Alexander Sverdlin
  2017-11-30 10:44         ` Arnd Bergmann
  -1 siblings, 1 reply; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-30  9:57 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Arnd!

On Thu Nov 30 10:02:26 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> Can we clarify who is picking up ep93xx patches these days? The
> last time I think Linus Walleij offered to do it for the 4.14 merge
> window, as neither Hartley nor Alexander had a git tree.
> 
> I don't care too much who does it in the end, between Hartley, Alexander,
> Linus and even Lukasz directly, but I'd like whoever feels responsible
> for the platform to be listed in the MAINTAINERS file and pick up
> the patches from everyone else to forward them to me as either
> pull requests or separate patches to arm at kernel.org when the
> patches are ready, so I don't have to make a decision about when to
> pick them up from the list.

As I stepped in as a maintainer there was a common understanding, that ep93xx is so inactive these days, that is doesn't deserve a separate tree. But I feel also that we will benefit from one, so let me create one this evening and I'll send you pull request when we agree with Lukasz. Just let me know if you'd be fine with github or should I care about kernel.org?

--
Regards,
Alexander.

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

* Re: [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-30  9:57     ` Alexander Sverdlin
@ 2017-11-30 10:44         ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-30 10:44 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Lukasz Majewski, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson, Linus Walleij

On Thu, Nov 30, 2017 at 10:57 AM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> Hello Arnd!
>
> On Thu Nov 30 10:02:26 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> Can we clarify who is picking up ep93xx patches these days? The
>> last time I think Linus Walleij offered to do it for the 4.14 merge
>> window, as neither Hartley nor Alexander had a git tree.
>>
>> I don't care too much who does it in the end, between Hartley, Alexander,
>> Linus and even Lukasz directly, but I'd like whoever feels responsible
>> for the platform to be listed in the MAINTAINERS file and pick up
>> the patches from everyone else to forward them to me as either
>> pull requests or separate patches to arm@kernel.org when the
>> patches are ready, so I don't have to make a decision about when to
>> pick them up from the list.
>
> As I stepped in as a maintainer there was a common understanding, that
> ep93xx is so inactive these days, that is doesn't deserve a separate tree.
> But I feel also that we will benefit from one, so let me create one this
> evening and I'll send you pull request when we agree with Lukasz.
> Just let me know if you'd be fine with github or should I care about
> kernel.org?

Up to you. Normally I try to avoid github for more active trees, but
if you don't already have kernel.org account, it's probably not worth
the effort of getting one just for the few ep93xx patches. As I said,
we're probably also fine with picking up the patches individually,
as long as the process is clear to everyone, i.e. you pick up the
patches from any other contributors and notify them about the
status of their patches, and then you send them to arm@kernel.org
in whatever way makes most sense for you.

       Arnd

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

* [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-30 10:44         ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-11-30 10:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 30, 2017 at 10:57 AM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> Hello Arnd!
>
> On Thu Nov 30 10:02:26 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> Can we clarify who is picking up ep93xx patches these days? The
>> last time I think Linus Walleij offered to do it for the 4.14 merge
>> window, as neither Hartley nor Alexander had a git tree.
>>
>> I don't care too much who does it in the end, between Hartley, Alexander,
>> Linus and even Lukasz directly, but I'd like whoever feels responsible
>> for the platform to be listed in the MAINTAINERS file and pick up
>> the patches from everyone else to forward them to me as either
>> pull requests or separate patches to arm at kernel.org when the
>> patches are ready, so I don't have to make a decision about when to
>> pick them up from the list.
>
> As I stepped in as a maintainer there was a common understanding, that
> ep93xx is so inactive these days, that is doesn't deserve a separate tree.
> But I feel also that we will benefit from one, so let me create one this
> evening and I'll send you pull request when we agree with Lukasz.
> Just let me know if you'd be fine with github or should I care about
> kernel.org?

Up to you. Normally I try to avoid github for more active trees, but
if you don't already have kernel.org account, it's probably not worth
the effort of getting one just for the few ep93xx patches. As I said,
we're probably also fine with picking up the patches individually,
as long as the process is clear to everyone, i.e. you pick up the
patches from any other contributors and notify them about the
status of their patches, and then you send them to arm at kernel.org
in whatever way makes most sense for you.

       Arnd

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

* RE: [PATCH v3 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
  2017-11-30  0:45     ` Lukasz Majewski
@ 2017-11-30 16:59       ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 16:59 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This commit cleans up the code by using dedicated macros instead of full definitions.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

<snip>

> @@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {  };
 >
>  static struct resource ts72xx_wdt_resources[] = {
> -	{
> -		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
> -		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	{
> -		.start	= TS72XX_WDT_FEED_PHYS_BASE,
> -		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
> +	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
>  };
 
Lukasz,

The chunk above is already cleaned up in linux-next by:

commit 97c3bca922468996c864917c9a8ea6a410233985
ARM: ep93xx: tidy up TS-72xx Watchdog resources

Can you please rebase this series against linux-next?

I'm reviewing the rest of the series now and will reply with any other issues.

Thanks,
Hartley

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

* [PATCH v3 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable
@ 2017-11-30 16:59       ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 16:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This commit cleans up the code by using dedicated macros instead of full definitions.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

<snip>

> @@ -187,16 +187,8 @@ static struct platform_device ts72xx_rtc_device = {  };
 >
>  static struct resource ts72xx_wdt_resources[] = {
> -	{
> -		.start	= TS72XX_WDT_CONTROL_PHYS_BASE,
> -		.end	= TS72XX_WDT_CONTROL_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> -	{
> -		.start	= TS72XX_WDT_FEED_PHYS_BASE,
> -		.end	= TS72XX_WDT_FEED_PHYS_BASE + SZ_4K - 1,
> -		.flags	= IORESOURCE_MEM,
> -	},
> +	DEFINE_RES_MEM(TS72XX_WDT_CONTROL_PHYS_BASE, SZ_4K),
> +	DEFINE_RES_MEM(TS72XX_WDT_FEED_PHYS_BASE, SZ_4K),
>  };
 
Lukasz,

The chunk above is already cleaned up in linux-next by:

commit 97c3bca922468996c864917c9a8ea6a410233985
ARM: ep93xx: tidy up TS-72xx Watchdog resources

Can you please rebase this series against linux-next?

I'm reviewing the rest of the series now and will reply with any other issues.

Thanks,
Hartley

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

* RE: [PATCH v3 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-11-30  0:45     ` Lukasz Majewski
@ 2017-11-30 17:07       ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:07 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This commit extend the ts72xx_register_flash() to accept passed parameters, which makes it more reusable.
>
> Now it is possible to accept ep93xx flash start address and partitions.

<snip>

@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {  static void __init ts72xx_init_machine(void)  {

Lukasz,

The line above is corrupted in the patch and will not apply. Not sure what happened...

>  	ep93xx_init_devices();
> -	ts72xx_register_flash();
> +	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
> +			      is_ts9420_installed() ?
> +			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
>  	platform_device_register(&ts72xx_rtc_device);
>  	platform_device_register(&ts72xx_wdt_device);

Regards,
Hartley

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

* [PATCH v3 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-11-30 17:07       ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This commit extend the ts72xx_register_flash() to accept passed parameters, which makes it more reusable.
>
> Now it is possible to accept ep93xx flash start address and partitions.

<snip>

@@ -223,7 +217,9 @@ static struct platform_device ts73xx_fpga_device = {  static void __init ts72xx_init_machine(void)  {

Lukasz,

The line above is corrupted in the patch and will not apply. Not sure what happened...

>  	ep93xx_init_devices();
> -	ts72xx_register_flash();
> +	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
> +			      is_ts9420_installed() ?
> +			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
>  	platform_device_register(&ts72xx_rtc_device);
>  	platform_device_register(&ts72xx_wdt_device);

Regards,
Hartley

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

* RE: [PATCH v3 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  2017-11-30  0:45     ` Lukasz Majewski
@ 2017-11-30 17:11       ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:11 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> The map IO common code has been excluded to be reused by other ts72xx clones.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

<snip>

> arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 00e0e5b8babf..a6e473b3dcf6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -30,11 +30,6 @@
>  
>  static struct map_desc ts72xx_io_desc[] __initdata = {
>  	{
> -		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> -		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> -		.length		= TS72XX_MODEL_SIZE,
> -		.type		= MT_DEVICE,
> -	}, {
>  		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
>  		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
>  		.length		= TS72XX_OPTIONS_SIZE,
> @@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
>  	}
>  };
>  
> -static void __init ts72xx_map_io(void)
> +static struct map_desc ts72xx_common_io_desc[] __initdata = {
> +	{
> +		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> +		.length		= TS72XX_MODEL_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +void __init ts72xx_common_map_io(void)
>  {
>  	ep93xx_map_io();
> -	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +	iotable_init(ts72xx_common_io_desc, 

There is a trailing whitespace on the line above.

> +ARRAY_SIZE(ts72xx_common_io_desc));

This line is missing an indent.

>  }
 >
> +static void __init ts72xx_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc)); }
>  
>  /*************************************************************************
>   * NAND flash

Hartley

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

* [PATCH v3 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
@ 2017-11-30 17:11       ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> The map IO common code has been excluded to be reused by other ts72xx clones.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

<snip>

> arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 00e0e5b8babf..a6e473b3dcf6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -30,11 +30,6 @@
>  
>  static struct map_desc ts72xx_io_desc[] __initdata = {
>  	{
> -		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> -		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> -		.length		= TS72XX_MODEL_SIZE,
> -		.type		= MT_DEVICE,
> -	}, {
>  		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
>  		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
>  		.length		= TS72XX_OPTIONS_SIZE,
> @@ -47,12 +42,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
>  	}
>  };
>  
> -static void __init ts72xx_map_io(void)
> +static struct map_desc ts72xx_common_io_desc[] __initdata = {
> +	{
> +		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
> +		.length		= TS72XX_MODEL_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +
> +void __init ts72xx_common_map_io(void)
>  {
>  	ep93xx_map_io();
> -	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
> +	iotable_init(ts72xx_common_io_desc, 

There is a trailing whitespace on the line above.

> +ARRAY_SIZE(ts72xx_common_io_desc));

This line is missing an indent.

>  }
 >
> +static void __init ts72xx_map_io(void)
> +{
> +	ts72xx_common_map_io();
> +	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc)); }
>  
>  /*************************************************************************
>   * NAND flash

Hartley

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

* RE: [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-11-30  0:45     ` Lukasz Majewski
@ 2017-11-30 17:23       ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:23 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This patch extends readability of ts72xx.c code.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

This patch does not apply to linux-next.

> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index a6e473b3dcf6..2e8fcc6e87b6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -28,6 +28,9 @@
>  #include "soc.h"
>  #include "ts72xx.h"
>  
> +/**********************************************************************
> +***
> + * IO map
> + 
> +***********************************************************************
> +**/

There is also something funny with the patch. The lines above appear to be getting split incorrectly.

The same thing is seen in PATCH 6/6.

Please rebase the series against linux-next and I'll take another look at is.

Thanks,
Hartley

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

* [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-11-30 17:23       ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-11-30 17:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, November 29, 2017 5:45 PM, Lukasz Majewski wrote:
> This patch extends readability of ts72xx.c code.
>
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> Changes for v2:
> - New patch
> ---
>  arch/arm/mach-ep93xx/ts72xx.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

This patch does not apply to linux-next.

> diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index a6e473b3dcf6..2e8fcc6e87b6 100644
> --- a/arch/arm/mach-ep93xx/ts72xx.c
> +++ b/arch/arm/mach-ep93xx/ts72xx.c
> @@ -28,6 +28,9 @@
>  #include "soc.h"
>  #include "ts72xx.h"
>  
> +/**********************************************************************
> +***
> + * IO map
> + 
> +***********************************************************************
> +**/

There is also something funny with the patch. The lines above appear to be getting split incorrectly.

The same thing is seen in PATCH 6/6.

Please rebase the series against linux-next and I'll take another look at is.

Thanks,
Hartley

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

* Re: [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-11-30 17:23       ` Hartley Sweeten
@ 2017-11-30 20:01         ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-30 20:01 UTC (permalink / raw)
  To: Hartley Sweeten
  Cc: Lukasz Majewski, Arnd Bergmann, arndbergmann, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

Hello Hartley!

On Thu, 30 Nov 2017 17:23:02 +0000
Hartley Sweeten <HartleyS@visionengravers.com> wrote:

> > +/**********************************************************************
> > +***
> > + * IO map
> > + 
> > +***********************************************************************
> > +**/
> 
> There is also something funny with the patch. The lines above appear to be getting split incorrectly.

That's definitely not the case, I can apply the patch to 4.14 just fine and
there is no funny wrapping. But you are right about the rest, it should be
re-based.

-- 
Alexander Sverdlin.

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

* [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-11-30 20:01         ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-11-30 20:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Hartley!

On Thu, 30 Nov 2017 17:23:02 +0000
Hartley Sweeten <HartleyS@visionengravers.com> wrote:

> > +/**********************************************************************
> > +***
> > + * IO map
> > + 
> > +***********************************************************************
> > +**/
> 
> There is also something funny with the patch. The lines above appear to be getting split incorrectly.

That's definitely not the case, I can apply the patch to 4.14 just fine and
there is no funny wrapping. But you are right about the rest, it should be
re-based.

-- 
Alexander Sverdlin.

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

* [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-11-30 23:51   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 6/6)

This series applies on top of linux-next/master (next-20171130)

Lukasz Majewski (5):
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
 arch/arm/mach-ep93xx/ts72xx.h |   9 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 202 insertions(+), 19 deletions(-)

-- 
2.11.0

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

* [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-11-30 23:51   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 6/6)

This series applies on top of linux-next/master (next-20171130)

Lukasz Majewski (5):
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
 arch/arm/mach-ep93xx/ts72xx.h |   9 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 202 insertions(+), 19 deletions(-)

-- 
2.11.0

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

* [PATCH v4 1/5] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-11-30 23:51     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 8a3206a54b39..7b7490f10fa9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -83,3 +86,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v4 1/5] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-11-30 23:51     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 8a3206a54b39..7b7490f10fa9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -83,3 +86,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v4 2/5] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-11-30 23:51     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index f386ebae0163..141ae4c65a81 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -123,8 +123,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -148,8 +146,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -157,16 +155,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -257,7 +251,9 @@ static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v4 2/5] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-11-30 23:51     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index f386ebae0163..141ae4c65a81 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -123,8 +123,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -148,8 +146,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -157,16 +155,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -257,7 +251,9 @@ static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v4 3/5] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-11-30 23:51     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 141ae4c65a81..19b23c9a2efa 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -33,11 +33,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -50,12 +45,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v4 3/5] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
@ 2017-11-30 23:51     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

The map IO common code has been excluded to be reused by other ts72xx
clones.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 141ae4c65a81..19b23c9a2efa 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -33,11 +33,6 @@
 
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
-		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
-		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
-		.length		= TS72XX_MODEL_SIZE,
-		.type		= MT_DEVICE,
-	}, {
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS_PHYS_BASE),
 		.length		= TS72XX_OPTIONS_SIZE,
@@ -50,12 +45,26 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 	}
 };
 
-static void __init ts72xx_map_io(void)
+static struct map_desc ts72xx_common_io_desc[] __initdata = {
+	{
+		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_MODEL_PHYS_BASE),
+		.length		= TS72XX_MODEL_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+void __init ts72xx_common_map_io(void)
 {
 	ep93xx_map_io();
-	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+	iotable_init(ts72xx_common_io_desc, ARRAY_SIZE(ts72xx_common_io_desc));
 }
 
+static void __init ts72xx_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(ts72xx_io_desc, ARRAY_SIZE(ts72xx_io_desc));
+}
 
 /*************************************************************************
  * NAND flash
-- 
2.11.0

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

* [PATCH v4 4/5] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-11-30 23:51     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes to v4:
- Adjust the code to be applicable to linux-next/master
---
 arch/arm/mach-ep93xx/ts72xx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 19b23c9a2efa..cf269b5397e5 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -31,6 +31,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -210,10 +213,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v4 4/5] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-11-30 23:51     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes to v4:
- Adjust the code to be applicable to linux-next/master
---
 arch/arm/mach-ep93xx/ts72xx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 19b23c9a2efa..cf269b5397e5 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -31,6 +31,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_OPTIONS_VIRT_BASE,
@@ -210,10 +213,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-11-30 23:51     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
Changes for v4:
- Adjust the code to be applicable on top of linux-next/master
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 146 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 165 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4149cd992825..2fc98b40268d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1254,6 +1254,12 @@ L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index cf269b5397e5..de3be5e3bee7 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -19,10 +19,15 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
 #include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/gpio-ep93xx.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -221,6 +226,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -294,3 +362,81 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+			    ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 7b7490f10fa9..61410faa3785 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -42,6 +42,11 @@
 #define TS72XX_OPTIONS2_TS9420		0x04
 #define TS72XX_OPTIONS2_TS9420_BOOT	0x02
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-11-30 23:51     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-11-30 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
Changes for v4:
- Adjust the code to be applicable on top of linux-next/master
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 146 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 165 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4149cd992825..2fc98b40268d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1254,6 +1254,12 @@ L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index cf269b5397e5..de3be5e3bee7 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -19,10 +19,15 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
 #include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/gpio-ep93xx.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -221,6 +226,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -294,3 +362,81 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static struct map_desc bk3_io_desc[] __initdata = {
+	{
+		.virtual	= BK3_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
+		.length	= BK3_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
+	}
+};
+
+static void __init bk3_map_io(void)
+{
+	ts72xx_common_map_io();
+	iotable_init(bk3_io_desc, ARRAY_SIZE(bk3_io_desc));
+}
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+			    ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io	= bk3_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 7b7490f10fa9..61410faa3785 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -42,6 +42,11 @@
 #define TS72XX_OPTIONS2_TS9420		0x04
 #define TS72XX_OPTIONS2_TS9420_BOOT	0x02
 
+/* BK3 specific defines */
+#define BK3_CPLDVER_PHYS_BASE		0x23400000
+#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
+#define BK3_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* RE: [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-30 23:51   ` Lukasz Majewski
@ 2017-12-05 18:14     ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-05 18:14 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann,
	Linus Walleij (linus.walleij@linaro.org)
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson

On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>
> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>
> This series applies on top of linux-next/master (next-20171130)
>
> Lukasz Majewski (5):
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>
>  MAINTAINERS                   |   6 ++
>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>  arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
>  arch/arm/mach-ep93xx/ts72xx.h |   9 ++
>  arch/arm/tools/mach-types     |   1 +
>  5 files changed, 202 insertions(+), 19 deletions(-)

Looks good.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Linus,

Would you mind picking this series up?

Thanks,
Hartley

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

* [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-05 18:14     ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-05 18:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>
> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>
> This series applies on top of linux-next/master (next-20171130)
>
> Lukasz Majewski (5):
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>
>  MAINTAINERS                   |   6 ++
>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>  arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
>  arch/arm/mach-ep93xx/ts72xx.h |   9 ++
>  arch/arm/tools/mach-types     |   1 +
>  5 files changed, 202 insertions(+), 19 deletions(-)

Looks good.

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

Linus,

Would you mind picking this series up?

Thanks,
Hartley

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

* Re: [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-05 18:14     ` Hartley Sweeten
@ 2017-12-06 17:46       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-06 17:46 UTC (permalink / raw)
  To: Hartley Sweeten, Lukasz Majewski, Arnd Bergmann, arndbergmann,
	Linus Walleij (linus.walleij@linaro.org)
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson

Hello Hartley,

On 05/12/17 19:14, Hartley Sweeten wrote:
>> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>>
>> This patchset consists of following patches:
>>
>> - ts72xx.[c|h] cosmetic cleanup/improvement
>> - Rewrite ts72xx.c to be reusable by bk3
>> - The Liebherr's BK3 board has been added with re-using code of
>>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>>
>> This series applies on top of linux-next/master (next-20171130)
>>
>> Lukasz Majewski (5):
>>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>>     parameters
>>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>>
>>  MAINTAINERS                   |   6 ++
>>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>>  arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
>>  arch/arm/mach-ep93xx/ts72xx.h |   9 ++
>>  arch/arm/tools/mach-types     |   1 +
>>  5 files changed, 202 insertions(+), 19 deletions(-)
> Looks good.
> 
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

I can prepare pull request to Arnd, as we discussed previously, just
waited for your review.

Regards,
Alexander.

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

* [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-06 17:46       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-06 17:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Hartley,

On 05/12/17 19:14, Hartley Sweeten wrote:
>> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>>
>> This patchset consists of following patches:
>>
>> - ts72xx.[c|h] cosmetic cleanup/improvement
>> - Rewrite ts72xx.c to be reusable by bk3
>> - The Liebherr's BK3 board has been added with re-using code of
>>   ts72xx.c (detalied list of changes can be found in patch 6/6)
>>
>> This series applies on top of linux-next/master (next-20171130)
>>
>> Lukasz Majewski (5):
>>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>>     parameters
>>   ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable
>>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>>
>>  MAINTAINERS                   |   6 ++
>>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>>  arch/arm/mach-ep93xx/ts72xx.c | 198 ++++++++++++++++++++++++++++++++++++++----
>>  arch/arm/mach-ep93xx/ts72xx.h |   9 ++
>>  arch/arm/tools/mach-types     |   1 +
>>  5 files changed, 202 insertions(+), 19 deletions(-)
> Looks good.
> 
> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

I can prepare pull request to Arnd, as we discussed previously, just
waited for your review.

Regards,
Alexander.

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

* RE: [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-11-30 23:51     ` Lukasz Majewski
@ 2017-12-11 17:17       ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 17:17 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>
> The BK3 board is a derivative of the ts72xx reference design.

Lukasz,

I was just reviewing the other TS-72xx boards and noticed this:

<snip>

> +/* BK3 specific defines */
> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> +#define BK3_CPLDVER_SIZE		0x00001000
> +

<snip>

> +static struct map_desc bk3_io_desc[] __initdata = {
> +	{
> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> +		.length	= BK3_CPLDVER_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +

This register appears to be common to all the TS-72xx boards.

I don't think Arnd has pulled the series yet. Would you mind renaming the
defines and rebasing this patch? The BK3 board and other TS-72xx boards
can then have a common .map_io.

Thanks,
Hartley

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-12-11 17:17       ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 17:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>
> The BK3 board is a derivative of the ts72xx reference design.

Lukasz,

I was just reviewing the other TS-72xx boards and noticed this:

<snip>

> +/* BK3 specific defines */
> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> +#define BK3_CPLDVER_SIZE		0x00001000
> +

<snip>

> +static struct map_desc bk3_io_desc[] __initdata = {
> +	{
> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> +		.pfn		= __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> +		.length	= BK3_CPLDVER_SIZE,
> +		.type		= MT_DEVICE,
> +	}
> +};
> +

This register appears to be common to all the TS-72xx boards.

I don't think Arnd has pulled the series yet. Would you mind renaming the
defines and rebasing this patch? The BK3 board and other TS-72xx boards
can then have a common .map_io.

Thanks,
Hartley

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

* Re: [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-12-11 17:17       ` Hartley Sweeten
@ 2017-12-11 21:39         ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 21:39 UTC (permalink / raw)
  To: Hartley Sweeten
  Cc: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

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

Hi Hartley,

> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
> >
> > The BK3 board is a derivative of the ts72xx reference design.  
> 
> Lukasz,
> 
> I was just reviewing the other TS-72xx boards and noticed this:
> 
> <snip>
> 
> > +/* BK3 specific defines */
> > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > +#define BK3_CPLDVER_SIZE		0x00001000
> > +  
> 
> <snip>
> 
> > +static struct map_desc bk3_io_desc[] __initdata = {
> > +	{
> > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > +		.pfn		=
> > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > +		.length	= BK3_CPLDVER_SIZE,
> > +		.type		= MT_DEVICE,
> > +	}
> > +};
> > +  
> 
> This register appears to be common to all the TS-72xx boards.

The CPLD was used on the reference ts-72xx boards, but support for it
seems to not be present in the mainline kernel.

Do you have a ts72xx board with CPLD embedded? Is any of your design
using it?


My another concern - is it safe to perform IO mapping on memory regions
which are not used / specified? When I do a single ts72xx mapping - for
all boards - then we may end up with some mappings which are not needed.

With the code as it is - I only map regions which are already used on
relevant boards.

> 
> I don't think Arnd has pulled the series yet. Would you mind renaming
> the defines and rebasing this patch? 

If needed I can resend the patch series, or prepare a single fix patch.
No problem.

> The BK3 board and other TS-72xx
> boards can then have a common .map_io.
> 
> Thanks,
> Hartley
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-12-11 21:39         ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hartley,

> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
> >
> > The BK3 board is a derivative of the ts72xx reference design.  
> 
> Lukasz,
> 
> I was just reviewing the other TS-72xx boards and noticed this:
> 
> <snip>
> 
> > +/* BK3 specific defines */
> > +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> > +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> > +#define BK3_CPLDVER_SIZE		0x00001000
> > +  
> 
> <snip>
> 
> > +static struct map_desc bk3_io_desc[] __initdata = {
> > +	{
> > +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> > +		.pfn		=
> > __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> > +		.length	= BK3_CPLDVER_SIZE,
> > +		.type		= MT_DEVICE,
> > +	}
> > +};
> > +  
> 
> This register appears to be common to all the TS-72xx boards.

The CPLD was used on the reference ts-72xx boards, but support for it
seems to not be present in the mainline kernel.

Do you have a ts72xx board with CPLD embedded? Is any of your design
using it?


My another concern - is it safe to perform IO mapping on memory regions
which are not used / specified? When I do a single ts72xx mapping - for
all boards - then we may end up with some mappings which are not needed.

With the code as it is - I only map regions which are already used on
relevant boards.

> 
> I don't think Arnd has pulled the series yet. Would you mind renaming
> the defines and rebasing this patch? 

If needed I can resend the patch series, or prepare a single fix patch.
No problem.

> The BK3 board and other TS-72xx
> boards can then have a common .map_io.
> 
> Thanks,
> Hartley
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171211/0cfc9f29/attachment.sig>

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

* RE: [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-12-11 21:39         ` Lukasz Majewski
@ 2017-12-11 22:28           ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 22:28 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

On Monday, December 11, 2017 2:40 PM, Lukasz Majewski wrote:
> Hi Hartley,
>
>> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>>>
>>> The BK3 board is a derivative of the ts72xx reference design.  
>> 
>> Lukasz,
>> 
>> I was just reviewing the other TS-72xx boards and noticed this:
>> 
>> <snip>
>> 
>>> +/* BK3 specific defines */
>>> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
>>> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
>>> +#define BK3_CPLDVER_SIZE		0x00001000
>>> +  
>> 
>> <snip>
>> 
>>> +static struct map_desc bk3_io_desc[] __initdata = {
>>> +	{
>>> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
>>> +		.pfn		=
>>> __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
>>> +		.length	= BK3_CPLDVER_SIZE,
>>> +		.type		= MT_DEVICE,
>>> +	}
>>> +};
>>> +  
>> 
>> This register appears to be common to all the TS-72xx boards.
>
> The CPLD was used on the reference ts-72xx boards, but support for it seems
> to not be present in the mainline kernel.

The CPLD is not directly called out but some parts of it are supported in the mainline
kernel.

The RTC index and data registers are chip selected by the CPLD and Watchdog is in
the CPLD. Also, the model number, options, and options2 registers are in the CPLD.

There are a couple other registers in the CPLD that are not currently present in
mainline. Some aren't because I haven't figured a good way to utilize them (the
COM2 RS485 registers and the PC/104 memory/IO spaces) or they simply have not
been necessary yet (the two status registers). There are a couple listed in the manuals
that are specific to the TS-7260 that also have not been added.

Basically, anything in the EP93xx CS1 or CS2 memory region is in or controlled by the CPLD.

> Do you have a ts72xx board with CPLD embedded? Is any of your design using it?

I have a stock TS-7300 board.

> My another concern - is it safe to perform IO mapping on memory regions which are
> not used / specified?

The mapping is safe. If there is nothing at the address you just read back the static state
(noise) of the bus and writing doesn't do anything.

>  When I do a single ts72xx mapping - for all boards - then we may end up with some
> mappings which are not needed.

True, but it's harmless and it keeps the platform init code cleaner.

> With the code as it is - I only map regions which are already used on relevant boards.

Yes, but this register in particular exists in the CPLD on all the TS-72xx boards.

>> I don't think Arnd has pulled the series yet. Would you mind renaming 
>> the defines and rebasing this patch?
>
> If needed I can resend the patch series, or prepare a single fix patch.
> No problem.

Fixing it after Arnd merges your series is fine. I just wanted to make sure it was
pointed out.

BTW, is there a reason the BK3 board needs this register mapped? It was mapped
in the Technologic Systems 2.4, 2.6, and 3.x kernels but I never found anything that
used it. Of course the stock boards probably always had the same revision in the CPLD,
the BK3 board might have multiple revisions...

Hartley

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-12-11 22:28           ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 22:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, December 11, 2017 2:40 PM, Lukasz Majewski wrote:
> Hi Hartley,
>
>> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:
>>>
>>> The BK3 board is a derivative of the ts72xx reference design.  
>> 
>> Lukasz,
>> 
>> I was just reviewing the other TS-72xx boards and noticed this:
>> 
>> <snip>
>> 
>>> +/* BK3 specific defines */
>>> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
>>> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
>>> +#define BK3_CPLDVER_SIZE		0x00001000
>>> +  
>> 
>> <snip>
>> 
>>> +static struct map_desc bk3_io_desc[] __initdata = {
>>> +	{
>>> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
>>> +		.pfn		=
>>> __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
>>> +		.length	= BK3_CPLDVER_SIZE,
>>> +		.type		= MT_DEVICE,
>>> +	}
>>> +};
>>> +  
>> 
>> This register appears to be common to all the TS-72xx boards.
>
> The CPLD was used on the reference ts-72xx boards, but support for it seems
> to not be present in the mainline kernel.

The CPLD is not directly called out but some parts of it are supported in the mainline
kernel.

The RTC index and data registers are chip selected by the CPLD and Watchdog is in
the CPLD. Also, the model number, options, and options2 registers are in the CPLD.

There are a couple other registers in the CPLD that are not currently present in
mainline. Some aren't because I haven't figured a good way to utilize them (the
COM2 RS485 registers and the PC/104 memory/IO spaces) or they simply have not
been necessary yet (the two status registers). There are a couple listed in the manuals
that are specific to the TS-7260 that also have not been added.

Basically, anything in the EP93xx CS1 or CS2 memory region is in or controlled by the CPLD.

> Do you have a ts72xx board with CPLD embedded? Is any of your design using it?

I have a stock TS-7300 board.

> My another concern - is it safe to perform IO mapping on memory regions which are
> not used / specified?

The mapping is safe. If there is nothing at the address you just read back the static state
(noise) of the bus and writing doesn't do anything.

>  When I do a single ts72xx mapping - for all boards - then we may end up with some
> mappings which are not needed.

True, but it's harmless and it keeps the platform init code cleaner.

> With the code as it is - I only map regions which are already used on relevant boards.

Yes, but this register in particular exists in the CPLD on all the TS-72xx boards.

>> I don't think Arnd has pulled the series yet. Would you mind renaming 
>> the defines and rebasing this patch?
>
> If needed I can resend the patch series, or prepare a single fix patch.
> No problem.

Fixing it after Arnd merges your series is fine. I just wanted to make sure it was
pointed out.

BTW, is there a reason the BK3 board needs this register mapped? It was mapped
in the Technologic Systems 2.4, 2.6, and 3.x kernels but I never found anything that
used it. Of course the stock boards probably always had the same revision in the CPLD,
the BK3 board might have multiple revisions...

Hartley

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

* Re: [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-12-11 22:28           ` Hartley Sweeten
@ 2017-12-11 22:46             ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 22:46 UTC (permalink / raw)
  To: Hartley Sweeten
  Cc: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Russell King,
	linux-arm-kernel, linux-kernel, Olof Johansson, Linus Walleij

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

Hi Hartley,

> On Monday, December 11, 2017 2:40 PM, Lukasz Majewski wrote:
> > Hi Hartley,
> >  
> >> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:  
> >>>
> >>> The BK3 board is a derivative of the ts72xx reference design.    
> >> 
> >> Lukasz,
> >> 
> >> I was just reviewing the other TS-72xx boards and noticed this:
> >> 
> >> <snip>
> >>   
> >>> +/* BK3 specific defines */
> >>> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> >>> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> >>> +#define BK3_CPLDVER_SIZE		0x00001000
> >>> +    
> >> 
> >> <snip>
> >>   
> >>> +static struct map_desc bk3_io_desc[] __initdata = {
> >>> +	{
> >>> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> >>> +		.pfn		=
> >>> __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> >>> +		.length	= BK3_CPLDVER_SIZE,
> >>> +		.type		= MT_DEVICE,
> >>> +	}
> >>> +};
> >>> +    
> >> 
> >> This register appears to be common to all the TS-72xx boards.  
> >
> > The CPLD was used on the reference ts-72xx boards, but support for
> > it seems to not be present in the mainline kernel.  
> 
> The CPLD is not directly called out but some parts of it are
> supported in the mainline kernel.
> 
> The RTC index and data registers are chip selected by the CPLD and
> Watchdog is in the CPLD. Also, the model number, options, and
> options2 registers are in the CPLD.
> 
> There are a couple other registers in the CPLD that are not currently
> present in mainline. Some aren't because I haven't figured a good way
> to utilize them (the COM2 RS485 registers and the PC/104 memory/IO
> spaces) or they simply have not been necessary yet (the two status
> registers). There are a couple listed in the manuals that are
> specific to the TS-7260 that also have not been added.
> 
> Basically, anything in the EP93xx CS1 or CS2 memory region is in or
> controlled by the CPLD.
> 
> > Do you have a ts72xx board with CPLD embedded? Is any of your
> > design using it?  
> 
> I have a stock TS-7300 board.
> 
> > My another concern - is it safe to perform IO mapping on memory
> > regions which are not used / specified?  
> 
> The mapping is safe. If there is nothing at the address you just read
> back the static state (noise) of the bus and writing doesn't do
> anything.

Ok.

> 
> >  When I do a single ts72xx mapping - for all boards - then we may
> > end up with some mappings which are not needed.  
> 
> True, but it's harmless and it keeps the platform init code cleaner.

I will add all the mappings.

> 
> > With the code as it is - I only map regions which are already used
> > on relevant boards.  
> 
> Yes, but this register in particular exists in the CPLD on all the
> TS-72xx boards.
> 
> >> I don't think Arnd has pulled the series yet. Would you mind
> >> renaming the defines and rebasing this patch?  
> >
> > If needed I can resend the patch series, or prepare a single fix
> > patch. No problem.  
> 
> Fixing it after Arnd merges your series is fine. I just wanted to
> make sure it was pointed out.

I've checked a few minutes ago and it seems like arm-soc hasn't been
pulled to for-next.

I may resend the whole series.

> 
> BTW, is there a reason the BK3 board needs this register mapped? It
> was mapped in the Technologic Systems 2.4, 2.6, and 3.x kernels but I
> never found anything that used it.

It is used to check the version. BK3 has some CPLD modifications and
it is important to know which version we do have as the board is
already deployed for some time in the field.

> Of course the stock boards
> probably always had the same revision in the CPLD, the BK3 board
> might have multiple revisions...

Yes, correct.

> 
> Hartley



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-12-11 22:46             ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 22:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hartley,

> On Monday, December 11, 2017 2:40 PM, Lukasz Majewski wrote:
> > Hi Hartley,
> >  
> >> On Thursday, November 30, 2017 4:52 PM, Lukasz Majewski wrote:  
> >>>
> >>> The BK3 board is a derivative of the ts72xx reference design.    
> >> 
> >> Lukasz,
> >> 
> >> I was just reviewing the other TS-72xx boards and noticed this:
> >> 
> >> <snip>
> >>   
> >>> +/* BK3 specific defines */
> >>> +#define BK3_CPLDVER_PHYS_BASE		0x23400000
> >>> +#define BK3_CPLDVER_VIRT_BASE		0xfebfd000
> >>> +#define BK3_CPLDVER_SIZE		0x00001000
> >>> +    
> >> 
> >> <snip>
> >>   
> >>> +static struct map_desc bk3_io_desc[] __initdata = {
> >>> +	{
> >>> +		.virtual	= BK3_CPLDVER_VIRT_BASE,
> >>> +		.pfn		=
> >>> __phys_to_pfn(BK3_CPLDVER_PHYS_BASE),
> >>> +		.length	= BK3_CPLDVER_SIZE,
> >>> +		.type		= MT_DEVICE,
> >>> +	}
> >>> +};
> >>> +    
> >> 
> >> This register appears to be common to all the TS-72xx boards.  
> >
> > The CPLD was used on the reference ts-72xx boards, but support for
> > it seems to not be present in the mainline kernel.  
> 
> The CPLD is not directly called out but some parts of it are
> supported in the mainline kernel.
> 
> The RTC index and data registers are chip selected by the CPLD and
> Watchdog is in the CPLD. Also, the model number, options, and
> options2 registers are in the CPLD.
> 
> There are a couple other registers in the CPLD that are not currently
> present in mainline. Some aren't because I haven't figured a good way
> to utilize them (the COM2 RS485 registers and the PC/104 memory/IO
> spaces) or they simply have not been necessary yet (the two status
> registers). There are a couple listed in the manuals that are
> specific to the TS-7260 that also have not been added.
> 
> Basically, anything in the EP93xx CS1 or CS2 memory region is in or
> controlled by the CPLD.
> 
> > Do you have a ts72xx board with CPLD embedded? Is any of your
> > design using it?  
> 
> I have a stock TS-7300 board.
> 
> > My another concern - is it safe to perform IO mapping on memory
> > regions which are not used / specified?  
> 
> The mapping is safe. If there is nothing at the address you just read
> back the static state (noise) of the bus and writing doesn't do
> anything.

Ok.

> 
> >  When I do a single ts72xx mapping - for all boards - then we may
> > end up with some mappings which are not needed.  
> 
> True, but it's harmless and it keeps the platform init code cleaner.

I will add all the mappings.

> 
> > With the code as it is - I only map regions which are already used
> > on relevant boards.  
> 
> Yes, but this register in particular exists in the CPLD on all the
> TS-72xx boards.
> 
> >> I don't think Arnd has pulled the series yet. Would you mind
> >> renaming the defines and rebasing this patch?  
> >
> > If needed I can resend the patch series, or prepare a single fix
> > patch. No problem.  
> 
> Fixing it after Arnd merges your series is fine. I just wanted to
> make sure it was pointed out.

I've checked a few minutes ago and it seems like arm-soc hasn't been
pulled to for-next.

I may resend the whole series.

> 
> BTW, is there a reason the BK3 board needs this register mapped? It
> was mapped in the Technologic Systems 2.4, 2.6, and 3.x kernels but I
> never found anything that used it.

It is used to check the version. BK3 has some CPLD modifications and
it is important to know which version we do have as the board is
already deployed for some time in the field.

> Of course the stock boards
> probably always had the same revision in the CPLD, the BK3 board
> might have multiple revisions...

Yes, correct.

> 
> Hartley



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171211/4003dd39/attachment-0001.sig>

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-11-16 23:22 ` Lukasz Majewski
@ 2017-12-11 23:36   ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 4/4)

This series applies on top of linux-next/master (next-20171211)

Lukasz Majewski (4):
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 165 +++++++++++++++++++++++++++++++++++++++---
 arch/arm/mach-ep93xx/ts72xx.h |   9 +++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 176 insertions(+), 12 deletions(-)

-- 
2.11.0

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-11 23:36   ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: linux-arm-kernel

This patch series adds support for Liebherr's BK3 board, being
a derivative of TS72XX design.

This patchset consists of following patches:

- ts72xx.[c|h] cosmetic cleanup/improvement
- Rewrite ts72xx.c to be reusable by bk3
- The Liebherr's BK3 board has been added with re-using code of
  ts72xx.c (detalied list of changes can be found in patch 4/4)

This series applies on top of linux-next/master (next-20171211)

Lukasz Majewski (4):
  ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
    parameters
  ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative

 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 ++
 arch/arm/mach-ep93xx/ts72xx.c | 165 +++++++++++++++++++++++++++++++++++++++---
 arch/arm/mach-ep93xx/ts72xx.h |   9 +++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 176 insertions(+), 12 deletions(-)

-- 
2.11.0

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

* [PATCH v5 1/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-11 23:36     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 8a3206a54b39..7b7490f10fa9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -83,3 +86,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v5 1/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
@ 2017-12-11 23:36     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: linux-arm-kernel

This commit adds include file guards to ts72xx.h

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 8a3206a54b39..7b7490f10fa9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -12,6 +12,9 @@
  * febfd000	22800000	4K	options register #2
  */
 
+#ifndef __TS72XX_H_
+#define __TS72XX_H_
+
 #define TS72XX_MODEL_PHYS_BASE		0x22000000
 #define TS72XX_MODEL_VIRT_BASE		IOMEM(0xfebff000)
 #define TS72XX_MODEL_SIZE		0x00001000
@@ -83,3 +86,4 @@ static inline int is_ts9420_installed(void)
 					TS72XX_OPTIONS2_TS9420);
 }
 #endif
+#endif /* __TS72XX_H_ */
-- 
2.11.0

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

* [PATCH v5 2/4] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-11 23:36     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index f386ebae0163..141ae4c65a81 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -123,8 +123,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -148,8 +146,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -157,16 +155,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -257,7 +251,9 @@ static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v5 2/4] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters
@ 2017-12-11 23:36     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: linux-arm-kernel

This commit extend the ts72xx_register_flash() to accept passed parameters,
which makes it more reusable.

Now it is possible to accept ep93xx flash start address and partitions.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index f386ebae0163..141ae4c65a81 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -123,8 +123,6 @@ static struct platform_nand_data ts72xx_nand_data = {
 		.nr_chips	= 1,
 		.chip_offset	= 0,
 		.chip_delay	= 15,
-		.partitions	= ts72xx_nand_parts,
-		.nr_partitions	= ARRAY_SIZE(ts72xx_nand_parts),
 	},
 	.ctrl = {
 		.cmd_ctrl	= ts72xx_nand_hwcontrol,
@@ -148,8 +146,8 @@ static struct platform_device ts72xx_nand_flash = {
 	.num_resources		= ARRAY_SIZE(ts72xx_nand_resource),
 };
 
-
-static void __init ts72xx_register_flash(void)
+void __init ts72xx_register_flash(struct mtd_partition *parts, int n,
+				  resource_size_t start)
 {
 	/*
 	 * TS7200 has NOR flash all other TS72xx board have NAND flash.
@@ -157,16 +155,12 @@ static void __init ts72xx_register_flash(void)
 	if (board_is_ts7200()) {
 		ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
 	} else {
-		resource_size_t start;
-
-		if (is_ts9420_installed())
-			start = EP93XX_CS7_PHYS_BASE;
-		else
-			start = EP93XX_CS6_PHYS_BASE;
-
 		ts72xx_nand_resource[0].start = start;
 		ts72xx_nand_resource[0].end = start + SZ_16M - 1;
 
+		ts72xx_nand_data.chip.partitions = parts;
+		ts72xx_nand_data.chip.nr_partitions = n;
+
 		platform_device_register(&ts72xx_nand_flash);
 	}
 }
@@ -257,7 +251,9 @@ static struct ep93xx_spi_info ts72xx_spi_info __initdata = {
 static void __init ts72xx_init_machine(void)
 {
 	ep93xx_init_devices();
-	ts72xx_register_flash();
+	ts72xx_register_flash(ts72xx_nand_parts, ARRAY_SIZE(ts72xx_nand_parts),
+			      is_ts9420_installed() ?
+			      EP93XX_CS7_PHYS_BASE : EP93XX_CS6_PHYS_BASE);
 	platform_device_register(&ts72xx_rtc_device);
 	platform_device_register(&ts72xx_wdt_device);
 
-- 
2.11.0

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

* [PATCH v5 3/4] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-11 23:36     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes to v4:
- Adjust the code to be applicable to linux-next/master
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 141ae4c65a81..17af9d834b51 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -31,6 +31,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
@@ -201,10 +204,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v5 3/4] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
@ 2017-12-11 23:36     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: linux-arm-kernel

This patch extends readability of ts72xx.c code.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- New patch
Changes for v3:
- None
Changes to v4:
- Adjust the code to be applicable to linux-next/master
Changes for v5:
- None
---
 arch/arm/mach-ep93xx/ts72xx.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 141ae4c65a81..17af9d834b51 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -31,6 +31,9 @@
 #include "soc.h"
 #include "ts72xx.h"
 
+/*************************************************************************
+ * IO map
+ *************************************************************************/
 static struct map_desc ts72xx_io_desc[] __initdata = {
 	{
 		.virtual	= (unsigned long)TS72XX_MODEL_VIRT_BASE,
@@ -201,10 +204,16 @@ static struct platform_device ts72xx_wdt_device = {
 	.num_resources	= ARRAY_SIZE(ts72xx_wdt_resources),
 };
 
+/*************************************************************************
+ * ETH
+ *************************************************************************/
 static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 	.phy_id		= 1,
 };
 
+/*************************************************************************
+ * TS72XX support code
+ *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
 
 /* Relative to EP93XX_CS1_PHYS_BASE */
-- 
2.11.0

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

* [PATCH v5 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-11 23:36     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: Alexander Sverdlin, Arnd Bergmann, arndbergmann, Hartley Sweeten
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij, Lukasz Majewski

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
Changes for v4:
- Adjust the code to be applicable on top of linux-next/master
Changes for v5:
- Combine map_io to be reused across all ts72xx boards
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 +++
 arch/arm/mach-ep93xx/ts72xx.c | 136 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 155 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7d195739f892..17e1263b085d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1258,6 +1258,12 @@ L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 17af9d834b51..c089a2a4fe30 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -19,10 +19,15 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
 #include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/gpio-ep93xx.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -50,6 +55,11 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
 		.length		= TS72XX_OPTIONS2_SIZE,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)TS72XX_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_CPLDVER_PHYS_BASE),
+		.length		= TS72XX_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
 	}
 };
 
@@ -212,6 +222,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -285,3 +358,66 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+			    ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io		= ts72xx_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 7b7490f10fa9..00b4941d29c9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -10,6 +10,7 @@
  * febff000	22000000	4K	model number register (bits 0-2)
  * febfe000	22400000	4K	options register
  * febfd000	22800000	4K	options register #2
+ * febfc000     23400000        4K      CPLD version register
  */
 
 #ifndef __TS72XX_H_
@@ -42,6 +43,10 @@
 #define TS72XX_OPTIONS2_TS9420		0x04
 #define TS72XX_OPTIONS2_TS9420_BOOT	0x02
 
+#define TS72XX_CPLDVER_PHYS_BASE	0x23400000
+#define TS72XX_CPLDVER_VIRT_BASE	IOMEM(0xfebfc000)
+#define TS72XX_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* [PATCH v5 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
@ 2017-12-11 23:36     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-11 23:36 UTC (permalink / raw)
  To: linux-arm-kernel

The BK3 board is a derivative of the ts72xx reference design.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
Changes for v2:
- Place bk3 support code to the ts72xx.c file
Changes for v3:
- Add SD card support (via SPI) for BK3
- Remove definition of apb:i2s bus
- Remove board registration of CPLD WDT device
- Add I2S platform device to BK3
- Add MAINTAINERS entry for BK3 maintainer
Changes for v4:
- Adjust the code to be applicable on top of linux-next/master
Changes for v5:
- Combine map_io to be reused across all ts72xx boards
---
 MAINTAINERS                   |   6 ++
 arch/arm/mach-ep93xx/Kconfig  |   7 +++
 arch/arm/mach-ep93xx/ts72xx.c | 136 ++++++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-ep93xx/ts72xx.h |   5 ++
 arch/arm/tools/mach-types     |   1 +
 5 files changed, 155 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7d195739f892..17e1263b085d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1258,6 +1258,12 @@ L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
 S:	Supported
 F:	drivers/net/ethernet/cavium/thunder/
 
+ARM/CIRRUS LOGIC BK3 MACHINE SUPPORT
+M:	Lukasz Majewski <lukma@denx.de>
+L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
+S:	Maintained
+F:	arch/arm/mach-ep93xx/ts72xx.c
+
 ARM/CIRRUS LOGIC CLPS711X ARM ARCHITECTURE
 M:	Alexander Shiyan <shc_work@mail.ru>
 L:	linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 61a75ca3684e..c095236d7ff8 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -21,6 +21,13 @@ config MACH_ADSSPHERE
 	  Say 'Y' here if you want your kernel to support the ADS
 	  Sphere board.
 
+config MACH_BK3
+	bool "Support Liebherr BK3.1"
+	select MACH_TS72XX
+	help
+	  Say 'Y' here if you want your kernel to support the
+	  Liebherr controller BK3.1.
+
 config MACH_EDB93XX
 	bool
 
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c
index 17af9d834b51..c089a2a4fe30 100644
--- a/arch/arm/mach-ep93xx/ts72xx.c
+++ b/arch/arm/mach-ep93xx/ts72xx.c
@@ -19,10 +19,15 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/mmc_spi.h>
+#include <linux/mmc/host.h>
 #include <linux/platform_data/spi-ep93xx.h>
 
 #include <mach/gpio-ep93xx.h>
 #include <mach/hardware.h>
+#include <mach/irqs.h>
+#include <mach/gpio-ep93xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
@@ -50,6 +55,11 @@ static struct map_desc ts72xx_io_desc[] __initdata = {
 		.pfn		= __phys_to_pfn(TS72XX_OPTIONS2_PHYS_BASE),
 		.length		= TS72XX_OPTIONS2_SIZE,
 		.type		= MT_DEVICE,
+	}, {
+		.virtual	= (unsigned long)TS72XX_CPLDVER_VIRT_BASE,
+		.pfn		= __phys_to_pfn(TS72XX_CPLDVER_PHYS_BASE),
+		.length		= TS72XX_CPLDVER_SIZE,
+		.type		= MT_DEVICE,
 	}
 };
 
@@ -212,6 +222,69 @@ static struct ep93xx_eth_data __initdata ts72xx_eth_data = {
 };
 
 /*************************************************************************
+ * SPI SD/MMC host
+ *************************************************************************/
+#define BK3_EN_SDCARD_PHYS_BASE         0x12400000
+#define BK3_EN_SDCARD_PWR 0x0
+#define BK3_DIS_SDCARD_PWR 0x0C
+static void bk3_mmc_spi_setpower(struct device *dev, unsigned int vdd)
+{
+	void __iomem *pwr_sd = ioremap(BK3_EN_SDCARD_PHYS_BASE, SZ_4K);
+
+	if (!pwr_sd) {
+		pr_err("Failed to enable SD card power!");
+		return;
+	}
+
+	pr_debug("%s: SD card pwr %s VDD:0x%x\n", __func__,
+		 !!vdd ? "ON" : "OFF", vdd);
+
+	if (!!vdd)
+		__raw_writeb(BK3_EN_SDCARD_PWR, pwr_sd);
+	else
+		__raw_writeb(BK3_DIS_SDCARD_PWR, pwr_sd);
+
+	iounmap(pwr_sd);
+}
+
+static struct mmc_spi_platform_data bk3_spi_mmc_data = {
+	.detect_delay	= 500,
+	.powerup_msecs	= 100,
+	.ocr_mask	= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.caps		= MMC_CAP_NONREMOVABLE,
+	.setpower       = bk3_mmc_spi_setpower,
+};
+
+/*************************************************************************
+ * SPI Bus - SD card access
+ *************************************************************************/
+static struct spi_board_info bk3_spi_board_info[] __initdata = {
+	{
+		.modalias		= "mmc_spi",
+		.platform_data		= &bk3_spi_mmc_data,
+		.max_speed_hz		= 7.4E6,
+		.bus_num		= 0,
+		.chip_select		= 0,
+		.mode			= SPI_MODE_0,
+	},
+};
+
+/*
+ * This is a stub -> the FGPIO[3] pin is not connected on the schematic
+ * The all work is performed automatically by !SPI_FRAME (SFRM1) and
+ * goes through CPLD
+ */
+static int bk3_spi_chipselects[] __initdata = {
+	EP93XX_GPIO_LINE_F(3),
+};
+
+static struct ep93xx_spi_info bk3_spi_master __initdata = {
+	.chipselect	= bk3_spi_chipselects,
+	.num_chipselect = ARRAY_SIZE(bk3_spi_chipselects),
+	.use_dma	= 1,
+};
+
+/*************************************************************************
  * TS72XX support code
  *************************************************************************/
 #if IS_ENABLED(CONFIG_FPGA_MGR_TS73XX)
@@ -285,3 +358,66 @@ MACHINE_START(TS72XX, "Technologic Systems TS-72xx SBC")
 	.init_late	= ep93xx_init_late,
 	.restart	= ep93xx_restart,
 MACHINE_END
+
+/*************************************************************************
+ * EP93xx I2S audio peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_i2s_resource[] = {
+	DEFINE_RES_MEM(EP93XX_I2S_PHYS_BASE, 0x100),
+	DEFINE_RES_IRQ_NAMED(IRQ_EP93XX_SAI, "spilink i2s slave"),
+};
+
+static struct platform_device ep93xx_i2s_device = {
+	.name		= "ep93xx-spilink-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(ep93xx_i2s_resource),
+	.resource	= ep93xx_i2s_resource,
+};
+
+/*************************************************************************
+ * BK3 support code
+ *************************************************************************/
+static struct mtd_partition bk3_nand_parts[] = {
+	{
+		.name		= "System",
+		.offset	= 0x00000000,
+		.size		= 0x01e00000,
+	}, {
+		.name		= "Data",
+		.offset	= 0x01e00000,
+		.size		= 0x05f20000
+	}, {
+		.name		= "RedBoot",
+		.offset	= 0x07d20000,
+		.size		= 0x002e0000,
+		.mask_flags	= MTD_WRITEABLE,	/* force RO */
+	},
+};
+
+static void __init bk3_init_machine(void)
+{
+	ep93xx_init_devices();
+
+	ts72xx_register_flash(bk3_nand_parts, ARRAY_SIZE(bk3_nand_parts),
+			      EP93XX_CS6_PHYS_BASE);
+
+	ep93xx_register_eth(&ts72xx_eth_data, 1);
+
+	ep93xx_register_spi(&bk3_spi_master, bk3_spi_board_info,
+			    ARRAY_SIZE(bk3_spi_board_info));
+
+	/* Configure ep93xx's I2S to use AC97 pins */
+	ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_I2SONAC97);
+	platform_device_register(&ep93xx_i2s_device);
+}
+
+MACHINE_START(BK3, "Liebherr controller BK3.1")
+	/* Maintainer: Lukasz Majewski <lukma@denx.de> */
+	.atag_offset	= 0x100,
+	.map_io		= ts72xx_map_io,
+	.init_irq	= ep93xx_init_irq,
+	.init_time	= ep93xx_timer_init,
+	.init_machine	= bk3_init_machine,
+	.init_late	= ep93xx_init_late,
+	.restart	= ep93xx_restart,
+MACHINE_END
diff --git a/arch/arm/mach-ep93xx/ts72xx.h b/arch/arm/mach-ep93xx/ts72xx.h
index 7b7490f10fa9..00b4941d29c9 100644
--- a/arch/arm/mach-ep93xx/ts72xx.h
+++ b/arch/arm/mach-ep93xx/ts72xx.h
@@ -10,6 +10,7 @@
  * febff000	22000000	4K	model number register (bits 0-2)
  * febfe000	22400000	4K	options register
  * febfd000	22800000	4K	options register #2
+ * febfc000     23400000        4K      CPLD version register
  */
 
 #ifndef __TS72XX_H_
@@ -42,6 +43,10 @@
 #define TS72XX_OPTIONS2_TS9420		0x04
 #define TS72XX_OPTIONS2_TS9420_BOOT	0x02
 
+#define TS72XX_CPLDVER_PHYS_BASE	0x23400000
+#define TS72XX_CPLDVER_VIRT_BASE	IOMEM(0xfebfc000)
+#define TS72XX_CPLDVER_SIZE		0x00001000
+
 #ifndef __ASSEMBLY__
 
 static inline int ts72xx_model(void)
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index a9313b66f770..4eac94c1eb6f 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -345,6 +345,7 @@ mxlads			MACH_MXLADS		MXLADS			1851
 linkstation_mini	MACH_LINKSTATION_MINI	LINKSTATION_MINI	1858
 afeb9260		MACH_AFEB9260		AFEB9260		1859
 imx27ipcam		MACH_IMX27IPCAM		IMX27IPCAM		1871
+bk3			MACH_BK3		BK3			1880
 rd88f6183ap_ge		MACH_RD88F6183AP_GE	RD88F6183AP_GE		1894
 realview_pba8		MACH_REALVIEW_PBA8	REALVIEW_PBA8		1897
 realview_pbx		MACH_REALVIEW_PBX	REALVIEW_PBX		1901
-- 
2.11.0

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

* RE: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-11 23:43     ` Hartley Sweeten
  -1 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 23:43 UTC (permalink / raw)
  To: Lukasz Majewski, Alexander Sverdlin, Arnd Bergmann, arndbergmann
  Cc: Russell King, linux-arm-kernel, linux-kernel, Olof Johansson,
	Linus Walleij

On Monday, December 11, 2017 4:36 PM, Lukasz Majewski wrote:
> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 4/4)
>
> This series applies on top of linux-next/master (next-20171211)
>
> Lukasz Majewski (4):
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>
>  MAINTAINERS                   |   6 ++
>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>  arch/arm/mach-ep93xx/ts72xx.c | 165 +++++++++++++++++++++++++++++++++++++++---
>  arch/arm/mach-ep93xx/ts72xx.h |   9 +++
>  arch/arm/tools/mach-types     |   1 +
>  5 files changed, 176 insertions(+), 12 deletions(-)

Looks good. Thanks!

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-11 23:43     ` Hartley Sweeten
  0 siblings, 0 replies; 159+ messages in thread
From: Hartley Sweeten @ 2017-12-11 23:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, December 11, 2017 4:36 PM, Lukasz Majewski wrote:
> This patch series adds support for Liebherr's BK3 board, being a derivative of TS72XX design.
>
> This patchset consists of following patches:
>
> - ts72xx.[c|h] cosmetic cleanup/improvement
> - Rewrite ts72xx.c to be reusable by bk3
> - The Liebherr's BK3 board has been added with re-using code of
>   ts72xx.c (detalied list of changes can be found in patch 4/4)
>
> This series applies on top of linux-next/master (next-20171211)
>
> Lukasz Majewski (4):
>   ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file
>   ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept
>     parameters
>   ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code
>   ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative
>
>  MAINTAINERS                   |   6 ++
>  arch/arm/mach-ep93xx/Kconfig  |   7 ++
>  arch/arm/mach-ep93xx/ts72xx.c | 165 +++++++++++++++++++++++++++++++++++++++---
>  arch/arm/mach-ep93xx/ts72xx.h |   9 +++
>  arch/arm/tools/mach-types     |   1 +
>  5 files changed, 176 insertions(+), 12 deletions(-)

Looks good. Thanks!

Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-11 23:36   ` Lukasz Majewski
@ 2017-12-13  7:34     ` Linus Walleij
  -1 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-13  7:34 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Arnd Bergmann, Arnd Bergmann,
	Hartley Sweeten, Russell King, Linux ARM, linux-kernel,
	Olof Johansson

On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de> wrote:

> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.

All looks good.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Out of curiosity: Liebherr is obviously doing heavy-duty industrial
control systems. Likewise Hartley is doing similar business over
at Vision Engravings.

Is the situation such that there is a whole bunch of industrial
systems out there, in active use and needing future upgrades,
that use the EP93xx?

Arnd has been nudging me to do DT conversion for EP93xx
so if there are many active industrial users of these
I should prioritize it, because these things have 20+ years
support cycles.

We also need to think about upholding support in GCC for
ARMv4(t) for the foreseeable future if there is a big web of
random deeply embedded systems out there that will need
updates.

Yours,
Linus Walleij

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-13  7:34     ` Linus Walleij
  0 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-13  7:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de> wrote:

> This patch series adds support for Liebherr's BK3 board, being
> a derivative of TS72XX design.

All looks good.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Out of curiosity: Liebherr is obviously doing heavy-duty industrial
control systems. Likewise Hartley is doing similar business over
at Vision Engravings.

Is the situation such that there is a whole bunch of industrial
systems out there, in active use and needing future upgrades,
that use the EP93xx?

Arnd has been nudging me to do DT conversion for EP93xx
so if there are many active industrial users of these
I should prioritize it, because these things have 20+ years
support cycles.

We also need to think about upholding support in GCC for
ARMv4(t) for the foreseeable future if there is a big web of
random deeply embedded systems out there that will need
updates.

Yours,
Linus Walleij

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-13  7:34     ` Linus Walleij
@ 2017-12-13  8:26       ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-13  8:26 UTC (permalink / raw)
  To: Linus Walleij, Lukasz Majewski
  Cc: Arnd Bergmann, Arnd Bergmann, Hartley Sweeten, Russell King,
	Linux ARM, linux-kernel, Olof Johansson

Hello Linus!

On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Out of curiosity: Liebherr is obviously doing heavy-duty industrial
> control systems. Likewise Hartley is doing similar business over
> at Vision Engravings.
> 
> Is the situation such that there is a whole bunch of industrial
> systems out there, in active use and needing future upgrades,
> that use the EP93xx?

That's definitely the case. I'm as well aware of several thousands of industrial devices which are expected to run 24/7 for the next 5 years at least. And they are updated from time to time.

> Arnd has been nudging me to do DT conversion for EP93xx
> so if there are many active industrial users of these
> I should prioritize it, because these things have 20+ years
> support cycles.

I'm not sure how important or necessary at all is to change anything in these legacy platforms.

> We also need to think about upholding support in GCC for
> ARMv4(t) for the foreseeable future if there is a big web of
> random deeply embedded systems out there that will need
> updates.

But we should definitely preserve at least what we have.

--
Alexander.

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-13  8:26       ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-13  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hello Linus!

On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org> wrote:
> On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de> wrote:
> Out of curiosity: Liebherr is obviously doing heavy-duty industrial
> control systems. Likewise Hartley is doing similar business over
> at Vision Engravings.
> 
> Is the situation such that there is a whole bunch of industrial
> systems out there, in active use and needing future upgrades,
> that use the EP93xx?

That's definitely the case. I'm as well aware of several thousands of industrial devices which are expected to run 24/7 for the next 5 years at least. And they are updated from time to time.

> Arnd has been nudging me to do DT conversion for EP93xx
> so if there are many active industrial users of these
> I should prioritize it, because these things have 20+ years
> support cycles.

I'm not sure how important or necessary at all is to change anything in these legacy platforms.

> We also need to think about upholding support in GCC for
> ARMv4(t) for the foreseeable future if there is a big web of
> random deeply embedded systems out there that will need
> updates.

But we should definitely preserve at least what we have.

--
Alexander.

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-13  8:26       ` Alexander Sverdlin
@ 2017-12-13  8:52         ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-13  8:52 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Linus Walleij, Arnd Bergmann, Arnd Bergmann, Hartley Sweeten,
	Russell King, Linux ARM, linux-kernel, Olof Johansson

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

Hi Alexander, Linus

> Hello Linus!
> 
> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org>
> wrote:
> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
> > industrial control systems. Likewise Hartley is doing similar
> > business over at Vision Engravings.
> > 
> > Is the situation such that there is a whole bunch of industrial
> > systems out there, in active use and needing future upgrades,
> > that use the EP93xx?  
> 
> That's definitely the case. I'm as well aware of several thousands of
> industrial devices which are expected to run 24/7 for the next 5
> years at least. And they are updated from time to time.

I can agree with this statement. 

> 
> > Arnd has been nudging me to do DT conversion for EP93xx
> > so if there are many active industrial users of these
> > I should prioritize it, because these things have 20+ years
> > support cycles.  
> 
> I'm not sure how important or necessary at all is to change anything
> in these legacy platforms.

+1

> 
> > We also need to think about upholding support in GCC for
> > ARMv4(t) for the foreseeable future if there is a big web of
> > random deeply embedded systems out there that will need
> > updates.  
> 
> But we should definitely preserve at least what we have.

I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2 works
with it.

And yes, armv4 support shall be preserved in GCC ....

> 
> --
> Alexander.
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-13  8:52         ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-13  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Alexander, Linus

> Hello Linus!
> 
> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org>
> wrote:
> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
> > industrial control systems. Likewise Hartley is doing similar
> > business over at Vision Engravings.
> > 
> > Is the situation such that there is a whole bunch of industrial
> > systems out there, in active use and needing future upgrades,
> > that use the EP93xx?  
> 
> That's definitely the case. I'm as well aware of several thousands of
> industrial devices which are expected to run 24/7 for the next 5
> years at least. And they are updated from time to time.

I can agree with this statement. 

> 
> > Arnd has been nudging me to do DT conversion for EP93xx
> > so if there are many active industrial users of these
> > I should prioritize it, because these things have 20+ years
> > support cycles.  
> 
> I'm not sure how important or necessary at all is to change anything
> in these legacy platforms.

+1

> 
> > We also need to think about upholding support in GCC for
> > ARMv4(t) for the foreseeable future if there is a big web of
> > random deeply embedded systems out there that will need
> > updates.  
> 
> But we should definitely preserve at least what we have.

I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2 works
with it.

And yes, armv4 support shall be preserved in GCC ....

> 
> --
> Alexander.
> 



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171213/d6dfd68c/attachment-0001.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-13  8:26       ` Alexander Sverdlin
@ 2017-12-13 10:11         ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-13 10:11 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Linus Walleij, Lukasz Majewski, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

On Wed, Dec 13, 2017 at 9:26 AM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org> wrote:
>> Arnd has been nudging me to do DT conversion for EP93xx
>> so if there are many active industrial users of these
>> I should prioritize it, because these things have 20+ years
>> support cycles.
>
> I'm not sure how important or necessary at all is to change anything in these legacy platforms.

I suspect that at several points in the next 5 to 10 years, we will remove
additional platforms or CPU types, as we tend to do when a platform
becomes a maintenance burden and is clearly not used by anyone.

It's hard to predict in advance what triggers the removal, but as the
number of platforms that are not using DT or ARCH_MULTIPLATFORM
goes down to a small number, there will be increased interested in either
removing or converting the remaining ones. This is not an immediate
danger at the moment, since we still have 14 platforms that are not
using ARCH_MULTIPLATFORM, and 23 that have remaining
board files, but you don't want to be the last user of the last platform
after the other ones are done ;-)

>> We also need to think about upholding support in GCC for
>> ARMv4(t) for the foreseeable future if there is a big web of
>> random deeply embedded systems out there that will need
>> updates.
>
> But we should definitely preserve at least what we have.

Plain ARMv4 (and earlier) support in gcc is already marked 'deprecated'
and will likely be gone in gcc-8 (it's still there as of last week). ARMv4T
is going to be around for a while, and you can even keep building for
ARMv4 using "-march=armv4t -marm" when linking with 'ld --fix-v4bx'.

Debian recently did a survey to find out whether there were still users
on ARMv4 or ARMv4T, and the result was that probably everyone is
on ARMv5E or ARMv6 for the ARM port (which is separate from the
ARMHF port that is ARMv7+). See also
https://lists.debian.org/debian-user/2017/11/msg00379.html
and let them know quickly if you use Debian stable releases and
plan to update to Debian 10 (Buster) in the future.

     Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-13 10:11         ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-13 10:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 13, 2017 at 9:26 AM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org> wrote:
>> Arnd has been nudging me to do DT conversion for EP93xx
>> so if there are many active industrial users of these
>> I should prioritize it, because these things have 20+ years
>> support cycles.
>
> I'm not sure how important or necessary at all is to change anything in these legacy platforms.

I suspect that at several points in the next 5 to 10 years, we will remove
additional platforms or CPU types, as we tend to do when a platform
becomes a maintenance burden and is clearly not used by anyone.

It's hard to predict in advance what triggers the removal, but as the
number of platforms that are not using DT or ARCH_MULTIPLATFORM
goes down to a small number, there will be increased interested in either
removing or converting the remaining ones. This is not an immediate
danger at the moment, since we still have 14 platforms that are not
using ARCH_MULTIPLATFORM, and 23 that have remaining
board files, but you don't want to be the last user of the last platform
after the other ones are done ;-)

>> We also need to think about upholding support in GCC for
>> ARMv4(t) for the foreseeable future if there is a big web of
>> random deeply embedded systems out there that will need
>> updates.
>
> But we should definitely preserve at least what we have.

Plain ARMv4 (and earlier) support in gcc is already marked 'deprecated'
and will likely be gone in gcc-8 (it's still there as of last week). ARMv4T
is going to be around for a while, and you can even keep building for
ARMv4 using "-march=armv4t -marm" when linking with 'ld --fix-v4bx'.

Debian recently did a survey to find out whether there were still users
on ARMv4 or ARMv4T, and the result was that probably everyone is
on ARMv5E or ARMv6 for the ARM port (which is separate from the
ARMHF port that is ARMv7+). See also
https://lists.debian.org/debian-user/2017/11/msg00379.html
and let them know quickly if you use Debian stable releases and
plan to update to Debian 10 (Buster) in the future.

     Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-13 10:11         ` Arnd Bergmann
@ 2017-12-17 19:41           ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-17 19:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

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

Hi Arnd,

> On Wed, Dec 13, 2017 at 9:26 AM, Alexander Sverdlin
> <alexander.sverdlin@gmail.com> wrote:
> > On Wed Dec 13 08:34:22 2017 Linus Walleij
> > <linus.walleij@linaro.org> wrote:  
> >> Arnd has been nudging me to do DT conversion for EP93xx
> >> so if there are many active industrial users of these
> >> I should prioritize it, because these things have 20+ years
> >> support cycles.  
> >
> > I'm not sure how important or necessary at all is to change
> > anything in these legacy platforms.  
> 
> I suspect that at several points in the next 5 to 10 years, we will
> remove additional platforms or CPU types, as we tend to do when a
> platform becomes a maintenance burden and is clearly not used by
> anyone.

I suppose that at least the last argument is not the case here :-).

> 
> It's hard to predict in advance what triggers the removal, but as the
> number of platforms that are not using DT or ARCH_MULTIPLATFORM
> goes down to a small number, there will be increased interested in
> either removing or converting the remaining ones. This is not an
> immediate danger at the moment, since we still have 14 platforms that
> are not using ARCH_MULTIPLATFORM, and 23 that have remaining
> board files, but you don't want to be the last user of the last
> platform after the other ones are done ;-)

:-)

> 
> >> We also need to think about upholding support in GCC for
> >> ARMv4(t) for the foreseeable future if there is a big web of
> >> random deeply embedded systems out there that will need
> >> updates.  
> >
> > But we should definitely preserve at least what we have.  
> 
> Plain ARMv4 (and earlier) support in gcc is already marked
> 'deprecated' and will likely be gone in gcc-8 (it's still there as of
> last week). ARMv4T is going to be around for a while, and you can
> even keep building for ARMv4 using "-march=armv4t -marm" when linking
> with 'ld --fix-v4bx'.

I think that we shall start complaining on the gcc-devel mailing list
now.

I would be hard to wake up in 2 years time and realise that we don't
have a modern compiler.

> 
> Debian recently did a survey to find out whether there were still
> users on ARMv4 or ARMv4T, and the result was that probably everyone is
> on ARMv5E or ARMv6 for the ARM port (which is separate from the
> ARMHF port that is ARMv7+). See also
> https://lists.debian.org/debian-user/2017/11/msg00379.html
> and let them know quickly if you use Debian stable releases and
> plan to update to Debian 10 (Buster) in the future.
> 
>      Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-17 19:41           ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-17 19:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> On Wed, Dec 13, 2017 at 9:26 AM, Alexander Sverdlin
> <alexander.sverdlin@gmail.com> wrote:
> > On Wed Dec 13 08:34:22 2017 Linus Walleij
> > <linus.walleij@linaro.org> wrote:  
> >> Arnd has been nudging me to do DT conversion for EP93xx
> >> so if there are many active industrial users of these
> >> I should prioritize it, because these things have 20+ years
> >> support cycles.  
> >
> > I'm not sure how important or necessary at all is to change
> > anything in these legacy platforms.  
> 
> I suspect that at several points in the next 5 to 10 years, we will
> remove additional platforms or CPU types, as we tend to do when a
> platform becomes a maintenance burden and is clearly not used by
> anyone.

I suppose that at least the last argument is not the case here :-).

> 
> It's hard to predict in advance what triggers the removal, but as the
> number of platforms that are not using DT or ARCH_MULTIPLATFORM
> goes down to a small number, there will be increased interested in
> either removing or converting the remaining ones. This is not an
> immediate danger at the moment, since we still have 14 platforms that
> are not using ARCH_MULTIPLATFORM, and 23 that have remaining
> board files, but you don't want to be the last user of the last
> platform after the other ones are done ;-)

:-)

> 
> >> We also need to think about upholding support in GCC for
> >> ARMv4(t) for the foreseeable future if there is a big web of
> >> random deeply embedded systems out there that will need
> >> updates.  
> >
> > But we should definitely preserve at least what we have.  
> 
> Plain ARMv4 (and earlier) support in gcc is already marked
> 'deprecated' and will likely be gone in gcc-8 (it's still there as of
> last week). ARMv4T is going to be around for a while, and you can
> even keep building for ARMv4 using "-march=armv4t -marm" when linking
> with 'ld --fix-v4bx'.

I think that we shall start complaining on the gcc-devel mailing list
now.

I would be hard to wake up in 2 years time and realise that we don't
have a modern compiler.

> 
> Debian recently did a survey to find out whether there were still
> users on ARMv4 or ARMv4T, and the result was that probably everyone is
> on ARMv5E or ARMv6 for the ARM port (which is separate from the
> ARMHF port that is ARMv7+). See also
> https://lists.debian.org/debian-user/2017/11/msg00379.html
> and let them know quickly if you use Debian stable releases and
> plan to update to Debian 10 (Buster) in the future.
> 
>      Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171217/56d4973a/attachment.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-17 19:41           ` Lukasz Majewski
@ 2017-12-17 20:07             ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-17 20:07 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de> wrote:
>> >> We also need to think about upholding support in GCC for
>> >> ARMv4(t) for the foreseeable future if there is a big web of
>> >> random deeply embedded systems out there that will need
>> >> updates.
>> >
>> > But we should definitely preserve at least what we have.
>>
>> Plain ARMv4 (and earlier) support in gcc is already marked
>> 'deprecated' and will likely be gone in gcc-8 (it's still there as of
>> last week). ARMv4T is going to be around for a while, and you can
>> even keep building for ARMv4 using "-march=armv4t -marm" when linking
>> with 'ld --fix-v4bx'.
>
> I think that we shall start complaining on the gcc-devel mailing list
> now.
>
> I would be hard to wake up in 2 years time and realise that we don't
> have a modern compiler.

What distro or build system are you using? It would also be helpful
to test whether the -march=armv4t/--fix-v4bx workaround produces
working binaries for you, in that case you could report to the gcc
developers that the removal of armv4 can continue but that
the --fix-v4bx option in ld needs to stay around.

       Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-17 20:07             ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-17 20:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de> wrote:
>> >> We also need to think about upholding support in GCC for
>> >> ARMv4(t) for the foreseeable future if there is a big web of
>> >> random deeply embedded systems out there that will need
>> >> updates.
>> >
>> > But we should definitely preserve at least what we have.
>>
>> Plain ARMv4 (and earlier) support in gcc is already marked
>> 'deprecated' and will likely be gone in gcc-8 (it's still there as of
>> last week). ARMv4T is going to be around for a while, and you can
>> even keep building for ARMv4 using "-march=armv4t -marm" when linking
>> with 'ld --fix-v4bx'.
>
> I think that we shall start complaining on the gcc-devel mailing list
> now.
>
> I would be hard to wake up in 2 years time and realise that we don't
> have a modern compiler.

What distro or build system are you using? It would also be helpful
to test whether the -march=armv4t/--fix-v4bx workaround produces
working binaries for you, in that case you could report to the gcc
developers that the removal of armv4 can continue but that
the --fix-v4bx option in ld needs to stay around.

       Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-17 20:07             ` Arnd Bergmann
@ 2017-12-17 21:28               ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-17 21:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

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

Hi Arnd,

> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
> wrote:
> >> >> We also need to think about upholding support in GCC for
> >> >> ARMv4(t) for the foreseeable future if there is a big web of
> >> >> random deeply embedded systems out there that will need
> >> >> updates.  
> >> >
> >> > But we should definitely preserve at least what we have.  
> >>
> >> Plain ARMv4 (and earlier) support in gcc is already marked
> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
> >> of last week). ARMv4T is going to be around for a while, and you
> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
> >> linking with 'ld --fix-v4bx'.  
> >
> > I think that we shall start complaining on the gcc-devel mailing
> > list now.
> >
> > I would be hard to wake up in 2 years time and realise that we don't
> > have a modern compiler.  
> 
> What distro or build system are you using?

I'm using OE with the "include conf/machine/include/tune-arm920t.inc"

GCC 7.2 is working 

> It would also be helpful
> to test whether the -march=armv4t/--fix-v4bx workaround produces
> working binaries for you, in that case you could report to the gcc
> developers that the removal of armv4 can continue but that
> the --fix-v4bx option in ld needs to stay around.

I may ask this issue on OE/Yocto mailing list as well....

Thanks for hint.

> 
>        Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-17 21:28               ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-17 21:28 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
> wrote:
> >> >> We also need to think about upholding support in GCC for
> >> >> ARMv4(t) for the foreseeable future if there is a big web of
> >> >> random deeply embedded systems out there that will need
> >> >> updates.  
> >> >
> >> > But we should definitely preserve at least what we have.  
> >>
> >> Plain ARMv4 (and earlier) support in gcc is already marked
> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
> >> of last week). ARMv4T is going to be around for a while, and you
> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
> >> linking with 'ld --fix-v4bx'.  
> >
> > I think that we shall start complaining on the gcc-devel mailing
> > list now.
> >
> > I would be hard to wake up in 2 years time and realise that we don't
> > have a modern compiler.  
> 
> What distro or build system are you using?

I'm using OE with the "include conf/machine/include/tune-arm920t.inc"

GCC 7.2 is working 

> It would also be helpful
> to test whether the -march=armv4t/--fix-v4bx workaround produces
> working binaries for you, in that case you could report to the gcc
> developers that the removal of armv4 can continue but that
> the --fix-v4bx option in ld needs to stay around.

I may ask this issue on OE/Yocto mailing list as well....

Thanks for hint.

> 
>        Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171217/bec5a31a/attachment-0001.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-17 21:28               ` Lukasz Majewski
@ 2017-12-18 11:55                 ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-18 11:55 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Arnd,
>
>> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
>> wrote:
>> >> >> We also need to think about upholding support in GCC for
>> >> >> ARMv4(t) for the foreseeable future if there is a big web of
>> >> >> random deeply embedded systems out there that will need
>> >> >> updates.
>> >> >
>> >> > But we should definitely preserve at least what we have.
>> >>
>> >> Plain ARMv4 (and earlier) support in gcc is already marked
>> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
>> >> of last week). ARMv4T is going to be around for a while, and you
>> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
>> >> linking with 'ld --fix-v4bx'.
>> >
>> > I think that we shall start complaining on the gcc-devel mailing
>> > list now.
>> >
>> > I would be hard to wake up in 2 years time and realise that we don't
>> > have a modern compiler.
>>
>> What distro or build system are you using?
>
> I'm using OE with the "include conf/machine/include/tune-arm920t.inc"
>
> GCC 7.2 is working

Ah wait, this is still for ep93xx, which is always at least armv4t, right?
So it won't have a problem with the armv4 deprecation anyway, even
the older ep72xx/73xx were ARM720T based and don't have a problem.
I'm not entirely sure about their clps711x predecessors, which were some
earlier arm7 variant, but Linux doesn't support them any more anyway,
and the ARM710T would already be fine without --fix-v4bx.

>> It would also be helpful
>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>> working binaries for you, in that case you could report to the gcc
>> developers that the removal of armv4 can continue but that
>> the --fix-v4bx option in ld needs to stay around.
>
> I may ask this issue on OE/Yocto mailing list as well....

To clarify, the only  affected platforms are those based on either
DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
FootBridge, RPC, SA1100, Moxart and Gemini.

       Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-18 11:55                 ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-18 11:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Arnd,
>
>> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
>> wrote:
>> >> >> We also need to think about upholding support in GCC for
>> >> >> ARMv4(t) for the foreseeable future if there is a big web of
>> >> >> random deeply embedded systems out there that will need
>> >> >> updates.
>> >> >
>> >> > But we should definitely preserve at least what we have.
>> >>
>> >> Plain ARMv4 (and earlier) support in gcc is already marked
>> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
>> >> of last week). ARMv4T is going to be around for a while, and you
>> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
>> >> linking with 'ld --fix-v4bx'.
>> >
>> > I think that we shall start complaining on the gcc-devel mailing
>> > list now.
>> >
>> > I would be hard to wake up in 2 years time and realise that we don't
>> > have a modern compiler.
>>
>> What distro or build system are you using?
>
> I'm using OE with the "include conf/machine/include/tune-arm920t.inc"
>
> GCC 7.2 is working

Ah wait, this is still for ep93xx, which is always at least armv4t, right?
So it won't have a problem with the armv4 deprecation anyway, even
the older ep72xx/73xx were ARM720T based and don't have a problem.
I'm not entirely sure about their clps711x predecessors, which were some
earlier arm7 variant, but Linux doesn't support them any more anyway,
and the ARM710T would already be fine without --fix-v4bx.

>> It would also be helpful
>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>> working binaries for you, in that case you could report to the gcc
>> developers that the removal of armv4 can continue but that
>> the --fix-v4bx option in ld needs to stay around.
>
> I may ask this issue on OE/Yocto mailing list as well....

To clarify, the only  affected platforms are those based on either
DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
FootBridge, RPC, SA1100, Moxart and Gemini.

       Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-18 11:55                 ` Arnd Bergmann
@ 2017-12-18 12:03                   ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-18 12:03 UTC (permalink / raw)
  To: Arnd Bergmann, Lukasz Majewski
  Cc: Linus Walleij, Hartley Sweeten, Russell King, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson

Hi!

On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > GCC 7.2 is working
> 
> Ah wait, this is still for ep93xx, which is always at least armv4t,
> right? So it won't have a problem with the armv4 deprecation anyway, even

Correct.

--
Alex.

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-18 12:03                   ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-18 12:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > GCC 7.2 is working
> 
> Ah wait, this is still for ep93xx, which is always at least armv4t,
> right? So it won't have a problem with the armv4 deprecation anyway, even

Correct.

--
Alex.

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-18 12:03                   ` Alexander Sverdlin
@ 2017-12-19 21:36                     ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-19 21:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

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

Hi Arnd,

> Hi!
> 
> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > > GCC 7.2 is working  
> > 
> > Ah wait, this is still for ep93xx, which is always at least armv4t,
> > right? So it won't have a problem with the armv4 deprecation
> > anyway, even  
> 
> Correct.

Maybe a bit off topic :-)

Are there any more comments regarding this patch series? Are those
patches eligible for applying them to -next?

> 
> --
> Alex.



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-19 21:36                     ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-19 21:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> Hi!
> 
> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > > GCC 7.2 is working  
> > 
> > Ah wait, this is still for ep93xx, which is always at least armv4t,
> > right? So it won't have a problem with the armv4 deprecation
> > anyway, even  
> 
> Correct.

Maybe a bit off topic :-)

Are there any more comments regarding this patch series? Are those
patches eligible for applying them to -next?

> 
> --
> Alex.



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171219/bc84a3eb/attachment.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-19 21:36                     ` Lukasz Majewski
@ 2017-12-20  8:11                       ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20  8:11 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

On Tue, Dec 19, 2017 at 10:36 PM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Arnd,
>
>> Hi!
>>
>> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> > > GCC 7.2 is working
>> >
>> > Ah wait, this is still for ep93xx, which is always at least armv4t,
>> > right? So it won't have a problem with the armv4 deprecation
>> > anyway, even
>>
>> Correct.
>
> Maybe a bit off topic :-)
>
> Are there any more comments regarding this patch series? Are those
> patches eligible for applying them to -next?

Alexander already sent a pull request, I just haven't pulled them. If there
are any other comments or additional patches, they should be done
on top of the first pull request, unless there is a major regression in
the original pull (which is unlikely).

        Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20  8:11                       ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20  8:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 19, 2017 at 10:36 PM, Lukasz Majewski <lukma@denx.de> wrote:
> Hi Arnd,
>
>> Hi!
>>
>> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> > > GCC 7.2 is working
>> >
>> > Ah wait, this is still for ep93xx, which is always at least armv4t,
>> > right? So it won't have a problem with the armv4 deprecation
>> > anyway, even
>>
>> Correct.
>
> Maybe a bit off topic :-)
>
> Are there any more comments regarding this patch series? Are those
> patches eligible for applying them to -next?

Alexander already sent a pull request, I just haven't pulled them. If there
are any other comments or additional patches, they should be done
on top of the first pull request, unless there is a major regression in
the original pull (which is unlikely).

        Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20  8:11                       ` Arnd Bergmann
@ 2017-12-20  8:53                         ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20  8:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alexander Sverdlin, Linus Walleij, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

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

Hi Arnd,

> On Tue, Dec 19, 2017 at 10:36 PM, Lukasz Majewski <lukma@denx.de>
> wrote:
> > Hi Arnd,
> >  
> >> Hi!
> >>
> >> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:  
> >> > > GCC 7.2 is working  
> >> >
> >> > Ah wait, this is still for ep93xx, which is always at least
> >> > armv4t, right? So it won't have a problem with the armv4
> >> > deprecation anyway, even  
> >>
> >> Correct.  
> >
> > Maybe a bit off topic :-)
> >
> > Are there any more comments regarding this patch series? Are those
> > patches eligible for applying them to -next?  
> 
> Alexander already sent a pull request, I just haven't pulled them. If
> there are any other comments or additional patches, they should be
> done on top of the first pull request, unless there is a major
> regression in the original pull (which is unlikely).

Thanks for reply.

> 
>         Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20  8:53                         ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20  8:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> On Tue, Dec 19, 2017 at 10:36 PM, Lukasz Majewski <lukma@denx.de>
> wrote:
> > Hi Arnd,
> >  
> >> Hi!
> >>
> >> On Mon Dec 18 12:55:40 2017 Arnd Bergmann <arnd@arndb.de> wrote:  
> >> > > GCC 7.2 is working  
> >> >
> >> > Ah wait, this is still for ep93xx, which is always at least
> >> > armv4t, right? So it won't have a problem with the armv4
> >> > deprecation anyway, even  
> >>
> >> Correct.  
> >
> > Maybe a bit off topic :-)
> >
> > Are there any more comments regarding this patch series? Are those
> > patches eligible for applying them to -next?  
> 
> Alexander already sent a pull request, I just haven't pulled them. If
> there are any other comments or additional patches, they should be
> done on top of the first pull request, unless there is a major
> regression in the original pull (which is unlikely).

Thanks for reply.

> 
>         Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171220/391d72da/attachment-0001.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-13  8:52         ` Lukasz Majewski
@ 2017-12-20 12:33           ` Linus Walleij
  -1 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-20 12:33 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Alexander Sverdlin, Arnd Bergmann, Arnd Bergmann,
	Hartley Sweeten, Russell King, Linux ARM, linux-kernel,
	Olof Johansson

On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de> wrote:
>> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org>
>> wrote:
>> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
>> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
>> > industrial control systems. Likewise Hartley is doing similar
>> > business over at Vision Engravings.
>> >
>> > Is the situation such that there is a whole bunch of industrial
>> > systems out there, in active use and needing future upgrades,
>> > that use the EP93xx?
>>
>> That's definitely the case. I'm as well aware of several thousands of
>> industrial devices which are expected to run 24/7 for the next 5
>> years at least. And they are updated from time to time.
>
> I can agree with this statement.

OK I'm coloring this platform with a highlight for ARM32 maintenance.

>> > Arnd has been nudging me to do DT conversion for EP93xx
>> > so if there are many active industrial users of these
>> > I should prioritize it, because these things have 20+ years
>> > support cycles.
>>
>> I'm not sure how important or necessary at all is to change anything
>> in these legacy platforms.
>
> +1

That is an understandable conservative stance.

There is a fine line between "it works, don't touch it" and
"modernize the ARM32 ecosystem".

There is a point where supporting old board files will stand in
the way and cost a lot in maintenance (like moving drivers our
of arch/arm, or modernizing misc subsystems). Then moving the
platform over to device tree should be preferred.

> I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2 works
> with it.
>
> And yes, armv4 support shall be preserved in GCC ....

Yes that is the same toochain I use.

Yours,
Linus Walleij

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 12:33           ` Linus Walleij
  0 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-20 12:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de> wrote:
>> On Wed Dec 13 08:34:22 2017 Linus Walleij <linus.walleij@linaro.org>
>> wrote:
>> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
>> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
>> > industrial control systems. Likewise Hartley is doing similar
>> > business over at Vision Engravings.
>> >
>> > Is the situation such that there is a whole bunch of industrial
>> > systems out there, in active use and needing future upgrades,
>> > that use the EP93xx?
>>
>> That's definitely the case. I'm as well aware of several thousands of
>> industrial devices which are expected to run 24/7 for the next 5
>> years at least. And they are updated from time to time.
>
> I can agree with this statement.

OK I'm coloring this platform with a highlight for ARM32 maintenance.

>> > Arnd has been nudging me to do DT conversion for EP93xx
>> > so if there are many active industrial users of these
>> > I should prioritize it, because these things have 20+ years
>> > support cycles.
>>
>> I'm not sure how important or necessary at all is to change anything
>> in these legacy platforms.
>
> +1

That is an understandable conservative stance.

There is a fine line between "it works, don't touch it" and
"modernize the ARM32 ecosystem".

There is a point where supporting old board files will stand in
the way and cost a lot in maintenance (like moving drivers our
of arch/arm, or modernizing misc subsystems). Then moving the
platform over to device tree should be preferred.

> I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2 works
> with it.
>
> And yes, armv4 support shall be preserved in GCC ....

Yes that is the same toochain I use.

Yours,
Linus Walleij

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-18 11:55                 ` Arnd Bergmann
@ 2017-12-20 12:48                   ` Linus Walleij
  -1 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-20 12:48 UTC (permalink / raw)
  To: Arnd Bergmann, Russell King, Jonas Jensen
  Cc: Lukasz Majewski, Alexander Sverdlin, Hartley Sweeten, Linux ARM,
	Linux Kernel Mailing List, Olof Johansson

On Mon, Dec 18, 2017 at 12:55 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
>>> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
>>> wrote:
>>> >> >> We also need to think about upholding support in GCC for
>>> >> >> ARMv4(t) for the foreseeable future if there is a big web of
>>> >> >> random deeply embedded systems out there that will need
>>> >> >> updates.
>>> >> >
>>> >> > But we should definitely preserve at least what we have.
>>> >>
>>> >> Plain ARMv4 (and earlier) support in gcc is already marked
>>> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
>>> >> of last week). ARMv4T is going to be around for a while, and you
>>> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
>>> >> linking with 'ld --fix-v4bx'.
>>> >
>>> > I think that we shall start complaining on the gcc-devel mailing
>>> > list now.
>>> >
>>> > I would be hard to wake up in 2 years time and realise that we don't
>>> > have a modern compiler.
(...)
>>> It would also be helpful
>>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>>> working binaries for you, in that case you could report to the gcc
>>> developers that the removal of armv4 can continue but that
>>> the --fix-v4bx option in ld needs to stay around.
>>
>> I may ask this issue on OE/Yocto mailing list as well....
>
> To clarify, the only  affected platforms are those based on either
> DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
> FootBridge, RPC, SA1100, Moxart and Gemini.

It's a bit unfortunate since there are users and active contributors to
these architectures, I think the OE community is being missed out
just because they "are not Debian". :/

Even NetWinder.org is still up and kicking.

Some of it may be nostalgia and platform-hugging with regards to
SA110 and SA1100 systems, I am certainly aware of such tendencies
in myself. And I understand if GCC drops support for old systems
that only have a bunch of elderly gentlemen running it for the fun of it.

What really worries me is if there are widely deployed SA110,
SA1100, FA526 or similar embedded systems using plain ARMv4
and doing regular kernel builds and userspaces for them, in
items with 20+ years support cycles.

With reports in the media about things like nuclear powerplants running
unsupported versions of Windows NT or 95, I want to make sure
that we're not creating a similar situation somewhere for deeply
embedded Linux. Sadly these users mostly seem to come out
of the shadows after-the-fact.

My own experiments with an upgraded Gemini platform are mostly
related to the fact that home routers using this ARMv4 SoC are still
being sold and deployed, using a v2.6 kernel (contributing to the
world of botnets I suppose). The hardware-accelerated gigabit ethernet
on these routers for the home make them still fully usable despite the
ARMv4 core, but securitywise they are a nightmare.

Yours,
Linus Walleij

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 12:48                   ` Linus Walleij
  0 siblings, 0 replies; 159+ messages in thread
From: Linus Walleij @ 2017-12-20 12:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 18, 2017 at 12:55 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
>>> On Sun, Dec 17, 2017 at 8:41 PM, Lukasz Majewski <lukma@denx.de>
>>> wrote:
>>> >> >> We also need to think about upholding support in GCC for
>>> >> >> ARMv4(t) for the foreseeable future if there is a big web of
>>> >> >> random deeply embedded systems out there that will need
>>> >> >> updates.
>>> >> >
>>> >> > But we should definitely preserve at least what we have.
>>> >>
>>> >> Plain ARMv4 (and earlier) support in gcc is already marked
>>> >> 'deprecated' and will likely be gone in gcc-8 (it's still there as
>>> >> of last week). ARMv4T is going to be around for a while, and you
>>> >> can even keep building for ARMv4 using "-march=armv4t -marm" when
>>> >> linking with 'ld --fix-v4bx'.
>>> >
>>> > I think that we shall start complaining on the gcc-devel mailing
>>> > list now.
>>> >
>>> > I would be hard to wake up in 2 years time and realise that we don't
>>> > have a modern compiler.
(...)
>>> It would also be helpful
>>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>>> working binaries for you, in that case you could report to the gcc
>>> developers that the removal of armv4 can continue but that
>>> the --fix-v4bx option in ld needs to stay around.
>>
>> I may ask this issue on OE/Yocto mailing list as well....
>
> To clarify, the only  affected platforms are those based on either
> DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
> FootBridge, RPC, SA1100, Moxart and Gemini.

It's a bit unfortunate since there are users and active contributors to
these architectures, I think the OE community is being missed out
just because they "are not Debian". :/

Even NetWinder.org is still up and kicking.

Some of it may be nostalgia and platform-hugging with regards to
SA110 and SA1100 systems, I am certainly aware of such tendencies
in myself. And I understand if GCC drops support for old systems
that only have a bunch of elderly gentlemen running it for the fun of it.

What really worries me is if there are widely deployed SA110,
SA1100, FA526 or similar embedded systems using plain ARMv4
and doing regular kernel builds and userspaces for them, in
items with 20+ years support cycles.

With reports in the media about things like nuclear powerplants running
unsupported versions of Windows NT or 95, I want to make sure
that we're not creating a similar situation somewhere for deeply
embedded Linux. Sadly these users mostly seem to come out
of the shadows after-the-fact.

My own experiments with an upgraded Gemini platform are mostly
related to the fact that home routers using this ARMv4 SoC are still
being sold and deployed, using a v2.6 kernel (contributing to the
world of botnets I suppose). The hardware-accelerated gigabit ethernet
on these routers for the home make them still fully usable despite the
ARMv4 core, but securitywise they are a nightmare.

Yours,
Linus Walleij

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 12:33           ` Linus Walleij
@ 2017-12-20 12:50             ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 12:50 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Lukasz Majewski, Alexander Sverdlin, Hartley Sweeten,
	Russell King, Linux ARM, linux-kernel, Olof Johansson

On Wed, Dec 20, 2017 at 1:33 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de> wrote:

>
> There is a point where supporting old board files will stand in
> the way and cost a lot in maintenance (like moving drivers our
> of arch/arm, or modernizing misc subsystems). Then moving the
> platform over to device tree should be preferred.

I'm generally more interested in the multiplatform conversion than
the DT conversion, and I think converting this one to multiplatform
isn't actually that hard, and doesn't have a significant risk for
regressions, the main work is to convert the clock handling.

       Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 12:50             ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 20, 2017 at 1:33 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de> wrote:

>
> There is a point where supporting old board files will stand in
> the way and cost a lot in maintenance (like moving drivers our
> of arch/arm, or modernizing misc subsystems). Then moving the
> platform over to device tree should be preferred.

I'm generally more interested in the multiplatform conversion than
the DT conversion, and I think converting this one to multiplatform
isn't actually that hard, and doesn't have a significant risk for
regressions, the main work is to convert the clock handling.

       Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 12:48                   ` Linus Walleij
@ 2017-12-20 12:59                     ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 12:59 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Russell King, Jonas Jensen, Lukasz Majewski, Alexander Sverdlin,
	Hartley Sweeten, Linux ARM, Linux Kernel Mailing List,
	Olof Johansson

On Wed, Dec 20, 2017 at 1:48 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Dec 18, 2017 at 12:55 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
>>>> It would also be helpful
>>>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>>>> working binaries for you, in that case you could report to the gcc
>>>> developers that the removal of armv4 can continue but that
>>>> the --fix-v4bx option in ld needs to stay around.
>>>
>>> I may ask this issue on OE/Yocto mailing list as well....
>>
>> To clarify, the only  affected platforms are those based on either
>> DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
>> FootBridge, RPC, SA1100, Moxart and Gemini.
>
> It's a bit unfortunate since there are users and active contributors to
> these architectures, I think the OE community is being missed out
> just because they "are not Debian". :/

IIRC, OE already uses the --fix-v4bx workaround. I had an older patch
to do the same in the kernel, let me resend it now, so you can try it
and see if that works for you.

       Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 12:59                     ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 12:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 20, 2017 at 1:48 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Dec 18, 2017 at 12:55 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Sun, Dec 17, 2017 at 10:28 PM, Lukasz Majewski <lukma@denx.de> wrote:
>>>> It would also be helpful
>>>> to test whether the -march=armv4t/--fix-v4bx workaround produces
>>>> working binaries for you, in that case you could report to the gcc
>>>> developers that the removal of armv4 can continue but that
>>>> the --fix-v4bx option in ld needs to stay around.
>>>
>>> I may ask this issue on OE/Yocto mailing list as well....
>>
>> To clarify, the only  affected platforms are those based on either
>> DEC/Intel StrongARM or Faraday FA526, i.e. EBSA-110,
>> FootBridge, RPC, SA1100, Moxart and Gemini.
>
> It's a bit unfortunate since there are users and active contributors to
> these architectures, I think the OE community is being missed out
> just because they "are not Debian". :/

IIRC, OE already uses the --fix-v4bx workaround. I had an older patch
to do the same in the kernel, let me resend it now, so you can try it
and see if that works for you.

       Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 12:50             ` Arnd Bergmann
@ 2017-12-20 13:00               ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-20 13:00 UTC (permalink / raw)
  To: Arnd Bergmann, Linus Walleij
  Cc: Lukasz Majewski, Hartley Sweeten, Russell King, Linux ARM,
	linux-kernel, Olof Johansson

Hi!

On Wed Dec 20 13:50:28 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> I'm generally more interested in the multiplatform conversion than
> the DT conversion, and I think converting this one to multiplatform
> isn't actually that hard, and doesn't have a significant risk for
> regressions, the main work is to convert the clock handling.

If it will be still possible to build the binary kernel of the same size after the conversion, I'm in for testing, otherwise it will not fit into Flash any more...

--
Alex.

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 13:00               ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-20 13:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On Wed Dec 20 13:50:28 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> I'm generally more interested in the multiplatform conversion than
> the DT conversion, and I think converting this one to multiplatform
> isn't actually that hard, and doesn't have a significant risk for
> regressions, the main work is to convert the clock handling.

If it will be still possible to build the binary kernel of the same size after the conversion, I'm in for testing, otherwise it will not fit into Flash any more...

--
Alex.

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 13:00               ` Alexander Sverdlin
@ 2017-12-20 13:14                 ` Arnd Bergmann
  -1 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 13:14 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: Linus Walleij, Lukasz Majewski, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

On Wed, Dec 20, 2017 at 2:00 PM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> Hi!
>
> On Wed Dec 20 13:50:28 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> I'm generally more interested in the multiplatform conversion than
>> the DT conversion, and I think converting this one to multiplatform
>> isn't actually that hard, and doesn't have a significant risk for
>> regressions, the main work is to convert the clock handling.
>
> If it will be still possible to build the binary kernel of the same size after the
> conversion, I'm in for testing, otherwise it will not fit into Flash any more...

I think there is an increase in code size that comes mainly from the
common clock layer itself, plus a few bytes here and there. Obviously
the increase is much bigger if you actually enable multiple platforms.

Here is the size of the uncompressed vmlinux file with the current
clk implementation, compared to a build with a build containing the
common clk code but no clock driver, and the separate clock
implementation we have today:

   text    data     bss     dec     hex filename
4752655 1036028 128260 5916943 5a490f build/tmp/vmlinux-old-clk
4780174 1040524 128284 5948982 5ac636 build/tmp/vmlinux-common-clk
   2491    1700       0    4191    105f build/tmp/arch/arm/mach-ep93xx/clock.o

The difference would come to about 0.7% of the current image size,
I guess around 1% when the other changes are included. Is that within
the margins you have, or is this already critical?

       Arnd

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 13:14                 ` Arnd Bergmann
  0 siblings, 0 replies; 159+ messages in thread
From: Arnd Bergmann @ 2017-12-20 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Dec 20, 2017 at 2:00 PM, Alexander Sverdlin
<alexander.sverdlin@gmail.com> wrote:
> Hi!
>
> On Wed Dec 20 13:50:28 2017 Arnd Bergmann <arnd@arndb.de> wrote:
>> I'm generally more interested in the multiplatform conversion than
>> the DT conversion, and I think converting this one to multiplatform
>> isn't actually that hard, and doesn't have a significant risk for
>> regressions, the main work is to convert the clock handling.
>
> If it will be still possible to build the binary kernel of the same size after the
> conversion, I'm in for testing, otherwise it will not fit into Flash any more...

I think there is an increase in code size that comes mainly from the
common clock layer itself, plus a few bytes here and there. Obviously
the increase is much bigger if you actually enable multiple platforms.

Here is the size of the uncompressed vmlinux file with the current
clk implementation, compared to a build with a build containing the
common clk code but no clock driver, and the separate clock
implementation we have today:

   text    data     bss     dec     hex filename
4752655 1036028 128260 5916943 5a490f build/tmp/vmlinux-old-clk
4780174 1040524 128284 5948982 5ac636 build/tmp/vmlinux-common-clk
   2491    1700       0    4191    105f build/tmp/arch/arm/mach-ep93xx/clock.o

The difference would come to about 0.7% of the current image size,
I guess around 1% when the other changes are included. Is that within
the margins you have, or is this already critical?

       Arnd

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 12:50             ` Arnd Bergmann
@ 2017-12-20 13:14               ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20 13:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Alexander Sverdlin, Hartley Sweeten, Russell King,
	Linux ARM, linux-kernel, Olof Johansson

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

Hi Arnd,

> On Wed, Dec 20, 2017 at 1:33 PM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
> > On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de>
> > wrote:  
> 
> >
> > There is a point where supporting old board files will stand in
> > the way and cost a lot in maintenance (like moving drivers our
> > of arch/arm, or modernizing misc subsystems). Then moving the
> > platform over to device tree should be preferred.  
> 
> I'm generally more interested in the multiplatform conversion than
> the DT conversion, and I think converting this one to multiplatform
> isn't actually that hard, and doesn't have a significant risk for
> regressions, the main work is to convert the clock handling.

Maybe we need some kind of a schedule (or roadmap)?

> 
>        Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 13:14               ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd,

> On Wed, Dec 20, 2017 at 1:33 PM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
> > On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de>
> > wrote:  
> 
> >
> > There is a point where supporting old board files will stand in
> > the way and cost a lot in maintenance (like moving drivers our
> > of arch/arm, or modernizing misc subsystems). Then moving the
> > platform over to device tree should be preferred.  
> 
> I'm generally more interested in the multiplatform conversion than
> the DT conversion, and I think converting this one to multiplatform
> isn't actually that hard, and doesn't have a significant risk for
> regressions, the main work is to convert the clock handling.

Maybe we need some kind of a schedule (or roadmap)?

> 
>        Arnd



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171220/c753049a/attachment.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 12:33           ` Linus Walleij
@ 2017-12-20 13:18             ` Lukasz Majewski
  -1 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20 13:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Alexander Sverdlin, Arnd Bergmann, Arnd Bergmann,
	Hartley Sweeten, Russell King, Linux ARM, linux-kernel,
	Olof Johansson

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

Hi Linus,

> On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de>
> wrote:
> >> On Wed Dec 13 08:34:22 2017 Linus Walleij
> >> <linus.walleij@linaro.org> wrote:  
> >> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
> >> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
> >> > industrial control systems. Likewise Hartley is doing similar
> >> > business over at Vision Engravings.
> >> >
> >> > Is the situation such that there is a whole bunch of industrial
> >> > systems out there, in active use and needing future upgrades,
> >> > that use the EP93xx?  
> >>
> >> That's definitely the case. I'm as well aware of several thousands
> >> of industrial devices which are expected to run 24/7 for the next 5
> >> years at least. And they are updated from time to time.  
> >
> > I can agree with this statement.  
> 
> OK I'm coloring this platform with a highlight for ARM32 maintenance.
> 
> >> > Arnd has been nudging me to do DT conversion for EP93xx
> >> > so if there are many active industrial users of these
> >> > I should prioritize it, because these things have 20+ years
> >> > support cycles.  
> >>
> >> I'm not sure how important or necessary at all is to change
> >> anything in these legacy platforms.  
> >
> > +1  
> 
> That is an understandable conservative stance.
> 
> There is a fine line between "it works, don't touch it" and
> "modernize the ARM32 ecosystem".

There may be a more pragmatic reason. If those boards are deployed
(widely) in the industry - there may be a problem with re-validation of
the SW.

> 
> There is a point where supporting old board files will stand in
> the way and cost a lot in maintenance (like moving drivers our
> of arch/arm, or modernizing misc subsystems). Then moving the
> platform over to device tree should be preferred.

With my limited experience - those platforms have more similarities to
x86. Multiplatform may be the goal here....

> 
> > I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2
> > works with it.
> >
> > And yes, armv4 support shall be preserved in GCC ....  

I should have be more peculiar - this is armv4t (arm920t)

> 
> Yes that is the same toochain I use.
> 
> Yours,
> Linus Walleij



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de

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

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 13:18             ` Lukasz Majewski
  0 siblings, 0 replies; 159+ messages in thread
From: Lukasz Majewski @ 2017-12-20 13:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Linus,

> On Wed, Dec 13, 2017 at 9:52 AM, Lukasz Majewski <lukma@denx.de>
> wrote:
> >> On Wed Dec 13 08:34:22 2017 Linus Walleij
> >> <linus.walleij@linaro.org> wrote:  
> >> > On Tue, Dec 12, 2017 at 12:36 AM, Lukasz Majewski <lukma@denx.de>
> >> > wrote: Out of curiosity: Liebherr is obviously doing heavy-duty
> >> > industrial control systems. Likewise Hartley is doing similar
> >> > business over at Vision Engravings.
> >> >
> >> > Is the situation such that there is a whole bunch of industrial
> >> > systems out there, in active use and needing future upgrades,
> >> > that use the EP93xx?  
> >>
> >> That's definitely the case. I'm as well aware of several thousands
> >> of industrial devices which are expected to run 24/7 for the next 5
> >> years at least. And they are updated from time to time.  
> >
> > I can agree with this statement.  
> 
> OK I'm coloring this platform with a highlight for ARM32 maintenance.
> 
> >> > Arnd has been nudging me to do DT conversion for EP93xx
> >> > so if there are many active industrial users of these
> >> > I should prioritize it, because these things have 20+ years
> >> > support cycles.  
> >>
> >> I'm not sure how important or necessary at all is to change
> >> anything in these legacy platforms.  
> >
> > +1  
> 
> That is an understandable conservative stance.
> 
> There is a fine line between "it works, don't touch it" and
> "modernize the ARM32 ecosystem".

There may be a more pragmatic reason. If those boards are deployed
(widely) in the industry - there may be a problem with re-validation of
the SW.

> 
> There is a point where supporting old board files will stand in
> the way and cost a lot in maintenance (like moving drivers our
> of arch/arm, or modernizing misc subsystems). Then moving the
> platform over to device tree should be preferred.

With my limited experience - those platforms have more similarities to
x86. Multiplatform may be the goal here....

> 
> > I'm using OE to build toolchain (SDK). I can confirm that gcc 7.2
> > works with it.
> >
> > And yes, armv4 support shall be preserved in GCC ....  

I should have be more peculiar - this is armv4t (arm920t)

> 
> Yes that is the same toochain I use.
> 
> Yours,
> Linus Walleij



Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20171220/7d527241/attachment.sig>

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

* Re: [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
  2017-12-20 13:14                 ` Arnd Bergmann
@ 2017-12-20 13:39                   ` Alexander Sverdlin
  -1 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-20 13:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linus Walleij, Lukasz Majewski, Hartley Sweeten, Russell King,
	Linux ARM, Linux Kernel Mailing List, Olof Johansson

Hi Arnd!

On Wed Dec 20 14:14:07 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > If it will be still possible to build the binary kernel of the same
> > size after the conversion, I'm in for testing, otherwise it will not
> > fit into Flash any more...
> 
> I think there is an increase in code size that comes mainly from the
> common clock layer itself, plus a few bytes here and there. Obviously
> the increase is much bigger if you actually enable multiple platforms.
> 
> Here is the size of the uncompressed vmlinux file with the current
> clk implementation, compared to a build with a build containing the
> common clk code but no clock driver, and the separate clock
> implementation we have today:
> 
>       text       data         bss         dec         hex filename
> 4752655 1036028 128260 5916943 5a490f build/tmp/vmlinux-old-clk
> 4780174 1040524 128284 5948982 5ac636 build/tmp/vmlinux-common-clk
>       2491       1700             0       4191       105f
> build/tmp/arch/arm/mach-ep93xx/clock.o
> 
> The difference would come to about 0.7% of the current image size,
> I guess around 1% when the other changes are included. Is that within
> the margins you have, or is this already critical?

No, your numbers are promising, I was afraid of the increase of other orders of magnitude. So this should be fine.

Thanks for this info.

--
Alex.

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

* [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board
@ 2017-12-20 13:39                   ` Alexander Sverdlin
  0 siblings, 0 replies; 159+ messages in thread
From: Alexander Sverdlin @ 2017-12-20 13:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Arnd!

On Wed Dec 20 14:14:07 2017 Arnd Bergmann <arnd@arndb.de> wrote:
> > If it will be still possible to build the binary kernel of the same
> > size after the conversion, I'm in for testing, otherwise it will not
> > fit into Flash any more...
> 
> I think there is an increase in code size that comes mainly from the
> common clock layer itself, plus a few bytes here and there. Obviously
> the increase is much bigger if you actually enable multiple platforms.
> 
> Here is the size of the uncompressed vmlinux file with the current
> clk implementation, compared to a build with a build containing the
> common clk code but no clock driver, and the separate clock
> implementation we have today:
> 
>? ? ?  text? ? ?  data? ? ? ?  bss? ? ? ?  dec? ? ? ?  hex filename
> 4752655 1036028 128260 5916943 5a490f build/tmp/vmlinux-old-clk
> 4780174 1040524 128284 5948982 5ac636 build/tmp/vmlinux-common-clk
>? ? ?  2491? ? ?  1700? ? ? ? ? ?  0? ? ?  4191? ? ?  105f
> build/tmp/arch/arm/mach-ep93xx/clock.o
> 
> The difference would come to about 0.7% of the current image size,
> I guess around 1% when the other changes are included. Is that within
> the margins you have, or is this already critical?

No, your numbers are promising, I was afraid of the increase of other orders of magnitude. So this should be fine.

Thanks for this info.

--
Alex.

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

end of thread, other threads:[~2017-12-20 13:39 UTC | newest]

Thread overview: 159+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 23:22 [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board Lukasz Majewski
2017-11-16 23:22 ` Lukasz Majewski
2017-11-16 23:22 ` [PATCH 1/4] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable Lukasz Majewski
2017-11-16 23:22   ` Lukasz Majewski
2017-11-16 23:22 ` [PATCH 2/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file Lukasz Majewski
2017-11-16 23:22   ` Lukasz Majewski
2017-11-16 23:22 ` [PATCH 3/4] ARM: ep93xx: ts72xx: Exclude reusable part of the ts72xx board Lukasz Majewski
2017-11-16 23:22   ` Lukasz Majewski
2017-11-16 23:22 ` [PATCH 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative Lukasz Majewski
2017-11-16 23:22   ` Lukasz Majewski
2017-11-19 21:28 ` [PATCH 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board Alexander Sverdlin
2017-11-19 21:28   ` Alexander Sverdlin
2017-11-19 23:23   ` Lukasz Majewski
2017-11-19 23:23     ` Lukasz Majewski
2017-11-20 13:23     ` Arnd Bergmann
2017-11-20 13:23       ` Arnd Bergmann
2017-11-20 14:44       ` Lukasz Majewski
2017-11-20 14:44         ` Lukasz Majewski
2017-11-21 14:31 ` [PATCH v2 0/6] " Lukasz Majewski
2017-11-21 14:31   ` Lukasz Majewski
2017-11-21 14:31   ` [PATCH v2 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable Lukasz Majewski
2017-11-21 14:31     ` Lukasz Majewski
2017-11-29 20:33     ` Alexander Sverdlin
2017-11-29 20:33       ` Alexander Sverdlin
2017-11-21 14:32   ` [PATCH v2 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file Lukasz Majewski
2017-11-21 14:32     ` Lukasz Majewski
2017-11-29 20:34     ` Alexander Sverdlin
2017-11-29 20:34       ` Alexander Sverdlin
2017-11-21 14:32   ` [PATCH v2 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters Lukasz Majewski
2017-11-21 14:32     ` Lukasz Majewski
2017-11-29 20:54     ` Alexander Sverdlin
2017-11-29 20:54       ` Alexander Sverdlin
2017-11-21 14:32   ` [PATCH v2 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable Lukasz Majewski
2017-11-21 14:32     ` Lukasz Majewski
2017-11-29 20:36     ` Alexander Sverdlin
2017-11-29 20:36       ` Alexander Sverdlin
2017-11-21 14:32   ` [PATCH v2 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code Lukasz Majewski
2017-11-21 14:32     ` Lukasz Majewski
2017-11-21 14:32   ` [PATCH v2 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative Lukasz Majewski
2017-11-21 14:32     ` Lukasz Majewski
2017-11-29 20:48     ` Alexander Sverdlin
2017-11-29 20:48       ` Alexander Sverdlin
2017-11-29 22:07       ` Lukasz Majewski
2017-11-29 22:07         ` Lukasz Majewski
2017-11-30  0:26         ` Lukasz Majewski
2017-11-30  0:26           ` Lukasz Majewski
2017-11-30  7:07         ` Alexander Sverdlin
2017-11-30  7:07           ` Alexander Sverdlin
2017-11-29  9:45   ` [PATCH v2 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board Lukasz Majewski
2017-11-29  9:45     ` Lukasz Majewski
2017-11-29 12:48     ` Arnd Bergmann
2017-11-29 12:48       ` Arnd Bergmann
2017-11-30  0:45 ` [PATCH v3 " Lukasz Majewski
2017-11-30  0:45   ` Lukasz Majewski
2017-11-30  0:45   ` [PATCH v3 1/6] ARM: ep93xx: ts72xx: Use DEFINE_RES_MEM macros where applicable Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30 16:59     ` Hartley Sweeten
2017-11-30 16:59       ` Hartley Sweeten
2017-11-30  0:45   ` [PATCH v3 2/6] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30  0:45   ` [PATCH v3 3/6] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30 17:07     ` Hartley Sweeten
2017-11-30 17:07       ` Hartley Sweeten
2017-11-30  0:45   ` [PATCH v3 4/6] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30 17:11     ` Hartley Sweeten
2017-11-30 17:11       ` Hartley Sweeten
2017-11-30  0:45   ` [PATCH v3 5/6] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30 17:23     ` Hartley Sweeten
2017-11-30 17:23       ` Hartley Sweeten
2017-11-30 20:01       ` Alexander Sverdlin
2017-11-30 20:01         ` Alexander Sverdlin
2017-11-30  0:45   ` [PATCH v3 6/6] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative Lukasz Majewski
2017-11-30  0:45     ` Lukasz Majewski
2017-11-30  9:02   ` [PATCH v3 0/6] ARM: ep93xx: ts72xx: Add support for BK3 board Arnd Bergmann
2017-11-30  9:02     ` Arnd Bergmann
2017-11-30  9:57     ` Alexander Sverdlin
2017-11-30 10:44       ` Arnd Bergmann
2017-11-30 10:44         ` Arnd Bergmann
2017-11-30 23:51 ` [PATCH v4 0/5] " Lukasz Majewski
2017-11-30 23:51   ` Lukasz Majewski
2017-11-30 23:51   ` [PATCH v4 1/5] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file Lukasz Majewski
2017-11-30 23:51     ` Lukasz Majewski
2017-11-30 23:51   ` [PATCH v4 2/5] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters Lukasz Majewski
2017-11-30 23:51     ` Lukasz Majewski
2017-11-30 23:51   ` [PATCH v4 3/5] ARM: ep93xx: ts72xx: Rewrite map IO code to be reusable Lukasz Majewski
2017-11-30 23:51     ` Lukasz Majewski
2017-11-30 23:51   ` [PATCH v4 4/5] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code Lukasz Majewski
2017-11-30 23:51     ` Lukasz Majewski
2017-11-30 23:51   ` [PATCH v4 5/5] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative Lukasz Majewski
2017-11-30 23:51     ` Lukasz Majewski
2017-12-11 17:17     ` Hartley Sweeten
2017-12-11 17:17       ` Hartley Sweeten
2017-12-11 21:39       ` Lukasz Majewski
2017-12-11 21:39         ` Lukasz Majewski
2017-12-11 22:28         ` Hartley Sweeten
2017-12-11 22:28           ` Hartley Sweeten
2017-12-11 22:46           ` Lukasz Majewski
2017-12-11 22:46             ` Lukasz Majewski
2017-12-05 18:14   ` [PATCH v4 0/5] ARM: ep93xx: ts72xx: Add support for BK3 board Hartley Sweeten
2017-12-05 18:14     ` Hartley Sweeten
2017-12-06 17:46     ` Alexander Sverdlin
2017-12-06 17:46       ` Alexander Sverdlin
2017-12-11 23:36 ` [PATCH v5 0/4] " Lukasz Majewski
2017-12-11 23:36   ` Lukasz Majewski
2017-12-11 23:36   ` [PATCH v5 1/4] ARM: ep93xx: ts72xx: Provide include guards for ts72xx.h file Lukasz Majewski
2017-12-11 23:36     ` Lukasz Majewski
2017-12-11 23:36   ` [PATCH v5 2/4] ARM: ep93xx: ts72xx: Rewrite ts72xx_register_flash() to accept parameters Lukasz Majewski
2017-12-11 23:36     ` Lukasz Majewski
2017-12-11 23:36   ` [PATCH v5 3/4] ARM: ep93xx: ts72xx: cosmetic: Add some description to ts72xx code Lukasz Majewski
2017-12-11 23:36     ` Lukasz Majewski
2017-12-11 23:36   ` [PATCH v5 4/4] ARM: ep93xx: ts72xx: Add support for BK3 board - ts72xx derivative Lukasz Majewski
2017-12-11 23:36     ` Lukasz Majewski
2017-12-11 23:43   ` [PATCH v5 0/4] ARM: ep93xx: ts72xx: Add support for BK3 board Hartley Sweeten
2017-12-11 23:43     ` Hartley Sweeten
2017-12-13  7:34   ` Linus Walleij
2017-12-13  7:34     ` Linus Walleij
2017-12-13  8:26     ` Alexander Sverdlin
2017-12-13  8:26       ` Alexander Sverdlin
2017-12-13  8:52       ` Lukasz Majewski
2017-12-13  8:52         ` Lukasz Majewski
2017-12-20 12:33         ` Linus Walleij
2017-12-20 12:33           ` Linus Walleij
2017-12-20 12:50           ` Arnd Bergmann
2017-12-20 12:50             ` Arnd Bergmann
2017-12-20 13:00             ` Alexander Sverdlin
2017-12-20 13:00               ` Alexander Sverdlin
2017-12-20 13:14               ` Arnd Bergmann
2017-12-20 13:14                 ` Arnd Bergmann
2017-12-20 13:39                 ` Alexander Sverdlin
2017-12-20 13:39                   ` Alexander Sverdlin
2017-12-20 13:14             ` Lukasz Majewski
2017-12-20 13:14               ` Lukasz Majewski
2017-12-20 13:18           ` Lukasz Majewski
2017-12-20 13:18             ` Lukasz Majewski
2017-12-13 10:11       ` Arnd Bergmann
2017-12-13 10:11         ` Arnd Bergmann
2017-12-17 19:41         ` Lukasz Majewski
2017-12-17 19:41           ` Lukasz Majewski
2017-12-17 20:07           ` Arnd Bergmann
2017-12-17 20:07             ` Arnd Bergmann
2017-12-17 21:28             ` Lukasz Majewski
2017-12-17 21:28               ` Lukasz Majewski
2017-12-18 11:55               ` Arnd Bergmann
2017-12-18 11:55                 ` Arnd Bergmann
2017-12-18 12:03                 ` Alexander Sverdlin
2017-12-18 12:03                   ` Alexander Sverdlin
2017-12-19 21:36                   ` Lukasz Majewski
2017-12-19 21:36                     ` Lukasz Majewski
2017-12-20  8:11                     ` Arnd Bergmann
2017-12-20  8:11                       ` Arnd Bergmann
2017-12-20  8:53                       ` Lukasz Majewski
2017-12-20  8:53                         ` Lukasz Majewski
2017-12-20 12:48                 ` Linus Walleij
2017-12-20 12:48                   ` Linus Walleij
2017-12-20 12:59                   ` Arnd Bergmann
2017-12-20 12:59                     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.