Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/omap Support extclk. This value get from prop-...
details: https://anonhg.NetBSD.org/src/rev/20e4f690adc1
branches: trunk
changeset: 348113:20e4f690adc1
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Tue Oct 04 15:59:36 2016 +0000
description:
Support extclk. This value get from prop-dictionary "port?-extclk".
diffstat:
sys/arch/arm/omap/omap3_ehci.c | 56 ++++++++++++++++++++++++++++++++++-------
1 files changed, 46 insertions(+), 10 deletions(-)
diffs (103 lines):
diff -r cb6f4222216c -r 20e4f690adc1 sys/arch/arm/omap/omap3_ehci.c
--- a/sys/arch/arm/omap/omap3_ehci.c Tue Oct 04 15:54:09 2016 +0000
+++ b/sys/arch/arm/omap/omap3_ehci.c Tue Oct 04 15:59:36 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $ */
/*-
* Copyright (c) 2010-2012 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $");
#include "locators.h"
@@ -196,6 +196,7 @@
enum omap3_ehci_port_mode mode;
int gpio;
bool value;
+ bool extclk;
} sc_portconfig[3];
struct {
uint16_t m, n, m2;
@@ -405,15 +406,24 @@
sc->sc_portconfig[0].mode = omap3_ehci_get_port_mode(prop, "port0-mode");
sc->sc_portconfig[0].gpio = omap3_ehci_get_port_gpio(prop, "port0-gpio");
prop_dictionary_get_bool(prop, "port0-gpioval", &sc->sc_portconfig[0].value);
+#if defined(OMAP4) || defined(OMAP5)
+ prop_dictionary_get_bool(prop, "port0-extclk", &sc->sc_portconfig[0].extclk);
+#endif
if (sc->sc_nports > 1) {
sc->sc_portconfig[1].mode = omap3_ehci_get_port_mode(prop, "port1-mode");
sc->sc_portconfig[1].gpio = omap3_ehci_get_port_gpio(prop, "port1-gpio");
prop_dictionary_get_bool(prop, "port1-gpioval", &sc->sc_portconfig[1].value);
+#if defined(OMAP4) || defined(OMAP5)
+ prop_dictionary_get_bool(prop, "port1-extclk", &sc->sc_portconfig[1].extclk);
+#endif
}
if (sc->sc_nports > 2) {
sc->sc_portconfig[2].mode = omap3_ehci_get_port_mode(prop, "port2-mode");
sc->sc_portconfig[2].gpio = omap3_ehci_get_port_gpio(prop, "port2-gpio");
prop_dictionary_get_bool(prop, "port2-gpioval", &sc->sc_portconfig[2].value);
+#if defined(OMAP4) || defined(OMAP5)
+ prop_dictionary_get_bool(prop, "port2-extclk", &sc->sc_portconfig[2].extclk);
+#endif
}
#ifdef OMAP_3XXX
@@ -670,17 +680,43 @@
KASSERT(err == 0);
val = bus_space_read_4(iot, ioh, OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL);
- val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P3_CLK
- | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P2_CLK
- | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P3_CLK
- | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P2_CLK
- | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P3_CLK
- | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P2_CLK;
+ if (sc->sc_portconfig[0].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+ if (sc->sc_portconfig[0].extclk)
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_CLKSEL_UTMI_P1;
+ else
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P1_CLK;
+ if (sc->sc_portconfig[0].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P1_CLK
+ | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P1_CLK;
+ }
+ if (sc->sc_nports > 1
+ && sc->sc_portconfig[1].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+ if (sc->sc_portconfig[1].extclk)
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_CLKSEL_UTMI_P2;
+ else
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P2_CLK;
+ if (sc->sc_portconfig[1].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P2_CLK
+ | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P2_CLK;
+ }
+ if (sc->sc_nports > 2
+ && sc->sc_portconfig[2].mode != OMAP3_EHCI_PORT_MODE_NONE) {
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_UTMI_P3_CLK;
+ if (sc->sc_portconfig[2].mode == OMAP3_EHCI_PORT_MODE_HSIC)
+ val |= OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC60M_P3_CLK
+ | OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL_OPTFCLKEN_HSIC480M_P3_CLK;
+ }
bus_space_write_4(iot, ioh, OMAP4_CM_L3INIT_USB_HOST_HS_CLKCTRL, val);
val = bus_space_read_4(iot, ioh, OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL);
- val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH2_CLK
- | OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH1_CLK;
+ if (sc->sc_portconfig[0].mode != OMAP3_EHCI_PORT_MODE_NONE)
+ val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH0_CLK;
+ if (sc->sc_nports > 1
+ && sc->sc_portconfig[1].mode != OMAP3_EHCI_PORT_MODE_NONE)
+ val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH1_CLK;
+ if (sc->sc_nports > 2
+ && sc->sc_portconfig[2].mode != OMAP3_EHCI_PORT_MODE_NONE)
+ val |= OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL_USB_CH2_CLK;
bus_space_write_4(iot, ioh, OMAP4_CM_L3INIT_USB_TLL_HS_CLKCTRL, val);
bus_space_unmap(iot, ioh, 0x100);
Home |
Main Index |
Thread Index |
Old Index