Skip to contentSkip to conversation

arm: add basic support for Rockchip Cortex-A9 SoCs

PATCH Superseded Heiko Stübner 1 participant 4 messages Jun 20, 2013

Subsystems (4)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Heiko Stübner

author maintainer
#0 lore raw

v5 cover arm: add basic support for Rockchip Cortex-A9 SoCs

Fifth version of basic Rockchip A9 support.

Following a comment from Arnd, I stripped the submission from all specific clocks, only using dummy clocks for now. It's enough to reach a shell in an initramfs. MMC patches are currently pending on the mmc list, so if they also get merged accessing the sd controllers would also be possible.

Changes since v4:
- remove ifdef around l2x0 init
- only use dummy clocks

Changes since v3:
- split out standalone dw_mmc patches (submitted to linux-mmc)
- Remove divider and mux clocks and use fixed rate clocks instead until divider and mux clocks have got their generic dt bindings
- Make the gate clock use CLK_OF_DECLARE and document the bindings

Changes since v2:
- use common (pending review) HIWORD_MASK clock flag from Haojian Zhuang and me
- pinctrl driver is already in the pinctrl tree
- add core-periph clock that supplies the twd
- split "mmc: dw_mmc-pltfm: add Rockchip variant" into move and feature parts as suggested by Andy Shevchenko

Changes since v1:
- addressed Linus Walleij's comments to the pinctrl driver, including the move to generic pinconfig (hopefully I did catch all)
- renamed the clocks to use the SoC name of the initial user as suggested by Olof Johansson
- fixed the uart address, found by Arnd Bergmann
- address Arnd's comments on the board file (use of_clk_init and friends, remove map_io, use real soc names)
- removed Makefile.boot as suggested by Thomas Petazzoni

no dependencies anymore

Heiko Stuebner (3):
arm: Add basic clocks for Rockchip rk3066a SoCs
arm: add debug uarts for rockchip rk29xx and rk3xxx series
arm: add basic support for Rockchip RK3066a boards

 arch/arm/Kconfig                      |    2 +
 arch/arm/Kconfig.debug                |   34 +++
 arch/arm/Makefile                     |    1 +
 arch/arm/boot/dts/rk3066a-clocks.dtsi |   52 +++++
 arch/arm/boot/dts/rk3066a.dtsi        |  390 +++++++++++++++++++++++++++++++++
 arch/arm/include/debug/rockchip.S     |   42 ++++
 arch/arm/mach-rockchip/Kconfig        |   16 ++
 arch/arm/mach-rockchip/Makefile       |    1 +
 arch/arm/mach-rockchip/rockchip.c     |   52 +++++
 9 files changed, 590 insertions(+)
 create mode 100644 arch/arm/boot/dts/rk3066a-clocks.dtsi
 create mode 100644 arch/arm/boot/dts/rk3066a.dtsi
 create mode 100644 arch/arm/include/debug/rockchip.S
 create mode 100644 arch/arm/mach-rockchip/Kconfig
 create mode 100644 arch/arm/mach-rockchip/Makefile
 create mode 100644 arch/arm/mach-rockchip/rockchip.c
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw

PATCH v5 1/3 arm: Add basic clocks for Rockchip rk3066a SoCs

This adds a basic clock setup for rk3066a SoCs, currently only using dummy clocks to satisfy drivers requiring clocks..

Clocks whose rates need to be known are supplied by fixed-rate "dummy"-clocks that provide the correct rate. This is uncritical insofar that the only bootloader currently in existence for Rockchip devices is the propietary Rockchip one that always setups the clocks in the necessary and same way.

---
 arch/arm/boot/dts/rk3066a-clocks.dtsi |   52 +++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 arch/arm/boot/dts/rk3066a-clocks.dtsi
arch/arm/boot/dts/rk3066a-clocks.dtsi new file +51 -0
new file mode 100644
index 0000000..4db426b
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013 MundoReader S.L.
+ * Author: Heiko Stuebner <[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.
+ */
+
+/ {
+	clocks {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		/*
+		 * These are dummy clock, to be used as placeholder when
+		 * a specific clock is not yet implemented. It should be
+		 * dropped when the driver is complete.
+		 */
+		dummy: dummy {
+			compatible = "fixed-clock";
+			clock-frequency = <0>;
+			#clock-cells = <0>;
+		};
+
+		xin24m: xin24m {
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;
+			#clock-cells = <0>;
+		};
+
+		dummy48m: dummy48m {
+			compatible = "fixed-clock";
+			clock-frequency = <48000000>;
+			#clock-cells = <0>;
+		};
+
+		dummy150m: dummy150m {
+			compatible = "fixed-clock";
+			clock-frequency = <150000000>;
+			#clock-cells = <0>;
+		};
+	};
+};
Signature · 1 line
1.7.10.4
author maintainer
#2 lore raw

PATCH v5 2/3 arm: add debug uarts for rockchip rk29xx and rk3xxx series

In reply to Heiko Stübner

Uarts on all recent Rockchip SoCs are Synopsis DesignWare 8250 types. Only their addresses vary very much.

This patch adds the necessary definitions to use any of the uart ports for early debug purposes.

---
 arch/arm/Kconfig.debug            |   34 ++++++++++++++++++++++++++++++
 arch/arm/include/debug/rockchip.S |   42 +++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+)
 create mode 100644 arch/arm/include/debug/rockchip.S
arch/arm/Kconfig.debug +34 -0
index 003f371..0e88bc8 100644
@@ -399,6 +399,13 @@ choice
 		  their output to the standard serial port on the RealView
 		  PB1176 platform.
 
+	config DEBUG_ROCKCHIP_UART
+		bool "Kernel low-level debugging messages via Rockchip UART"
+		depends on ARCH_ROCKCHIP
+		help
+		  Say Y here if you want kernel low-level debugging support
+		  on Rockchip based platforms.
+
 	config DEBUG_S3C_UART0
 		depends on PLAT_SAMSUNG
 		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
@@ -643,6 +650,32 @@ endchoice
 
 choice
 	prompt "Low-level debug console UART"
+	depends on DEBUG_ROCKCHIP_UART
+
+	config DEBUG_RK29_UART0
+		bool "RK29 UART0"
+
+	config DEBUG_RK29_UART1
+		bool "RK29 UART1"
+
+	config DEBUG_RK29_UART2
+		bool "RK29 UART2"
+
+	config DEBUG_RK3X_UART0
+		bool "RK3X UART0"
+
+	config DEBUG_RK3X_UART1
+		bool "RK3X UART1"
+
+	config DEBUG_RK3X_UART2
+		bool "RK3X UART2"
+
+	config DEBUG_RK3X_UART3
+		bool "RK3X UART3"
+endchoice
+
+choice
+	prompt "Low-level debug console UART"
 	depends on DEBUG_LL && DEBUG_TEGRA_UART
 
 	config TEGRA_DEBUG_UART_AUTO_ODMDATA
@@ -697,6 +730,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
 	default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
 				 DEBUG_MMP_UART3
+	default "debug/rockchip.S" if DEBUG_ROCKCHIP_UART
 	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
arch/arm/include/debug/rockchip.S new file +42 -0

42 lines not on this page · raw message

Signature · 1 line
1.7.10.4
author maintainer
#3 lore raw

PATCH v5 3/3 arm: add basic support for Rockchip RK3066a boards

In reply to Heiko Stübner

This adds a generic devicetree board file and a dtsi for boards based on the RK3066a SoCs from Rockchip.

Apart from the generic parts (gic, clocks, pinctrl) the only components currently supported are the timers, uarts and mmc ports (all DesignWare- based).

---
 arch/arm/Kconfig                  |    2 +
 arch/arm/Makefile                 |    1 +
 arch/arm/boot/dts/rk3066a.dtsi    |  390 +++++++++++++++++++++++++++++++++++++
 arch/arm/mach-rockchip/Kconfig    |   16 ++
 arch/arm/mach-rockchip/Makefile   |    1 +
 arch/arm/mach-rockchip/rockchip.c |   52 +++++
 6 files changed, 462 insertions(+)
 create mode 100644 arch/arm/boot/dts/rk3066a.dtsi
 create mode 100644 arch/arm/mach-rockchip/Kconfig
 create mode 100644 arch/arm/mach-rockchip/Makefile
 create mode 100644 arch/arm/mach-rockchip/rockchip.c
arch/arm/Kconfig +2 -0
index ca30d75..6c696f5 100644
@@ -1006,6 +1006,8 @@ source "arch/arm/mach-mmp/Kconfig"
 
 source "arch/arm/mach-realview/Kconfig"
 
+source "arch/arm/mach-rockchip/Kconfig"
+
 source "arch/arm/mach-sa1100/Kconfig"
 
 source "arch/arm/plat-samsung/Kconfig"
arch/arm/Makefile +1 -0
index d7e5e8c..c01e4a7 100644
@@ -172,6 +172,7 @@ machine-$(CONFIG_ARCH_PICOXCELL)	+= picoxcell
 machine-$(CONFIG_ARCH_SIRF)		+= prima2
 machine-$(CONFIG_ARCH_PXA)		+= pxa
 machine-$(CONFIG_ARCH_REALVIEW)		+= realview
+machine-$(CONFIG_ARCH_ROCKCHIP)		+= rockchip
 machine-$(CONFIG_ARCH_RPC)		+= rpc
 machine-$(CONFIG_ARCH_S3C24XX)		+= s3c24xx
 machine-$(CONFIG_ARCH_S3C64XX)		+= s3c64xx
arch/arm/boot/dts/rk3066a.dtsi new file +390 -0

390 lines not on this page · raw message

arch/arm/mach-rockchip/Kconfig new file +16 -0
new file mode 100644
index 0000000..25ee12b
@@ -0,0 +1,16 @@
+config ARCH_ROCKCHIP
+	bool "Rockchip RK2928 and RK3xxx SOCs" if ARCH_MULTI_V7
+	select PINCTRL
+	select PINCTRL_ROCKCHIP
+	select ARCH_REQUIRE_GPIOLIB
+	select ARM_GIC
+	select CACHE_L2X0
+	select HAVE_ARM_TWD if LOCAL_TIMERS
+	select HAVE_SMP
+	select LOCAL_TIMERS if SMP
+	select COMMON_CLK
+	select GENERIC_CLOCKEVENTS
+	select DW_APB_TIMER_OF
+	help
+	  Support for Rockchip's Cortex-A9 Single-to-Quad-Core-SoCs
+	  containing the RK2928, RK30xx and RK31xx series.
arch/arm/mach-rockchip/Makefile new file +1 -0
new file mode 100644
index 0000000..1547d4f
@@ -0,0 +1 @@
+obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip.o
arch/arm/mach-rockchip/rockchip.c new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
1.7.10.4