From d71910fc509933fab881f85ae244ea95525a41d6 Mon Sep 17 00:00:00 2001 From: Iain Paton Date: Sun, 28 Sep 2014 14:18:42 +0100 Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2 This adds support for the Olimex A20-OLinuXino-Lime2 https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXIno-LIME2 Differences to previous Lime boards are 1GB RAM and gigabit ethernet Signed-off-by: Iain Paton Signed-off-by: Hans de Goede --- board/sunxi/MAINTAINERS | 6 ++++++ board/sunxi/Makefile | 1 + board/sunxi/dram_a20_olinuxino_l2.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 board/sunxi/dram_a20_olinuxino_l2.c (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 4f32195dcd..4ed82cf6e3 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -38,3 +38,9 @@ M: FUKAUMI Naoki S: Maintained F: board/sunxi/dram_a20_olinuxino_l.c F: configs/A20-OLinuXino-Lime_defconfig + +A20-OLINUXINO-LIME2 BOARD +M: Iain Paton +S: Maintained +F: board/sunxi/dram_a20_olinuxino_l2.c +F: configs/A20-OLinuXino-Lime2_defconfig diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index 56073a024d..d63a6d2c79 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_A10S_OLINUXINO_M) += dram_a10s_olinuxino_m.o obj-$(CONFIG_A13_OLINUXINO) += dram_a13_olinuxino.o obj-$(CONFIG_A13_OLINUXINOM) += dram_a13_oli_micro.o obj-$(CONFIG_A20_OLINUXINO_L) += dram_a20_olinuxino_l.o +obj-$(CONFIG_A20_OLINUXINO_L2) += dram_a20_olinuxino_l2.o obj-$(CONFIG_A20_OLINUXINO_M) += dram_sun7i_384_1024_iow16.o # This is not a typo, uses the same mem settings as the a10s-olinuxino-m obj-$(CONFIG_AUXTEK_T004) += dram_a10s_olinuxino_m.o diff --git a/board/sunxi/dram_a20_olinuxino_l2.c b/board/sunxi/dram_a20_olinuxino_l2.c new file mode 100644 index 0000000000..2115d37470 --- /dev/null +++ b/board/sunxi/dram_a20_olinuxino_l2.c @@ -0,0 +1,31 @@ +/* this file is generated, don't edit it yourself */ + +#include +#include + +static struct dram_para dram_para = { + .clock = 480, + .type = 3, + .rank_num = 1, + .density = 4096, + .io_width = 16, + .bus_width = 32, + .cas = 9, + .zq = 0x7f, + .odt_en = 0, + .size = 1024, + .tpr0 = 0x42d899b7, + .tpr1 = 0xa090, + .tpr2 = 0x22a00, + .tpr3 = 0, + .tpr4 = 0, + .tpr5 = 0, + .emr1 = 0x4, + .emr2 = 0x10, + .emr3 = 0, +}; + +unsigned long sunxi_dram_init(void) +{ + return dramc_init(&dram_para); +} -- cgit v1.2.1 From f1fe97527a5301549133a5b0e25ac1fe0243e7a9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 30 Sep 2014 16:12:39 +0200 Subject: sunxi: Add support for the Mele M3 board The Mele M3 is yet another Allwinnner based Android top set box from Mele. It uses a housing similar to the A2000, but without the USM sata storage slot at the top. It features an A20 SoC, 1G RAM, 4G eMMC (unique for Allwinner devices), 100Mbit ethernet, HDMI out, 3 USB A receptacles, VGA, and A/V OUT connections. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/MAINTAINERS | 1 + board/sunxi/Makefile | 1 + 2 files changed, 2 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 4ed82cf6e3..6c4226ed32 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -8,6 +8,7 @@ F: configs/ba10_tv_box_defconfig F: configs/Cubieboard_defconfig F: configs/Mele_A1000_defconfig F: configs/Mele_A1000G_defconfig +F: configs/Mele_M3_defconfig F: configs/Mini-X_defconfig F: configs/Mini-X-1Gb_defconfig F: include/configs/sun5i.h diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index d63a6d2c79..6a2e4c9d5b 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -28,6 +28,7 @@ obj-$(CONFIG_CUBIETRUCK) += dram_cubietruck.o obj-$(CONFIG_I12_TVBOX) += dram_sun7i_384_1024_iow16.o obj-$(CONFIG_MELE_A1000) += dram_sun4i_360_512.o obj-$(CONFIG_MELE_A1000G) += dram_sun4i_360_1024_iow8.o +obj-$(CONFIG_MELE_M3) += dram_sun7i_384_1024_iow16.o obj-$(CONFIG_MINI_X) += dram_sun4i_360_512.o obj-$(CONFIG_MINI_X_1GB) += dram_sun4i_360_1024_iow16.o obj-$(CONFIG_PCDUINO3) += dram_linksprite_pcduino3.o -- cgit v1.2.1 From 8a6564dacb7e24e82077d109d7d5992d2a14dac3 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 3 Oct 2014 20:16:29 +0800 Subject: ARM: sunxi: Add basic A31 support Add a new sun6i machine that supports UART and MMC. Signed-off-by: Maxime Ripard Signed-off-by: Hans de Goede [wens@csie.org: use SPDX labels, adapt to Kconfig system, drop ifdef around mmc and smp code, drop MACH_TYPE] Signed-off-by: Chen-Yu Tsai Acked-by: Ian Campbell --- board/sunxi/Kconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index bcd0a55a1e..05defacfca 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -12,6 +12,14 @@ config SYS_CONFIG_NAME endif +if TARGET_SUN6I + +config SYS_CONFIG_NAME + string + default "sun6i" + +endif + if TARGET_SUN7I config SYS_CONFIG_NAME @@ -19,7 +27,7 @@ config SYS_CONFIG_NAME endif -if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN7I +if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I config SYS_CPU default "armv7" -- cgit v1.2.1 From 7ad3b6aa37ccf3caa5b8d6f7d639f2904009ed1e Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Fri, 3 Oct 2014 20:16:30 +0800 Subject: ARM: sun6i: Add Colombus board defconfig The Colombus board is an A31 evaluation board from WITS Technology. Maxime has kindly agreed to maintain this board. [1] http://lists.denx.de/pipermail/u-boot/2014-September/190043.html Signed-off-by: Chen-Yu Tsai Cc: Maxime Ripard Acked-by: Maxime Ripard Acked-by: Ian Campbell --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 6c4226ed32..7afe45ebee 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -45,3 +45,8 @@ M: Iain Paton S: Maintained F: board/sunxi/dram_a20_olinuxino_l2.c F: configs/A20-OLinuXino-Lime2_defconfig + +COLOMBUS BOARD +M: Maxime Ripard +S: Maintained +F: configs/Colombus_defconfig -- cgit v1.2.1 From cd82113a98e152b34e727718b729d0c5be44da99 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 2 Oct 2014 20:29:26 +0200 Subject: sunxi: Add mmc card-detect functionality Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 05defacfca..63188dd321 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -41,4 +41,30 @@ config SYS_SOC config FDTFILE string "Default fdtfile env setting for this board" +config MMC0_CD_PIN + string "Card detect pin for mmc0" + default "" + ---help--- + Set the card detect pin for mmc0, leave empty to not use cd. This + takes a string in the format understood by sunxi_name_to_gpio, e.g. + PH1 for pin 1 of port H. + +config MMC1_CD_PIN + string "Card detect pin for mmc1" + default "" + ---help--- + See MMC0_CD_PIN help text. + +config MMC2_CD_PIN + string "Card detect pin for mmc2" + default "" + ---help--- + See MMC0_CD_PIN help text. + +config MMC3_CD_PIN + string "Card detect pin for mmc3" + default "" + ---help--- + See MMC0_CD_PIN help text. + endif -- cgit v1.2.1 From 2ccfac01fca3c58ee87db7bbe54c8243e3980d02 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 2 Oct 2014 20:43:50 +0200 Subject: sunxi: Turn MMC_SUNXI_SLOT_EXTRA into a proper Kconfig option Note we also drop the SPL check for initializing the 2nd mmc slot, the SPL check is not necessary with Kconfig, because only options explicitly marked as also being for the SPL get set during SPL builds. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 8 ++++++++ board/sunxi/board.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 63188dd321..552fce8394 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -67,4 +67,12 @@ config MMC3_CD_PIN ---help--- See MMC0_CD_PIN help text. +config MMC_SUNXI_SLOT_EXTRA + int "mmc extra slot number" + default -1 + ---help--- + sunxi builds always enable mmc0, some boards also have a second sdcard + slot or emmc on mmc1 - mmc3. Setting this to 1, 2 or 3 will enable + support for this. + endif diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 2179e234e2..cfe22b6138 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -106,7 +106,7 @@ int board_mmc_init(bd_t *bis) { mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT); sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT); -#if !defined (CONFIG_SPL_BUILD) && defined (CONFIG_MMC_SUNXI_SLOT_EXTRA) +#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1 mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA); sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA); #endif -- cgit v1.2.1 From e79c7c881047ca99191cc79b6d83ec64b898cd9b Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 2 Oct 2014 21:13:54 +0200 Subject: sunxi: When we've both mmc0 and mmc2, detect from which one we're booting sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're booting, and make that one "mmc dev 0" so that a single u-boot binary can be used for both the onboard eMMC and for external sdcards. When we're booting from mmc2, we make it dev 0 because that is where the SPL will load the tertiary payload (the actual u-boot binary in our case) from, see: common/spl/spl_mmc.c, which has dev 0 hardcoded everywhere. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/board.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index cfe22b6138..f310e8dbff 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -12,6 +12,7 @@ */ #include +#include #ifdef CONFIG_AXP152_POWER #include #endif @@ -104,11 +105,36 @@ static void mmc_pinmux_setup(int sdc) int board_mmc_init(bd_t *bis) { + __maybe_unused struct mmc *mmc0, *mmc1; + __maybe_unused char buf[512]; + mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT); - sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT); + mmc0 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT); + if (!mmc0) + return -1; + #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1 mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA); - sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA); + mmc1 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA); + if (!mmc1) + return -1; +#endif + +#if CONFIG_MMC_SUNXI_SLOT == 0 && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2 + /* + * Both mmc0 and mmc2 are bootable, figure out where we're booting + * from. Try mmc0 first, just like the brom does. + */ + if (mmc_getcd(mmc0) && mmc_init(mmc0) == 0 && + mmc0->block_dev.block_read(0, 16, 1, buf) == 1) { + buf[12] = 0; + if (strcmp(&buf[4], "eGON.BT0") == 0) + return 0; + } + + /* no bootable card in mmc0, so we must be booting from mmc2, swap */ + mmc0->block_dev.dev = 1; + mmc1->block_dev.dev = 0; #endif return 0; -- cgit v1.2.1 From bbff84b3b0092d00db1b0b77ef9043b46991d791 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 3 Oct 2014 16:44:57 +0200 Subject: sunxi: Use PG3 - PG8 as io-pins for mmc1 None of the known sunxi devices actually use mmc1 routed through PH, where as some devices do actually use mmc1 routed through PG, so change the routing of mmc1 to PG. If in the future we encounter devices with mmc1 routed through PH, we will need to change things to be a bit more flexible. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/board.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'board') diff --git a/board/sunxi/board.c b/board/sunxi/board.c index f310e8dbff..03890c8c9c 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -71,9 +71,9 @@ static void mmc_pinmux_setup(int sdc) break; case 1: - /* CMD-PH22, CLK-PH23, D0~D3-PH24~27 : 5 */ - for (pin = SUNXI_GPH(22); pin <= SUNXI_GPH(27); pin++) { - sunxi_gpio_set_cfgpin(pin, SUN4I_GPH22_SDC1); + /* CMD-PG3, CLK-PG4, D0~D3-PG5-8 */ + for (pin = SUNXI_GPG(3); pin <= SUNXI_GPG(8); pin++) { + sunxi_gpio_set_cfgpin(pin, SUN5I_GPG3_SDC1); sunxi_gpio_set_pull(pin, SUNXI_GPIO_PULL_UP); sunxi_gpio_set_drv(pin, 2); } -- cgit v1.2.1 From 722e00cef4e497f171dcbc5ef84d81d215670a24 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 13 Aug 2014 14:02:29 +0200 Subject: sunxi: Kconfig: Unify sunxi Kconfig code Unify the sunxi Kconfig code, instead of having separate code blocks for each of sun4i - sun7i. Signed-off-by: Hans de Goede Acked-by: Ian Campbell --- board/sunxi/Kconfig | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 552fce8394..9892a34cfb 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,33 +1,11 @@ -if TARGET_SUN4I - -config SYS_CONFIG_NAME - default "sun4i" - -endif - -if TARGET_SUN5I - -config SYS_CONFIG_NAME - default "sun5i" - -endif - -if TARGET_SUN6I +if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I config SYS_CONFIG_NAME string - default "sun6i" - -endif - -if TARGET_SUN7I - -config SYS_CONFIG_NAME - default "sun7i" - -endif - -if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I + default "sun4i" if TARGET_SUN4I + default "sun5i" if TARGET_SUN5I + default "sun6i" if TARGET_SUN6I + default "sun7i" if TARGET_SUN7I config SYS_CPU default "armv7" -- cgit v1.2.1 From 8ebe4f429266a7cb9011f5b3ab51226297f41210 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Wed, 22 Oct 2014 16:47:44 +0800 Subject: ARM: sunxi: Add basic A23 support The basic blocks of the A23 are similar to the A31 (sun6i). Re-use sun6i code for initial clock, gpio, and uart setup. There is no SPL support for A23, as we do not have any documentation or sample code for DRAM initialization. Signed-off-by: Chen-Yu Tsai Acked-by: Ian Campbell --- board/sunxi/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 9892a34cfb..449c0460f9 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,4 +1,4 @@ -if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I +if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN6I || TARGET_SUN7I || TARGET_SUN8I config SYS_CONFIG_NAME string @@ -6,6 +6,7 @@ config SYS_CONFIG_NAME default "sun5i" if TARGET_SUN5I default "sun6i" if TARGET_SUN6I default "sun7i" if TARGET_SUN7I + default "sun8i" if TARGET_SUN8I config SYS_CPU default "armv7" -- cgit v1.2.1 From 7b48d8c8bc40ba3215a5ceb2731d762d4b143e3b Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Wed, 22 Oct 2014 16:47:48 +0800 Subject: ARM: sunxi: Add Ippo-q8h-v5 A23 tablet board defconfig Ippo q8h is a series of A23 tablet boards. This defconfig is for v5 of these boards, though for u-boot purposes they are mostly the same. See: http://linux-sunxi.org/Ippo_q8h Signed-off-by: Chen-Yu Tsai Acked-by: Ian Campbell --- board/sunxi/MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/sunxi/MAINTAINERS b/board/sunxi/MAINTAINERS index 7afe45ebee..febd126cb8 100644 --- a/board/sunxi/MAINTAINERS +++ b/board/sunxi/MAINTAINERS @@ -50,3 +50,8 @@ COLOMBUS BOARD M: Maxime Ripard S: Maintained F: configs/Colombus_defconfig + +IPPO-Q8H-V5 BOARD +M: CHen-Yu Tsai +S: Maintained +F: configs/Ippo_q8h_v5_defconfig -- cgit v1.2.1 From accc9e446be6c3bd129315a0c5830bddccfa16da Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Wed, 22 Oct 2014 14:56:36 +0200 Subject: sunxi: Add CONFIG_OLD_SUNXI_KERNEL_COMPAT Kconfig option Add a Kconfig option which users can select when they want to boot older kernels, e.g. the linux-sunxi 3.4 kernels. For now this just forces the pll5 "p" value to 1 (divide by 2) as that is what those kernels are hardcoded too, in the future this may enable further workarounds. Signed-off-by: Hans de Goede Reviewed-by: Tom Rini -- Changes in v2: -s/CONFIG_OLD_KERNEL_COMPAT/CONFIG_OLD_SUNXI_KERNEL_COMPAT. -Move the code block setting P(1) for old kernels to where P gets cleared --- board/sunxi/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'board') diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index 449c0460f9..31a15037d0 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -20,6 +20,13 @@ config SYS_SOC config FDTFILE string "Default fdtfile env setting for this board" +config OLD_SUNXI_KERNEL_COMPAT + boolean "Enable workarounds for booting old kernels" + default n + ---help--- + Set this to enable various workarounds for old kernels, this results in + sub-optimal settings for newer kernels, only enable if needed. + config MMC0_CD_PIN string "Card detect pin for mmc0" default "" -- cgit v1.2.1