Skip to contentSkip to conversation

ARM: meson: add preliminary support for MesonX/Meson6 SoCs

PATCH New Carlo Caione 4 participants 17 messages Sep 11, 2014 – Sep 16, 2014

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover ARM: meson: add preliminary support for MesonX/Meson6 SoCs

Amlogic AML8726-MX (codename Meson6) is a highly integrated multimedia application processor SoC for Multimedia Internet Device (MID), tablet and Set Top Box (STB). It integrates a powerful CPU, a 2D/3D graphics subsystem and a state-of-the-art video decoding engine together with all major peripherals. It is manufactured by Amlogic, inc.

This patchset introduces preliminary support for Meson6-based SoCs but several IPs and drivers are common among all the MesonX SoCs.

Amlogic doesn't release any documentation about their SoCs, so the code has been reverse-engineered from the messy source code released at:

http://openlinux.amlogic.com:8000/download/

Notes:
* The patchset requires https://lkml.org/lkml/2014/7/7/344
* Patch [3/9] is already in tty-next branch

Changes since v1:
* clocksource driver: deleted useless pointers to timers not used and code restyling
* machine file: deleted useless compatibles and .init_machine
* DTS: addressed several issues
* defconfigs: deleted meson_defconfig
* documentation: split documentation patch and added bindings documentation

Carlo Caione (9):
ARM: meson: debug: add debug UART for earlyprintk support
ARM: meson: documentation: add UART documentation
ARM: meson: serial: add MesonX SoC on-chip uart driver
ARM: meson: documentation: add timer documentation
ARM: meson6: clocksource: add Meson6 timer support
ARM: meson: documentation: add bindings documentation
ARM: meson: add basic support for MesonX SoCs
ARM: meson: dts: add basic Meson/Meson6/Meson6-atv1200 DTSI/DTS
ARM: meson: update multi_v7_defconfig

 Documentation/devicetree/bindings/arm/amlogic.txt  |   8 +
 .../devicetree/bindings/arm/geniatech.txt          |   5 +
 .../bindings/serial/amlogic,meson-uart.txt         |  17 +
 .../bindings/timer/amlogic,meson6-timer.txt        |  16 +
 .../devicetree/bindings/vendor-prefixes.txt        |   2 +
 arch/arm/Kconfig                                   |   2 +
 arch/arm/Kconfig.debug                             |  14 +-
 arch/arm/Makefile                                  |   1 +
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/meson.dtsi                       |  74 +++
 arch/arm/boot/dts/meson6-atv1200.dts               |  25 +
 arch/arm/boot/dts/meson6.dtsi                      |  40 ++
 arch/arm/configs/multi_v7_defconfig                |   3 +
 arch/arm/include/debug/meson.S                     |  35 ++
 arch/arm/mach-meson/Kconfig                        |  13 +
 arch/arm/mach-meson/Makefile                       |   1 +
 arch/arm/mach-meson/meson.c                        |  27 +
 drivers/clocksource/Kconfig                        |   3 +
 drivers/clocksource/Makefile                       |   1 +
 drivers/clocksource/meson6_timer.c                 | 167 ++++++
 drivers/tty/serial/Kconfig                         |  18 +
 drivers/tty/serial/Makefile                        |   1 +
 drivers/tty/serial/meson_uart.c                    | 634 +++++++++++++++++++++
 include/uapi/linux/serial_core.h                   |   3 +
 24 files changed, 1109 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/amlogic.txt
 create mode 100644 Documentation/devicetree/bindings/arm/geniatech.txt
 create mode 100644 Documentation/devicetree/bindings/serial/amlogic,meson-uart.txt
 create mode 100644 Documentation/devicetree/bindings/timer/amlogic,meson6-timer.txt
 create mode 100644 arch/arm/boot/dts/meson.dtsi
 create mode 100644 arch/arm/boot/dts/meson6-atv1200.dts
 create mode 100644 arch/arm/boot/dts/meson6.dtsi
 create mode 100644 arch/arm/include/debug/meson.S
 create mode 100644 arch/arm/mach-meson/Kconfig
 create mode 100644 arch/arm/mach-meson/Makefile
 create mode 100644 arch/arm/mach-meson/meson.c
 create mode 100644 drivers/clocksource/meson6_timer.c
 create mode 100644 drivers/tty/serial/meson_uart.c
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/9 ARM: meson: debug: add debug UART for earlyprintk support

Add the UART definitions needed to support earlyprintk for MesonX SoCs on UARTAO.

---
 arch/arm/Kconfig.debug         | 14 ++++++++++++--
 arch/arm/include/debug/meson.S | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/debug/meson.S
arch/arm/Kconfig.debug +12 -2
index 8f90595..c396ecc 100644
@@ -340,6 +340,13 @@ choice
 		  Say Y here if you want the debug print routines to direct
 		  their output to UART1 serial port on KEYSTONE2 devices.
 
+	config DEBUG_MESON_UARTAO
+		bool "Kernel low-level debugging via Meson6 UARTAO"
+		depends on ARCH_MESON
+		help
+		  Say Y here if you want kernel low-lever debugging support
+		  on Amlogic Meson6 based platforms on the UARTAO.
+
 	config DEBUG_MMP_UART2
 		bool "Kernel low-level debugging message via MMP UART2"
 		depends on ARCH_MMP
@@ -991,6 +998,7 @@ config DEBUG_STI_UART
 config DEBUG_LL_INCLUDE
 	string
 	default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
+	default "debug/meson.S" if DEBUG_MESON_UARTAO
 	default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X
 	default "debug/exynos.S" if DEBUG_EXYNOS_UART
 	default "debug/efm32.S" if DEBUG_LL_UART_EFM32
@@ -1084,6 +1092,7 @@ config DEBUG_UART_PHYS
 	default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
 	default 0xd0000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
 	default 0xd0012000 if DEBUG_MVEBU_UART
+	default 0xc81004c0 if DEBUG_MESON_UARTAO
 	default 0xd4017000 if DEBUG_MMP_UART2
 	default 0xd4018000 if DEBUG_MMP_UART3
 	default 0xe0000000 if ARCH_SPEAR13XX
@@ -1102,7 +1111,7 @@ config DEBUG_UART_PHYS
 	default 0xfffff700 if ARCH_IOP33X
 	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
 		DEBUG_LL_UART_EFM32 || \
-		DEBUG_UART_8250 || DEBUG_UART_PL01X || \
+		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
 		DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART
 
 config DEBUG_UART_VIRT
@@ -1138,6 +1147,7 @@ config DEBUG_UART_VIRT
 	default 0xfd012000 if ARCH_MV78XX0
 	default 0xfde12000 if ARCH_DOVE
 	default 0xfe012000 if ARCH_ORION5X
+	default 0xf31004c0 if DEBUG_MESON_UARTAO
 	default 0xfe017000 if DEBUG_MMP_UART2
 	default 0xfe018000 if DEBUG_MMP_UART3
 	default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART
@@ -1169,7 +1179,7 @@ config DEBUG_UART_VIRT
 	default 0xff003000 if DEBUG_U300_UART
 	default DEBUG_UART_PHYS if !MMU
 	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
-		DEBUG_UART_8250 || DEBUG_UART_PL01X || \
+		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
 		DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART
 
 config DEBUG_UART_8250_SHIFT
arch/arm/include/debug/meson.S new file +35 -0
new file mode 100644
index 0000000..1bae99b
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2014 Carlo Caione
+ * Carlo Caione <[email protected]>
+ *
+ * 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 MESON_AO_UART_WFIFO		0x0
+#define MESON_AO_UART_STATUS		0xc
+
+#define MESON_AO_UART_TX_FIFO_EMPTY	(1 << 22)
+#define MESON_AO_UART_TX_FIFO_FULL	(1 << 21)
+
+	.macro	addruart, rp, rv, tmp
+	ldr	\rp, =(CONFIG_DEBUG_UART_PHYS)		@ physical
+	ldr	\rv, =(CONFIG_DEBUG_UART_VIRT)		@ virtual
+	.endm
+
+	.macro	senduart,rd,rx
+	str	\rd, [\rx, #MESON_AO_UART_WFIFO]
+	.endm
+
+	.macro	busyuart,rd,rx
+1002:	ldr	\rd, [\rx, #MESON_AO_UART_STATUS]
+	tst	\rd, #MESON_AO_UART_TX_FIFO_EMPTY
+	beq	1002b
+	.endm
+
+	.macro	waituart,rd,rx
+1001:	ldr	\rd, [\rx, #MESON_AO_UART_STATUS]
+	tst	\rd, #MESON_AO_UART_TX_FIFO_FULL
+	bne	1001b
+	.endm
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/9 ARM: meson: documentation: add UART documentation

In reply to Carlo Caione
---
 .../devicetree/bindings/serial/amlogic,meson-uart.txt   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/serial/amlogic,meson-uart.txt
Documentation/devicetree/bindings/serial/amlogic,meson-uart.txt new file +17 -0
new file mode 100644
index 0000000..fa1935a
@@ -0,0 +1,17 @@
+Amlogic Meson UART
+
+Required properties:
+- compatible : Should be "amlogic,meson-uart"
+- reg : Address and length of the register set
+- interrupts : Should contain uart interrupt
+- clocks: phandle to the source clock
+
+Example:
+
+uart0: serial at c81004c0 {
+	compatible = "amlogic,meson-uart";
+	reg = <0xc81004c0 0x14>;
+	interrupts = <0 90 1>;
+	clocks = <&clk81>;
+};
+
Signature · 1 line
1.9.1
#3 lore raw

PATCH v2 3/9 ARM: meson: serial: add MesonX SoC on-chip uart driver

In reply to Carlo Caione

The SoC has four fully functional UARTs which use the same programming model. They are named UART_A, UART_B, UART_C and UART_AO (Always-On) which cannot be powered off.

---
 drivers/tty/serial/Kconfig       |  18 ++
 drivers/tty/serial/Makefile      |   1 +
 drivers/tty/serial/meson_uart.c  | 634 +++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |   3 +
 4 files changed, 656 insertions(+)
 create mode 100644 drivers/tty/serial/meson_uart.c
drivers/tty/serial/Kconfig +18 -0
index fb57159..89d50c6 100644
@@ -200,6 +200,24 @@ config SERIAL_KS8695_CONSOLE
 	  receives all kernel messages and warnings and which allows
 	  logins in single user mode).
 
+config SERIAL_MESON
+	tristate "Meson serial port support"
+	depends on ARCH_MESON
+	select SERIAL_CORE
+	help
+	  This enables the driver for the on-chip UARTs of the Amlogic
+	  MesonX processors.
+
+config SERIAL_MESON_CONSOLE
+	bool "Support for console on meson"
+	depends on SERIAL_MESON=y
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you wish to use a Amlogic MesonX UART as the
+	  system console (the system console is the device which
+	  receives all kernel messages and warnings and which allows
+	  logins in single user mode) as /dev/ttyAMLx.
+
 config SERIAL_CLPS711X
 	tristate "CLPS711X serial port support"
 	depends on ARCH_CLPS711X || COMPILE_TEST
drivers/tty/serial/Makefile +1 -0
index 0080cc3..9a548ac 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_SERIAL_MPC52xx) += mpc52xx_uart.o
 obj-$(CONFIG_SERIAL_ICOM) += icom.o
 obj-$(CONFIG_SERIAL_M32R_SIO) += m32r_sio.o
 obj-$(CONFIG_SERIAL_MPSC) += mpsc.o
+obj-$(CONFIG_SERIAL_MESON) += meson_uart.o
 obj-$(CONFIG_SERIAL_SB1250_DUART) += sb1250-duart.o
 obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
 obj-$(CONFIG_SERIAL_SCCNXP) += sccnxp.o
drivers/tty/serial/meson_uart.c new file +634 -0

634 lines not on this page · raw message

include/uapi/linux/serial_core.h +3 -0
index 5820269..16ad852 100644
@@ -244,4 +244,7 @@
 /* SC16IS74xx */
 #define PORT_SC16IS7XX   108
 
+/* MESON */
+#define PORT_MESON	109
+
 #endif /* _UAPILINUX_SERIAL_CORE_H */
Signature · 1 line
1.9.1
maintainer
#4 lore raw

PATCH v2 3/9 ARM: meson: serial: add MesonX SoC on-chip uart driver

Quoted 4 lines · Carlo Caione

The SoC has four fully functional UARTs which use the same programming model. They are named UART_A, UART_B, UART_C and UART_AO (Always-On) which cannot be powered off.

Quoted 8 lines
---
 drivers/tty/serial/Kconfig       |  18 ++
 drivers/tty/serial/Makefile      |   1 +
 drivers/tty/serial/meson_uart.c  | 634 +++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |   3 +
 4 files changed, 656 insertions(+)
 create mode 100644 drivers/tty/serial/meson_uart.c

I've already taken this patch, why resend it?

confused,

greg k-h

#5 lore raw

PATCH v2 3/9 ARM: meson: serial: add MesonX SoC on-chip uart driver

Quoted 14 lines · Greg KH
Quoted 4 lines · Carlo Caione

The SoC has four fully functional UARTs which use the same programming model. They are named UART_A, UART_B, UART_C and UART_AO (Always-On) which cannot be powered off.

Quoted 8 lines
---
 drivers/tty/serial/Kconfig       |  18 ++
 drivers/tty/serial/Makefile      |   1 +
 drivers/tty/serial/meson_uart.c  | 634 +++++++++++++++++++++++++++++++++++++++
 include/uapi/linux/serial_core.h |   3 +
 4 files changed, 656 insertions(+)
 create mode 100644 drivers/tty/serial/meson_uart.c
Quoted 1 line

I've already taken this patch, why resend it?

Just for completeness' sake since there is also the documentation in the patchset.
In the cover I specified that it was already taken.

I'll leave it out in v3 (if any).

Signature · 1 line
Carlo Caione
#6 lore raw

PATCH v2 4/9 ARM: meson: documentation: add timer documentation

In reply to Carlo Caione
---
 .../devicetree/bindings/timer/amlogic,meson6-timer.txt   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/timer/amlogic,meson6-timer.txt
Documentation/devicetree/bindings/timer/amlogic,meson6-timer.txt new file +16 -0
new file mode 100644
index 0000000..cf89894
@@ -0,0 +1,16 @@
+Amlogic Meson6 SoCs Timer Controller
+
+Required properties:
+
+- compatible : should be "amlogic,meson6-timer.txt"
+- reg : Specifies base physical address and size of the registers.
+- interrupts : The interrupt of the first timer
+
+Example:
+
+timer at c1109940 {
+	compatible = "amlogic,meson6-timer";
+	reg = <0xc1109940 0x14>;
+	interrupts = <0 10 1>;
+};
+
Signature · 1 line
1.9.1
maintainer
#7 lore raw

PATCH v2 4/9 ARM: meson: documentation: add timer documentation

Quoted 2 lines · On Thursday 11 September 2014 22:11:35 Carlo Caione wrote:

+- compatible : should be "amlogic,meson6-timer.txt"

Typo: remove the .txt

Otherwise

#8 lore raw

PATCH v2 5/9 ARM: meson6: clocksource: add Meson6 timer support

In reply to Carlo Caione

Meson6 SoCs are equipped with 5 32-bit timers, called TIMER_A, TIMER_B, TIMER_C, TIMER_D and TIMER_E.

The driver is providing clocksource support for the 32-bit counter using TIMER_E. Clockevents are also supported using TIMER_A.

---
 drivers/clocksource/Kconfig        |   3 +
 drivers/clocksource/Makefile       |   1 +
 drivers/clocksource/meson6_timer.c | 167 +++++++++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+)
 create mode 100644 drivers/clocksource/meson6_timer.c
drivers/clocksource/Kconfig +3 -0
index 065131c..1c80d7e 100644
@@ -28,6 +28,9 @@ config ARMADA_370_XP_TIMER
 	bool
 	select CLKSRC_OF
 
+config MESON6_TIMER
+	bool
+
 config ORION_TIMER
 	select CLKSRC_OF
 	select CLKSRC_MMIO
drivers/clocksource/Makefile +1 -0
index 800b130..5a4fc59 100644
@@ -23,6 +23,7 @@ obj-$(CONFIG_ARCH_PRIMA2)	+= timer-prima2.o
 obj-$(CONFIG_ARCH_U300)		+= timer-u300.o
 obj-$(CONFIG_SUN4I_TIMER)	+= sun4i_timer.o
 obj-$(CONFIG_SUN5I_HSTIMER)	+= timer-sun5i.o
+obj-$(CONFIG_MESON6_TIMER)	+= meson6_timer.o
 obj-$(CONFIG_ARCH_TEGRA)	+= tegra20_timer.o
 obj-$(CONFIG_VT8500_TIMER)	+= vt8500_timer.o
 obj-$(CONFIG_ARCH_NSPIRE)	+= zevio-timer.o
drivers/clocksource/meson6_timer.c new file +167 -0

167 lines not on this page · raw message

Signature · 1 line
1.9.1
maintainer
#9 lore raw

PATCH v2 5/9 ARM: meson6: clocksource: add Meson6 timer support

Quoted 8 lines · On Thursday 11 September 2014 22:11:36 Carlo Caione wrote:

Meson6 SoCs are equipped with 5 32-bit timers, called TIMER_A, TIMER_B, TIMER_C, TIMER_D and TIMER_E.

The driver is providing clocksource support for the 32-bit counter using TIMER_E. Clockevents are also supported using TIMER_A.

We should take all the platform code through the arm-soc tree, this one along with the DT binding document should go through the clocksource tree.

#10 lore raw

PATCH v2 5/9 ARM: meson6: clocksource: add Meson6 timer support

2014-09-11 22:57 GMT+02:00 Arnd Bergmann <[email protected]>:

Quoted 9 lines · On Thursday 11 September 2014 22:11:36 Carlo Caione wrote:
Quoted 8 lines

Meson6 SoCs are equipped with 5 32-bit timers, called TIMER_A, TIMER_B, TIMER_C, TIMER_D and TIMER_E.

The driver is providing clocksource support for the 32-bit counter using TIMER_E. Clockevents are also supported using TIMER_A.

This version addresses all the comments I had:

Quoted 6 lines

We should take all the platform code through the arm-soc tree, this one along with the DT binding document should go through the clocksource tree.

Signature · 1 line
motzblog.wordpress.com
#11 lore raw

PATCH v2 6/9 ARM: meson: documentation: add bindings documentation

In reply to Carlo Caione

Add vendor prefixes and basic documentation for MesonX SoCs bindings

---
 Documentation/devicetree/bindings/arm/amlogic.txt     | 8 ++++++++
 Documentation/devicetree/bindings/arm/geniatech.txt   | 5 +++++
 Documentation/devicetree/bindings/vendor-prefixes.txt | 2 ++
 3 files changed, 15 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/amlogic.txt
 create mode 100644 Documentation/devicetree/bindings/arm/geniatech.txt
Documentation/devicetree/bindings/arm/amlogic.txt new file +8 -0
new file mode 100644
index 0000000..7eece72
@@ -0,0 +1,8 @@
+Amlogic MesonX device tree bindings
+-------------------------------------------
+
+Boards with the Amlogic Meson6 SoC shall have the following properties:
+
+Required root node property:
+
+compatible = "amlogic,meson6";
Documentation/devicetree/bindings/arm/geniatech.txt new file +5 -0
new file mode 100644
index 0000000..74ccba4
@@ -0,0 +1,5 @@
+Geniatech platforms device tree bindings
+-------------------------------------------
+
+Geniatech ATV1200
+    - compatible = "geniatech,atv1200"
Documentation/devicetree/bindings/vendor-prefixes.txt +2 -0
index 46a311e..fb32fe0 100644
@@ -13,6 +13,7 @@ allwinner	Allwinner Technology Co., Ltd.
 altr	Altera Corp.
 amcc	Applied Micro Circuits Corporation (APM, formally AMCC)
 amd	Advanced Micro Devices (AMD), Inc.
+amlogic	Amlogic, Inc.
 ams	AMS AG
 amstaos	AMS-Taos Inc.
 apm	Applied Micro Circuits Corporation (APM)
@@ -50,6 +51,7 @@ excito	Excito
 fsl	Freescale Semiconductor
 GEFanuc	GE Fanuc Intelligent Platforms Embedded Systems, Inc.
 gef	GE Fanuc Intelligent Platforms Embedded Systems, Inc.
+geniatech	Geniatech, Inc.
 globalscale	Globalscale Technologies, Inc.
 gmt	Global Mixed-mode Technology, Inc.
 google	Google, Inc.
Signature · 1 line
1.9.1
#12 lore raw

PATCH v2 7/9 ARM: meson: add basic support for MesonX SoCs

In reply to Carlo Caione

This patch adds the basic machine file for the MesonX SoCs. Only Meson6 is populated.

---
 arch/arm/Kconfig             |  2 ++
 arch/arm/Makefile            |  1 +
 arch/arm/mach-meson/Kconfig  | 13 +++++++++++++
 arch/arm/mach-meson/Makefile |  1 +
 arch/arm/mach-meson/meson.c  | 27 +++++++++++++++++++++++++++
 5 files changed, 44 insertions(+)
 create mode 100644 arch/arm/mach-meson/Kconfig
 create mode 100644 arch/arm/mach-meson/Makefile
 create mode 100644 arch/arm/mach-meson/meson.c
arch/arm/Kconfig +2 -0
index 88acf8b..cf7f870 100644
@@ -956,6 +956,8 @@ source "arch/arm/mach-kirkwood/Kconfig"
 
 source "arch/arm/mach-ks8695/Kconfig"
 
+source "arch/arm/mach-meson/Kconfig"
+
 source "arch/arm/mach-msm/Kconfig"
 
 source "arch/arm/mach-moxart/Kconfig"
arch/arm/Makefile +1 -0
index 6721fab..f998803 100644
@@ -166,6 +166,7 @@ machine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
 machine-$(CONFIG_ARCH_KIRKWOOD)		+= kirkwood
 machine-$(CONFIG_ARCH_KS8695)		+= ks8695
 machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
+machine-$(CONFIG_ARCH_MESON)		+= meson
 machine-$(CONFIG_ARCH_MMP)		+= mmp
 machine-$(CONFIG_ARCH_MOXART)		+= moxart
 machine-$(CONFIG_ARCH_MSM)		+= msm
arch/arm/mach-meson/Kconfig new file +13 -0
new file mode 100644
index 0000000..2c1154e
@@ -0,0 +1,13 @@
+menuconfig ARCH_MESON
+	bool "Amlogic Meson SoCs" if ARCH_MULTI_V7
+	select GENERIC_IRQ_CHIP
+	select ARM_GIC
+
+if ARCH_MESON
+
+config MACH_MESON6
+	bool "Amlogic Meson6 (8726MX) SoCs support"
+	default ARCH_MESON
+	select MESON6_TIMER
+
+endif
arch/arm/mach-meson/Makefile new file +1 -0
new file mode 100644
index 0000000..9d7380e
@@ -0,0 +1 @@
+obj-$(CONFIG_ARCH_MESON) += meson.o
arch/arm/mach-meson/meson.c new file +27 -0
new file mode 100644
index 0000000..5ee064f
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 Carlo Caione <[email protected]>
+ *
+ * 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.
+ *
+ */
+
+#include <linux/of_platform.h>
+#include <asm/mach/arch.h>
+
+static const char * const m6_common_board_compat[] = {
+	"amlogic,meson6",
+	NULL,
+};
+
+DT_MACHINE_START(AML8726_MX, "Amlogic Meson6 platform")
+	.dt_compat	= m6_common_board_compat,
+MACHINE_END
+
Signature · 1 line
1.9.1
#13 lore raw

PATCH v2 8/9 ARM: meson: dts: add basic Meson/Meson6/Meson6-atv1200 DTSI/DTS

In reply to Carlo Caione

The Meson6 SoC is produced by Amlogic inc. and it is based on 2 Cortex A9 and an ARM Mali-400 GPU.
This patch adds two basic DTSI for the preliminary support of Meson and Meson6 SoCs. Another DTS is also added for supporting the atv1200 board, produced by Geniatech inc.

---
 arch/arm/boot/dts/Makefile           |  1 +
 arch/arm/boot/dts/meson.dtsi         | 74 ++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson6-atv1200.dts | 25 ++++++++++++
 arch/arm/boot/dts/meson6.dtsi        | 40 +++++++++++++++++++
 4 files changed, 140 insertions(+)
 create mode 100644 arch/arm/boot/dts/meson.dtsi
 create mode 100644 arch/arm/boot/dts/meson6-atv1200.dts
 create mode 100644 arch/arm/boot/dts/meson6.dtsi
arch/arm/boot/dts/Makefile +1 -0
index adb5ed9..4e2bb17 100644
@@ -154,6 +154,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += $(kirkwood)
 dtb-$(CONFIG_MACH_KIRKWOOD) += $(kirkwood)
 dtb-$(CONFIG_ARCH_LPC32XX) += ea3250.dtb phy3250.dtb
 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb
+dtb-$(CONFIG_MACH_MESON6) += meson6-atv1200.dtb
 dtb-$(CONFIG_ARCH_MOXART) += moxart-uc7112lx.dtb
 dtb-$(CONFIG_ARCH_MXC) += \
 	imx25-eukrea-mbimxsd25-baseboard.dtb \
arch/arm/boot/dts/meson.dtsi new file +74 -0

74 lines not on this page · raw message

arch/arm/boot/dts/meson6-atv1200.dts new file +25 -0
new file mode 100644
index 0000000..84576aa
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 Carlo Caione <[email protected]>
+ *
+ * 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.
+ */
+
+/dts-v1/;
+/include/ "meson6.dtsi"
+
+/ {
+	model = "Geniatech ATV1200";
+	compatible = "geniatech,atv1200";
+
+	memory {
+		reg = <0x40000000 0x80000000>;
+	};
+};
+
+&uart_AO {
+	status = "okay";
+};
+
arch/arm/boot/dts/meson6.dtsi new file +40 -0
new file mode 100644
index 0000000..f9d2cb5
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2014 Carlo Caione <[email protected]>
+ *
+ * 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/ "meson.dtsi"
+
+/ {
+	model = "Amlogic Meson6 SoC";
+	compatible = "amlogic,meson6";
+
+	interrupt-parent = <&gic>;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu at 200 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0x200>;
+		};
+
+		cpu at 201 {
+			device_type = "cpu";
+			compatible = "arm,cortex-a9";
+			reg = <0x201>;
+		};
+	};
+
+	clk81: clk at 0 {
+		#clock-cells = <0>;
+		compatible = "fixed-clock";
+		clock-frequency = <200000000>;
+	};
+}; /* end of / */
Signature · 1 line
1.9.1
maintainer
#14 lore raw

PATCH v2 8/9 ARM: meson: dts: add basic Meson/Meson6/Meson6-atv1200 DTSI/DTS

Quoted 6 lines · On Thursday 11 September 2014 22:11:39 Carlo Caione wrote:
arch/arm/boot/dts/meson.dtsi new file +0 -0
new file mode 100644
index 0000000..ace5db8

arch/arm/boot/dts/meson.dtsi line 8

Quoted 8 lines
arch/arm/boot/dts/meson.dtsi new file +8 -0
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2014 Carlo Caione <[email protected]>
+ *
+ * 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.
+ */

We recently had a discussion about licensing of dts files. Please make these dual-licensed GPL+BSD or similar, so they can be included in other operating systems as well.

arch/arm/boot/dts/meson.dtsi line 20

Quoted 11 lines
arch/arm/boot/dts/meson.dtsi new file +11 -0
+/include/ "skeleton.dtsi"
+
+/ {
+	interrupt-parent = <&gic>;
+
+	aliases {
+		serial0 = &uart_AO;
+		serial1 = &uart_A;
+		serial2 = &uart_B;
+		serial3 = &uart_C;
+	};

I think it would be best to move these aliases into the per-board file and only list the present ones.

Arnd

#15 lore raw

PATCH v2 9/9 ARM: meson: update multi_v7_defconfig

In reply to Carlo Caione

This patch updates the multi_v7_defconfig with the CONFIG_* needed by the just added Meson anch. It also adds a new defconfig specifically for the Meson SoCs.

---
 arch/arm/configs/multi_v7_defconfig | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/configs/multi_v7_defconfig +3 -0
index 5348364..4a853f2 100644
@@ -26,6 +26,7 @@ CONFIG_MACH_BERLIN_BG2Q=y
 CONFIG_ARCH_HIGHBANK=y
 CONFIG_ARCH_HI3xxx=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ARCH_MESON=y
 CONFIG_ARCH_MXC=y
 CONFIG_MACH_IMX51_DT=y
 CONFIG_SOC_IMX53=y
@@ -165,6 +166,8 @@ CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_DW=y
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+CONFIG_SERIAL_MESON=y
+CONFIG_SERIAL_MESON_CONSOLE=y
 CONFIG_SERIAL_SAMSUNG=y
 CONFIG_SERIAL_SAMSUNG_CONSOLE=y
 CONFIG_SERIAL_SIRFSOC=y
Signature · 1 line
1.9.1
maintainer
#16 lore raw

v2 cover ARM: meson: add preliminary support for MesonX/Meson6 SoCs

In reply to Carlo Caione
Quoted 6 lines · On Thursday 11 September 2014 22:11:31 Carlo Caione wrote:

Amlogic AML8726-MX (codename Meson6) is a highly integrated multimedia application processor SoC for Multimedia Internet Device (MID), tablet and Set Top Box (STB). It integrates a powerful CPU, a 2D/3D graphics subsystem and a state-of-the-art video decoding engine together with all major peripherals. It is manufactured by Amlogic, inc.

Quoted 7 lines

This patchset introduces preliminary support for Meson6-based SoCs but several IPs and drivers are common among all the MesonX SoCs.

Amlogic doesn't release any documentation about their SoCs, so the code has been reverse-engineered from the messy source code released at:

http://openlinux.amlogic.com:8000/download/

I don't remember seeing v1 of the patch set, but this looks awesome.

Unless there are further review comments in the next few days, please send a patches 1 and 6-9 to arm at kernel.org with a request to merge them for 3.18.

ARnd