summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2015-07-25 09:04:18 -0400
committerTom Rini <trini@konsulko.com>2015-07-25 09:04:18 -0400
commit26473945ad6667183296e7edee2a65edf31bb6f7 (patch)
treeceb27f9307dbc86e20a5a9eb392c786e2fee5025 /board
parent6f4e050639241218987541f4729172e4e0e2ff31 (diff)
parent7f7409ba6ab937b73f16bac8d83e215db86ace3d (diff)
downloadtalos-obmc-uboot-26473945ad6667183296e7edee2a65edf31bb6f7.tar.gz
talos-obmc-uboot-26473945ad6667183296e7edee2a65edf31bb6f7.zip
Merge branch 'master' of http://git.denx.de/u-boot-sunxi
Diffstat (limited to 'board')
-rw-r--r--board/sunxi/Kconfig7
-rw-r--r--board/sunxi/board.c50
2 files changed, 19 insertions, 38 deletions
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 2a1cd3cf3b..441c880813 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -294,6 +294,13 @@ config USB0_VBUS_DET
Set the Vbus detect pin for usb0 (otg). This takes a string in the
format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+config USB0_ID_DET
+ string "ID detect pin for usb0 (otg)"
+ default ""
+ ---help---
+ Set the ID detect pin for usb0 (otg). This takes a string in the
+ format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H.
+
config USB1_VBUS_PIN
string "Vbus enable pin for usb1 (ehci0)"
default "PH6" if MACH_SUN4I || MACH_SUN7I
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index ed60e74808..afed6a31ca 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -31,7 +31,6 @@
#include <asm/arch/usb_phy.h>
#include <asm/gpio.h>
#include <asm/io.h>
-#include <linux/usb/musb.h>
#include <net.h>
#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
@@ -294,21 +293,19 @@ int board_mmc_init(bd_t *bis)
return -1;
#endif
-#if CONFIG_MMC_SUNXI_SLOT == 0 && CONFIG_MMC_SUNXI_SLOT_EXTRA == 2
+#if !defined(CONFIG_SPL_BUILD) && 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.
+ * On systems with an emmc (mmc2), figure out if we are booting from
+ * the emmc and if we are make it "mmc dev 0" so that boot.scr, etc.
+ * are searched there first. Note we only do this for u-boot proper,
+ * not for the SPL, see spl_boot_device().
*/
- 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;
+ if (!sunxi_mmc_has_egon_boot_signature(mmc0) &&
+ sunxi_mmc_has_egon_boot_signature(mmc1)) {
+ /* Booting from emmc / mmc2, swap */
+ mmc0->block_dev.dev = 1;
+ mmc1->block_dev.dev = 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;
@@ -451,28 +448,6 @@ void sunxi_board_init(void)
}
#endif
-#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
-extern const struct musb_platform_ops sunxi_musb_ops;
-
-static struct musb_hdrc_config musb_config = {
- .multipoint = 1,
- .dyn_fifo = 1,
- .num_eps = 6,
- .ram_bits = 11,
-};
-
-static struct musb_hdrc_platform_data musb_plat = {
-#if defined(CONFIG_MUSB_HOST)
- .mode = MUSB_HOST,
-#else
- .mode = MUSB_PERIPHERAL,
-#endif
- .config = &musb_config,
- .power = 250,
- .platform_ops = &sunxi_musb_ops,
-};
-#endif
-
#ifdef CONFIG_USB_GADGET
int g_dnl_board_usb_cable_connected(void)
{
@@ -535,9 +510,8 @@ int misc_init_r(void)
if (ret)
return ret;
#endif
-#if defined(CONFIG_MUSB_HOST) || defined(CONFIG_MUSB_GADGET)
- musb_register(&musb_plat, NULL, (void *)SUNXI_USB0_BASE);
-#endif
+ sunxi_musb_board_init();
+
return 0;
}
#endif
OpenPOWER on IntegriCloud