All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ARM: mach-moxart: add MOXA ART SoC support
@ 2013-06-12 12:34 ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, linux-kernel, Jonas Jensen

This set adds support for MOXA ART SoC.

Applies to arm-soc/for-next.

Note: no boot without clocksource and irqchip drivers (I'll submit these separately to the correct maintainers).

The main thread of discussion can be found here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-May/168438.html

Full source (including drivers) here:
https://code.google.com/p/linux-3-10-rc1-moxart/source/list

Jonas Jensen (3):
  ARM: mach-moxart: add MOXA ART SoC files
  ARM: mach-moxart: add MOXA ART device tree files
  ARM: mach-moxart: add MOXA ART UART debug files

 arch/arm/Kconfig                           |    2 +
 arch/arm/Kconfig.debug                     |   10 +++
 arch/arm/Makefile                          |    1 +
 arch/arm/boot/dts/Makefile                 |    1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts      |   89 ++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi              |   84 +++++++++++++++++++++
 arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
 arch/arm/include/debug/moxart.S            |   14 ++++
 arch/arm/mach-moxart/Kconfig               |   28 +++++++
 arch/arm/mach-moxart/Makefile              |   10 +++
 arch/arm/mach-moxart/idle.c                |   21 +++++
 arch/arm/mach-moxart/moxart.c              |   23 ++++++
 12 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi
 create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
 create mode 100644 arch/arm/include/debug/moxart.S
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/idle.c
 create mode 100644 arch/arm/mach-moxart/moxart.c

-- 
1.7.2.5


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

* [PATCH 0/3] ARM: mach-moxart: add MOXA ART SoC support
@ 2013-06-12 12:34 ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel

This set adds support for MOXA ART SoC.

Applies to arm-soc/for-next.

Note: no boot without clocksource and irqchip drivers (I'll submit these separately to the correct maintainers).

The main thread of discussion can be found here:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-May/168438.html

Full source (including drivers) here:
https://code.google.com/p/linux-3-10-rc1-moxart/source/list

Jonas Jensen (3):
  ARM: mach-moxart: add MOXA ART SoC files
  ARM: mach-moxart: add MOXA ART device tree files
  ARM: mach-moxart: add MOXA ART UART debug files

 arch/arm/Kconfig                           |    2 +
 arch/arm/Kconfig.debug                     |   10 +++
 arch/arm/Makefile                          |    1 +
 arch/arm/boot/dts/Makefile                 |    1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts      |   89 ++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi              |   84 +++++++++++++++++++++
 arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
 arch/arm/include/debug/moxart.S            |   14 ++++
 arch/arm/mach-moxart/Kconfig               |   28 +++++++
 arch/arm/mach-moxart/Makefile              |   10 +++
 arch/arm/mach-moxart/idle.c                |   21 +++++
 arch/arm/mach-moxart/moxart.c              |   23 ++++++
 12 files changed, 395 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi
 create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
 create mode 100644 arch/arm/include/debug/moxart.S
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/idle.c
 create mode 100644 arch/arm/mach-moxart/moxart.c

-- 
1.7.2.5

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-12 12:34 ` Jonas Jensen
@ 2013-06-12 12:34   ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, linux-kernel, Jonas Jensen


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/Kconfig                           |    2 +
 arch/arm/Makefile                          |    1 +
 arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
 arch/arm/mach-moxart/Kconfig               |   28 +++++++
 arch/arm/mach-moxart/Makefile              |   10 +++
 arch/arm/mach-moxart/idle.c                |   21 +++++
 arch/arm/mach-moxart/moxart.c              |   23 ++++++
 7 files changed, 197 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/idle.c
 create mode 100644 arch/arm/mach-moxart/moxart.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0435a6a..b004ae0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -937,6 +937,8 @@ source "arch/arm/mach-footbridge/Kconfig"
 
 source "arch/arm/mach-gemini/Kconfig"
 
+source "arch/arm/mach-moxart/Kconfig"
+
 source "arch/arm/mach-highbank/Kconfig"
 
 source "arch/arm/mach-integrator/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3380c4f..eb8f48e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -148,6 +148,7 @@ machine-$(CONFIG_ARCH_DOVE)		+= dove
 machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
 machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
+machine-$(CONFIG_ARCH_MOXART)		+= moxart
 machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
 machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
 machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
diff --git a/arch/arm/configs/moxart_uc7112lx_defconfig b/arch/arm/configs/moxart_uc7112lx_defconfig
new file mode 100644
index 0000000..8d8f3a4
--- /dev/null
+++ b/arch/arm/configs/moxart_uc7112lx_defconfig
@@ -0,0 +1,112 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_MULTI_V4=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MOXART=y
+CONFIG_MACH_UC7112LX=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ATAGS is not set
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_ARM_MOXART_ETHER=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_MOXA_SMARTIO=y
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_MOXART=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_MOXART_WDT=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI_MOXART=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MOXART=y
+CONFIG_DMADEVICES=y
+CONFIG_MOXART_DMA=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_EXT3_FS=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
new file mode 100644
index 0000000..633ce74
--- /dev/null
+++ b/arch/arm/mach-moxart/Kconfig
@@ -0,0 +1,28 @@
+config ARCH_MOXART
+	bool "MOXA ART SoC" if (ARCH_MULTI_V4)
+	select CPU_FA526
+	select ARM_DMA_MEM_BUFFERABLE
+	select USE_OF
+	select CLKSRC_OF
+	select HAVE_CLK
+	select COMMON_CLK
+	select GENERIC_IRQ_CHIP
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Say Y here if you want to run your kernel on hardware with a MOXA ART SoC.
+	  This is a Faraday FA526 ARMv4 32-bit 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX)
+	  This perticular SoC is used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.
+
+if ARCH_MOXART
+
+menu "MOXA ART SoC Implementation"
+
+config MACH_UC7112LX
+	bool "MOXA UC-7112-LX"
+	depends on ARCH_MOXART
+	help
+	  Say Y here if you intend to run this kernel on a MOXA UC-7112-LX embedded computer.
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
new file mode 100644
index 0000000..56d8984
--- /dev/null
+++ b/arch/arm/mach-moxart/Makefile
@@ -0,0 +1,10 @@
+#
+# Makefile for the linux kernel.
+#
+
+# Object file lists.
+
+obj-y          := idle.o
+
+obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
+
diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
new file mode 100644
index 0000000..73ed844
--- /dev/null
+++ b/arch/arm/mach-moxart/idle.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#include <linux/init.h>
+#include <asm/system.h>
+#include <asm/proc-fns.h>
+
+static void moxart_idle(void)
+{
+}
+
+static int __init moxart_idle_init(void)
+{
+	arm_pm_idle = moxart_idle;
+	return 0;
+}
+
+arch_initcall(moxart_idle_init);
diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
new file mode 100644
index 0000000..ab70386
--- /dev/null
+++ b/arch/arm/mach-moxart/moxart.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
+
+#include <asm/mach/arch.h>
+
+static const char * const moxart_dt_compat[] = {
+	"moxa,moxart-uc-7112-lx",
+	NULL,
+};
+
+DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
+	.dt_compat		= moxart_dt_compat,
+MACHINE_END
+
-- 
1.7.2.5


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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-12 12:34   ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/Kconfig                           |    2 +
 arch/arm/Makefile                          |    1 +
 arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
 arch/arm/mach-moxart/Kconfig               |   28 +++++++
 arch/arm/mach-moxart/Makefile              |   10 +++
 arch/arm/mach-moxart/idle.c                |   21 +++++
 arch/arm/mach-moxart/moxart.c              |   23 ++++++
 7 files changed, 197 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/idle.c
 create mode 100644 arch/arm/mach-moxart/moxart.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0435a6a..b004ae0 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -937,6 +937,8 @@ source "arch/arm/mach-footbridge/Kconfig"
 
 source "arch/arm/mach-gemini/Kconfig"
 
+source "arch/arm/mach-moxart/Kconfig"
+
 source "arch/arm/mach-highbank/Kconfig"
 
 source "arch/arm/mach-integrator/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3380c4f..eb8f48e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -148,6 +148,7 @@ machine-$(CONFIG_ARCH_DOVE)		+= dove
 machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
 machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
 machine-$(CONFIG_ARCH_GEMINI)		+= gemini
+machine-$(CONFIG_ARCH_MOXART)		+= moxart
 machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
 machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
 machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
diff --git a/arch/arm/configs/moxart_uc7112lx_defconfig b/arch/arm/configs/moxart_uc7112lx_defconfig
new file mode 100644
index 0000000..8d8f3a4
--- /dev/null
+++ b/arch/arm/configs/moxart_uc7112lx_defconfig
@@ -0,0 +1,112 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_MULTI_V4=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MOXART=y
+CONFIG_MACH_UC7112LX=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ATAGS is not set
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_ARM_MOXART_ETHER=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_MOXA_SMARTIO=y
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_MOXART=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_MOXART_WDT=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI_MOXART=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MOXART=y
+CONFIG_DMADEVICES=y
+CONFIG_MOXART_DMA=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_EXT3_FS=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
new file mode 100644
index 0000000..633ce74
--- /dev/null
+++ b/arch/arm/mach-moxart/Kconfig
@@ -0,0 +1,28 @@
+config ARCH_MOXART
+	bool "MOXA ART SoC" if (ARCH_MULTI_V4)
+	select CPU_FA526
+	select ARM_DMA_MEM_BUFFERABLE
+	select USE_OF
+	select CLKSRC_OF
+	select HAVE_CLK
+	select COMMON_CLK
+	select GENERIC_IRQ_CHIP
+	select ARCH_REQUIRE_GPIOLIB
+	help
+	  Say Y here if you want to run your kernel on hardware with a MOXA ART SoC.
+	  This is a Faraday FA526 ARMv4 32-bit 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX)
+	  This perticular SoC is used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.
+
+if ARCH_MOXART
+
+menu "MOXA ART SoC Implementation"
+
+config MACH_UC7112LX
+	bool "MOXA UC-7112-LX"
+	depends on ARCH_MOXART
+	help
+	  Say Y here if you intend to run this kernel on a MOXA UC-7112-LX embedded computer.
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
new file mode 100644
index 0000000..56d8984
--- /dev/null
+++ b/arch/arm/mach-moxart/Makefile
@@ -0,0 +1,10 @@
+#
+# Makefile for the linux kernel.
+#
+
+# Object file lists.
+
+obj-y          := idle.o
+
+obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
+
diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
new file mode 100644
index 0000000..73ed844
--- /dev/null
+++ b/arch/arm/mach-moxart/idle.c
@@ -0,0 +1,21 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#include <linux/init.h>
+#include <asm/system.h>
+#include <asm/proc-fns.h>
+
+static void moxart_idle(void)
+{
+}
+
+static int __init moxart_idle_init(void)
+{
+	arm_pm_idle = moxart_idle;
+	return 0;
+}
+
+arch_initcall(moxart_idle_init);
diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
new file mode 100644
index 0000000..ab70386
--- /dev/null
+++ b/arch/arm/mach-moxart/moxart.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/io.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
+
+#include <asm/mach/arch.h>
+
+static const char * const moxart_dt_compat[] = {
+	"moxa,moxart-uc-7112-lx",
+	NULL,
+};
+
+DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
+	.dt_compat		= moxart_dt_compat,
+MACHINE_END
+
-- 
1.7.2.5

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

* [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
  2013-06-12 12:34 ` Jonas Jensen
@ 2013-06-12 12:34   ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, linux-kernel, Jonas Jensen


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/boot/dts/Makefile            |    1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts |   89 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi         |   84 +++++++++++++++++++++++++++++++
 3 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0d1e98b..059e6d3 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
 	wm8750-apc8750.dtb \
 	wm8850-w70v2.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 
 targets += dtbs
 targets += $(dtb-y)
diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
new file mode 100644
index 0000000..c2bb7dc
--- /dev/null
+++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
@@ -0,0 +1,89 @@
+/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later. */
+
+/dts-v1/;
+/include/ "moxart.dtsi"
+
+/ {
+	model = "MOXA UC-7112-LX";
+	compatible = "moxa,moxart-uc-7112-lx";
+
+	memory {
+		reg = <0x00000000 0x02000000>;
+	};
+
+	flash@80000000,0 {
+		/* JS28F128 J3D75 A9087684 - Numonyx Embedded Flash Memory (J3 v. D) */
+		compatible = "numonyx,js28f128", "cfi-flash";
+		reg = <0x80000000 0x01000000>;
+		bank-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "bootloader";
+			reg = <0x00000000 0x00040000>;
+		};
+		partition@40000 {
+			label = "linux kernel";
+			reg = <0x00040000 0x001C0000>;
+		};
+		partition@200000 {
+			label = "root filesystem";
+			reg = <0x00200000 0x00800000>;
+		};
+		partition@a00000 {
+			label = "user filesystem";
+			reg = <0x00a00000 0x00600000>;
+		};
+	};
+
+	mmc@98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg =	<0x98e00000 0x00001000>;
+		interrupts = <5 0>;
+		clock-names = "sys_clk";
+		clocks = <&sys_clk>;
+	};
+
+	mxser@98200040 {
+		compatible = "moxa,moxart-mxser";
+		reg =	<0x98200040 0x00000080>,	/* UART "3" base */
+				<0x982000e4 0x00000080>,	/* UART mode base */
+				<0x982000c0 0x00000020>;	/* UART interrupt vector */
+		interrupts = <31 1>;
+	};
+
+	mac0: mac@90900000 {
+		compatible = "moxa,moxart-mac0";
+		reg =   <0x90900000 0x1000>,
+				<0x80000050 0x5>;			/* MAC address stored on flash */
+		interrupts = <25 0>;
+	};
+
+	mac1: mac@92000000 {
+		compatible = "moxa,moxart-mac1";
+		reg =   <0x92000000 0x1000>,
+				<0x80000056 0x5>;			/* MAC address stored on flash */
+		interrupts = <27 0>;
+	};
+
+	uart0: uart@98200000 {
+		compatible = "ns16550a";
+		reg = <0x98200000 0x20>;
+		interrupts = <31 0>;
+		reg-shift = <2>;
+		reg-io-width = <4>;
+		clock-frequency = <14745600>;
+		status = "okay";
+	};
+
+	chosen {
+		/* uncomment to use on board flash root
+		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
+		*/
+		bootargs = "console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait";
+	};
+};
diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
new file mode 100644
index 0000000..debedb7
--- /dev/null
+++ b/arch/arm/boot/dts/moxart.dtsi
@@ -0,0 +1,84 @@
+/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later. */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	interrupt-parent = <&intc>;
+
+	cpus {
+		cpu@0 {
+			compatible = "faraday,fa526";
+		};
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		osc: oscillator {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;
+		};
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x90000000 0x10000000>;
+		ranges;
+
+		intc: interrupt-controller@98800000 {
+			compatible = "moxa,moxart-interrupt-controller";
+			reg = <0x98800000 0x38>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupt-mask = <0x00080000>;		/* single register vector, interrupts 0-31, 1s signify edge */
+		};
+
+		timer: timer@98400000 {
+			compatible = "moxa,moxart-timer";
+			reg = <0x98400000 0x10>;
+			interrupts = <19 1>;
+		};
+
+		gpio: gpio@98700000 {
+			compatible = "moxa,moxart-gpio";
+			reg =	<0x98700000 0x1000>,
+					<0x98100100 0x4>;			/*	Power Management Unit
+													enable/disable pin 0-31 (32bit register) */
+		};
+
+		rtc: rtc {
+			compatible = "moxa,moxart-rtc";
+		};
+
+		dma: dma@90500000 {
+			compatible = "moxa,moxart-dma";
+			reg = <0x90500000 0x1000>;
+			interrupts = <24 0>;
+		};
+
+		watchdog: watchdog@98500000 {
+			compatible = "moxa,moxart-watchdog";
+			reg = <0x98500000 0x1000>;
+		};
+
+		pmu: pmu@98100000 {						/* Power Management Unit */
+			compatible = "moxa,moxart-pmu";
+			reg = <0x98100000 0x34>;			/* offset mul @ 0x30, val @ 0x0c (2 * 32 bit registers) */
+			clocks {
+				sys_clk: sys_clk {
+					#clock-cells = <0>;
+					compatible = "moxa,moxart-sysclk";
+					clock-output-names = "sys_clk";
+				};
+			};
+		};
+	};
+};
-- 
1.7.2.5


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

* [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-06-12 12:34   ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/boot/dts/Makefile            |    1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts |   89 +++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi         |   84 +++++++++++++++++++++++++++++++
 3 files changed, 174 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0d1e98b..059e6d3 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
 	wm8750-apc8750.dtb \
 	wm8850-w70v2.dtb
 dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
+dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 
 targets += dtbs
 targets += $(dtb-y)
diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
new file mode 100644
index 0000000..c2bb7dc
--- /dev/null
+++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
@@ -0,0 +1,89 @@
+/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later. */
+
+/dts-v1/;
+/include/ "moxart.dtsi"
+
+/ {
+	model = "MOXA UC-7112-LX";
+	compatible = "moxa,moxart-uc-7112-lx";
+
+	memory {
+		reg = <0x00000000 0x02000000>;
+	};
+
+	flash at 80000000,0 {
+		/* JS28F128 J3D75 A9087684 - Numonyx Embedded Flash Memory (J3 v. D) */
+		compatible = "numonyx,js28f128", "cfi-flash";
+		reg = <0x80000000 0x01000000>;
+		bank-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition at 0 {
+			label = "bootloader";
+			reg = <0x00000000 0x00040000>;
+		};
+		partition at 40000 {
+			label = "linux kernel";
+			reg = <0x00040000 0x001C0000>;
+		};
+		partition at 200000 {
+			label = "root filesystem";
+			reg = <0x00200000 0x00800000>;
+		};
+		partition at a00000 {
+			label = "user filesystem";
+			reg = <0x00a00000 0x00600000>;
+		};
+	};
+
+	mmc at 98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg =	<0x98e00000 0x00001000>;
+		interrupts = <5 0>;
+		clock-names = "sys_clk";
+		clocks = <&sys_clk>;
+	};
+
+	mxser at 98200040 {
+		compatible = "moxa,moxart-mxser";
+		reg =	<0x98200040 0x00000080>,	/* UART "3" base */
+				<0x982000e4 0x00000080>,	/* UART mode base */
+				<0x982000c0 0x00000020>;	/* UART interrupt vector */
+		interrupts = <31 1>;
+	};
+
+	mac0: mac at 90900000 {
+		compatible = "moxa,moxart-mac0";
+		reg =   <0x90900000 0x1000>,
+				<0x80000050 0x5>;			/* MAC address stored on flash */
+		interrupts = <25 0>;
+	};
+
+	mac1: mac at 92000000 {
+		compatible = "moxa,moxart-mac1";
+		reg =   <0x92000000 0x1000>,
+				<0x80000056 0x5>;			/* MAC address stored on flash */
+		interrupts = <27 0>;
+	};
+
+	uart0: uart at 98200000 {
+		compatible = "ns16550a";
+		reg = <0x98200000 0x20>;
+		interrupts = <31 0>;
+		reg-shift = <2>;
+		reg-io-width = <4>;
+		clock-frequency = <14745600>;
+		status = "okay";
+	};
+
+	chosen {
+		/* uncomment to use on board flash root
+		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
+		*/
+		bootargs = "console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait";
+	};
+};
diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
new file mode 100644
index 0000000..debedb7
--- /dev/null
+++ b/arch/arm/boot/dts/moxart.dtsi
@@ -0,0 +1,84 @@
+/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later. */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	interrupt-parent = <&intc>;
+
+	cpus {
+		cpu at 0 {
+			compatible = "faraday,fa526";
+		};
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		osc: oscillator {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;
+		};
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x90000000 0x10000000>;
+		ranges;
+
+		intc: interrupt-controller at 98800000 {
+			compatible = "moxa,moxart-interrupt-controller";
+			reg = <0x98800000 0x38>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupt-mask = <0x00080000>;		/* single register vector, interrupts 0-31, 1s signify edge */
+		};
+
+		timer: timer at 98400000 {
+			compatible = "moxa,moxart-timer";
+			reg = <0x98400000 0x10>;
+			interrupts = <19 1>;
+		};
+
+		gpio: gpio at 98700000 {
+			compatible = "moxa,moxart-gpio";
+			reg =	<0x98700000 0x1000>,
+					<0x98100100 0x4>;			/*	Power Management Unit
+													enable/disable pin 0-31 (32bit register) */
+		};
+
+		rtc: rtc {
+			compatible = "moxa,moxart-rtc";
+		};
+
+		dma: dma at 90500000 {
+			compatible = "moxa,moxart-dma";
+			reg = <0x90500000 0x1000>;
+			interrupts = <24 0>;
+		};
+
+		watchdog: watchdog at 98500000 {
+			compatible = "moxa,moxart-watchdog";
+			reg = <0x98500000 0x1000>;
+		};
+
+		pmu: pmu at 98100000 {						/* Power Management Unit */
+			compatible = "moxa,moxart-pmu";
+			reg = <0x98100000 0x34>;			/* offset mul @ 0x30, val @ 0x0c (2 * 32 bit registers) */
+			clocks {
+				sys_clk: sys_clk {
+					#clock-cells = <0>;
+					compatible = "moxa,moxart-sysclk";
+					clock-output-names = "sys_clk";
+				};
+			};
+		};
+	};
+};
-- 
1.7.2.5

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

* [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
  2013-06-12 12:34 ` Jonas Jensen
@ 2013-06-12 12:34   ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: linux, linux-kernel, Jonas Jensen


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/Kconfig.debug          |   10 ++++++++++
 arch/arm/include/debug/moxart.S |   14 ++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/debug/moxart.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1d41908..a0e4a32 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -422,6 +422,15 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on Allwinner A1X based platforms on the UART1.
 
+    config DEBUG_MOXART_UART0
+        bool "Kernel low-level debugging messages via MOXART UART0"
+        depends on ARCH_MOXART
+        help
+          Say Y here if you want kernel low-level debugging support
+          on MOXART based platforms on the UART0.
+          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
+          uses arch/arm/include/debug/moxart.S:s "addruart" macro
+
 	config DEBUG_TEGRA_UART
 		depends on ARCH_TEGRA
 		bool "Use Tegra UART for low-level debug"
@@ -642,6 +651,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
 	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
 	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
+	default "debug/moxart.S" if DEBUG_MOXART_UART0
 	default "debug/tegra.S" if DEBUG_TEGRA_UART
 	default "debug/ux500.S" if DEBUG_UX500_UART
 	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
new file mode 100644
index 0000000..01e2aee
--- /dev/null
+++ b/arch/arm/include/debug/moxart.S
@@ -0,0 +1,14 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
+
+.macro	addruart, rp, rv, tmp
+	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE	@ physical
+.endm
+
+#define UART_SHIFT	2
+#include <asm/hardware/debug-8250.S>
-- 
1.7.2.5


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

* [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-06-12 12:34   ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-12 12:34 UTC (permalink / raw)
  To: linux-arm-kernel


Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---
 arch/arm/Kconfig.debug          |   10 ++++++++++
 arch/arm/include/debug/moxart.S |   14 ++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/debug/moxart.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 1d41908..a0e4a32 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -422,6 +422,15 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on Allwinner A1X based platforms on the UART1.
 
+    config DEBUG_MOXART_UART0
+        bool "Kernel low-level debugging messages via MOXART UART0"
+        depends on ARCH_MOXART
+        help
+          Say Y here if you want kernel low-level debugging support
+          on MOXART based platforms on the UART0.
+          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
+          uses arch/arm/include/debug/moxart.S:s "addruart" macro
+
 	config DEBUG_TEGRA_UART
 		depends on ARCH_TEGRA
 		bool "Use Tegra UART for low-level debug"
@@ -642,6 +651,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
 	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
 	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
+	default "debug/moxart.S" if DEBUG_MOXART_UART0
 	default "debug/tegra.S" if DEBUG_TEGRA_UART
 	default "debug/ux500.S" if DEBUG_UX500_UART
 	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
new file mode 100644
index 0000000..01e2aee
--- /dev/null
+++ b/arch/arm/include/debug/moxart.S
@@ -0,0 +1,14 @@
+/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version. */
+
+#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
+
+.macro	addruart, rp, rv, tmp
+	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE	@ physical
+.endm
+
+#define UART_SHIFT	2
+#include <asm/hardware/debug-8250.S>
-- 
1.7.2.5

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-06-12 22:42     ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:42 UTC (permalink / raw)
  To: Jonas Jensen; +Cc: linux-arm-kernel, linux, linux-kernel

Hi,


This looks pretty good. I have mostly a bunch of nits below.

Please feel free to cc arm@kernel.org (which goes to us arm-soc maintainers) on
future postings.

On Wed, Jun 12, 2013 at 02:34:06PM +0200, Jonas Jensen wrote:
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>

You should provide a commit message, ideally with a short introduction of the
platform.

> ---
>  arch/arm/Kconfig                           |    2 +
>  arch/arm/Makefile                          |    1 +
>  arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
>  arch/arm/mach-moxart/Kconfig               |   28 +++++++
>  arch/arm/mach-moxart/Makefile              |   10 +++
>  arch/arm/mach-moxart/idle.c                |   21 +++++
>  arch/arm/mach-moxart/moxart.c              |   23 ++++++
>  7 files changed, 197 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
>  create mode 100644 arch/arm/mach-moxart/Kconfig
>  create mode 100644 arch/arm/mach-moxart/Makefile
>  create mode 100644 arch/arm/mach-moxart/idle.c
>  create mode 100644 arch/arm/mach-moxart/moxart.c
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0435a6a..b004ae0 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -937,6 +937,8 @@ source "arch/arm/mach-footbridge/Kconfig"
>  
>  source "arch/arm/mach-gemini/Kconfig"
>  
> +source "arch/arm/mach-moxart/Kconfig"
> +
>  source "arch/arm/mach-highbank/Kconfig"
>  
>  source "arch/arm/mach-integrator/Kconfig"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 3380c4f..eb8f48e 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -148,6 +148,7 @@ machine-$(CONFIG_ARCH_DOVE)		+= dove
>  machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
>  machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
>  machine-$(CONFIG_ARCH_GEMINI)		+= gemini
> +machine-$(CONFIG_ARCH_MOXART)		+= moxart
>  machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
>  machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
>  machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
> diff --git a/arch/arm/configs/moxart_uc7112lx_defconfig b/arch/arm/configs/moxart_uc7112lx_defconfig
> new file mode 100644
> index 0000000..8d8f3a4
> --- /dev/null
> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig

It'd be nice to keep the defconfig generic, and make sure to enable all boards
in it -- we're generally OK with adding one defconfig per platform upstream but
not more.

> diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
> new file mode 100644
> index 0000000..633ce74
> --- /dev/null
> +++ b/arch/arm/mach-moxart/Kconfig
> @@ -0,0 +1,28 @@
> +config ARCH_MOXART
> +	bool "MOXA ART SoC" if (ARCH_MULTI_V4)

No parens needed

> +	select CPU_FA526
> +	select ARM_DMA_MEM_BUFFERABLE
> +	select USE_OF
> +	select CLKSRC_OF
> +	select HAVE_CLK
> +	select COMMON_CLK
> +	select GENERIC_IRQ_CHIP
> +	select ARCH_REQUIRE_GPIOLIB
> +	help
> +	  Say Y here if you want to run your kernel on hardware with a MOXA ART SoC.
> +	  This is a Faraday FA526 ARMv4 32-bit 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX)
> +	  This perticular SoC is used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.

This should probably be line-wrapped so it doesn't get too wide when looking at
the help text.

> +
> +if ARCH_MOXART
> +
> +menu "MOXA ART SoC Implementation"
> +
> +config MACH_UC7112LX
> +	bool "MOXA UC-7112-LX"
> +	depends on ARCH_MOXART

Since the menu is already wrapped with if ARCH_MOXART, you don't need
it here.

> +	help
> +	  Say Y here if you intend to run this kernel on a MOXA UC-7112-LX embedded computer.

Same here w.r.t wrapping

> +
> +endmenu
> +
> +endif
> diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
> new file mode 100644
> index 0000000..56d8984
> --- /dev/null
> +++ b/arch/arm/mach-moxart/Makefile
> @@ -0,0 +1,10 @@
> +#
> +# Makefile for the linux kernel.
> +#

Stale comment, can just remove it.

> +
> +# Object file lists.
> +
> +obj-y          := idle.o
> +
> +obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
> +
> diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
> new file mode 100644
> index 0000000..73ed844
> --- /dev/null
> +++ b/arch/arm/mach-moxart/idle.c
> @@ -0,0 +1,21 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */

These are sort of non-standard format. While I can't tell you what copyright
text to use (within reason), please format it similarly to how others do,
please.

> +#include <linux/init.h>
> +#include <asm/system.h>
> +#include <asm/proc-fns.h>

arm_pm_idle is defined in <asm/system_misc.h>, so it's a good idea to include
that directly.

> +
> +static void moxart_idle(void)
> +{
> +}
> +
> +static int __init moxart_idle_init(void)
> +{
> +	arm_pm_idle = moxart_idle;
> +	return 0;
> +}
> +
> +arch_initcall(moxart_idle_init);

If you multiplatform enable this, then you need to have a check in
moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
will still be called and override the arm_pm_idle setting on other platforms as
well.

> diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
> new file mode 100644
> index 0000000..ab70386
> --- /dev/null
> +++ b/arch/arm/mach-moxart/moxart.c
> @@ -0,0 +1,23 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */

Same here w.r.t. copyright formatting.

> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +#include <linux/of_platform.h>
> +#include <linux/clk-provider.h>

I'm guessing some of these will be needed later when you add more code, so it
might not make sense to remove them just for that, but they sure aren't all
needed now. :)

> +
> +#include <asm/mach/arch.h>
> +
> +static const char * const moxart_dt_compat[] = {
> +	"moxa,moxart-uc-7112-lx",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
> +	.dt_compat		= moxart_dt_compat,
> +MACHINE_END
> +
> -- 
> 1.7.2.5
> 

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-12 22:42     ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,


This looks pretty good. I have mostly a bunch of nits below.

Please feel free to cc arm at kernel.org (which goes to us arm-soc maintainers) on
future postings.

On Wed, Jun 12, 2013 at 02:34:06PM +0200, Jonas Jensen wrote:
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>

You should provide a commit message, ideally with a short introduction of the
platform.

> ---
>  arch/arm/Kconfig                           |    2 +
>  arch/arm/Makefile                          |    1 +
>  arch/arm/configs/moxart_uc7112lx_defconfig |  112 ++++++++++++++++++++++++++++
>  arch/arm/mach-moxart/Kconfig               |   28 +++++++
>  arch/arm/mach-moxart/Makefile              |   10 +++
>  arch/arm/mach-moxart/idle.c                |   21 +++++
>  arch/arm/mach-moxart/moxart.c              |   23 ++++++
>  7 files changed, 197 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/configs/moxart_uc7112lx_defconfig
>  create mode 100644 arch/arm/mach-moxart/Kconfig
>  create mode 100644 arch/arm/mach-moxart/Makefile
>  create mode 100644 arch/arm/mach-moxart/idle.c
>  create mode 100644 arch/arm/mach-moxart/moxart.c
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 0435a6a..b004ae0 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -937,6 +937,8 @@ source "arch/arm/mach-footbridge/Kconfig"
>  
>  source "arch/arm/mach-gemini/Kconfig"
>  
> +source "arch/arm/mach-moxart/Kconfig"
> +
>  source "arch/arm/mach-highbank/Kconfig"
>  
>  source "arch/arm/mach-integrator/Kconfig"
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 3380c4f..eb8f48e 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -148,6 +148,7 @@ machine-$(CONFIG_ARCH_DOVE)		+= dove
>  machine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
>  machine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
>  machine-$(CONFIG_ARCH_GEMINI)		+= gemini
> +machine-$(CONFIG_ARCH_MOXART)		+= moxart
>  machine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
>  machine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
>  machine-$(CONFIG_ARCH_IOP13XX)		+= iop13xx
> diff --git a/arch/arm/configs/moxart_uc7112lx_defconfig b/arch/arm/configs/moxart_uc7112lx_defconfig
> new file mode 100644
> index 0000000..8d8f3a4
> --- /dev/null
> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig

It'd be nice to keep the defconfig generic, and make sure to enable all boards
in it -- we're generally OK with adding one defconfig per platform upstream but
not more.

> diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
> new file mode 100644
> index 0000000..633ce74
> --- /dev/null
> +++ b/arch/arm/mach-moxart/Kconfig
> @@ -0,0 +1,28 @@
> +config ARCH_MOXART
> +	bool "MOXA ART SoC" if (ARCH_MULTI_V4)

No parens needed

> +	select CPU_FA526
> +	select ARM_DMA_MEM_BUFFERABLE
> +	select USE_OF
> +	select CLKSRC_OF
> +	select HAVE_CLK
> +	select COMMON_CLK
> +	select GENERIC_IRQ_CHIP
> +	select ARCH_REQUIRE_GPIOLIB
> +	help
> +	  Say Y here if you want to run your kernel on hardware with a MOXA ART SoC.
> +	  This is a Faraday FA526 ARMv4 32-bit 192 MHz processor with MMU and 16KB/8KB D/I-cache (UC-7112-LX)
> +	  This perticular SoC is used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.

This should probably be line-wrapped so it doesn't get too wide when looking at
the help text.

> +
> +if ARCH_MOXART
> +
> +menu "MOXA ART SoC Implementation"
> +
> +config MACH_UC7112LX
> +	bool "MOXA UC-7112-LX"
> +	depends on ARCH_MOXART

Since the menu is already wrapped with if ARCH_MOXART, you don't need
it here.

> +	help
> +	  Say Y here if you intend to run this kernel on a MOXA UC-7112-LX embedded computer.

Same here w.r.t wrapping

> +
> +endmenu
> +
> +endif
> diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
> new file mode 100644
> index 0000000..56d8984
> --- /dev/null
> +++ b/arch/arm/mach-moxart/Makefile
> @@ -0,0 +1,10 @@
> +#
> +# Makefile for the linux kernel.
> +#

Stale comment, can just remove it.

> +
> +# Object file lists.
> +
> +obj-y          := idle.o
> +
> +obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
> +
> diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
> new file mode 100644
> index 0000000..73ed844
> --- /dev/null
> +++ b/arch/arm/mach-moxart/idle.c
> @@ -0,0 +1,21 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */

These are sort of non-standard format. While I can't tell you what copyright
text to use (within reason), please format it similarly to how others do,
please.

> +#include <linux/init.h>
> +#include <asm/system.h>
> +#include <asm/proc-fns.h>

arm_pm_idle is defined in <asm/system_misc.h>, so it's a good idea to include
that directly.

> +
> +static void moxart_idle(void)
> +{
> +}
> +
> +static int __init moxart_idle_init(void)
> +{
> +	arm_pm_idle = moxart_idle;
> +	return 0;
> +}
> +
> +arch_initcall(moxart_idle_init);

If you multiplatform enable this, then you need to have a check in
moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
will still be called and override the arm_pm_idle setting on other platforms as
well.

> diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
> new file mode 100644
> index 0000000..ab70386
> --- /dev/null
> +++ b/arch/arm/mach-moxart/moxart.c
> @@ -0,0 +1,23 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */

Same here w.r.t. copyright formatting.

> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +#include <linux/of_platform.h>
> +#include <linux/clk-provider.h>

I'm guessing some of these will be needed later when you add more code, so it
might not make sense to remove them just for that, but they sure aren't all
needed now. :)

> +
> +#include <asm/mach/arch.h>
> +
> +static const char * const moxart_dt_compat[] = {
> +	"moxa,moxart-uc-7112-lx",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
> +	.dt_compat		= moxart_dt_compat,
> +MACHINE_END
> +
> -- 
> 1.7.2.5
> 

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

* Re: [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-06-12 22:49     ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:49 UTC (permalink / raw)
  To: Jonas Jensen; +Cc: linux-arm-kernel, linux, linux-kernel

On Wed, Jun 12, 2013 at 02:34:07PM +0200, Jonas Jensen wrote:
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>

Hi,

You should add a bindings description for the MOXA SoC platforms, similar to
how others do it, under Documentation/devicetree/bindings/arm/.

Same goes for other device bindings below -- they all need to be added to the
bindings documentation. You might be better off removing some of them until you
post and merge the corresponding drivers.


> ---
>  arch/arm/boot/dts/Makefile            |    1 +
>  arch/arm/boot/dts/moxart-uc7112lx.dts |   89 +++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/moxart.dtsi         |   84 +++++++++++++++++++++++++++++++
>  3 files changed, 174 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
>  create mode 100644 arch/arm/boot/dts/moxart.dtsi
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 0d1e98b..059e6d3 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
>  	wm8750-apc8750.dtb \
>  	wm8850-w70v2.dtb
>  dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
> +dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
>  
>  targets += dtbs
>  targets += $(dtb-y)
> diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
> new file mode 100644
> index 0000000..c2bb7dc
> --- /dev/null
> +++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
> @@ -0,0 +1,89 @@
> +/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
> + *
> + * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + *
> + * Licensed under GPLv2 or later. */

*/ on new line


> +
> +/dts-v1/;
> +/include/ "moxart.dtsi"
> +
> +/ {
> +	model = "MOXA UC-7112-LX";
> +	compatible = "moxa,moxart-uc-7112-lx";

Is there a generic board design / eval board that you can have as a fallback
compatible value? That way you won't have to add every board to the table in
the c file.

> +
> +	memory {
> +		reg = <0x00000000 0x02000000>;
> +	};
> +
> +	flash@80000000,0 {
> +		/* JS28F128 J3D75 A9087684 - Numonyx Embedded Flash Memory (J3 v. D) */
> +		compatible = "numonyx,js28f128", "cfi-flash";
> +		reg = <0x80000000 0x01000000>;
> +		bank-width = <2>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		partition@0 {
> +			label = "bootloader";
> +			reg = <0x00000000 0x00040000>;
> +		};
> +		partition@40000 {
> +			label = "linux kernel";
> +			reg = <0x00040000 0x001C0000>;
> +		};
> +		partition@200000 {
> +			label = "root filesystem";
> +			reg = <0x00200000 0x00800000>;
> +		};
> +		partition@a00000 {
> +			label = "user filesystem";
> +			reg = <0x00a00000 0x00600000>;
> +		};
> +	};
> +
> +	mmc@98e00000 {
> +		compatible = "moxa,moxart-mmc";
> +		reg =	<0x98e00000 0x00001000>;
> +		interrupts = <5 0>;
> +		clock-names = "sys_clk";
> +		clocks = <&sys_clk>;
> +	};
> +
> +	mxser@98200040 {
> +		compatible = "moxa,moxart-mxser";
> +		reg =	<0x98200040 0x00000080>,	/* UART "3" base */
> +				<0x982000e4 0x00000080>,	/* UART mode base */
> +				<0x982000c0 0x00000020>;	/* UART interrupt vector */

Are there other registers for other devices inbetween, or could you just do one
large memory area here?

> +		interrupts = <31 1>;
> +	};
> +
> +	mac0: mac@90900000 {
> +		compatible = "moxa,moxart-mac0";
> +		reg =   <0x90900000 0x1000>,
> +				<0x80000050 0x5>;			/* MAC address stored on flash */

This is a pretty unusal way to indicate mac address location. While I suppose
it works, I'd like to get the device tree maintainers in the loop. ADding them
to cc.

Also, there should be a bindings doc for this device (and a driver)

I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
common. :)

Finally, are the two MACs using the same driver? if so, using the same
compatible value makes more sense.

Also, while we're not super-strict about line lengths, please check your
tabbing and try to bring the comments in a bit.

> +		interrupts = <25 0>;
> +	};
> +
> +	mac1: mac@92000000 {
> +		compatible = "moxa,moxart-mac1";
> +		reg =   <0x92000000 0x1000>,
> +				<0x80000056 0x5>;			/* MAC address stored on flash */
> +		interrupts = <27 0>;
> +	};
> +
> +	uart0: uart@98200000 {
> +		compatible = "ns16550a";
> +		reg = <0x98200000 0x20>;
> +		interrupts = <31 0>;
> +		reg-shift = <2>;
> +		reg-io-width = <4>;
> +		clock-frequency = <14745600>;
> +		status = "okay";
> +	};
> +
> +	chosen {
> +		/* uncomment to use on board flash root
> +		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
> +		*/

Just leave that out, I'd say.

> +		bootargs = "console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait";
> +	};
> +};
> diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
> new file mode 100644
> index 0000000..debedb7
> --- /dev/null
> +++ b/arch/arm/boot/dts/moxart.dtsi
> @@ -0,0 +1,84 @@
> +/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
> + *
> + * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + *
> + * Licensed under GPLv2 or later. */
> +
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	interrupt-parent = <&intc>;
> +
> +	cpus {
> +		cpu@0 {
> +			compatible = "faraday,fa526";

There are a couple of more properties required here. See recent postings on cpu
bindings.

> +		};
> +	};
> +
> +	clocks {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		osc: oscillator {
> +			#clock-cells = <0>;
> +			compatible = "fixed-clock";
> +			clock-frequency = <24000000>;
> +		};
> +	};
> +
> +	soc {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x90000000 0x10000000>;
> +		ranges;
> +
> +		intc: interrupt-controller@98800000 {
> +			compatible = "moxa,moxart-interrupt-controller";
> +			reg = <0x98800000 0x38>;
> +			interrupt-controller;
> +			#interrupt-cells = <2>;
> +			interrupt-mask = <0x00080000>;		/* single register vector, interrupts 0-31, 1s signify edge */

Very long line, here and below.

> +		};
> +
> +		timer: timer@98400000 {
> +			compatible = "moxa,moxart-timer";
> +			reg = <0x98400000 0x10>;
> +			interrupts = <19 1>;
> +		};
> +
> +		gpio: gpio@98700000 {
> +			compatible = "moxa,moxart-gpio";
> +			reg =	<0x98700000 0x1000>,
> +					<0x98100100 0x4>;			/*	Power Management Unit
> +													enable/disable pin 0-31 (32bit register) */
> +		};
> +
> +		rtc: rtc {
> +			compatible = "moxa,moxart-rtc";
> +		};
> +
> +		dma: dma@90500000 {
> +			compatible = "moxa,moxart-dma";
> +			reg = <0x90500000 0x1000>;
> +			interrupts = <24 0>;
> +		};
> +
> +		watchdog: watchdog@98500000 {
> +			compatible = "moxa,moxart-watchdog";
> +			reg = <0x98500000 0x1000>;
> +		};
> +
> +		pmu: pmu@98100000 {						/* Power Management Unit */
> +			compatible = "moxa,moxart-pmu";
> +			reg = <0x98100000 0x34>;			/* offset mul @ 0x30, val @ 0x0c (2 * 32 bit registers) */
> +			clocks {
> +				sys_clk: sys_clk {
> +					#clock-cells = <0>;
> +					compatible = "moxa,moxart-sysclk";
> +					clock-output-names = "sys_clk";
> +				};
> +			};
> +		};
> +	};
> +};
> -- 
> 1.7.2.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-06-12 22:49     ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 12, 2013 at 02:34:07PM +0200, Jonas Jensen wrote:
> 
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>

Hi,

You should add a bindings description for the MOXA SoC platforms, similar to
how others do it, under Documentation/devicetree/bindings/arm/.

Same goes for other device bindings below -- they all need to be added to the
bindings documentation. You might be better off removing some of them until you
post and merge the corresponding drivers.


> ---
>  arch/arm/boot/dts/Makefile            |    1 +
>  arch/arm/boot/dts/moxart-uc7112lx.dts |   89 +++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/moxart.dtsi         |   84 +++++++++++++++++++++++++++++++
>  3 files changed, 174 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
>  create mode 100644 arch/arm/boot/dts/moxart.dtsi
> 
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 0d1e98b..059e6d3 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -217,6 +217,7 @@ dtb-$(CONFIG_ARCH_VT8500) += vt8500-bv07.dtb \
>  	wm8750-apc8750.dtb \
>  	wm8850-w70v2.dtb
>  dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb
> +dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
>  
>  targets += dtbs
>  targets += $(dtb-y)
> diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
> new file mode 100644
> index 0000000..c2bb7dc
> --- /dev/null
> +++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
> @@ -0,0 +1,89 @@
> +/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
> + *
> + * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + *
> + * Licensed under GPLv2 or later. */

*/ on new line


> +
> +/dts-v1/;
> +/include/ "moxart.dtsi"
> +
> +/ {
> +	model = "MOXA UC-7112-LX";
> +	compatible = "moxa,moxart-uc-7112-lx";

Is there a generic board design / eval board that you can have as a fallback
compatible value? That way you won't have to add every board to the table in
the c file.

> +
> +	memory {
> +		reg = <0x00000000 0x02000000>;
> +	};
> +
> +	flash at 80000000,0 {
> +		/* JS28F128 J3D75 A9087684 - Numonyx Embedded Flash Memory (J3 v. D) */
> +		compatible = "numonyx,js28f128", "cfi-flash";
> +		reg = <0x80000000 0x01000000>;
> +		bank-width = <2>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		partition at 0 {
> +			label = "bootloader";
> +			reg = <0x00000000 0x00040000>;
> +		};
> +		partition at 40000 {
> +			label = "linux kernel";
> +			reg = <0x00040000 0x001C0000>;
> +		};
> +		partition at 200000 {
> +			label = "root filesystem";
> +			reg = <0x00200000 0x00800000>;
> +		};
> +		partition at a00000 {
> +			label = "user filesystem";
> +			reg = <0x00a00000 0x00600000>;
> +		};
> +	};
> +
> +	mmc at 98e00000 {
> +		compatible = "moxa,moxart-mmc";
> +		reg =	<0x98e00000 0x00001000>;
> +		interrupts = <5 0>;
> +		clock-names = "sys_clk";
> +		clocks = <&sys_clk>;
> +	};
> +
> +	mxser at 98200040 {
> +		compatible = "moxa,moxart-mxser";
> +		reg =	<0x98200040 0x00000080>,	/* UART "3" base */
> +				<0x982000e4 0x00000080>,	/* UART mode base */
> +				<0x982000c0 0x00000020>;	/* UART interrupt vector */

Are there other registers for other devices inbetween, or could you just do one
large memory area here?

> +		interrupts = <31 1>;
> +	};
> +
> +	mac0: mac at 90900000 {
> +		compatible = "moxa,moxart-mac0";
> +		reg =   <0x90900000 0x1000>,
> +				<0x80000050 0x5>;			/* MAC address stored on flash */

This is a pretty unusal way to indicate mac address location. While I suppose
it works, I'd like to get the device tree maintainers in the loop. ADding them
to cc.

Also, there should be a bindings doc for this device (and a driver)

I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
common. :)

Finally, are the two MACs using the same driver? if so, using the same
compatible value makes more sense.

Also, while we're not super-strict about line lengths, please check your
tabbing and try to bring the comments in a bit.

> +		interrupts = <25 0>;
> +	};
> +
> +	mac1: mac at 92000000 {
> +		compatible = "moxa,moxart-mac1";
> +		reg =   <0x92000000 0x1000>,
> +				<0x80000056 0x5>;			/* MAC address stored on flash */
> +		interrupts = <27 0>;
> +	};
> +
> +	uart0: uart at 98200000 {
> +		compatible = "ns16550a";
> +		reg = <0x98200000 0x20>;
> +		interrupts = <31 0>;
> +		reg-shift = <2>;
> +		reg-io-width = <4>;
> +		clock-frequency = <14745600>;
> +		status = "okay";
> +	};
> +
> +	chosen {
> +		/* uncomment to use on board flash root
> +		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
> +		*/

Just leave that out, I'd say.

> +		bootargs = "console=ttyS0,115200n8 root=/dev/mmcblk0p1 rw rootwait";
> +	};
> +};
> diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
> new file mode 100644
> index 0000000..debedb7
> --- /dev/null
> +++ b/arch/arm/boot/dts/moxart.dtsi
> @@ -0,0 +1,84 @@
> +/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
> + *
> + * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + *
> + * Licensed under GPLv2 or later. */
> +
> +/include/ "skeleton.dtsi"
> +
> +/ {
> +	interrupt-parent = <&intc>;
> +
> +	cpus {
> +		cpu at 0 {
> +			compatible = "faraday,fa526";

There are a couple of more properties required here. See recent postings on cpu
bindings.

> +		};
> +	};
> +
> +	clocks {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		osc: oscillator {
> +			#clock-cells = <0>;
> +			compatible = "fixed-clock";
> +			clock-frequency = <24000000>;
> +		};
> +	};
> +
> +	soc {
> +		compatible = "simple-bus";
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x90000000 0x10000000>;
> +		ranges;
> +
> +		intc: interrupt-controller at 98800000 {
> +			compatible = "moxa,moxart-interrupt-controller";
> +			reg = <0x98800000 0x38>;
> +			interrupt-controller;
> +			#interrupt-cells = <2>;
> +			interrupt-mask = <0x00080000>;		/* single register vector, interrupts 0-31, 1s signify edge */

Very long line, here and below.

> +		};
> +
> +		timer: timer at 98400000 {
> +			compatible = "moxa,moxart-timer";
> +			reg = <0x98400000 0x10>;
> +			interrupts = <19 1>;
> +		};
> +
> +		gpio: gpio at 98700000 {
> +			compatible = "moxa,moxart-gpio";
> +			reg =	<0x98700000 0x1000>,
> +					<0x98100100 0x4>;			/*	Power Management Unit
> +													enable/disable pin 0-31 (32bit register) */
> +		};
> +
> +		rtc: rtc {
> +			compatible = "moxa,moxart-rtc";
> +		};
> +
> +		dma: dma at 90500000 {
> +			compatible = "moxa,moxart-dma";
> +			reg = <0x90500000 0x1000>;
> +			interrupts = <24 0>;
> +		};
> +
> +		watchdog: watchdog at 98500000 {
> +			compatible = "moxa,moxart-watchdog";
> +			reg = <0x98500000 0x1000>;
> +		};
> +
> +		pmu: pmu at 98100000 {						/* Power Management Unit */
> +			compatible = "moxa,moxart-pmu";
> +			reg = <0x98100000 0x34>;			/* offset mul @ 0x30, val @ 0x0c (2 * 32 bit registers) */
> +			clocks {
> +				sys_clk: sys_clk {
> +					#clock-cells = <0>;
> +					compatible = "moxa,moxart-sysclk";
> +					clock-output-names = "sys_clk";
> +				};
> +			};
> +		};
> +	};
> +};
> -- 
> 1.7.2.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-06-12 22:56     ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:56 UTC (permalink / raw)
  To: Jonas Jensen; +Cc: linux-arm-kernel, linux, linux-kernel

Hi,

On Wed, Jun 12, 2013 at 02:34:08PM +0200, Jonas Jensen wrote:
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
> ---
>  arch/arm/Kconfig.debug          |   10 ++++++++++
>  arch/arm/include/debug/moxart.S |   14 ++++++++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/include/debug/moxart.S
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 1d41908..a0e4a32 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -422,6 +422,15 @@ choice
>  		  Say Y here if you want kernel low-level debugging support
>  		  on Allwinner A1X based platforms on the UART1.
>  
> +    config DEBUG_MOXART_UART0
> +        bool "Kernel low-level debugging messages via MOXART UART0"
> +        depends on ARCH_MOXART
> +        help
> +          Say Y here if you want kernel low-level debugging support
> +          on MOXART based platforms on the UART0.
> +          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
> +          uses arch/arm/include/debug/moxart.S:s "addruart" macro

Looks like the last two lines above are leftovers? It's not super-helpful for
someone trying to figure out if they want this option or not; the first two
lines covers that quite nicely.

> +
>  	config DEBUG_TEGRA_UART
>  		depends on ARCH_TEGRA
>  		bool "Use Tegra UART for low-level debug"
> @@ -642,6 +651,7 @@ config DEBUG_LL_INCLUDE
>  	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
>  	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
>  	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
> +	default "debug/moxart.S" if DEBUG_MOXART_UART0
>  	default "debug/tegra.S" if DEBUG_TEGRA_UART
>  	default "debug/ux500.S" if DEBUG_UX500_UART
>  	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
> diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
> new file mode 100644
> index 0000000..01e2aee
> --- /dev/null
> +++ b/arch/arm/include/debug/moxart.S
> @@ -0,0 +1,14 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
> +
> +.macro	addruart, rp, rv, tmp
> +	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE	@ physical

You need to set rv here too.

-Olof

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

* [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-06-12 22:56     ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-12 22:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Wed, Jun 12, 2013 at 02:34:08PM +0200, Jonas Jensen wrote:
> Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
> ---
>  arch/arm/Kconfig.debug          |   10 ++++++++++
>  arch/arm/include/debug/moxart.S |   14 ++++++++++++++
>  2 files changed, 24 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/include/debug/moxart.S
> 
> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
> index 1d41908..a0e4a32 100644
> --- a/arch/arm/Kconfig.debug
> +++ b/arch/arm/Kconfig.debug
> @@ -422,6 +422,15 @@ choice
>  		  Say Y here if you want kernel low-level debugging support
>  		  on Allwinner A1X based platforms on the UART1.
>  
> +    config DEBUG_MOXART_UART0
> +        bool "Kernel low-level debugging messages via MOXART UART0"
> +        depends on ARCH_MOXART
> +        help
> +          Say Y here if you want kernel low-level debugging support
> +          on MOXART based platforms on the UART0.
> +          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
> +          uses arch/arm/include/debug/moxart.S:s "addruart" macro

Looks like the last two lines above are leftovers? It's not super-helpful for
someone trying to figure out if they want this option or not; the first two
lines covers that quite nicely.

> +
>  	config DEBUG_TEGRA_UART
>  		depends on ARCH_TEGRA
>  		bool "Use Tegra UART for low-level debug"
> @@ -642,6 +651,7 @@ config DEBUG_LL_INCLUDE
>  	default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
>  	default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
>  	default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
> +	default "debug/moxart.S" if DEBUG_MOXART_UART0
>  	default "debug/tegra.S" if DEBUG_TEGRA_UART
>  	default "debug/ux500.S" if DEBUG_UX500_UART
>  	default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
> diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
> new file mode 100644
> index 0000000..01e2aee
> --- /dev/null
> +++ b/arch/arm/include/debug/moxart.S
> @@ -0,0 +1,14 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
> +
> +.macro	addruart, rp, rv, tmp
> +	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE	@ physical

You need to set rv here too.

-Olof

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-12 22:42     ` Olof Johansson
@ 2013-06-14 14:33       ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:33 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-arm-kernel, linux, linux-kernel, devicetree-discuss, arm

Hi,

Thanks for the replies.

What isn't commented below should already be fixed. I'll resubmit the
entire set when it looks like there's nothing left to amend.

On 13 June 2013 00:42, Olof Johansson <olof@lixom.net> wrote:
> You should provide a commit message, ideally with a short introduction of the
> platform.

Will do. I was thinking I should do that, this is the first time I
used git format-patch / git send-email.

>> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig
>
> It'd be nice to keep the defconfig generic, and make sure to enable all boards
> in it -- we're generally OK with adding one defconfig per platform upstream but
> not more.

Since MACH_UC7112LX is the only board right now, how can it "enable all boards"?

One way I can think of is to remove CONFIG_MACH_UC7112LX=y from
defconfig and have it (and all future boards) "default y" in
arch/arm/mach-moxart/Kconfig.

I focus on a single hardware, UC-7112-LX. There's at least one more
board with only minor differences (RAM / flash size). But for now,
MACH_UC7112LX is the one I have access to and can test. I think
UC-7110 is already supported, that it would boot, just copy
arch/arm/boot/dts/moxart-uc7112lx.dts and modify ranges for RAM and
MTD. I want to leave this in a state where remaining hardware can
easily be added, albeit by someone that isn't me :)

> If you multiplatform enable this, then you need to have a check in
> moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
> will still be called and override the arm_pm_idle setting on other platforms as
> well.

I can't find a good example of how other platforms do this, is a DT
lookup an accepted solution? :

static const struct of_device_id moxart_match[] = {
       { .compatible = "moxa,moxart" },
       { }
};

static int __init moxart_idle_init(void)
{
    struct device_node *node;

    node = of_find_matching_node(NULL, moxart_match);
    if (!node)
        return -ENODEV;

    arm_pm_idle = moxart_idle;
    return 0;
}

arch_initcall(moxart_idle_init);


Best regards,
Jonas

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-14 14:33       ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Thanks for the replies.

What isn't commented below should already be fixed. I'll resubmit the
entire set when it looks like there's nothing left to amend.

On 13 June 2013 00:42, Olof Johansson <olof@lixom.net> wrote:
> You should provide a commit message, ideally with a short introduction of the
> platform.

Will do. I was thinking I should do that, this is the first time I
used git format-patch / git send-email.

>> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig
>
> It'd be nice to keep the defconfig generic, and make sure to enable all boards
> in it -- we're generally OK with adding one defconfig per platform upstream but
> not more.

Since MACH_UC7112LX is the only board right now, how can it "enable all boards"?

One way I can think of is to remove CONFIG_MACH_UC7112LX=y from
defconfig and have it (and all future boards) "default y" in
arch/arm/mach-moxart/Kconfig.

I focus on a single hardware, UC-7112-LX. There's at least one more
board with only minor differences (RAM / flash size). But for now,
MACH_UC7112LX is the one I have access to and can test. I think
UC-7110 is already supported, that it would boot, just copy
arch/arm/boot/dts/moxart-uc7112lx.dts and modify ranges for RAM and
MTD. I want to leave this in a state where remaining hardware can
easily be added, albeit by someone that isn't me :)

> If you multiplatform enable this, then you need to have a check in
> moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
> will still be called and override the arm_pm_idle setting on other platforms as
> well.

I can't find a good example of how other platforms do this, is a DT
lookup an accepted solution? :

static const struct of_device_id moxart_match[] = {
       { .compatible = "moxa,moxart" },
       { }
};

static int __init moxart_idle_init(void)
{
    struct device_node *node;

    node = of_find_matching_node(NULL, moxart_match);
    if (!node)
        return -ENODEV;

    arm_pm_idle = moxart_idle;
    return 0;
}

arch_initcall(moxart_idle_init);


Best regards,
Jonas

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

* Re: [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
  2013-06-12 22:49     ` Olof Johansson
@ 2013-06-14 14:34       ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:34 UTC (permalink / raw)
  To: Olof Johansson
  Cc: linux-arm-kernel, linux, linux-kernel, devicetree-discuss, arm

Hi,

Thanks for the replies.

What isn't commented below should already be fixed.

On 13 June 2013 00:49, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> You should add a bindings description for the MOXA SoC platforms, similar to
> how others do it, under Documentation/devicetree/bindings/arm/.

The following is now added under Documentation:

 Documentation/devicetree/bindings/arm/moxart.txt   |    8 +++
 .../arm/moxart/moxart-interrupt-controller.txt     |   29 ++++++++++++
 .../bindings/arm/moxart/moxart-timer.txt           |   17 +++++++

> Same goes for other device bindings below -- they all need to be added to the
> bindings documentation. You might be better off removing some of them until you
> post and merge the corresponding drivers.

I'll remove them for now with the intent of adding them later. Maybe
when (and if) all drivers are posted and merged.

>> +/dts-v1/;
>> +/include/ "moxart.dtsi"
>> +
>> +/ {
>> +     model = "MOXA UC-7112-LX";
>> +     compatible = "moxa,moxart-uc-7112-lx";
>
> Is there a generic board design / eval board that you can have as a fallback
> compatible value? That way you won't have to add every board to the table in
> the c file.

There isn't really a generic board but the same can be accomplished by
adding "moxa,moxart" to compatible? New boards can then be added
without patching arch/arm/mach-moxart/moxart.c.

>> +     mxser@98200040 {
>> +             compatible = "moxa,moxart-mxser";
>> +             reg =   <0x98200040 0x00000080>,        /* UART "3" base */
>> +                             <0x982000e4 0x00000080>,        /* UART mode base */
>> +                             <0x982000c0 0x00000020>;        /* UART interrupt vector */
>
> Are there other registers for other devices inbetween, or could you just do one
> large memory area here?

No, reg could simply be 0x98200040 to 0x982000e0. I split them out as
documentation but those could be defined in the driver instead, also
because it's sort of easier to assign values with of_iomap.

>> +             interrupts = <31 1>;
>> +     };
>> +
>> +     mac0: mac@90900000 {
>> +             compatible = "moxa,moxart-mac0";
>> +             reg =   <0x90900000 0x1000>,
>> +                             <0x80000050 0x5>;                       /* MAC address stored on flash */
>
> This is a pretty unusal way to indicate mac address location. While I suppose
> it works, I'd like to get the device tree maintainers in the loop. ADding them
> to cc.
>
> Also, there should be a bindings doc for this device (and a driver)

I'm removing ethernet until the driver is submitted. This allows me to
submit bindings doc later?

> I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
> common. :)

That _is_ surprising :) Corrected to 6 bytes.

> Finally, are the two MACs using the same driver? if so, using the same
> compatible value makes more sense.

Yes, using the same driver is the point. I see now they can use the
same value, they'll still be probed from the DT entries.


Best regards,
Jonas

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

* [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-06-14 14:34       ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Thanks for the replies.

What isn't commented below should already be fixed.

On 13 June 2013 00:49, Olof Johansson <olof@lixom.net> wrote:
> Hi,
>
> You should add a bindings description for the MOXA SoC platforms, similar to
> how others do it, under Documentation/devicetree/bindings/arm/.

The following is now added under Documentation:

 Documentation/devicetree/bindings/arm/moxart.txt   |    8 +++
 .../arm/moxart/moxart-interrupt-controller.txt     |   29 ++++++++++++
 .../bindings/arm/moxart/moxart-timer.txt           |   17 +++++++

> Same goes for other device bindings below -- they all need to be added to the
> bindings documentation. You might be better off removing some of them until you
> post and merge the corresponding drivers.

I'll remove them for now with the intent of adding them later. Maybe
when (and if) all drivers are posted and merged.

>> +/dts-v1/;
>> +/include/ "moxart.dtsi"
>> +
>> +/ {
>> +     model = "MOXA UC-7112-LX";
>> +     compatible = "moxa,moxart-uc-7112-lx";
>
> Is there a generic board design / eval board that you can have as a fallback
> compatible value? That way you won't have to add every board to the table in
> the c file.

There isn't really a generic board but the same can be accomplished by
adding "moxa,moxart" to compatible? New boards can then be added
without patching arch/arm/mach-moxart/moxart.c.

>> +     mxser at 98200040 {
>> +             compatible = "moxa,moxart-mxser";
>> +             reg =   <0x98200040 0x00000080>,        /* UART "3" base */
>> +                             <0x982000e4 0x00000080>,        /* UART mode base */
>> +                             <0x982000c0 0x00000020>;        /* UART interrupt vector */
>
> Are there other registers for other devices inbetween, or could you just do one
> large memory area here?

No, reg could simply be 0x98200040 to 0x982000e0. I split them out as
documentation but those could be defined in the driver instead, also
because it's sort of easier to assign values with of_iomap.

>> +             interrupts = <31 1>;
>> +     };
>> +
>> +     mac0: mac at 90900000 {
>> +             compatible = "moxa,moxart-mac0";
>> +             reg =   <0x90900000 0x1000>,
>> +                             <0x80000050 0x5>;                       /* MAC address stored on flash */
>
> This is a pretty unusal way to indicate mac address location. While I suppose
> it works, I'd like to get the device tree maintainers in the loop. ADding them
> to cc.
>
> Also, there should be a bindings doc for this device (and a driver)

I'm removing ethernet until the driver is submitted. This allows me to
submit bindings doc later?

> I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
> common. :)

That _is_ surprising :) Corrected to 6 bytes.

> Finally, are the two MACs using the same driver? if so, using the same
> compatible value makes more sense.

Yes, using the same driver is the point. I see now they can use the
same value, they'll still be probed from the DT entries.


Best regards,
Jonas

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

* Re: [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
  2013-06-12 22:56     ` Olof Johansson
@ 2013-06-14 14:35       ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:35 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-arm-kernel, linux, linux-kernel, arm

Hi,

Thanks for the replies.

On 13 June 2013 00:56, Olof Johansson <olof@lixom.net> wrote:
>> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
>> index 1d41908..a0e4a32 100644
>> --- a/arch/arm/Kconfig.debug
>> +++ b/arch/arm/Kconfig.debug
>> @@ -422,6 +422,15 @@ choice
>>                 Say Y here if you want kernel low-level debugging support
>>                 on Allwinner A1X based platforms on the UART1.
>>
>> +    config DEBUG_MOXART_UART0
>> +        bool "Kernel low-level debugging messages via MOXART UART0"
>> +        depends on ARCH_MOXART
>> +        help
>> +          Say Y here if you want kernel low-level debugging support
>> +          on MOXART based platforms on the UART0.
>> +          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
>> +          uses arch/arm/include/debug/moxart.S:s "addruart" macro
>
> Looks like the last two lines above are leftovers? It's not super-helpful for
> someone trying to figure out if they want this option or not; the first two
> lines covers that quite nicely.

Leftovers removed. I only added them because I spent some time
figuring out the call chain around putc.

>> +++ b/arch/arm/include/debug/moxart.S
>> @@ -0,0 +1,14 @@
>> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License as published by the
>> + * Free Software Foundation; either version 2 of the License,
>> + * or (at your option) any later version. */
>> +
>> +#define MOXART_UART_DEBUG_PHYS_BASE          0x98200000
>> +
>> +.macro       addruart, rp, rv, tmp
>> +     ldr     \rp, =MOXART_UART_DEBUG_PHYS_BASE       @ physical
>
> You need to set rv here too.

Done. Used to be set with the IO_ADDRESS macro I worked so hard to
remove. Looking at other platforms, it seems accepted to set a
hardcoded value here.


Best regards,
Jonas

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

* [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-06-14 14:35       ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-06-14 14:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Thanks for the replies.

On 13 June 2013 00:56, Olof Johansson <olof@lixom.net> wrote:
>> diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
>> index 1d41908..a0e4a32 100644
>> --- a/arch/arm/Kconfig.debug
>> +++ b/arch/arm/Kconfig.debug
>> @@ -422,6 +422,15 @@ choice
>>                 Say Y here if you want kernel low-level debugging support
>>                 on Allwinner A1X based platforms on the UART1.
>>
>> +    config DEBUG_MOXART_UART0
>> +        bool "Kernel low-level debugging messages via MOXART UART0"
>> +        depends on ARCH_MOXART
>> +        help
>> +          Say Y here if you want kernel low-level debugging support
>> +          on MOXART based platforms on the UART0.
>> +          select this to make sure "putc" in arch/arm/boot/compressed/debug.S
>> +          uses arch/arm/include/debug/moxart.S:s "addruart" macro
>
> Looks like the last two lines above are leftovers? It's not super-helpful for
> someone trying to figure out if they want this option or not; the first two
> lines covers that quite nicely.

Leftovers removed. I only added them because I spent some time
figuring out the call chain around putc.

>> +++ b/arch/arm/include/debug/moxart.S
>> @@ -0,0 +1,14 @@
>> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU General Public License as published by the
>> + * Free Software Foundation; either version 2 of the License,
>> + * or (at your option) any later version. */
>> +
>> +#define MOXART_UART_DEBUG_PHYS_BASE          0x98200000
>> +
>> +.macro       addruart, rp, rv, tmp
>> +     ldr     \rp, =MOXART_UART_DEBUG_PHYS_BASE       @ physical
>
> You need to set rv here too.

Done. Used to be set with the IO_ADDRESS macro I worked so hard to
remove. Looking at other platforms, it seems accepted to set a
hardcoded value here.


Best regards,
Jonas

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-06-14 14:47     ` Arnd Bergmann
  -1 siblings, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2013-06-14 14:47 UTC (permalink / raw)
  To: Jonas Jensen; +Cc: linux-arm-kernel, linux, linux-kernel

On Wednesday 12 June 2013 14:34:06 Jonas Jensen wrote:

> diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
> new file mode 100644
> index 0000000..73ed844
> --- /dev/null
> +++ b/arch/arm/mach-moxart/idle.c
> @@ -0,0 +1,21 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#include <linux/init.h>
> +#include <asm/system.h>
> +#include <asm/proc-fns.h>
> +
> +static void moxart_idle(void)
> +{
> +}
> +
> +static int __init moxart_idle_init(void)
> +{
> +	arm_pm_idle = moxart_idle;
> +	return 0;
> +}
> +
> +arch_initcall(moxart_idle_init);

IIRC Russell suggested changing cpu_fa526_do_idle() to not call WFI instead,
since the only other platform with fa526 has the same problem.

Your change above is actually wrong and breaks non-fa526 platforms in a
multiplatform kernel because it overrides arm_pm_idle without checking
what machine it currently runs on.

> diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
> new file mode 100644
> index 0000000..ab70386
> --- /dev/null
> +++ b/arch/arm/mach-moxart/moxart.c
> @@ -0,0 +1,23 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +#include <linux/of_platform.h>
> +#include <linux/clk-provider.h>

Most of these are probably unneeded now.

> +#include <asm/mach/arch.h>
> +
> +static const char * const moxart_dt_compat[] = {
> +	"moxa,moxart-uc-7112-lx",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
> +	.dt_compat		= moxart_dt_compat,
> +MACHINE_END

If the .dt_compat fields is the only field in the machine descriptor,
you can leave out the entire descriptor!

Olof, do you have a preference to how we want to handle this? The
only advantage of having this file at all is to have the
"MOXA UC-7112-LX" string in /proc/cpuinfo.
Should we just remove the entire directory or leave it as the trivial
file above?

	Arnd

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-14 14:47     ` Arnd Bergmann
  0 siblings, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2013-06-14 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 12 June 2013 14:34:06 Jonas Jensen wrote:

> diff --git a/arch/arm/mach-moxart/idle.c b/arch/arm/mach-moxart/idle.c
> new file mode 100644
> index 0000000..73ed844
> --- /dev/null
> +++ b/arch/arm/mach-moxart/idle.c
> @@ -0,0 +1,21 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#include <linux/init.h>
> +#include <asm/system.h>
> +#include <asm/proc-fns.h>
> +
> +static void moxart_idle(void)
> +{
> +}
> +
> +static int __init moxart_idle_init(void)
> +{
> +	arm_pm_idle = moxart_idle;
> +	return 0;
> +}
> +
> +arch_initcall(moxart_idle_init);

IIRC Russell suggested changing cpu_fa526_do_idle() to not call WFI instead,
since the only other platform with fa526 has the same problem.

Your change above is actually wrong and breaks non-fa526 platforms in a
multiplatform kernel because it overrides arm_pm_idle without checking
what machine it currently runs on.

> diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
> new file mode 100644
> index 0000000..ab70386
> --- /dev/null
> +++ b/arch/arm/mach-moxart/moxart.c
> @@ -0,0 +1,23 @@
> +/* Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License,
> + * or (at your option) any later version. */
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +#include <linux/of_platform.h>
> +#include <linux/clk-provider.h>

Most of these are probably unneeded now.

> +#include <asm/mach/arch.h>
> +
> +static const char * const moxart_dt_compat[] = {
> +	"moxa,moxart-uc-7112-lx",
> +	NULL,
> +};
> +
> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
> +	.dt_compat		= moxart_dt_compat,
> +MACHINE_END

If the .dt_compat fields is the only field in the machine descriptor,
you can leave out the entire descriptor!

Olof, do you have a preference to how we want to handle this? The
only advantage of having this file at all is to have the
"MOXA UC-7112-LX" string in /proc/cpuinfo.
Should we just remove the entire directory or leave it as the trivial
file above?

	Arnd

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-14 14:47     ` Arnd Bergmann
@ 2013-06-14 16:41       ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-14 16:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Jonas Jensen, linux-arm-kernel, Russell King - ARM Linux, linux-kernel

On Fri, Jun 14, 2013 at 7:47 AM, Arnd Bergmann <arnd@arndb.de> wrote:
arch.h>
>> +
>> +static const char * const moxart_dt_compat[] = {
>> +     "moxa,moxart-uc-7112-lx",
>> +     NULL,
>> +};
>> +
>> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
>> +     .dt_compat              = moxart_dt_compat,
>> +MACHINE_END
>
> If the .dt_compat fields is the only field in the machine descriptor,
> you can leave out the entire descriptor!
>
> Olof, do you have a preference to how we want to handle this? The
> only advantage of having this file at all is to have the
> "MOXA UC-7112-LX" string in /proc/cpuinfo.
> Should we just remove the entire directory or leave it as the trivial
> file above?

I sort of presumed that there might be need for _some_ platform code
later on, just not quite yet, so I didn't want to be quite that
drastic. I suppose leaving it with the trivial file for now is OK, and
we can make a sweeping change down the road in case we want to clean
up and consolidate all the trivial platforms.


-Olof

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-14 16:41       ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-14 16:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jun 14, 2013 at 7:47 AM, Arnd Bergmann <arnd@arndb.de> wrote:
arch.h>
>> +
>> +static const char * const moxart_dt_compat[] = {
>> +     "moxa,moxart-uc-7112-lx",
>> +     NULL,
>> +};
>> +
>> +DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
>> +     .dt_compat              = moxart_dt_compat,
>> +MACHINE_END
>
> If the .dt_compat fields is the only field in the machine descriptor,
> you can leave out the entire descriptor!
>
> Olof, do you have a preference to how we want to handle this? The
> only advantage of having this file at all is to have the
> "MOXA UC-7112-LX" string in /proc/cpuinfo.
> Should we just remove the entire directory or leave it as the trivial
> file above?

I sort of presumed that there might be need for _some_ platform code
later on, just not quite yet, so I didn't want to be quite that
drastic. I suppose leaving it with the trivial file for now is OK, and
we can make a sweeping change down the road in case we want to clean
up and consolidate all the trivial platforms.


-Olof

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-14 16:41       ` Olof Johansson
@ 2013-06-14 17:44         ` Arnd Bergmann
  -1 siblings, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2013-06-14 17:44 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Jonas Jensen, linux-arm-kernel, Russell King - ARM Linux, linux-kernel

On Friday 14 June 2013 09:41:36 Olof Johansson wrote:
> I sort of presumed that there might be need for _some_ platform code
> later on, just not quite yet, so I didn't want to be quite that
> drastic. I suppose leaving it with the trivial file for now is OK, and
> we can make a sweeping change down the road in case we want to clean
> up and consolidate all the trivial platforms.

Yes, good idea.

	Arnd

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-14 17:44         ` Arnd Bergmann
  0 siblings, 0 replies; 39+ messages in thread
From: Arnd Bergmann @ 2013-06-14 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 14 June 2013 09:41:36 Olof Johansson wrote:
> I sort of presumed that there might be need for _some_ platform code
> later on, just not quite yet, so I didn't want to be quite that
> drastic. I suppose leaving it with the trivial file for now is OK, and
> we can make a sweeping change down the road in case we want to clean
> up and consolidate all the trivial platforms.

Yes, good idea.

	Arnd

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

* Re: [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-14 14:33       ` Jonas Jensen
@ 2013-06-17 22:21         ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-17 22:21 UTC (permalink / raw)
  To: Jonas Jensen
  Cc: linux-arm-kernel, linux, linux-kernel, devicetree-discuss, arm

Hi,

On Fri, Jun 14, 2013 at 04:33:29PM +0200, Jonas Jensen wrote:
> Hi,
> 
> Thanks for the replies.
> 
> What isn't commented below should already be fixed. I'll resubmit the
> entire set when it looks like there's nothing left to amend.
> 
> On 13 June 2013 00:42, Olof Johansson <olof@lixom.net> wrote:
> > You should provide a commit message, ideally with a short introduction of the
> > platform.
> 
> Will do. I was thinking I should do that, this is the first time I
> used git format-patch / git send-email.
> 
> >> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig
> >
> > It'd be nice to keep the defconfig generic, and make sure to enable all boards
> > in it -- we're generally OK with adding one defconfig per platform upstream but
> > not more.
> 
> Since MACH_UC7112LX is the only board right now, how can it "enable all boards"?

Yeah, that was more with respect to future use of the defconfig. So keeping it
generic in name for now (moxart_defconfig) is really all I am asking for.

> One way I can think of is to remove CONFIG_MACH_UC7112LX=y from
> defconfig and have it (and all future boards) "default y" in
> arch/arm/mach-moxart/Kconfig.

Enabling it in the defconfig is just fine, no need to change anything there at
this time.

> I focus on a single hardware, UC-7112-LX. There's at least one more
> board with only minor differences (RAM / flash size). But for now,
> MACH_UC7112LX is the one I have access to and can test. I think
> UC-7110 is already supported, that it would boot, just copy
> arch/arm/boot/dts/moxart-uc7112lx.dts and modify ranges for RAM and
> MTD. I want to leave this in a state where remaining hardware can
> easily be added, albeit by someone that isn't me :)

Sure, that's a fair stance.

> > If you multiplatform enable this, then you need to have a check in
> > moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
> > will still be called and override the arm_pm_idle setting on other platforms as
> > well.
> 
> I can't find a good example of how other platforms do this, is a DT
> lookup an accepted solution? :
> 
> static const struct of_device_id moxart_match[] = {
>        { .compatible = "moxa,moxart" },
>        { }
> };
> 
> static int __init moxart_idle_init(void)
> {
>     struct device_node *node;
> 
>     node = of_find_matching_node(NULL, moxart_match);
>     if (!node)
>         return -ENODEV;
> 
>     arm_pm_idle = moxart_idle;
>     return 0;
> }
> 
> arch_initcall(moxart_idle_init);

Easiest of all is if you have a "moxa,moxart" compatible field as the
most-specific one for your machine, then you can just do:

...
{
	if (!of_machine_is_compatible("moxa,moxart"))
		return -ENODEV;

	arm_pm_idle = moxart_idle;
	return 0;
}

-Olof

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

* [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-06-17 22:21         ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-17 22:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Jun 14, 2013 at 04:33:29PM +0200, Jonas Jensen wrote:
> Hi,
> 
> Thanks for the replies.
> 
> What isn't commented below should already be fixed. I'll resubmit the
> entire set when it looks like there's nothing left to amend.
> 
> On 13 June 2013 00:42, Olof Johansson <olof@lixom.net> wrote:
> > You should provide a commit message, ideally with a short introduction of the
> > platform.
> 
> Will do. I was thinking I should do that, this is the first time I
> used git format-patch / git send-email.
> 
> >> +++ b/arch/arm/configs/moxart_uc7112lx_defconfig
> >
> > It'd be nice to keep the defconfig generic, and make sure to enable all boards
> > in it -- we're generally OK with adding one defconfig per platform upstream but
> > not more.
> 
> Since MACH_UC7112LX is the only board right now, how can it "enable all boards"?

Yeah, that was more with respect to future use of the defconfig. So keeping it
generic in name for now (moxart_defconfig) is really all I am asking for.

> One way I can think of is to remove CONFIG_MACH_UC7112LX=y from
> defconfig and have it (and all future boards) "default y" in
> arch/arm/mach-moxart/Kconfig.

Enabling it in the defconfig is just fine, no need to change anything there at
this time.

> I focus on a single hardware, UC-7112-LX. There's at least one more
> board with only minor differences (RAM / flash size). But for now,
> MACH_UC7112LX is the one I have access to and can test. I think
> UC-7110 is already supported, that it would boot, just copy
> arch/arm/boot/dts/moxart-uc7112lx.dts and modify ranges for RAM and
> MTD. I want to leave this in a state where remaining hardware can
> easily be added, albeit by someone that isn't me :)

Sure, that's a fair stance.

> > If you multiplatform enable this, then you need to have a check in
> > moxart_idle_init() to make sure you're running on a moxart soc. Otherwise this
> > will still be called and override the arm_pm_idle setting on other platforms as
> > well.
> 
> I can't find a good example of how other platforms do this, is a DT
> lookup an accepted solution? :
> 
> static const struct of_device_id moxart_match[] = {
>        { .compatible = "moxa,moxart" },
>        { }
> };
> 
> static int __init moxart_idle_init(void)
> {
>     struct device_node *node;
> 
>     node = of_find_matching_node(NULL, moxart_match);
>     if (!node)
>         return -ENODEV;
> 
>     arm_pm_idle = moxart_idle;
>     return 0;
> }
> 
> arch_initcall(moxart_idle_init);

Easiest of all is if you have a "moxa,moxart" compatible field as the
most-specific one for your machine, then you can just do:

...
{
	if (!of_machine_is_compatible("moxa,moxart"))
		return -ENODEV;

	arm_pm_idle = moxart_idle;
	return 0;
}

-Olof

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

* Re: [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
  2013-06-14 14:34       ` Jonas Jensen
@ 2013-06-17 22:23         ` Olof Johansson
  -1 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-17 22:23 UTC (permalink / raw)
  To: Jonas Jensen
  Cc: linux-arm-kernel, linux, linux-kernel, devicetree-discuss, arm

On Fri, Jun 14, 2013 at 04:34:24PM +0200, Jonas Jensen wrote:
> Hi,
> 
> Thanks for the replies.
> 
> What isn't commented below should already be fixed.
> 
> On 13 June 2013 00:49, Olof Johansson <olof@lixom.net> wrote:
> > Hi,
> >
> > You should add a bindings description for the MOXA SoC platforms, similar to
> > how others do it, under Documentation/devicetree/bindings/arm/.
> 
> The following is now added under Documentation:
> 
>  Documentation/devicetree/bindings/arm/moxart.txt   |    8 +++
>  .../arm/moxart/moxart-interrupt-controller.txt     |   29 ++++++++++++
>  .../bindings/arm/moxart/moxart-timer.txt           |   17 +++++++
> 
> > Same goes for other device bindings below -- they all need to be added to the
> > bindings documentation. You might be better off removing some of them until you
> > post and merge the corresponding drivers.
> 
> I'll remove them for now with the intent of adding them later. Maybe
> when (and if) all drivers are posted and merged.
> 
> >> +/dts-v1/;
> >> +/include/ "moxart.dtsi"
> >> +
> >> +/ {
> >> +     model = "MOXA UC-7112-LX";
> >> +     compatible = "moxa,moxart-uc-7112-lx";
> >
> > Is there a generic board design / eval board that you can have as a fallback
> > compatible value? That way you won't have to add every board to the table in
> > the c file.
> 
> There isn't really a generic board but the same can be accomplished by
> adding "moxa,moxart" to compatible? New boards can then be added
> without patching arch/arm/mach-moxart/moxart.c.

Sounds good. See comment on the other email about checking for machine
compatible in the init setup function too, that'll work well.

> 
> >> +     mxser@98200040 {
> >> +             compatible = "moxa,moxart-mxser";
> >> +             reg =   <0x98200040 0x00000080>,        /* UART "3" base */
> >> +                             <0x982000e4 0x00000080>,        /* UART mode base */
> >> +                             <0x982000c0 0x00000020>;        /* UART interrupt vector */
> >
> > Are there other registers for other devices inbetween, or could you just do one
> > large memory area here?
> 
> No, reg could simply be 0x98200040 to 0x982000e0. I split them out as
> documentation but those could be defined in the driver instead, also
> because it's sort of easier to assign values with of_iomap.

I'd say just go with one register area, it's how most other drivers do it so
it's most familiar to someone else coming in and reading your code to fix bugs
or whatnot.

> >> +             interrupts = <31 1>;
> >> +     };
> >> +
> >> +     mac0: mac@90900000 {
> >> +             compatible = "moxa,moxart-mac0";
> >> +             reg =   <0x90900000 0x1000>,
> >> +                             <0x80000050 0x5>;                       /* MAC address stored on flash */
> >
> > This is a pretty unusal way to indicate mac address location. While I suppose
> > it works, I'd like to get the device tree maintainers in the loop. ADding them
> > to cc.
> >
> > Also, there should be a bindings doc for this device (and a driver)
> 
> I'm removing ethernet until the driver is submitted. This allows me to
> submit bindings doc later?

Yep.

> 
> > I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
> > common. :)
> 
> That _is_ surprising :) Corrected to 6 bytes.

:)

> > Finally, are the two MACs using the same driver? if so, using the same
> > compatible value makes more sense.
> 
> Yes, using the same driver is the point. I see now they can use the
> same value, they'll still be probed from the DT entries.

Yeah. Let's discuss that further when the driver is ready if needed.


-Olof

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

* [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-06-17 22:23         ` Olof Johansson
  0 siblings, 0 replies; 39+ messages in thread
From: Olof Johansson @ 2013-06-17 22:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jun 14, 2013 at 04:34:24PM +0200, Jonas Jensen wrote:
> Hi,
> 
> Thanks for the replies.
> 
> What isn't commented below should already be fixed.
> 
> On 13 June 2013 00:49, Olof Johansson <olof@lixom.net> wrote:
> > Hi,
> >
> > You should add a bindings description for the MOXA SoC platforms, similar to
> > how others do it, under Documentation/devicetree/bindings/arm/.
> 
> The following is now added under Documentation:
> 
>  Documentation/devicetree/bindings/arm/moxart.txt   |    8 +++
>  .../arm/moxart/moxart-interrupt-controller.txt     |   29 ++++++++++++
>  .../bindings/arm/moxart/moxart-timer.txt           |   17 +++++++
> 
> > Same goes for other device bindings below -- they all need to be added to the
> > bindings documentation. You might be better off removing some of them until you
> > post and merge the corresponding drivers.
> 
> I'll remove them for now with the intent of adding them later. Maybe
> when (and if) all drivers are posted and merged.
> 
> >> +/dts-v1/;
> >> +/include/ "moxart.dtsi"
> >> +
> >> +/ {
> >> +     model = "MOXA UC-7112-LX";
> >> +     compatible = "moxa,moxart-uc-7112-lx";
> >
> > Is there a generic board design / eval board that you can have as a fallback
> > compatible value? That way you won't have to add every board to the table in
> > the c file.
> 
> There isn't really a generic board but the same can be accomplished by
> adding "moxa,moxart" to compatible? New boards can then be added
> without patching arch/arm/mach-moxart/moxart.c.

Sounds good. See comment on the other email about checking for machine
compatible in the init setup function too, that'll work well.

> 
> >> +     mxser at 98200040 {
> >> +             compatible = "moxa,moxart-mxser";
> >> +             reg =   <0x98200040 0x00000080>,        /* UART "3" base */
> >> +                             <0x982000e4 0x00000080>,        /* UART mode base */
> >> +                             <0x982000c0 0x00000020>;        /* UART interrupt vector */
> >
> > Are there other registers for other devices inbetween, or could you just do one
> > large memory area here?
> 
> No, reg could simply be 0x98200040 to 0x982000e0. I split them out as
> documentation but those could be defined in the driver instead, also
> because it's sort of easier to assign values with of_iomap.

I'd say just go with one register area, it's how most other drivers do it so
it's most familiar to someone else coming in and reading your code to fix bugs
or whatnot.

> >> +             interrupts = <31 1>;
> >> +     };
> >> +
> >> +     mac0: mac at 90900000 {
> >> +             compatible = "moxa,moxart-mac0";
> >> +             reg =   <0x90900000 0x1000>,
> >> +                             <0x80000050 0x5>;                       /* MAC address stored on flash */
> >
> > This is a pretty unusal way to indicate mac address location. While I suppose
> > it works, I'd like to get the device tree maintainers in the loop. ADding them
> > to cc.
> >
> > Also, there should be a bindings doc for this device (and a driver)
> 
> I'm removing ethernet until the driver is submitted. This allows me to
> submit bindings doc later?

Yep.

> 
> > I'm also surprised that you have a 5-byte mac address. 6 bytes is much more
> > common. :)
> 
> That _is_ surprising :) Corrected to 6 bytes.

:)

> > Finally, are the two MACs using the same driver? if so, using the same
> > compatible value makes more sense.
> 
> Yes, using the same driver is the point. I see now they can use the
> same value, they'll still be probed from the DT entries.

Yeah. Let's discuss that further when the driver is ready if needed.


-Olof

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

* [PATCH v3 1/4] ARM: mach-moxart: add MOXA ART SoC files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-07-04 14:44     ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:44 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux, linux-kernel, devicetree-discuss, arm, arnd, olof, Jonas Jensen

Add MOXA ART SoC support.

The MOXA ART SoC is based on a Faraday FA526 ARMv4 32-bit 192 MHz CPU
with MMU and 16KB/8KB D/I-cache (UC-7112-LX).

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. add CLKSRC_MMIO and GENERIC_CLOCKEVENTS to ARCH_MOXART
    2. call of_clk_init(NULL) from .init_time hook

 arch/arm/Kconfig                  |   2 +
 arch/arm/Makefile                 |   1 +
 arch/arm/configs/moxart_defconfig | 116 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-moxart/Kconfig      |  29 ++++++++++
 arch/arm/mach-moxart/Makefile     |   3 +
 arch/arm/mach-moxart/moxart.c     |  43 ++++++++++++++
 6 files changed, 194 insertions(+)
 create mode 100644 arch/arm/configs/moxart_defconfig
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/moxart.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0ac9be6..d84161c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -964,6 +964,8 @@ source "arch/arm/mach-ks8695/Kconfig"
 
 source "arch/arm/mach-msm/Kconfig"
 
+source "arch/arm/mach-moxart/Kconfig"
+
 source "arch/arm/mach-mv78xx0/Kconfig"
 
 source "arch/arm/mach-imx/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 72caf82..17907c8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -158,6 +158,7 @@ machine-$(CONFIG_ARCH_KIRKWOOD)		+= kirkwood
 machine-$(CONFIG_ARCH_KS8695)		+= ks8695
 machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
 machine-$(CONFIG_ARCH_MMP)		+= mmp
+machine-$(CONFIG_ARCH_MOXART)		+= moxart
 machine-$(CONFIG_ARCH_MSM)		+= msm
 machine-$(CONFIG_ARCH_MV78XX0)		+= mv78xx0
 machine-$(CONFIG_ARCH_MXC)		+= imx
diff --git a/arch/arm/configs/moxart_defconfig b/arch/arm/configs/moxart_defconfig
new file mode 100644
index 0000000..9977d33
--- /dev/null
+++ b/arch/arm/configs/moxart_defconfig
@@ -0,0 +1,116 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_MULTI_V4=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MOXART=y
+CONFIG_MACH_UC7112LX=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ATAGS is not set
+CONFIG_ARM_APPENDED_DTB=y
+# CONFIG_SUSPEND is not set
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_ARM_MOXART_ETHER=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_MOXART=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_MOXART_WDT=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI_MOXART=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MOXART=y
+CONFIG_DMADEVICES=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_EXT3_FS=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
new file mode 100644
index 0000000..a6ad825
--- /dev/null
+++ b/arch/arm/mach-moxart/Kconfig
@@ -0,0 +1,29 @@
+config ARCH_MOXART
+	bool "MOXA ART SoC" if ARCH_MULTI_V4
+	select CPU_FA526
+	select ARM_DMA_MEM_BUFFERABLE
+	select USE_OF
+	select CLKSRC_OF
+	select CLKSRC_MMIO
+	select HAVE_CLK
+	select COMMON_CLK
+	select GENERIC_IRQ_CHIP
+	select ARCH_REQUIRE_GPIOLIB
+	select GENERIC_CLOCKEVENTS
+	help
+	  Say Y here if you want to run your kernel on hardware with a
+	  MOXA ART SoC.
+	  The MOXA ART SoC is based on a Faraday FA526 ARMv4 32-bit
+	  192 MHz CPU with MMU and 16KB/8KB D/I-cache (UC-7112-LX).
+	  Used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.
+
+if ARCH_MOXART
+
+config MACH_UC7112LX
+	bool "MOXA UC-7112-LX"
+	depends on ARCH_MOXART
+	help
+	  Say Y here if you intend to run this kernel on a MOXA
+	  UC-7112-LX embedded computer.
+
+endif
diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
new file mode 100644
index 0000000..fa022eb
--- /dev/null
+++ b/arch/arm/mach-moxart/Makefile
@@ -0,0 +1,3 @@
+# Object file lists.
+
+obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
new file mode 100644
index 0000000..86b4e49
--- /dev/null
+++ b/arch/arm/mach-moxart/moxart.c
@@ -0,0 +1,43 @@
+/*
+ * arch/arm/mach-moxart/moxart.c
+ *
+ * (C) Copyright 2013, Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <linux/init.h>
+#include <linux/clocksource.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
+
+#include <asm/mach/arch.h>
+
+static const char * const moxart_dt_compat[] = {
+	"moxa,moxart",
+	NULL,
+};
+
+static void __init moxart_init_time(void)
+{
+	of_clk_init(NULL);
+	clocksource_of_init();
+}
+
+DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
+	.init_time		= moxart_init_time,
+	.dt_compat		= moxart_dt_compat,
+MACHINE_END
-- 
1.8.2.1


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

* [PATCH v3 1/4] ARM: mach-moxart: add MOXA ART SoC files
@ 2013-07-04 14:44     ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

Add MOXA ART SoC support.

The MOXA ART SoC is based on a Faraday FA526 ARMv4 32-bit 192 MHz CPU
with MMU and 16KB/8KB D/I-cache (UC-7112-LX).

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. add CLKSRC_MMIO and GENERIC_CLOCKEVENTS to ARCH_MOXART
    2. call of_clk_init(NULL) from .init_time hook

 arch/arm/Kconfig                  |   2 +
 arch/arm/Makefile                 |   1 +
 arch/arm/configs/moxart_defconfig | 116 ++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-moxart/Kconfig      |  29 ++++++++++
 arch/arm/mach-moxart/Makefile     |   3 +
 arch/arm/mach-moxart/moxart.c     |  43 ++++++++++++++
 6 files changed, 194 insertions(+)
 create mode 100644 arch/arm/configs/moxart_defconfig
 create mode 100644 arch/arm/mach-moxart/Kconfig
 create mode 100644 arch/arm/mach-moxart/Makefile
 create mode 100644 arch/arm/mach-moxart/moxart.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 0ac9be6..d84161c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -964,6 +964,8 @@ source "arch/arm/mach-ks8695/Kconfig"
 
 source "arch/arm/mach-msm/Kconfig"
 
+source "arch/arm/mach-moxart/Kconfig"
+
 source "arch/arm/mach-mv78xx0/Kconfig"
 
 source "arch/arm/mach-imx/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 72caf82..17907c8 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -158,6 +158,7 @@ machine-$(CONFIG_ARCH_KIRKWOOD)		+= kirkwood
 machine-$(CONFIG_ARCH_KS8695)		+= ks8695
 machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
 machine-$(CONFIG_ARCH_MMP)		+= mmp
+machine-$(CONFIG_ARCH_MOXART)		+= moxart
 machine-$(CONFIG_ARCH_MSM)		+= msm
 machine-$(CONFIG_ARCH_MV78XX0)		+= mv78xx0
 machine-$(CONFIG_ARCH_MXC)		+= imx
diff --git a/arch/arm/configs/moxart_defconfig b/arch/arm/configs/moxart_defconfig
new file mode 100644
index 0000000..9977d33
--- /dev/null
+++ b/arch/arm/configs/moxart_defconfig
@@ -0,0 +1,116 @@
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_SWAP is not set
+CONFIG_SYSVIPC=y
+CONFIG_NO_HZ=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+# CONFIG_SIGNALFD is not set
+# CONFIG_TIMERFD is not set
+# CONFIG_EVENTFD is not set
+# CONFIG_AIO is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_SLUB_DEBUG is not set
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_ARCH_MULTI_V4=y
+# CONFIG_ARCH_MULTI_V7 is not set
+CONFIG_ARCH_MOXART=y
+CONFIG_MACH_UC7112LX=y
+CONFIG_PREEMPT=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ATAGS is not set
+CONFIG_ARM_APPENDED_DTB=y
+# CONFIG_SUSPEND is not set
+CONFIG_NET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+# CONFIG_INET_DIAG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_WIRELESS is not set
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+CONFIG_MTD=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_PHYSMAP_OF=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_NETDEVICES=y
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_ARM_MOXART_ETHER=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT is not set
+# CONFIG_SERIO is not set
+# CONFIG_VT is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_MOXART=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_MOXART_WDT=y
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI_MOXART=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_MOXART=y
+CONFIG_DMADEVICES=y
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_EXT3_FS=y
+CONFIG_TMPFS=y
+CONFIG_JFFS2_FS=y
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_DEBUG_PREEMPT is not set
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_INFO=y
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_FTRACE is not set
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_KEYS=y
diff --git a/arch/arm/mach-moxart/Kconfig b/arch/arm/mach-moxart/Kconfig
new file mode 100644
index 0000000..a6ad825
--- /dev/null
+++ b/arch/arm/mach-moxart/Kconfig
@@ -0,0 +1,29 @@
+config ARCH_MOXART
+	bool "MOXA ART SoC" if ARCH_MULTI_V4
+	select CPU_FA526
+	select ARM_DMA_MEM_BUFFERABLE
+	select USE_OF
+	select CLKSRC_OF
+	select CLKSRC_MMIO
+	select HAVE_CLK
+	select COMMON_CLK
+	select GENERIC_IRQ_CHIP
+	select ARCH_REQUIRE_GPIOLIB
+	select GENERIC_CLOCKEVENTS
+	help
+	  Say Y here if you want to run your kernel on hardware with a
+	  MOXA ART SoC.
+	  The MOXA ART SoC is based on a Faraday FA526 ARMv4 32-bit
+	  192 MHz CPU with MMU and 16KB/8KB D/I-cache (UC-7112-LX).
+	  Used on models UC-7101, UC-7112/UC-7110, IA240/IA241, IA3341.
+
+if ARCH_MOXART
+
+config MACH_UC7112LX
+	bool "MOXA UC-7112-LX"
+	depends on ARCH_MOXART
+	help
+	  Say Y here if you intend to run this kernel on a MOXA
+	  UC-7112-LX embedded computer.
+
+endif
diff --git a/arch/arm/mach-moxart/Makefile b/arch/arm/mach-moxart/Makefile
new file mode 100644
index 0000000..fa022eb
--- /dev/null
+++ b/arch/arm/mach-moxart/Makefile
@@ -0,0 +1,3 @@
+# Object file lists.
+
+obj-$(CONFIG_MACH_UC7112LX)	+= moxart.o
diff --git a/arch/arm/mach-moxart/moxart.c b/arch/arm/mach-moxart/moxart.c
new file mode 100644
index 0000000..86b4e49
--- /dev/null
+++ b/arch/arm/mach-moxart/moxart.c
@@ -0,0 +1,43 @@
+/*
+ * arch/arm/mach-moxart/moxart.c
+ *
+ * (C) Copyright 2013, Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <linux/init.h>
+#include <linux/clocksource.h>
+#include <linux/of_platform.h>
+#include <linux/clk-provider.h>
+
+#include <asm/mach/arch.h>
+
+static const char * const moxart_dt_compat[] = {
+	"moxa,moxart",
+	NULL,
+};
+
+static void __init moxart_init_time(void)
+{
+	of_clk_init(NULL);
+	clocksource_of_init();
+}
+
+DT_MACHINE_START(MOXART, "MOXA UC-7112-LX")
+	.init_time		= moxart_init_time,
+	.dt_compat		= moxart_dt_compat,
+MACHINE_END
-- 
1.8.2.1

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

* [PATCH v3 2/4] ARM: mach-moxart: add MOXA ART device tree files
  2013-06-12 12:34   ` Jonas Jensen
@ 2013-07-04 14:45     ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux, linux-kernel, devicetree-discuss, arm, arnd, olof, Jonas Jensen

Add generic SoC include and UC-7112-LX platform device tree files
and documentation.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. add and update documentation, new drivers: mmc, mac, rtc,
       watchdog, gpio, core-clock, apb-clock

 .../bindings/arm/moxart/moxa,moxart-apb-clock.txt  | 18 +++++
 .../devicetree/bindings/arm/moxart/moxart.txt      | 12 ++++
 .../bindings/clock/moxa,moxart-core-clock          | 19 +++++
 .../devicetree/bindings/gpio/moxa,moxart-gpio.txt  | 16 +++++
 .../interrupt-controller/moxa,moxart-ic.txt        | 28 ++++++++
 .../devicetree/bindings/mmc/moxa,moxart-mmc.txt    | 17 +++++
 .../devicetree/bindings/net/moxa,moxart-mac.txt    | 25 +++++++
 .../devicetree/bindings/rtc/moxa,moxart-rtc.txt    | 11 +++
 .../bindings/timer/moxa,moxart-timer.txt           | 17 +++++
 .../bindings/watchdog/moxa,moxart-watchdog.txt     | 15 ++++
 arch/arm/boot/dts/Makefile                         |  1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts              | 82 ++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi                      | 79 +++++++++++++++++++++
 13 files changed, 340 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
 create mode 100644 Documentation/devicetree/bindings/arm/moxart/moxart.txt
 create mode 100644 Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
 create mode 100644 Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
 create mode 100644 Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
 create mode 100644 Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
 create mode 100644 Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi

diff --git a/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt b/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
new file mode 100644
index 0000000..f6e88fc
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
@@ -0,0 +1,18 @@
+MOXA ART APB clock
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-apb-clock"
+- #clock-cells : Should be 0
+
+Example:
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		clkapb: clkapb {
+			compatible = "moxa,moxart-apb-clock";
+			#clock-cells = <0>;
+		};
+	};
diff --git a/Documentation/devicetree/bindings/arm/moxart/moxart.txt b/Documentation/devicetree/bindings/arm/moxart/moxart.txt
new file mode 100644
index 0000000..11087ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/moxart/moxart.txt
@@ -0,0 +1,12 @@
+MOXA ART device tree bindings
+
+Boards with the MOXA ART SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "moxa,moxart";
+
+Boards:
+
+- UC-7112-LX: embedded computer
+  compatible = "moxa,moxart-uc-7112-lx", "moxa,moxart"
diff --git a/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock b/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
new file mode 100644
index 0000000..cf69361
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
@@ -0,0 +1,19 @@
+Device Tree Clock bindings for arch-moxart
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+MOXA ART SoCs allow to determine core clock frequencies by reading
+a register.
+
+Required properties:
+- compatible : Should be "moxa,moxart-core-clock"
+- reg : Should contain registers location and length
+
+For example:
+
+	clk: core-clock@98100000 {
+		compatible = "moxa,moxart-core-clock";
+		reg = <0x98100000 0x34>;
+	};
diff --git a/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
new file mode 100644
index 0000000..1be5875
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
@@ -0,0 +1,16 @@
+MOXA ART GPIO Controller
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-gpio"
+- reg : Should contain registers location and length
+	index 0 : input, output, and direction control
+	index 1 : enable/disable individual pins, pin 0-31
+
+Example:
+
+	gpio: gpio@98700000 {
+		compatible = "moxa,moxart-gpio";
+		reg =	<0x98700000 0xC>,
+			<0x98100100 0x4>;
+	};
diff --git a/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
new file mode 100644
index 0000000..58f1fe1
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
@@ -0,0 +1,28 @@
+* MOXA ART Interrupt Controller
+
+MOXA ART Interrupt Controller (moxart-ic) is used on MOXA ART SoCs
+and supports 32 non-configurable number of interrupts
+
+Main node required properties:
+
+- compatible : "moxa,moxart-ic"
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The type shall be a <u32> and the value shall be 2.
+
+  The first cell contains the interrupt number in the range [0-31].
+  The second cell contains the interrupt type
+
+- reg: physical base address and size of the intc registers map.
+- interrupt-mask: Specifies if the interrupt is edge or level-triggered
+  each bit represent an interrupt 0-31 where 1 signify edge
+
+Example:
+
+	intc: interrupt-controller@98800000 {
+		compatible = "moxa,moxart-ic";
+		reg = <0x98800000 0x38>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupt-mask = <0x00080000>;
+	};
diff --git a/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt b/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
new file mode 100644
index 0000000..7cd7bd6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
@@ -0,0 +1,17 @@
+MOXA ART SD Host Controller Interface
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-mmc"
+- reg : Should contain registers location and length
+- interrupts : Should contain the interrupt number
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	mmc: mmc@98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg = <0x98e00000 0x0000005C>;
+		interrupts = <5 0>;
+		clocks = <&tclk>;
+	};
diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
new file mode 100644
index 0000000..8be75cd
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
@@ -0,0 +1,25 @@
+MOXA ART Ethernet Controller
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-mac"
+- reg : Should contain registers location and length
+  index 0 : main register
+  index 1 : mac address (stored on flash)
+- interrupts : Should contain the mac interrupt number
+
+Example:
+
+	mac0: mac@90900000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x90900000 0x1000>,
+			<0x80000050 0x6>;
+		interrupts = <25 0>;
+	};
+
+	mac1: mac@92000000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x92000000 0x1000>,
+			<0x80000056 0x6>;
+		interrupts = <27 0>;
+	};
diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
new file mode 100644
index 0000000..65f632c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
@@ -0,0 +1,11 @@
+MOXA ART real-time clock
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-rtc"
+
+Example:
+
+	rtc: rtc {
+		compatible = "moxa,moxart-rtc";
+	};
diff --git a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
new file mode 100644
index 0000000..9015b88
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
@@ -0,0 +1,17 @@
+MOXA ART timer
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-timer"
+- reg : Should contain registers location and length
+- interrupts : Should contain the timer interrupt number
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	timer: timer@98400000 {
+		compatible = "moxa,moxart-timer";
+		reg = <0x98400000 0x10>;
+		interrupts = <19 1>;
+		clocks = <&tclk>;
+	};
diff --git a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
new file mode 100644
index 0000000..00a23b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
@@ -0,0 +1,15 @@
+MOXA ART Watchdog timer
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-watchdog"
+- reg : Should contain registers location and length
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	watchdog: watchdog@98500000 {
+		compatible = "moxa,moxart-watchdog";
+		reg = <0x98500000 0x10>;
+		clocks = <&tclk>;
+	};
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 2cec2ff..66d4d73 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -96,6 +96,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-ts219-6282.dtb \
 	kirkwood-openblocks_a6.dtb
 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
+dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
 	msm8960-cdp.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
new file mode 100644
index 0000000..db65575
--- /dev/null
+++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
@@ -0,0 +1,82 @@
+/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/dts-v1/;
+/include/ "moxart.dtsi"
+
+/ {
+	model = "MOXA UC-7112-LX";
+	compatible = "moxa,moxart-uc-7112-lx", "moxa,moxart";
+
+	memory {
+		/* SAMSUNG K4S561632J-UC75 */
+		device_type = "memory";
+		reg = <0x0 0x2000000>;
+	};
+
+	flash@80000000,0 {
+		/* JS28F128 J3D75 A9087684
+		 * Numonyx Embedded Flash Memory (J3 v. D)
+		 */
+		compatible = "numonyx,js28f128", "cfi-flash";
+		reg = <0x80000000 0x1000000>;
+		bank-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "bootloader";
+			reg = <0x0 0x40000>;
+		};
+		partition@40000 {
+			label = "linux kernel";
+			reg = <0x40000 0x1C0000>;
+		};
+		partition@200000 {
+			label = "root filesystem";
+			reg = <0x200000 0x800000>;
+		};
+		partition@a00000 {
+			label = "user filesystem";
+			reg = <0xa00000 0x600000>;
+		};
+	};
+
+	mmc: mmc@98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg = <0x98e00000 0x5C>;
+		interrupts = <5 0>;
+		clocks = <&clkapb>;
+	};
+
+	mac0: mac@90900000 {
+		compatible = "moxa,moxart-mac";
+		reg =   <0x90900000 0x100>,
+			<0x80000050 0x6>;
+		interrupts = <25 0>;
+	};
+
+	mac1: mac@92000000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x92000000 0x100>,
+			<0x80000056 0x6>;
+		interrupts = <27 0>;
+	};
+
+	uart0: uart@98200000 {
+		compatible = "ns16550a";
+		reg = <0x98200000 0x20>;
+		interrupts = <31 8>;
+		reg-shift = <2>;
+		reg-io-width = <4>;
+		clock-frequency = <14745600>;
+		status = "okay";
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
+	};
+};
diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
new file mode 100644
index 0000000..40f20f3
--- /dev/null
+++ b/arch/arm/boot/dts/moxart.dtsi
@@ -0,0 +1,79 @@
+/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "moxa,moxart";
+	model = "MOXART";
+	interrupt-parent = <&intc>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "faraday,fa526";
+			reg = <0>;
+		};
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		clkapb: clkapb {
+			compatible = "moxa,moxart-apb-clock";
+			#clock-cells = <0>;
+		};
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x90000000 0x10000000>;
+		ranges;
+
+		intc: interrupt-controller@98800000 {
+			compatible = "moxa,moxart-ic";
+			reg = <0x98800000 0x38>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupt-mask = <0x00080000>;
+		};
+
+		clk: core-clock@98100000 {
+			compatible = "moxa,moxart-core-clock";
+			reg = <0x98100000 0x34>;
+		};
+
+		timer: timer@98400000 {
+			compatible = "moxa,moxart-timer";
+			reg = <0x98400000 0x42>;
+			interrupts = <19 1>;
+			clocks = <&clkapb>;
+		};
+
+		gpio: gpio@98700000 {
+			compatible = "moxa,moxart-gpio";
+			reg =	<0x98700000 0xC>,
+				<0x98100100 0x4>;
+		};
+
+		rtc: rtc {
+			compatible = "moxa,moxart-rtc";
+		};
+
+		watchdog: watchdog@98500000 {
+			compatible = "moxa,moxart-watchdog";
+			reg = <0x98500000 0x10>;
+			clocks = <&clkapb>;
+		};
+	};
+};
-- 
1.8.2.1


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

* [PATCH v3 2/4] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-07-04 14:45     ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:45 UTC (permalink / raw)
  To: linux-arm-kernel

Add generic SoC include and UC-7112-LX platform device tree files
and documentation.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. add and update documentation, new drivers: mmc, mac, rtc,
       watchdog, gpio, core-clock, apb-clock

 .../bindings/arm/moxart/moxa,moxart-apb-clock.txt  | 18 +++++
 .../devicetree/bindings/arm/moxart/moxart.txt      | 12 ++++
 .../bindings/clock/moxa,moxart-core-clock          | 19 +++++
 .../devicetree/bindings/gpio/moxa,moxart-gpio.txt  | 16 +++++
 .../interrupt-controller/moxa,moxart-ic.txt        | 28 ++++++++
 .../devicetree/bindings/mmc/moxa,moxart-mmc.txt    | 17 +++++
 .../devicetree/bindings/net/moxa,moxart-mac.txt    | 25 +++++++
 .../devicetree/bindings/rtc/moxa,moxart-rtc.txt    | 11 +++
 .../bindings/timer/moxa,moxart-timer.txt           | 17 +++++
 .../bindings/watchdog/moxa,moxart-watchdog.txt     | 15 ++++
 arch/arm/boot/dts/Makefile                         |  1 +
 arch/arm/boot/dts/moxart-uc7112lx.dts              | 82 ++++++++++++++++++++++
 arch/arm/boot/dts/moxart.dtsi                      | 79 +++++++++++++++++++++
 13 files changed, 340 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
 create mode 100644 Documentation/devicetree/bindings/arm/moxart/moxart.txt
 create mode 100644 Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
 create mode 100644 Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
 create mode 100644 Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
 create mode 100644 Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
 create mode 100644 Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
 create mode 100644 arch/arm/boot/dts/moxart-uc7112lx.dts
 create mode 100644 arch/arm/boot/dts/moxart.dtsi

diff --git a/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt b/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
new file mode 100644
index 0000000..f6e88fc
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/moxart/moxa,moxart-apb-clock.txt
@@ -0,0 +1,18 @@
+MOXA ART APB clock
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-apb-clock"
+- #clock-cells : Should be 0
+
+Example:
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		clkapb: clkapb {
+			compatible = "moxa,moxart-apb-clock";
+			#clock-cells = <0>;
+		};
+	};
diff --git a/Documentation/devicetree/bindings/arm/moxart/moxart.txt b/Documentation/devicetree/bindings/arm/moxart/moxart.txt
new file mode 100644
index 0000000..11087ed
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/moxart/moxart.txt
@@ -0,0 +1,12 @@
+MOXA ART device tree bindings
+
+Boards with the MOXA ART SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "moxa,moxart";
+
+Boards:
+
+- UC-7112-LX: embedded computer
+  compatible = "moxa,moxart-uc-7112-lx", "moxa,moxart"
diff --git a/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock b/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
new file mode 100644
index 0000000..cf69361
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/moxa,moxart-core-clock
@@ -0,0 +1,19 @@
+Device Tree Clock bindings for arch-moxart
+
+This binding uses the common clock binding[1].
+
+[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+MOXA ART SoCs allow to determine core clock frequencies by reading
+a register.
+
+Required properties:
+- compatible : Should be "moxa,moxart-core-clock"
+- reg : Should contain registers location and length
+
+For example:
+
+	clk: core-clock at 98100000 {
+		compatible = "moxa,moxart-core-clock";
+		reg = <0x98100000 0x34>;
+	};
diff --git a/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
new file mode 100644
index 0000000..1be5875
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/moxa,moxart-gpio.txt
@@ -0,0 +1,16 @@
+MOXA ART GPIO Controller
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-gpio"
+- reg : Should contain registers location and length
+	index 0 : input, output, and direction control
+	index 1 : enable/disable individual pins, pin 0-31
+
+Example:
+
+	gpio: gpio at 98700000 {
+		compatible = "moxa,moxart-gpio";
+		reg =	<0x98700000 0xC>,
+			<0x98100100 0x4>;
+	};
diff --git a/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt b/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
new file mode 100644
index 0000000..58f1fe1
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/moxa,moxart-ic.txt
@@ -0,0 +1,28 @@
+* MOXA ART Interrupt Controller
+
+MOXA ART Interrupt Controller (moxart-ic) is used on MOXA ART SoCs
+and supports 32 non-configurable number of interrupts
+
+Main node required properties:
+
+- compatible : "moxa,moxart-ic"
+- interrupt-controller : Identifies the node as an interrupt controller
+- #interrupt-cells : Specifies the number of cells needed to encode an
+  interrupt source. The type shall be a <u32> and the value shall be 2.
+
+  The first cell contains the interrupt number in the range [0-31].
+  The second cell contains the interrupt type
+
+- reg: physical base address and size of the intc registers map.
+- interrupt-mask: Specifies if the interrupt is edge or level-triggered
+  each bit represent an interrupt 0-31 where 1 signify edge
+
+Example:
+
+	intc: interrupt-controller at 98800000 {
+		compatible = "moxa,moxart-ic";
+		reg = <0x98800000 0x38>;
+		interrupt-controller;
+		#interrupt-cells = <2>;
+		interrupt-mask = <0x00080000>;
+	};
diff --git a/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt b/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
new file mode 100644
index 0000000..7cd7bd6
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/moxa,moxart-mmc.txt
@@ -0,0 +1,17 @@
+MOXA ART SD Host Controller Interface
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-mmc"
+- reg : Should contain registers location and length
+- interrupts : Should contain the interrupt number
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	mmc: mmc at 98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg = <0x98e00000 0x0000005C>;
+		interrupts = <5 0>;
+		clocks = <&tclk>;
+	};
diff --git a/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt b/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
new file mode 100644
index 0000000..8be75cd
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/moxa,moxart-mac.txt
@@ -0,0 +1,25 @@
+MOXA ART Ethernet Controller
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-mac"
+- reg : Should contain registers location and length
+  index 0 : main register
+  index 1 : mac address (stored on flash)
+- interrupts : Should contain the mac interrupt number
+
+Example:
+
+	mac0: mac at 90900000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x90900000 0x1000>,
+			<0x80000050 0x6>;
+		interrupts = <25 0>;
+	};
+
+	mac1: mac at 92000000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x92000000 0x1000>,
+			<0x80000056 0x6>;
+		interrupts = <27 0>;
+	};
diff --git a/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
new file mode 100644
index 0000000..65f632c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/moxa,moxart-rtc.txt
@@ -0,0 +1,11 @@
+MOXA ART real-time clock
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-rtc"
+
+Example:
+
+	rtc: rtc {
+		compatible = "moxa,moxart-rtc";
+	};
diff --git a/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
new file mode 100644
index 0000000..9015b88
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/moxa,moxart-timer.txt
@@ -0,0 +1,17 @@
+MOXA ART timer
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-timer"
+- reg : Should contain registers location and length
+- interrupts : Should contain the timer interrupt number
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	timer: timer at 98400000 {
+		compatible = "moxa,moxart-timer";
+		reg = <0x98400000 0x10>;
+		interrupts = <19 1>;
+		clocks = <&tclk>;
+	};
diff --git a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
new file mode 100644
index 0000000..00a23b9
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt
@@ -0,0 +1,15 @@
+MOXA ART Watchdog timer
+
+Required properties:
+
+- compatible : Should be "moxa,moxart-watchdog"
+- reg : Should contain registers location and length
+- clocks : Should contain phandle for the internal bus clock "tclk"
+
+Example:
+
+	watchdog: watchdog at 98500000 {
+		compatible = "moxa,moxart-watchdog";
+		reg = <0x98500000 0x10>;
+		clocks = <&tclk>;
+	};
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 2cec2ff..66d4d73 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -96,6 +96,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-cloudbox.dtb \
 	kirkwood-ts219-6282.dtb \
 	kirkwood-openblocks_a6.dtb
 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
+dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
 	msm8960-cdp.dtb
 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
diff --git a/arch/arm/boot/dts/moxart-uc7112lx.dts b/arch/arm/boot/dts/moxart-uc7112lx.dts
new file mode 100644
index 0000000..db65575
--- /dev/null
+++ b/arch/arm/boot/dts/moxart-uc7112lx.dts
@@ -0,0 +1,82 @@
+/* moxart-uc7112lx.dts - Device Tree file for MOXA UC-7112-LX
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/dts-v1/;
+/include/ "moxart.dtsi"
+
+/ {
+	model = "MOXA UC-7112-LX";
+	compatible = "moxa,moxart-uc-7112-lx", "moxa,moxart";
+
+	memory {
+		/* SAMSUNG K4S561632J-UC75 */
+		device_type = "memory";
+		reg = <0x0 0x2000000>;
+	};
+
+	flash at 80000000,0 {
+		/* JS28F128 J3D75 A9087684
+		 * Numonyx Embedded Flash Memory (J3 v. D)
+		 */
+		compatible = "numonyx,js28f128", "cfi-flash";
+		reg = <0x80000000 0x1000000>;
+		bank-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition at 0 {
+			label = "bootloader";
+			reg = <0x0 0x40000>;
+		};
+		partition at 40000 {
+			label = "linux kernel";
+			reg = <0x40000 0x1C0000>;
+		};
+		partition at 200000 {
+			label = "root filesystem";
+			reg = <0x200000 0x800000>;
+		};
+		partition at a00000 {
+			label = "user filesystem";
+			reg = <0xa00000 0x600000>;
+		};
+	};
+
+	mmc: mmc at 98e00000 {
+		compatible = "moxa,moxart-mmc";
+		reg = <0x98e00000 0x5C>;
+		interrupts = <5 0>;
+		clocks = <&clkapb>;
+	};
+
+	mac0: mac at 90900000 {
+		compatible = "moxa,moxart-mac";
+		reg =   <0x90900000 0x100>,
+			<0x80000050 0x6>;
+		interrupts = <25 0>;
+	};
+
+	mac1: mac at 92000000 {
+		compatible = "moxa,moxart-mac";
+		reg =	<0x92000000 0x100>,
+			<0x80000056 0x6>;
+		interrupts = <27 0>;
+	};
+
+	uart0: uart at 98200000 {
+		compatible = "ns16550a";
+		reg = <0x98200000 0x20>;
+		interrupts = <31 8>;
+		reg-shift = <2>;
+		reg-io-width = <4>;
+		clock-frequency = <14745600>;
+		status = "okay";
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8 root=/dev/mtdblock2 rootfstype=jffs2 rw";
+	};
+};
diff --git a/arch/arm/boot/dts/moxart.dtsi b/arch/arm/boot/dts/moxart.dtsi
new file mode 100644
index 0000000..40f20f3
--- /dev/null
+++ b/arch/arm/boot/dts/moxart.dtsi
@@ -0,0 +1,79 @@
+/* moxart.dtsi - Device Tree Include file for MOXA ART family SoC
+ *
+ * Copyright (C) 2013 Jonas Jensen <jonas.jensen@gmail.com>
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+/include/ "skeleton.dtsi"
+
+/ {
+	compatible = "moxa,moxart";
+	model = "MOXART";
+	interrupt-parent = <&intc>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu at 0 {
+			device_type = "cpu";
+			compatible = "faraday,fa526";
+			reg = <0>;
+		};
+	};
+
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		clkapb: clkapb {
+			compatible = "moxa,moxart-apb-clock";
+			#clock-cells = <0>;
+		};
+	};
+
+	soc {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x90000000 0x10000000>;
+		ranges;
+
+		intc: interrupt-controller at 98800000 {
+			compatible = "moxa,moxart-ic";
+			reg = <0x98800000 0x38>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupt-mask = <0x00080000>;
+		};
+
+		clk: core-clock at 98100000 {
+			compatible = "moxa,moxart-core-clock";
+			reg = <0x98100000 0x34>;
+		};
+
+		timer: timer at 98400000 {
+			compatible = "moxa,moxart-timer";
+			reg = <0x98400000 0x42>;
+			interrupts = <19 1>;
+			clocks = <&clkapb>;
+		};
+
+		gpio: gpio at 98700000 {
+			compatible = "moxa,moxart-gpio";
+			reg =	<0x98700000 0xC>,
+				<0x98100100 0x4>;
+		};
+
+		rtc: rtc {
+			compatible = "moxa,moxart-rtc";
+		};
+
+		watchdog: watchdog at 98500000 {
+			compatible = "moxa,moxart-watchdog";
+			reg = <0x98500000 0x10>;
+			clocks = <&clkapb>;
+		};
+	};
+};
-- 
1.8.2.1

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

* [PATCH v3 3/4] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-07-04 14:45     ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:45 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux, linux-kernel, devicetree-discuss, arm, arnd, olof, Jonas Jensen

Add MOXA ART kernel low-level debugging port support.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. use alphabetic ordering in Kconfig

 arch/arm/Kconfig.debug          |  8 ++++++++
 arch/arm/include/debug/moxart.S | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm/include/debug/moxart.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5b7be8d..781018c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -286,6 +286,13 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on MMP UART3.
 
+	config DEBUG_MOXART_UART0
+		bool "Kernel low-level debugging messages via MOXART UART0"
+		depends on ARCH_MOXART
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on MOXART based platforms on the UART0.
+
 	config DEBUG_MSM_UART1
 		bool "Kernel low-level debugging messages via MSM UART1"
 		depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
@@ -777,6 +784,7 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX6SL_UART
 	default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \
 				      DEBUG_KEYSTONE_UART1
+	default "debug/moxart.S" if DEBUG_MOXART_UART0
 	default "debug/mvebu.S" if DEBUG_MVEBU_UART || \
 				   DEBUG_MVEBU_UART_ALTERNATE
 	default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
new file mode 100644
index 0000000..a228451
--- /dev/null
+++ b/arch/arm/include/debug/moxart.S
@@ -0,0 +1,20 @@
+/*
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2013 Jonas Jensen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
+#define MOXART_UART_DEBUG_VIRT_BASE		0xf9820000
+
+	.macro	addruart, rp, rv, tmp
+	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE
+	ldr	\rv, =MOXART_UART_DEBUG_VIRT_BASE
+	.endm
+
+#define UART_SHIFT	2
+#include <asm/hardware/debug-8250.S>
-- 
1.8.2.1


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

* [PATCH v3 3/4] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-07-04 14:45     ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:45 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, arm-DgEjT+Ai2ygdnm+yROfE0A

Add MOXA ART kernel low-level debugging port support.

Signed-off-by: Jonas Jensen <jonas.jensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. use alphabetic ordering in Kconfig

 arch/arm/Kconfig.debug          |  8 ++++++++
 arch/arm/include/debug/moxart.S | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm/include/debug/moxart.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5b7be8d..781018c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -286,6 +286,13 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on MMP UART3.
 
+	config DEBUG_MOXART_UART0
+		bool "Kernel low-level debugging messages via MOXART UART0"
+		depends on ARCH_MOXART
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on MOXART based platforms on the UART0.
+
 	config DEBUG_MSM_UART1
 		bool "Kernel low-level debugging messages via MSM UART1"
 		depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
@@ -777,6 +784,7 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX6SL_UART
 	default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \
 				      DEBUG_KEYSTONE_UART1
+	default "debug/moxart.S" if DEBUG_MOXART_UART0
 	default "debug/mvebu.S" if DEBUG_MVEBU_UART || \
 				   DEBUG_MVEBU_UART_ALTERNATE
 	default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
new file mode 100644
index 0000000..a228451
--- /dev/null
+++ b/arch/arm/include/debug/moxart.S
@@ -0,0 +1,20 @@
+/*
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2013 Jonas Jensen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
+#define MOXART_UART_DEBUG_VIRT_BASE		0xf9820000
+
+	.macro	addruart, rp, rv, tmp
+	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE
+	ldr	\rv, =MOXART_UART_DEBUG_VIRT_BASE
+	.endm
+
+#define UART_SHIFT	2
+#include <asm/hardware/debug-8250.S>
-- 
1.8.2.1

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

* [PATCH v3 3/4] ARM: mach-moxart: add MOXA ART UART debug files
@ 2013-07-04 14:45     ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-04 14:45 UTC (permalink / raw)
  To: linux-arm-kernel

Add MOXA ART kernel low-level debugging port support.

Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com>
---

Notes:
    Applies to next-20130703
    
    Changes since v2:
    
    1. use alphabetic ordering in Kconfig

 arch/arm/Kconfig.debug          |  8 ++++++++
 arch/arm/include/debug/moxart.S | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm/include/debug/moxart.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5b7be8d..781018c 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -286,6 +286,13 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on MMP UART3.
 
+	config DEBUG_MOXART_UART0
+		bool "Kernel low-level debugging messages via MOXART UART0"
+		depends on ARCH_MOXART
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on MOXART based platforms on the UART0.
+
 	config DEBUG_MSM_UART1
 		bool "Kernel low-level debugging messages via MSM UART1"
 		depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
@@ -777,6 +784,7 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX6SL_UART
 	default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \
 				      DEBUG_KEYSTONE_UART1
+	default "debug/moxart.S" if DEBUG_MOXART_UART0
 	default "debug/mvebu.S" if DEBUG_MVEBU_UART || \
 				   DEBUG_MVEBU_UART_ALTERNATE
 	default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
diff --git a/arch/arm/include/debug/moxart.S b/arch/arm/include/debug/moxart.S
new file mode 100644
index 0000000..a228451
--- /dev/null
+++ b/arch/arm/include/debug/moxart.S
@@ -0,0 +1,20 @@
+/*
+ * Debugging macro include header
+ *
+ *  Copyright (C) 2013 Jonas Jensen
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define MOXART_UART_DEBUG_PHYS_BASE		0x98200000
+#define MOXART_UART_DEBUG_VIRT_BASE		0xf9820000
+
+	.macro	addruart, rp, rv, tmp
+	ldr	\rp, =MOXART_UART_DEBUG_PHYS_BASE
+	ldr	\rv, =MOXART_UART_DEBUG_VIRT_BASE
+	.endm
+
+#define UART_SHIFT	2
+#include <asm/hardware/debug-8250.S>
-- 
1.8.2.1

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

* Re: [PATCH v3 2/4] ARM: mach-moxart: add MOXA ART device tree files
  2013-07-04 14:45     ` Jonas Jensen
@ 2013-07-17  9:04       ` Jonas Jensen
  -1 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-17  9:04 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux, linux-kernel, devicetree-discuss, arm, arnd, olof, Jonas Jensen

Just as a reminder, I intend to update this set with some minor changes:

1. remove devicetree bindings for drivers, I will mail those out separately
2. a devicetree node for DMA was added
3. GPIO numbers are now in DT aswell

Best regards,
Jonas

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

* [PATCH v3 2/4] ARM: mach-moxart: add MOXA ART device tree files
@ 2013-07-17  9:04       ` Jonas Jensen
  0 siblings, 0 replies; 39+ messages in thread
From: Jonas Jensen @ 2013-07-17  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

Just as a reminder, I intend to update this set with some minor changes:

1. remove devicetree bindings for drivers, I will mail those out separately
2. a devicetree node for DMA was added
3. GPIO numbers are now in DT aswell

Best regards,
Jonas

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

end of thread, other threads:[~2013-07-17  9:04 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-12 12:34 [PATCH 0/3] ARM: mach-moxart: add MOXA ART SoC support Jonas Jensen
2013-06-12 12:34 ` Jonas Jensen
2013-06-12 12:34 ` [PATCH 1/3] ARM: mach-moxart: add MOXA ART SoC files Jonas Jensen
2013-06-12 12:34   ` Jonas Jensen
2013-06-12 22:42   ` Olof Johansson
2013-06-12 22:42     ` Olof Johansson
2013-06-14 14:33     ` Jonas Jensen
2013-06-14 14:33       ` Jonas Jensen
2013-06-17 22:21       ` Olof Johansson
2013-06-17 22:21         ` Olof Johansson
2013-06-14 14:47   ` Arnd Bergmann
2013-06-14 14:47     ` Arnd Bergmann
2013-06-14 16:41     ` Olof Johansson
2013-06-14 16:41       ` Olof Johansson
2013-06-14 17:44       ` Arnd Bergmann
2013-06-14 17:44         ` Arnd Bergmann
2013-07-04 14:44   ` [PATCH v3 1/4] " Jonas Jensen
2013-07-04 14:44     ` Jonas Jensen
2013-06-12 12:34 ` [PATCH 2/3] ARM: mach-moxart: add MOXA ART device tree files Jonas Jensen
2013-06-12 12:34   ` Jonas Jensen
2013-06-12 22:49   ` Olof Johansson
2013-06-12 22:49     ` Olof Johansson
2013-06-14 14:34     ` Jonas Jensen
2013-06-14 14:34       ` Jonas Jensen
2013-06-17 22:23       ` Olof Johansson
2013-06-17 22:23         ` Olof Johansson
2013-07-04 14:45   ` [PATCH v3 2/4] " Jonas Jensen
2013-07-04 14:45     ` Jonas Jensen
2013-07-17  9:04     ` Jonas Jensen
2013-07-17  9:04       ` Jonas Jensen
2013-06-12 12:34 ` [PATCH 3/3] ARM: mach-moxart: add MOXA ART UART debug files Jonas Jensen
2013-06-12 12:34   ` Jonas Jensen
2013-06-12 22:56   ` Olof Johansson
2013-06-12 22:56     ` Olof Johansson
2013-06-14 14:35     ` Jonas Jensen
2013-06-14 14:35       ` Jonas Jensen
2013-07-04 14:45   ` [PATCH v3 3/4] " Jonas Jensen
2013-07-04 14:45     ` Jonas Jensen
2013-07-04 14:45     ` Jonas Jensen

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.