From 297bb9e0fc7049c7771feed5e11cf6db89b19f27 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Fri, 28 Oct 2016 18:21:28 +0800 Subject: sunxi: DRAM initialisation for sun9i This adds DRAM initialisation code for sun9i, which calculates the appropriate timings based on timing information for the supplied DDR3 bin and the clock speeds used. With this DRAM setup, we have verified DDR3 clocks of up to 792MHz (i.e. DDR3-1600) on the A80-Q7 using a dual-channel configuration. [wens@csie.org: Moved dram_sun9i.c to arch/arm/mach-sunxi/; style cleanup] Signed-off-by: Chen-Yu Tsai [hdegoede@redhat.com: Drop some huge non-documenting #if 0 ... #endif blocks] [hdegoede@redhat.com: Fix checkpatch warnings] Signed-off-by: Hans de Goede --- board/sunxi/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index c0ffeb3..a126c3e 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -141,11 +141,13 @@ config DRAM_TYPE config DRAM_CLK int "sunxi dram clock speed" + default 792 if MACH_SUN9I default 312 if MACH_SUN6I || MACH_SUN8I default 360 if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I ---help--- - Set the dram clock speed, valid range 240 - 480, must be a multiple - of 24. + Set the dram clock speed, valid range 240 - 480 (prior to sun9i), + must be a multiple of 24. For the sun9i (A80), the tested values + (for DDR3-1600) are 312 to 792. if MACH_SUN5I || MACH_SUN7I config DRAM_MBUS_CLK -- cgit v1.1 From a98c296a0ed7a77a86c86fc1b7d6d75681a76523 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Fri, 28 Oct 2016 18:21:32 +0800 Subject: sunxi: enable SPL for sun9i Now that DRAM initialization and clock setup is supported, we can enable SPL for the A80. [wens@csie.org: Added commit message] Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index a126c3e..ee6ae37 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -119,6 +119,7 @@ config MACH_SUN9I bool "sun9i (Allwinner A80)" select CPU_V7 select SUNXI_GEN_SUN6I + select SUPPORT_SPL config MACH_SUN50I bool "sun50i (Allwinner A64)" -- cgit v1.1 From 3ebb4567d688369ec95c407aae4fa88071188079 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Fri, 28 Oct 2016 18:21:33 +0800 Subject: sunxi: add MMC pinmux setup for SDC2 on sun9i The A80 can support 8-bit eMMC with reset on the PC pingroups. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/board.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 6281c9d..5365638 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -307,6 +307,13 @@ static void mmc_pinmux_setup(int sdc) sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); sunxi_gpio_set_drv(pin, 2); } +#elif defined(CONFIG_MACH_SUN9I) + /* SDC2: PC6-PC16 */ + for (pin = SUNXI_GPC(6); pin <= SUNXI_GPC(16); pin++) { + sunxi_gpio_set_cfgpin(pin, SUNXI_GPC_SDC2); + sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); + sunxi_gpio_set_drv(pin, 2); + } #endif break; -- cgit v1.1 From c53344ad9cbf09e9444eb416041f9fb5f373aa9b Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 28 Oct 2016 18:21:34 +0800 Subject: sunxi: Set default CPU clock rate to 1008 MHz for sun9i (A80) In Allwinner's SDK the A80 is clocked to 1008 MHz by default. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index ee6ae37..5cca1ea 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -255,7 +255,7 @@ endif config SYS_CLK_FREQ default 816000000 if MACH_SUN50I default 912000000 if MACH_SUN7I - default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I + default 1008000000 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I || MACH_SUN9I config SYS_CONFIG_NAME default "sun4i" if MACH_SUN4I -- cgit v1.1 From 58b628ed873b3dfcb715f8e73bba5abf7eb84523 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 28 Oct 2016 18:21:36 +0800 Subject: sunxi: Add default zq value for sun9i (A80) Both the A80 Optimus board and the Cubieboard 4 use a zq value of 4145117, or 0x3f3fdd. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 5cca1ea..e1d4ab1 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -163,6 +163,7 @@ config DRAM_ZQ int "sunxi dram zq value" default 123 if MACH_SUN4I || MACH_SUN5I || MACH_SUN6I || MACH_SUN8I default 127 if MACH_SUN7I + default 4145117 if MACH_SUN9I ---help--- Set the dram zq value. -- cgit v1.1 From 3e057e48b5046a2a3478fdc697bbe959b51bc156 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 28 Oct 2016 18:21:37 +0800 Subject: sunxi: Enable SPL support for A80 Optimus board The A80 Optimus Board was launched with the Allwinner A80 SoC. It was jointly developed by Allwinner and Merrii. This board has a UART port, a JTAG connector, 2 USB host ports, a USB 3.0 OTG connector, an HDMI output, a micro SD slot, 16G eMMC flash, 2G DRAM, a camera sensor interface, a WiFi/BT combo chip, a headphone jack, IR receiver, and additional GPIO headers. Signed-off-by: Chen-Yu Tsai [hdegoede@redhat.com: update existing Merrii_A80_Optimus_defconfig instead of adding a new defconfig] Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index f7129b7..88abf2d 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -94,6 +94,11 @@ M: Stefan Mavrodiev S: Maintained F: configs/A33-OLinuXino_defconfig +A80 OPTIMUS BOARD +M: Chen-Yu Tsai +S: Maintained +F: configs/Merrii_A80_Optimus_defconfig + AINOL AW1 BOARD M: Paul Kocialkowski S: Maintained -- cgit v1.1 From fda9d5d327302e2e5a45ade25e88edc0002336ec Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 28 Oct 2016 18:21:38 +0800 Subject: sunxi: Add support for Cubieboard4 The Cubieboard4 is an A80 SoC based development board from Cubietech. This board has a UART port, 4 USB host ports, a USB 3.0 OTG connector, HDMI and VGA outputs, a micro SD slot, 8G eMMC flash, 2G DRAM, a WiFi/BT combo chip, headphone and microphone jacks, IR receiver, and GPIO headers. Signed-off-by: Chen-Yu Tsai Acked-by: Hans de Goede Signed-off-by: Hans de Goede --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 88abf2d..d7dc55b 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -122,6 +122,11 @@ F: include/configs/sun7i.h F: configs/Cubieboard2_defconfig F: configs/Cubietruck_defconfig +CUBIEBOARD4 BOARD +M: Chen-Yu Tsai +S: Maintained +F: configs/Cubieboard4_defconfig + CUBIETRUCK-PLUS BOARD M: Chen-Yu Tsai S: Maintained -- cgit v1.1