diff options
Diffstat (limited to 'board/sunxi')
-rw-r--r-- | board/sunxi/Kconfig | 187 | ||||
-rw-r--r-- | board/sunxi/MAINTAINERS | 18 | ||||
-rw-r--r-- | board/sunxi/Makefile | 42 | ||||
-rw-r--r-- | board/sunxi/ahci.c | 1 | ||||
-rw-r--r-- | board/sunxi/board.c | 38 | ||||
-rw-r--r-- | board/sunxi/dram_a20_olinuxino_l2.c | 31 |
6 files changed, 277 insertions, 40 deletions
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig index bcd0a55a1e..5b2d091122 100644 --- a/board/sunxi/Kconfig +++ b/board/sunxi/Kconfig @@ -1,28 +1,141 @@ -if TARGET_SUN4I +if ARCH_SUNXI -config SYS_CONFIG_NAME - default "sun4i" +choice + prompt "Sunxi SoC Variant" -endif +config MACH_SUN4I + bool "sun4i (Allwinner A10)" + select CPU_V7 + select SUPPORT_SPL -if TARGET_SUN5I +config MACH_SUN5I + bool "sun5i (Allwinner A13)" + select CPU_V7 + select SUPPORT_SPL -config SYS_CONFIG_NAME - default "sun5i" +config MACH_SUN6I + bool "sun6i (Allwinner A31)" + select CPU_V7 -endif +config MACH_SUN7I + bool "sun7i (Allwinner A20)" + select CPU_V7 + select SUPPORT_SPL + +config MACH_SUN8I + bool "sun8i (Allwinner A23)" + select CPU_V7 -if TARGET_SUN7I +endchoice config SYS_CONFIG_NAME - default "sun7i" + string + default "sun4i" if MACH_SUN4I + default "sun5i" if MACH_SUN5I + default "sun6i" if MACH_SUN6I + default "sun7i" if MACH_SUN7I + default "sun8i" if MACH_SUN8I -endif +choice + prompt "Board" + +config TARGET_A10_OLINUXINO_L + bool "A10_OLINUXINO_L" + depends on MACH_SUN4I + +config TARGET_A10S_OLINUXINO_M + bool "A10S_OLINUXINO_M" + depends on MACH_SUN5I + +config TARGET_A13_OLINUXINOM + bool "A13_OLINUXINOM" + depends on MACH_SUN5I + +config TARGET_A13_OLINUXINO + bool "A13_OLINUXINO" + depends on MACH_SUN5I + +config TARGET_A20_OLINUXINO_L2 + bool "A20_OLINUXINO_L2" + depends on MACH_SUN7I + +config TARGET_A20_OLINUXINO_L + bool "A20_OLINUXINO_L" + depends on MACH_SUN7I + +config TARGET_A20_OLINUXINO_M + bool "A20_OLINUXINO_M" + depends on MACH_SUN7I + +config TARGET_AUXTEK_T004 + bool "AUXTEK_T004" + depends on MACH_SUN5I + +config TARGET_BANANAPI + bool "BANANAPI" + depends on MACH_SUN7I + +config TARGET_COLOMBUS + bool "COLOMBUS" + depends on MACH_SUN6I + +config TARGET_CUBIEBOARD2 + bool "CUBIEBOARD2" + depends on MACH_SUN7I + +config TARGET_CUBIEBOARD + bool "CUBIEBOARD" + depends on MACH_SUN4I -if TARGET_SUN4I || TARGET_SUN5I || TARGET_SUN7I +config TARGET_CUBIETRUCK + bool "CUBIETRUCK" + depends on MACH_SUN7I -config SYS_CPU - default "armv7" +config TARGET_IPPO_Q8H_V5 + bool "IPPO_Q8H_V5" + depends on MACH_SUN8I + +config TARGET_PCDUINO3 + bool "PCDUINO3" + depends on MACH_SUN7I + +config TARGET_MELE_A1000G + bool "MELE_A1000G" + depends on MACH_SUN4I + +config TARGET_MELE_A1000 + bool "MELE_A1000" + depends on MACH_SUN4I + +config TARGET_MELE_M3 + bool "MELE_M3" + depends on MACH_SUN7I + +config TARGET_MINI_X_1GB + bool "MINI_X_1GB" + depends on MACH_SUN4I + +config TARGET_MINI_X + bool "MINI_X" + depends on MACH_SUN4I + +config TARGET_BA10_TV_BOX + bool "BA10_TV_BOX" + depends on MACH_SUN4I + +config TARGET_I12_TVBOX + bool "I12_TVBOX" + depends on MACH_SUN7I + +config TARGET_QT840A + bool "QT840A" + depends on MACH_SUN7I + +config TARGET_R7DONGLE + bool "R7DONGLE" + depends on MACH_SUN5I + +endchoice config SYS_BOARD default "sunxi" @@ -30,7 +143,53 @@ config SYS_BOARD config SYS_SOC default "sunxi" +config SPL_FEL + bool "SPL/FEL mode support" + depends on SPL + default n + 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 "" + ---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. + +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/MAINTAINERS b/board/sunxi/MAINTAINERS index 4f32195dcd..b3c77a83cb 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 @@ -21,6 +22,7 @@ F: configs/A20-OLinuXino_MICRO_defconfig F: configs/Bananapi_defconfig F: configs/i12-tvbox_defconfig F: configs/Linksprite_pcDuino3_defconfig +F: configs/Linksprite_pcDuino3_fdt_defconfig F: configs/qt840a_defconfig CUBIEBOARD2 BOARD @@ -38,3 +40,19 @@ M: FUKAUMI Naoki <naobsd@gmail.com> S: Maintained F: board/sunxi/dram_a20_olinuxino_l.c F: configs/A20-OLinuXino-Lime_defconfig + +A20-OLINUXINO-LIME2 BOARD +M: Iain Paton <ipaton0@gmail.com> +S: Maintained +F: board/sunxi/dram_a20_olinuxino_l2.c +F: configs/A20-OLinuXino-Lime2_defconfig + +COLOMBUS BOARD +M: Maxime Ripard <maxime.ripard@free-electrons.com> +S: Maintained +F: configs/Colombus_defconfig + +IPPO-Q8H-V5 BOARD +M: Chen-Yu Tsai <wens@csie.org> +S: Maintained +F: configs/Ippo_q8h_v5_defconfig diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index 56073a024d..b84ff9b8ef 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -11,24 +11,26 @@ obj-y += board.o obj-$(CONFIG_SUNXI_GMAC) += gmac.o obj-$(CONFIG_SUNXI_AHCI) += ahci.o -obj-$(CONFIG_A10_OLINUXINO_L) += dram_a10_olinuxino_l.o -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_M) += dram_sun7i_384_1024_iow16.o +obj-$(CONFIG_TARGET_A10_OLINUXINO_L) += dram_a10_olinuxino_l.o +obj-$(CONFIG_TARGET_A10S_OLINUXINO_M) += dram_a10s_olinuxino_m.o +obj-$(CONFIG_TARGET_A13_OLINUXINO) += dram_a13_olinuxino.o +obj-$(CONFIG_TARGET_A13_OLINUXINOM) += dram_a13_oli_micro.o +obj-$(CONFIG_TARGET_A20_OLINUXINO_L) += dram_a20_olinuxino_l.o +obj-$(CONFIG_TARGET_A20_OLINUXINO_L2) += dram_a20_olinuxino_l2.o +obj-$(CONFIG_TARGET_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 -obj-$(CONFIG_BA10_TV_BOX) += dram_sun4i_384_1024_iow8.o -obj-$(CONFIG_BANANAPI) += dram_bananapi.o -obj-$(CONFIG_CUBIEBOARD) += dram_cubieboard.o -obj-$(CONFIG_CUBIEBOARD2) += dram_cubieboard2.o -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_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 -obj-$(CONFIG_QT840A) += dram_sun7i_384_512_busw16_iow16.o -obj-$(CONFIG_R7DONGLE) += dram_r7dongle.o +obj-$(CONFIG_TARGET_AUXTEK_T004) += dram_a10s_olinuxino_m.o +obj-$(CONFIG_TARGET_BA10_TV_BOX) += dram_sun4i_384_1024_iow8.o +obj-$(CONFIG_TARGET_BANANAPI) += dram_bananapi.o +obj-$(CONFIG_TARGET_CUBIEBOARD) += dram_cubieboard.o +obj-$(CONFIG_TARGET_CUBIEBOARD2) += dram_cubieboard2.o +obj-$(CONFIG_TARGET_CUBIETRUCK) += dram_cubietruck.o +obj-$(CONFIG_TARGET_I12_TVBOX) += dram_sun7i_384_1024_iow16.o +obj-$(CONFIG_TARGET_MELE_A1000) += dram_sun4i_360_512.o +obj-$(CONFIG_TARGET_MELE_A1000G) += dram_sun4i_360_1024_iow8.o +obj-$(CONFIG_TARGET_MELE_M3) += dram_sun7i_384_1024_iow16.o +obj-$(CONFIG_TARGET_MINI_X) += dram_sun4i_360_512.o +obj-$(CONFIG_TARGET_MINI_X_1GB) += dram_sun4i_360_1024_iow16.o +obj-$(CONFIG_TARGET_PCDUINO3) += dram_linksprite_pcduino3.o +obj-$(CONFIG_TARGET_QT840A) += dram_sun7i_384_512_busw16_iow16.o +obj-$(CONFIG_TARGET_R7DONGLE) += dram_r7dongle.o diff --git a/board/sunxi/ahci.c b/board/sunxi/ahci.c index 0c262eabb7..5e123285b0 100644 --- a/board/sunxi/ahci.c +++ b/board/sunxi/ahci.c @@ -74,6 +74,7 @@ void scsi_init(void) { printf("SUNXI SCSI INIT\n"); #ifdef CONFIG_SATAPWR + gpio_request(CONFIG_SATAPWR, "satapwr"); gpio_direction_output(CONFIG_SATAPWR, 1); #endif diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 2179e234e2..03890c8c9c 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -12,6 +12,7 @@ */ #include <common.h> +#include <mmc.h> #ifdef CONFIG_AXP152_POWER #include <axp152.h> #endif @@ -70,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); } @@ -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); -#if !defined (CONFIG_SPL_BUILD) && defined (CONFIG_MMC_SUNXI_SLOT_EXTRA) + 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; 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 <common.h> +#include <asm/arch/dram.h> + +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); +} |