コード例 #1
0
static void
ohci_bcmusb_attach(device_t parent, device_t self, void *aux)
{
	struct ohci_softc * const sc = device_private(self);
	struct bcmusb_attach_args * const usbaa = aux;

	sc->sc_dev = self;

	sc->iot = usbaa->usbaa_bst;
	sc->ioh = usbaa->usbaa_bsh;
	sc->sc_size = usbaa->usbaa_size;
	sc->sc_bus.dmatag = usbaa->usbaa_dmat;
	sc->sc_bus.hci_private = sc;

	sc->sc_id_vendor = PCI_VENDOR_BROADCOM;
	strlcpy(sc->sc_vendor, "Broadcom", sizeof(sc->sc_vendor));

	aprint_naive(": OHCI USB controller\n");
	aprint_normal(": OHCI USB controller\n");

	int error = ohci_init(sc);
	if (error != USBD_NORMAL_COMPLETION) {
		aprint_error_dev(self, "init failed, error=%d\n", error);
	} else {
		/* Attach usb device. */
		sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
	}
}
コード例 #2
0
ファイル: usb-ehci.c プロジェクト: floren/seabios-kvm
// Check if need companion controllers for full/low speed devices
static void
ehci_note_port(struct usb_ehci_s *cntl)
{
    if (--cntl->checkports)
        // Ports still being detected.
        return;
    if (! cntl->legacycount)
        // No full/low speed devices found.
        return;
    // Start companion controllers.
    int i;
    for (i=0; i<ARRAY_SIZE(cntl->companion); i++) {
        struct pci_device *pci = cntl->companion[i];
        if (!pci)
            break;

        // ohci/uhci_init call pci_config_XXX - don't run from irq handler.
        wait_preempt();

        if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_UHCI)
            uhci_init(pci, cntl->usb.busid + i);
        else if (pci_classprog(pci) == PCI_CLASS_SERIAL_USB_OHCI)
            ohci_init(pci, cntl->usb.busid + i);
    }
}
コード例 #3
0
static int ohci_xls_reset(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);

	ohci_hcd_init(ohci);
	return ohci_init(ohci);
}
コード例 #4
0
void
ohci_pci_attach_deferred(struct device *self)
{
	struct ohci_pci_softc *sc = (struct ohci_pci_softc *)self;
	usbd_status r;
	int s;

	s = splusb();

	sc->sc.sc_dying = 0;
	
	r = ohci_init(&sc->sc);
	if (r != USBD_NORMAL_COMPLETION) {
		printf("%s: init failed, error=%d\n",
		    sc->sc.sc_bus.bdev.dv_xname, r);
		bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
		splx(s);
		return;
	}

	sc->sc.sc_powerhook = powerhook_establish(ohci_power, &sc->sc);
	if (sc->sc.sc_powerhook == NULL)
		printf("%s: unable to establish powerhook\n",
		    sc->sc.sc_bus.bdev.dv_xname);

	splx(s);

	/* Attach usb device. */
	sc->sc.sc_child = config_found((void *)sc, &sc->sc.sc_bus,
				       usbctlprint);
}
コード例 #5
0
static void
exynos_ohci_attach(device_t parent, device_t self, void *aux)
{
	struct exynos_usb_softc *usbsc = &exynos_usb_sc;
	struct ohci_softc *sc = device_private(self);
	int r;

	sc->sc_dev = self;
	sc->iot = usbsc->sc_bst;
	sc->ioh = usbsc->sc_ohci_bsh;
	sc->sc_size = EXYNOS_BLOCK_SIZE;
	sc->sc_bus.dmatag = usbsc->sc_dmat;
	sc->sc_bus.hci_private = sc;

	strlcpy(sc->sc_vendor, "exynos", sizeof(sc->sc_vendor));

	aprint_naive(": OHCI USB controller\n");
	aprint_normal(": OHCI USB controller\n");

	/* attach */
	r = ohci_init(sc);
	if (r != USBD_NORMAL_COMPLETION) {
		aprint_error_dev(self, "init failed, error = %d\n", r);
		/* disable : TBD */
		return;
	}
	sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
	aprint_normal_dev(sc->sc_dev, "interrupting on irq %d\n",
		usbsc->sc_irq);
}
コード例 #6
0
ファイル: ohci-da8xx.c プロジェクト: mrtos/Logitech-Revue
static int ohci_da8xx_init(struct usb_hcd *hcd)
{
	struct device *dev		= hcd->self.controller;
	struct da8xx_ohci_root_hub *hub	= dev->platform_data;
	struct ohci_hcd	*ohci		= hcd_to_ohci(hcd);
	int result;
	u32 rh_a;

	dev_dbg(dev, "starting USB controller\n");

	ohci_da8xx_clock(1);

	/*
	 * DA830 only has 1 port connected to the pins but its HC root hub
	 * register A reports 2 ports, thus we'll have to override it...
	 */
	ohci->num_ports = 1;

	result = ohci_init(ohci);
	if (result < 0)
		return result;

	/*
	 * Since we're providing a board-specific root hub port power control
	 * and over-current reporting, we have to override the HC root hub A
	 * register's default value, so that ohci_hub_control() could return
	 * the correct hub descriptor...
	 */
	rh_a = ohci_readl(ohci, &ohci->regs->roothub.a);
	rh_a &= ~(RH_A_POTPGT | RH_A_NPS | RH_A_NOCP);
	rh_a |=  (hub->potpgt << 24) | RH_A_PSM | RH_A_OCPM;
	ohci_writel(ohci, rh_a, &ohci->regs->roothub.a);

	return result;
}
コード例 #7
0
ファイル: ohci_voyager.c プロジェクト: ajinkya93/OpenBSD
void
ohci_voyager_attach_deferred(struct device *self)
{
	struct ohci_voyager_softc *sc = (struct ohci_voyager_softc *)self;
	usbd_status r;
	int s;

	s = splusb();

	sc->sc.sc_bus.dying = 0;
	
	r = ohci_init(&sc->sc);
	if (r != USBD_NORMAL_COMPLETION) {
		printf("%s: init failed, error=%d\n",
		    sc->sc.sc_bus.bdev.dv_xname, r);
		bus_space_unmap(sc->sc.iot, sc->sc.ioh, sc->sc.sc_size);
		splx(s);
		return;
	}

	splx(s);

	/* Attach usb device. */
	config_found(self, &sc->sc.sc_bus, usbctlprint);
}
コード例 #8
0
static int __devinit
ohci_ep93xx_start (struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
	int ret;

	ohci_dbg(ohci, "ohci_ep93xx_start, ohci:%p", ohci);
			
	if ((ret = ohci_init(ohci)) < 0){
		ohci_dbg(ohci, "ohci_ep93xx_start, ohci_init error=%x\n",ret);
		return ret;
	}
		
	ohci_dbg(ohci, "ohci_ep93xx_start, ohci->hcca:%p", ohci->hcca);
	
	if ((ret = ohci_run (ohci)) < 0) {
		pr_debug ("can't start %s", hcd->self.bus_name);
		ohci_stop (hcd);
		return ret;
	}

	create_debug_files(ohci);

#ifdef	DEBUG
	ohci_dump(ohci, 1);
#endif /*DEBUG*/

	return 0;
}
コード例 #9
0
void
at91ohci_callback(device_t self)
{
	struct at91ohci_softc *sc = device_private(self);
	usbd_status r;

	/* Disable interrupts, so we don't get any spurious ones. */
	bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
			  OHCI_ALL_INTRS);

	strlcpy(sc->sc.sc_vendor, "Atmel", sizeof sc->sc.sc_vendor);

	sc->sc_ih = at91_intr_establish(sc->sc_pid, IPL_USB, INTR_HIGH_LEVEL, ohci_intr, sc);
	r = ohci_init(&sc->sc);

	if (r != USBD_NORMAL_COMPLETION) {
		printf("%s: init failed, error=%d\n", device_xname(self), r);

		at91_intr_disestablish(sc->sc_ih);
		return;
	}

	/* Attach usb device. */
	sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
}
コード例 #10
0
static int ohci_da8xx_init(struct usb_hcd *hcd)
{
	struct device *dev		= hcd->self.controller;
	struct da8xx_ohci_root_hub *hub	= dev->platform_data;
	struct ohci_hcd	*ohci		= hcd_to_ohci(hcd);
	int result;
	u32 rh_a;

	dev_dbg(dev, "starting USB controller\n");

	ohci_da8xx_clock(1);

	ohci->num_ports = 1;

	result = ohci_init(ohci);
	if (result < 0)
		return result;

	rh_a = ohci_readl(ohci, &ohci->regs->roothub.a);
	if (hub->set_power) {
		rh_a &= ~RH_A_NPS;
		rh_a |=  RH_A_PSM;
	}
	if (hub->get_oci) {
		rh_a &= ~RH_A_NOCP;
		rh_a |=  RH_A_OCPM;
	}
	rh_a &= ~RH_A_POTPGT;
	rh_a |= hub->potpgt << 24;
	ohci_writel(ohci, rh_a, &ohci->regs->roothub.a);

	return result;
}
コード例 #11
0
ファイル: ohci-rtl819x.c プロジェクト: LXiong/openwrt-rtk
static int /*__devinit*/ ohci_rtl819x_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
	int ret;
    unsigned int fminterval; 

	ret = ohci_init(ohci);
	if (ret < 0)
		return ret;

#if 1
    fminterval = 0x2edf;
    ohci_writel (ohci,(fminterval * 9) / 10, &ohci->regs->periodicstart);                                           
    fminterval |= ((((fminterval - 210) * 6) / 7) << 16); 
    ohci_writel (ohci, fminterval, &ohci->regs->fminterval); 

    ohci_writel (ohci, 0x0628, &ohci->regs->lsthresh); 		/* default value from datasheet */
    ohci_writel (ohci, 0x3e67, &ohci->regs->periodicstart); /* default value from datasheet */
#endif

	ret = ohci_run(ohci);

	if (ret < 0) 
		goto err;

	return 0;

 err:
	ohci_stop(hcd);
	return ret;
}
コード例 #12
0
static int ohci_sh_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);

	ohci_hcd_init(ohci);
	ohci_init(ohci);
	ohci_run(ohci);
<<<<<<< HEAD
コード例 #13
0
static int ps3_ohci_hc_reset(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);

	ohci->flags |= OHCI_QUIRK_BE_MMIO;
	ohci_hcd_init(ohci);
	return ohci_init(ohci);
}
コード例 #14
0
static int ohci_superh_reset(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);

	ohci->regs = hcd->regs;
	ohci->next_statechange = jiffies;
	return ohci_init(ohci);
}
コード例 #15
0
static int ohci_brcm_reset(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);

	ohci->flags |= OHCI_QUIRK_BE_MMIO;
	distrust_firmware = 0;
	ohci_hcd_init(ohci);
	return ohci_init(ohci);
}
コード例 #16
0
static int ohci_k3v2_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);

	ohci_hcd_init(ohci);
	ohci_init(ohci);
	ohci_run(ohci);
	hcd->state = HC_STATE_RUNNING;
	return 0;
}
コード例 #17
0
static int ssb_ohci_reset(struct usb_hcd *hcd)
{
	struct ssb_ohci_device *ohcidev = hcd_to_ssb_ohci(hcd);
	struct ohci_hcd *ohci = &ohcidev->ohci;
	int err;

	ohci_hcd_init(ohci);
	err = ohci_init(ohci);

	return err;
}
コード例 #18
0
static void
ohci_awinusb_attach(device_t parent, device_t self, void *aux)
{
    struct awinusb_softc * const usbsc = device_private(parent);
    struct ohci_softc * const sc = device_private(self);
    struct awinusb_attach_args * const usbaa = aux;
    int irq;

    sc->sc_dev = self;

    sc->iot = usbaa->usbaa_bst;
    sc->ioh = usbaa->usbaa_bsh;
    sc->sc_size = usbaa->usbaa_size;
    sc->sc_bus.dmatag = usbaa->usbaa_dmat;
    sc->sc_bus.hci_private = sc;

    //sc->sc_id_vendor = PCI_VENDOR_ALLWINNER;
    strlcpy(sc->sc_vendor, "Allwinner", sizeof(sc->sc_vendor));

    aprint_naive(": OHCI USB controller\n");
    aprint_normal(": OHCI USB controller\n");

    int error = ohci_init(sc);
    if (error != USBD_NORMAL_COMPLETION) {
        aprint_error_dev(self, "init failed, error=%d\n", error);
        return;
    }

    /* Attach usb device. */
    sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);

    switch (awin_chip_id()) {
    case AWIN_CHIP_ID_A80:
        irq = awinusb_ohci_irqs_a80[usbaa->usbaa_port];
        break;
    case AWIN_CHIP_ID_A31:
        irq = awinusb_ohci_irqs_a31[usbaa->usbaa_port];
        break;
    default:
        irq = awinusb_ohci_irqs[usbaa->usbaa_port];
        break;
    }

    usbsc->usbsc_ohci_ih = intr_establish(irq, IPL_VM,
                                          IST_LEVEL, ohci_intr, sc);
    if (usbsc->usbsc_ohci_ih == NULL) {
        aprint_error_dev(self, "failed to establish interrupt %d\n",
                         irq);
        return;
    }
    aprint_normal_dev(self, "interrupting on irq %d\n", irq);
}
コード例 #19
0
void
ohci_arbus_attach(device_t parent, device_t self, void *aux)
{
	ohci_softc_t * const sc = device_private(self);
	struct arbus_attach_args * const aa = aux;
	void *ih = NULL;
	usbd_status status;

	sc->sc_dev = self;
	sc->iot = aa->aa_bst;
	sc->sc_size = aa->aa_size;
	sc->sc_bus.dmatag = aa->aa_dmat;
	sc->sc_bus.hci_private = sc;

	if (bus_space_map(sc->iot, aa->aa_addr, sc->sc_size, 0, &sc->ioh)) {
		aprint_error_dev(self, "unable to map registers\n");
		return;
	}

	/* Disable OHCI interrupts */
	bus_space_write_4(sc->iot, sc->ioh, OHCI_INTERRUPT_DISABLE,
	    OHCI_ALL_INTRS);

	/* establish interrupt */
	ih = arbus_intr_establish(aa->aa_cirq, aa->aa_mirq, ohci_intr, sc);
	if (ih == NULL)
		panic("%s: couldn't establish interrupt", device_xname(self));

	/* we don't handle endianess in bus space */
	sc->sc_endian = OHCI_LITTLE_ENDIAN;

	status = ohci_init(sc);
	if (status != USBD_NORMAL_COMPLETION) {
		aprint_error_dev(self, "init failed, error=%d\n", status);
		if (ih != NULL)
			arbus_intr_disestablish(ih);
		return;
	}

#if 0
	if (psc->sc_ohci_devs[0] == NULL) {
		psc->sc_ohci_devs[0] = self;
	} else if (psc->sc_ohci_devs[1] == NULL) {
		psc->sc_ohci_devs[1] = self;
	} else {
		panic("%s: too many ohci devices", __func__);
	}
#endif

	/* Attach USB device */
	sc->sc_child = config_found(self, &sc->sc_bus, usbctlprint);
}
コード例 #20
0
static int __devinit
ohci_at91_reset (struct usb_hcd *hcd)
{
	struct at91_usbh_data	*board = hcd->self.controller->platform_data;
	struct ohci_hcd		*ohci = hcd_to_ohci (hcd);
	int			ret;

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	ohci->num_ports = board->ports;
	return 0;
}
コード例 #21
0
static int ohci_exynos_init(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
	int ret;

	ohci_dbg(ohci, "ohci_exynos_init, ohci:%p", ohci);

	ret = ohci_init(ohci);
	if (ret < 0)
		return ret;

	return 0;
}
コード例 #22
0
static int __devinit ohci_pnx4008_start(struct usb_hcd *hcd)
{
    struct ohci_hcd *ohci = hcd_to_ohci(hcd);
    int ret;

    if ((ret = ohci_init(ohci)) < 0)
        return ret;

    if ((ret = ohci_run(ohci)) < 0) {
        dev_err(hcd->self.controller, "can't start\n");
        ohci_stop(hcd);
        return ret;
    }
    return 0;
}
コード例 #23
0
ファイル: ohci-ep93xx.c プロジェクト: 3sOx/asuswrt-merlin
static int __devinit ohci_ep93xx_start(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
	int ret;

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	if ((ret = ohci_run(ohci)) < 0) {
		err("can't start %s", hcd->self.bus_name);
		ohci_stop(hcd);
		return ret;
	}

	return 0;
}
コード例 #24
0
ファイル: ohci_sunxi.c プロジェクト: alex-deng/a33_linux
static int sunxi_ohci_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
	int ret;

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	if ((ret = ohci_run(ohci)) < 0) {
		DMSG_PANIC("can't start %s", hcd->self.bus_name);
		ohci_stop(hcd);
		return ret;
	}

	return 0;
}
コード例 #25
0
static int ohci_tmio_start(struct usb_hcd *hcd)
{
    struct ohci_hcd *ohci = hcd_to_ohci(hcd);
    int ret;

    if ((ret = ohci_init(ohci)) < 0)
        return ret;

    if ((ret = ohci_run(ohci)) < 0) {
        dev_err(hcd->self.controller, "can't start %s\n",
                hcd->self.bus_name);
        ohci_stop(hcd);
        return ret;
    }

    return 0;
}
コード例 #26
0
static int __devinit sw_ohci_start(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
	int ret;

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	if ((ret = ohci_run(ohci)) < 0) {
		pr_err("%s: cannot start %s, rc=%d", __func__,
			hcd->self.bus_name, ret);
		ohci_stop(hcd);
		return ret;
	}

	return 0;
}
コード例 #27
0
static int ohci_omap_init(struct usb_hcd *hcd)
{
	struct ohci_hcd		*ohci = hcd_to_ohci(hcd);
	int			ret;

	dev_dbg(hcd->self.controller, "starting USB Controller\n");

	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	/* board init will have already handled HMC and mux setup.
	 * any external transceiver should already be initialized
	 * too, so all configured ports use the right signaling now.
	 */

	return 0;
}
コード例 #28
0
static int ohci_brcm_start(struct usb_hcd *hcd)
{
	struct ohci_hcd	*ohci = hcd_to_ohci(hcd);
	struct ohci_regs __iomem *regs;

	regs = hcd->regs;

	ohci_writel(ohci, 1, &regs->cmdstatus);
	ohci_readl(ohci, &regs->cmdstatus);
	mdelay(10);

	ohci_hcd_init(ohci);
	ohci_init(ohci);
	ohci_run(ohci);
	hcd->state = HC_STATE_RUNNING;
	return 0;
}
コード例 #29
0
ファイル: ohci-pci.c プロジェクト: ANFS/ANFS-kernel
static void ohci_quirk_nec_worker(struct work_struct *work)
{
	struct ohci_hcd *ohci = container_of(work, struct ohci_hcd, nec_work);
	int status;

	status = ohci_init(ohci);
	if (status != 0) {
		ohci_err(ohci, "Restarting NEC controller failed in %s, %d\n",
			 "ohci_init", status);
		return;
	}

	status = ohci_restart(ohci);
	if (status != 0)
		ohci_err(ohci, "Restarting NEC controller failed in %s, %d\n",
			 "ohci_restart", status);
}
コード例 #30
0
ファイル: ohci-stcore.c プロジェクト: highzeth/satip-axe
static int
stm_ohci_start(struct usb_hcd *hcd)
{
	struct ohci_hcd *ohci = hcd_to_ohci(hcd);
	int ret = 0;

	dgb_print("\n");
	if ((ret = ohci_init(ohci)) < 0)
		return ret;

	if ((ret = ohci_run(ohci)) < 0) {
		err("can't start %s", hcd->self.bus_name);
		ohci_stop(hcd);
		return ret;
	}

	return 0;
}