Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/samsung Remove the exyo_usb_locinfo structure a...
details: https://anonhg.NetBSD.org/src/rev/a8d7f92e2d93
branches: trunk
changeset: 329833:a8d7f92e2d93
user: reinoud <reinoud%NetBSD.org@localhost>
date: Wed Jun 11 14:54:32 2014 +0000
description:
Remove the exyo_usb_locinfo structure as exyousb becomes usb2 only
diffstat:
sys/arch/arm/samsung/exynos4_loc.c | 23 +------------
sys/arch/arm/samsung/exynos5_loc.c | 20 -----------
sys/arch/arm/samsung/exynos_usb.c | 68 ++++++++++++++++++-------------------
sys/arch/arm/samsung/exynos_var.h | 22 +-----------
4 files changed, 35 insertions(+), 98 deletions(-)
diffs (276 lines):
diff -r 90bf8c55bc35 -r a8d7f92e2d93 sys/arch/arm/samsung/exynos4_loc.c
--- a/sys/arch/arm/samsung/exynos4_loc.c Wed Jun 11 14:51:49 2014 +0000
+++ b/sys/arch/arm/samsung/exynos4_loc.c Wed Jun 11 14:54:32 2014 +0000
@@ -272,7 +272,7 @@
{ "sscom", OFFANDSIZE(,UART1), 1, IRQ_UART1, 0 },
{ "sscom", OFFANDSIZE(,UART2), 2, IRQ_UART2, 0 },
{ "sscom", OFFANDSIZE(,UART3), 3, IRQ_UART3, 0 },
- { "exyousb", 0, 0, NOPORT, NOINTR, 0}, /* uses usb locators */
+ { "exyousb", OFFANDSIZE(,USB2HOST), NOPORT, IRQ_UHOST, 0 },
};
const struct exyo_locinfo exynos4_locinfo = {
@@ -301,24 +301,3 @@
.nlocators = __arraycount(exynos4_i2c_locators)
};
-
-/* usb locators */
-const struct exyo_usb_locinfo exynos4_usb_locinfo = {
- .uloc_pmuregs_offset = EXYNOS4_PMU_OFFSET,
- .uloc_sysregs_offset = 0,
-
- .uloc_ehci_offset = EXYNOS4_USBHOST0_OFFSET,
- .uloc_ohci_offset = EXYNOS4_USBHOST1_OFFSET,
- .uloc_usbotg_offset = EXYNOS4_USBOTG1_OFFSET,
- .uloc_usb2phy_offset = EXYNOS4_USBOTG1_OFFSET,
-
- .uloc_usbhost_irq = IRQ_UHOST,
- .uloc_usbotg_irq = IRQ_HSOTG,
- .uloc_usb3_irq = 0, /* no usb3 */
-
- .uloc_usb3_xhci0_offset = 0, /* no usb3 */
- .uloc_usb3_xhci1_offset = 0, /* no usb3 */
- .uloc_usb3_phy0_offset = 0, /* no usb3 */
- .uloc_usb3_phy1_offset = 0, /* no usb3 */
-};
-
diff -r 90bf8c55bc35 -r a8d7f92e2d93 sys/arch/arm/samsung/exynos5_loc.c
--- a/sys/arch/arm/samsung/exynos5_loc.c Wed Jun 11 14:51:49 2014 +0000
+++ b/sys/arch/arm/samsung/exynos5_loc.c Wed Jun 11 14:54:32 2014 +0000
@@ -237,23 +237,3 @@
};
-/* usb locators */
-const struct exyo_usb_locinfo exynos5_usb_locinfo = {
- .uloc_pmuregs_offset = EXYNOS5_ALIVE_OFFSET,
- .uloc_sysregs_offset = EXYNOS5_SYSREG_OFFSET,
-
- .uloc_ehci_offset = EXYNOS5_USB2_HOST_EHCI_OFFSET,
- .uloc_ohci_offset = EXYNOS5_USB2_HOST_OHCI_OFFSET,
- .uloc_usbotg_offset = EXYNOS5_USB2_DEVICE_LINK_OFFSET,
- .uloc_usb2phy_offset = EXYNOS5_USB2_DEVICE_LINK_OFFSET,
-
- .uloc_usbhost_irq = IRQ_USB_HOST20,
- .uloc_usbotg_irq = IRQ_USBOTG,
- .uloc_usb3_irq = IRQ_USB_DRD30,
-
- .uloc_usb3_xhci0_offset = EXYNOS5_USB3_XHCI0_OFFSET,
- .uloc_usb3_xhci1_offset = EXYNOS5_USB3_XHCI1_OFFSET,
- .uloc_usb3_phy0_offset = EXYNOS5_USB3_PHY0_OFFSET,
- .uloc_usb3_phy1_offset = EXYNOS5_USB3_PHY1_OFFSET,
-};
-
diff -r 90bf8c55bc35 -r a8d7f92e2d93 sys/arch/arm/samsung/exynos_usb.c
--- a/sys/arch/arm/samsung/exynos_usb.c Wed Jun 11 14:51:49 2014 +0000
+++ b/sys/arch/arm/samsung/exynos_usb.c Wed Jun 11 14:54:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_usb.c,v 1.5 2014/06/06 14:28:58 reinoud Exp $ */
+/* $NetBSD: exynos_usb.c,v 1.6 2014/06/11 14:54:32 reinoud Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exynos_usb.c,v 1.5 2014/06/06 14:28:58 reinoud Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exynos_usb.c,v 1.6 2014/06/11 14:54:32 reinoud Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -67,10 +67,13 @@
#include <arm/samsung/exynos_var.h>
#include <arm/samsung/exynos_io.h>
+#define EHCI_OFFSET (0)
+#define OHCI_OFFSET (1*EXYNOS_BLOCK_SIZE)
+#define DEVLINK_OFFSET (2*EXYNOS_BLOCK_SIZE) /* Exynos5 */
+#define USB2PHY_OFFSET (3*EXYNOS_BLOCK_SIZE)
struct exynos_usb_softc {
device_t sc_self;
- const struct exyo_usb_locinfo *sc_locinfo;
/* keep our tags here */
bus_dma_tag_t sc_dmat;
@@ -81,11 +84,11 @@
bus_space_handle_t sc_usb2phy_bsh;
bus_space_handle_t sc_pmuregs_bsh;
- bus_space_handle_t sc_sysregs_bsh;
device_t sc_ohci_dev;
device_t sc_ehci_dev;
+ int sc_irq;
void *sc_intrh;
} exynos_usb_sc;
@@ -130,23 +133,15 @@
struct exyo_locators *loc = &exyoaa->exyo_loc;
struct exynos_gpio_pindata XuhostOVERCUR;
struct exynos_gpio_pindata XuhostPWREN;
+ bus_size_t pmu_offset;
/* no locators expected */
- KASSERT(loc->loc_offset == 0);
- KASSERT(loc->loc_size == 0);
- KASSERT(loc->loc_port == EXYOCF_PORT_DEFAULT);
+ KASSERT(loc->loc_port == EXYOCF_PORT_DEFAULT);
+ KASSERT(loc->loc_intr != EXYOCF_INTR_DEFAULT);
/* copy our device handle */
sc->sc_self = self;
-#ifdef EXYNOS4
- if (IS_EXYNOS4_P())
- sc->sc_locinfo = &exynos4_usb_locinfo;
-#endif
-#ifdef EXYNOS5
- if (IS_EXYNOS5_P())
- sc->sc_locinfo = &exynos5_usb_locinfo;
-#endif
- KASSERT(sc->sc_locinfo);
+ sc->sc_irq = loc->loc_intr;
/* get our bushandles */
sc->sc_bst = exyoaa->exyo_core_bst;
@@ -154,23 +149,28 @@
// sc->sc_dmat = exyoaa->exyo_coherent_dmat;
bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
- sc->sc_locinfo->uloc_ehci_offset, EXYNOS_BLOCK_SIZE,
+ loc->loc_offset + EHCI_OFFSET, EXYNOS_BLOCK_SIZE,
&sc->sc_ehci_bsh);
bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
- sc->sc_locinfo->uloc_ohci_offset, EXYNOS_BLOCK_SIZE,
+ loc->loc_offset + OHCI_OFFSET, EXYNOS_BLOCK_SIZE,
&sc->sc_ohci_bsh);
bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
- sc->sc_locinfo->uloc_usb2phy_offset, EXYNOS_BLOCK_SIZE,
+ loc->loc_offset + USB2PHY_OFFSET, EXYNOS_BLOCK_SIZE,
&sc->sc_usb2phy_bsh);
- bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
- sc->sc_locinfo->uloc_pmuregs_offset, EXYNOS_BLOCK_SIZE,
- &sc->sc_pmuregs_bsh);
+#ifdef EXYNOS4
+ if (IS_EXYNOS4_P())
+ pmu_offset = EXYNOS4_PMU_OFFSET;
+#endif
+#ifdef EXYNOS5
+ if (IS_EXYNOS5_P())
+ pmu_offset = EXYNOS5_ALIVE_OFFSET;
+#endif
- if (sc->sc_locinfo->uloc_sysregs_offset)
- bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
- sc->sc_locinfo->uloc_sysregs_offset, EXYNOS_BLOCK_SIZE,
- &sc->sc_sysregs_bsh);
+ KASSERT(pmu_offset);
+ bus_space_subregion(sc->sc_bst, exyoaa->exyo_core_bsh,
+ pmu_offset, EXYNOS_BLOCK_SIZE,
+ &sc->sc_pmuregs_bsh);
aprint_naive("\n");
aprint_normal("\n");
@@ -203,16 +203,16 @@
exynos_usb_phy_init(sc);
/* claim shared interrupt for OHCI/EHCI */
- sc->sc_intrh = intr_establish(sc->sc_locinfo->uloc_usbhost_irq,
+ sc->sc_intrh = intr_establish(sc->sc_irq,
IPL_USB, IST_LEVEL, exynos_usb_intr, sc);
if (!sc->sc_intrh) {
aprint_error(": unable to establish interrupt at irq %d\n",
- sc->sc_locinfo->uloc_usbhost_irq);
+ sc->sc_irq);
/* disable? TBD */
return;
}
aprint_normal_dev(sc->sc_self, "USB2 host interrupting on irq %d\n",
- sc->sc_locinfo->uloc_usbhost_irq);
+ sc->sc_irq);
#if NOHCI > 0
/* attach OHCI */
@@ -229,8 +229,6 @@
};
sc->sc_ehci_dev = config_found(self, &usb_ehci, NULL);
#endif
-
- /* TBD: USB3 xhci0 / xhci1 attachments */
}
@@ -307,7 +305,7 @@
}
sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
aprint_normal_dev(sc->sc_dev, "interrupting on irq %d\n",
- usbsc->sc_locinfo->uloc_usbhost_irq);
+ usbsc->sc_irq);
}
#endif
@@ -364,7 +362,7 @@
}
sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
aprint_normal_dev(sc->sc_dev, "interrupting on irq %d\n",
- usbsc->sc_locinfo->uloc_usbhost_irq);
+ usbsc->sc_irq);
}
#endif
@@ -413,13 +411,13 @@
phypwr = bus_space_read_4(sc->sc_bst, sc->sc_usb2phy_bsh,
USB_PHYPWR);
- /* set to normal of device */
+ /* enable analog, enable otg, unsleep phy0 (host) */
phypwr &= ~PHYPWR_NORMAL_MASK_PHY0;
bus_space_write_4(sc->sc_bst, sc->sc_usb2phy_bsh,
USB_PHYPWR, phypwr);
if (IS_EXYNOS4X12_P()) {
- /* set to normal of host */
+ /* enable hsic0 (host), enable hsic1 and phy1 (otg) */
phypwr = bus_space_read_4(sc->sc_bst, sc->sc_usb2phy_bsh,
USB_PHYPWR);
phypwr &= ~(PHYPWR_NORMAL_MASK_HSIC0 |
diff -r 90bf8c55bc35 -r a8d7f92e2d93 sys/arch/arm/samsung/exynos_var.h
--- a/sys/arch/arm/samsung/exynos_var.h Wed Jun 11 14:51:49 2014 +0000
+++ b/sys/arch/arm/samsung/exynos_var.h Wed Jun 11 14:54:32 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_var.h,v 1.11 2014/06/06 14:28:58 reinoud Exp $ */
+/* $NetBSD: exynos_var.h,v 1.12 2014/06/11 14:54:32 reinoud Exp $ */
/*-
* Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -81,26 +81,6 @@
};
-struct exyo_usb_locinfo {
- bus_size_t uloc_pmuregs_offset;
- bus_size_t uloc_sysregs_offset;
-
- bus_size_t uloc_ehci_offset;
- bus_size_t uloc_ohci_offset;
- bus_size_t uloc_usbotg_offset;
- bus_size_t uloc_usb2phy_offset;
-
- int uloc_usbhost_irq;
- int uloc_usbotg_irq;
- int uloc_usb3_irq;
-
- bus_size_t uloc_usb3_xhci0_offset;
- bus_size_t uloc_usb3_xhci1_offset;
- bus_size_t uloc_usb3_phy0_offset;
- bus_size_t uloc_usb3_phy1_offset;
-};
-
-
struct exyo_attach_args {
struct exyo_locators exyo_loc;
bus_space_tag_t exyo_core_bst;
Home |
Main Index |
Thread Index |
Old Index