summaryrefslogtreecommitdiff
path: root/board/samsung/odroid/odroid.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-03-14 11:37:11 -0400
committerTom Rini <trini@konsulko.com>2019-03-14 11:37:11 -0400
commit9659eb46af6249b6e4b3712e60a1eb2e87fc48a1 (patch)
tree2d7e7149804ddbf6d0bc5e6cb3dd20706be45809 /board/samsung/odroid/odroid.c
parent7f295ffed6f3c62bf15a48bb12b5757f4716f789 (diff)
parent1411298cbca83a8527d2c1b5c4d299871fc34cf1 (diff)
Merge branch 'master' of git://git.denx.de/u-boot-samsung
Diffstat (limited to 'board/samsung/odroid/odroid.c')
-rw-r--r--board/samsung/odroid/odroid.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index 552333fe86..3e594fd850 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -54,6 +54,14 @@ void set_board_type(void)
gd->board_type = ODROID_TYPE_U3;
}
+void set_board_revision(void)
+{
+ /*
+ * Revision already set by set_board_type() because it can be
+ * executed early.
+ */
+}
+
const char *get_board_type(void)
{
const char *board_type[] = {"u3", "x2"};
@@ -462,18 +470,33 @@ struct dwc2_plat_otg_data s5pc210_otg_data = {
#if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB)
+static void set_usb3503_ref_clk(void)
+{
+#ifdef CONFIG_BOARD_TYPES
+ /*
+ * gpx3-0 chooses primary (low) or secondary (high) reference clock
+ * frequencies table. The choice of clock is done through hard-wired
+ * REF_SEL pins.
+ * The Odroid Us have reference clock at 24 MHz (00 entry from secondary
+ * table) and Odroid Xs have it at 26 MHz (01 entry from primary table).
+ */
+ if (gd->board_type == ODROID_TYPE_U3)
+ gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
+ else
+ gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+#else
+ /* Choose Odroid Xs frequency without board types */
+ gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+#endif /* CONFIG_BOARD_TYPES */
+}
+
int board_usb_init(int index, enum usb_init_type init)
{
#ifdef CONFIG_CMD_USB
struct udevice *dev;
int ret;
- /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/
- /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */
- if (gd->board_type == ODROID_TYPE_U3)
- gpio_direction_output(EXYNOS4X12_GPIO_X30, 0);
- else
- gpio_direction_output(EXYNOS4X12_GPIO_X30, 1);
+ set_usb3503_ref_clk();
/* Disconnect, Reset, Connect */
gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);