Lines Matching refs:temp

187 	uint32_t temp;  in dwc_otg_tx_fifo_reset()  local
193 for (temp = 0; temp != 16; temp++) { in dwc_otg_tx_fifo_reset()
387 uint32_t temp; in dwc_otg_update_host_frame_interval()
390 temp = DWC_OTG_READ_4(sc, DOTG_HFIR) & HFIR_FRINT_MASK; in dwc_otg_update_host_frame_interval()
391 if (temp >= 10000) in dwc_otg_update_host_frame_interval()
392 temp /= 1000; in dwc_otg_update_host_frame_interval()
394 temp /= 125; in dwc_otg_update_host_frame_interval()
397 if (temp >= 54) in dwc_otg_update_host_frame_interval()
398 temp = 60; /* MHz */ in dwc_otg_update_host_frame_interval()
399 else if (temp >= 39) in dwc_otg_update_host_frame_interval()
400 temp = 48; /* MHz */ in dwc_otg_update_host_frame_interval()
402 temp = 30; /* MHz */ in dwc_otg_update_host_frame_interval()
405 temp *= 125; in dwc_otg_update_host_frame_interval()
407 temp *= 1000; in dwc_otg_update_host_frame_interval()
409 DPRINTF("HFIR=0x%08x\n", temp); in dwc_otg_update_host_frame_interval()
411 DWC_OTG_WRITE_4(sc, DOTG_HFIR, temp); in dwc_otg_update_host_frame_interval()
445 uint32_t temp; in dwc_otg_pull_up() local
453 temp = DWC_OTG_READ_4(sc, DOTG_DCTL); in dwc_otg_pull_up()
454 temp &= ~DCTL_SFTDISCON; in dwc_otg_pull_up()
455 DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); in dwc_otg_pull_up()
462 uint32_t temp; in dwc_otg_pull_down() local
469 temp = DWC_OTG_READ_4(sc, DOTG_DCTL); in dwc_otg_pull_down()
470 temp |= DCTL_SFTDISCON; in dwc_otg_pull_down()
471 DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); in dwc_otg_pull_down()
541 uint32_t temp; in dwc_otg_wakeup_peer() local
544 temp = DWC_OTG_READ_4(sc, DOTG_DCTL); in dwc_otg_wakeup_peer()
545 temp |= DCTL_RMTWKUPSIG; in dwc_otg_wakeup_peer()
546 DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); in dwc_otg_wakeup_peer()
551 temp &= ~DCTL_RMTWKUPSIG; in dwc_otg_wakeup_peer()
552 DWC_OTG_WRITE_4(sc, DOTG_DCTL, temp); in dwc_otg_wakeup_peer()
582 uint32_t temp; in dwc_otg_set_address() local
586 temp = DWC_OTG_READ_4(sc, DOTG_DCFG); in dwc_otg_set_address()
587 temp &= ~DCFG_DEVADDR_SET(0x7F); in dwc_otg_set_address()
588 temp |= DCFG_DEVADDR_SET(addr); in dwc_otg_set_address()
589 DWC_OTG_WRITE_4(sc, DOTG_DCFG, temp); in dwc_otg_set_address()
958 uint32_t temp; in dwc_otg_setup_rx() local
1041 temp = sc->sc_out_ctl[0]; in dwc_otg_setup_rx()
1045 temp | DOEPCTL_STALL); in dwc_otg_setup_rx()
1047 temp = sc->sc_in_ctl[0]; in dwc_otg_setup_rx()
1051 temp | DIEPCTL_STALL); in dwc_otg_setup_rx()
1481 uint32_t temp; in dwc_otg_data_rx() local
1556 temp = sc->sc_out_ctl[td->ep_no]; in dwc_otg_data_rx()
1559 if ((temp & DIEPCTL_EPTYPE_MASK) == in dwc_otg_data_rx()
1562 if (temp & DIEPCTL_SETD1PID) { in dwc_otg_data_rx()
1563 temp &= ~DIEPCTL_SETD1PID; in dwc_otg_data_rx()
1564 temp |= DIEPCTL_SETD0PID; in dwc_otg_data_rx()
1566 temp &= ~DIEPCTL_SETD0PID; in dwc_otg_data_rx()
1567 temp |= DIEPCTL_SETD1PID; in dwc_otg_data_rx()
1569 sc->sc_out_ctl[td->ep_no] = temp; in dwc_otg_data_rx()
1597 temp = sc->sc_out_ctl[td->ep_no]; in dwc_otg_data_rx()
1598 DWC_OTG_WRITE_4(sc, DOTG_DOEPCTL(td->ep_no), temp | in dwc_otg_data_rx()
1986 uint32_t temp; in dwc_otg_data_tx() local
1996 temp = sc->sc_last_rx_status; in dwc_otg_data_tx()
1998 if ((td->ep_no == 0) && (temp != 0) && in dwc_otg_data_tx()
1999 (GRXSTSRD_CHNUM_GET(temp) == 0)) { in dwc_otg_data_tx()
2001 if ((temp & GRXSTSRD_PKTSTS_MASK) != in dwc_otg_data_tx()
2003 (temp & GRXSTSRD_PKTSTS_MASK) != in dwc_otg_data_tx()
2024 temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); in dwc_otg_data_tx()
2027 cpkt = DXEPTSIZ_GET_NPKT(temp); in dwc_otg_data_tx()
2082 temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); in dwc_otg_data_tx()
2084 if (DXEPTSIZ_GET_NPKT(temp) != 0) { in dwc_otg_data_tx()
2088 DXEPTSIZ_GET_NPKT(temp), in dwc_otg_data_tx()
2089 temp, DWC_OTG_READ_4(sc, DOTG_DIEPCTL(td->ep_no))); in dwc_otg_data_tx()
2146 temp = sc->sc_in_ctl[td->ep_no]; in dwc_otg_data_tx()
2149 if ((temp & DIEPCTL_EPTYPE_MASK) == in dwc_otg_data_tx()
2152 if (temp & DIEPCTL_SETD1PID) { in dwc_otg_data_tx()
2153 temp &= ~DIEPCTL_SETD1PID; in dwc_otg_data_tx()
2154 temp |= DIEPCTL_SETD0PID; in dwc_otg_data_tx()
2156 temp &= ~DIEPCTL_SETD0PID; in dwc_otg_data_tx()
2157 temp |= DIEPCTL_SETD1PID; in dwc_otg_data_tx()
2159 sc->sc_in_ctl[td->ep_no] = temp; in dwc_otg_data_tx()
2163 DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(td->ep_no), temp | in dwc_otg_data_tx()
2185 uint32_t temp; in dwc_otg_data_tx_sync() local
2190 temp = DWC_OTG_READ_4(sc, DOTG_DIEPTSIZ(td->ep_no)); in dwc_otg_data_tx_sync()
2193 if (DXEPTSIZ_GET_NPKT(temp) != 0) { in dwc_otg_data_tx_sync()
2203 temp = sc->sc_last_rx_status; in dwc_otg_data_tx_sync()
2205 if ((td->ep_no == 0) && (temp != 0) && in dwc_otg_data_tx_sync()
2206 (GRXSTSRD_CHNUM_GET(temp) == 0)) { in dwc_otg_data_tx_sync()
2208 if ((temp & GRXSTSRD_PKTSTS_MASK) == in dwc_otg_data_tx_sync()
2210 (temp & GRXSTSRD_PKTSTS_MASK) == in dwc_otg_data_tx_sync()
2397 uint16_t temp; in dwc_otg_update_host_transfer_schedule_locked() local
2401 temp = DWC_OTG_READ_4(sc, DOTG_HFNUM) & DWC_OTG_FRAME_MASK; in dwc_otg_update_host_transfer_schedule_locked()
2403 if (sc->sc_last_frame_num == temp) in dwc_otg_update_host_transfer_schedule_locked()
2406 sc->sc_last_frame_num = temp; in dwc_otg_update_host_transfer_schedule_locked()
2419 if ((temp & 7) == 0) { in dwc_otg_update_host_transfer_schedule_locked()
2452 td->tt_start_slot = temp + slot; in dwc_otg_update_host_transfer_schedule_locked()
2476 td->tt_start_slot = temp; in dwc_otg_update_host_transfer_schedule_locked()
2502 td->tt_start_slot = temp; in dwc_otg_update_host_transfer_schedule_locked()
2523 td->tt_start_slot = temp; in dwc_otg_update_host_transfer_schedule_locked()
2529 if ((temp & 7) < 6) { in dwc_otg_update_host_transfer_schedule_locked()
2544 td->tt_start_slot = temp; in dwc_otg_update_host_transfer_schedule_locked()
2575 if ((temp & 7) == 0) { in dwc_otg_update_host_transfer_schedule_locked()
2578 (int)temp, (int)sc->sc_needsof); in dwc_otg_update_host_transfer_schedule_locked()
2603 uint32_t temp; in dwc_otg_interrupt_poll_locked() local
2610 temp = DWC_OTG_READ_4(sc, DOTG_HCINT(x)); in dwc_otg_interrupt_poll_locked()
2611 if (temp != 0) { in dwc_otg_interrupt_poll_locked()
2612 DWC_OTG_WRITE_4(sc, DOTG_HCINT(x), temp); in dwc_otg_interrupt_poll_locked()
2613 temp &= ~HCINT_SOFTWARE_ONLY; in dwc_otg_interrupt_poll_locked()
2614 sc->sc_chan_state[x].hcint |= temp; in dwc_otg_interrupt_poll_locked()
2620 temp = DWC_OTG_READ_4(sc, DOTG_GINTSTS); in dwc_otg_interrupt_poll_locked()
2621 if (temp & GINTSTS_RXFLVL) { in dwc_otg_interrupt_poll_locked()
2631 temp = sc->sc_last_rx_status & in dwc_otg_interrupt_poll_locked()
2635 if (temp != GRXSTSRD_STP_DATA && in dwc_otg_interrupt_poll_locked()
2636 temp != GRXSTSRD_STP_COMPLETE && in dwc_otg_interrupt_poll_locked()
2637 temp != GRXSTSRD_OUT_DATA) { in dwc_otg_interrupt_poll_locked()
2642 temp = GRXSTSRD_BCNT_GET( in dwc_otg_interrupt_poll_locked()
2648 if (temp != 0) { in dwc_otg_interrupt_poll_locked()
2649 DPRINTF("Reading %d bytes from ep %d\n", temp, ep_no); in dwc_otg_interrupt_poll_locked()
2652 sc->sc_rx_bounce_buffer, (temp + 3) / 4); in dwc_otg_interrupt_poll_locked()
2768 uint32_t temp; in dwc_otg_filter_interrupt() local
2772 temp = DWC_OTG_READ_4(sc, DOTG_DIEPINT(x)); in dwc_otg_filter_interrupt()
2773 if (temp & DIEPMSK_XFERCOMPLMSK) { in dwc_otg_filter_interrupt()
2830 uint32_t temp; in dwc_otg_interrupt() local
2850 temp = DWC_OTG_READ_4(sc, DOTG_DSTS); in dwc_otg_interrupt()
2851 if (DSTS_ENUMSPD_GET(temp) == DSTS_ENUMSPD_HI) in dwc_otg_interrupt()
2958 uint32_t temp; in dwc_otg_interrupt() local
2960 temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); in dwc_otg_interrupt()
2962 DPRINTFN(5, "GOTGCTL=0x%08x\n", temp); in dwc_otg_interrupt()
2965 (temp & (GOTGCTL_ASESVLD | GOTGCTL_BSESVLD)) ? 1 : 0); in dwc_otg_interrupt()
2985 dwc_otg_setup_standard_chain_sub(struct dwc_otg_std_temp *temp) in dwc_otg_setup_standard_chain_sub() argument
2990 td = temp->td_next; in dwc_otg_setup_standard_chain_sub()
2991 temp->td = td; in dwc_otg_setup_standard_chain_sub()
2994 temp->td_next = td->obj_next; in dwc_otg_setup_standard_chain_sub()
2997 td->func = temp->func; in dwc_otg_setup_standard_chain_sub()
2998 td->pc = temp->pc; in dwc_otg_setup_standard_chain_sub()
2999 td->offset = temp->offset; in dwc_otg_setup_standard_chain_sub()
3000 td->remainder = temp->len; in dwc_otg_setup_standard_chain_sub()
3005 td->did_stall = temp->did_stall; in dwc_otg_setup_standard_chain_sub()
3006 td->short_pkt = temp->short_pkt; in dwc_otg_setup_standard_chain_sub()
3007 td->alt_next = temp->setup_alt_next; in dwc_otg_setup_standard_chain_sub()
3021 struct dwc_otg_std_temp temp; in dwc_otg_setup_standard_chain() local
3031 temp.max_frame_size = xfer->max_frame_size; in dwc_otg_setup_standard_chain()
3039 temp.pc = NULL; in dwc_otg_setup_standard_chain()
3040 temp.td = NULL; in dwc_otg_setup_standard_chain()
3041 temp.td_next = xfer->td_start[0]; in dwc_otg_setup_standard_chain()
3042 temp.offset = 0; in dwc_otg_setup_standard_chain()
3043 temp.setup_alt_next = xfer->flags_int.short_frames_ok || in dwc_otg_setup_standard_chain()
3045 temp.did_stall = !xfer->flags_int.control_stall; in dwc_otg_setup_standard_chain()
3055 temp.func = &dwc_otg_host_setup_tx; in dwc_otg_setup_standard_chain()
3057 temp.func = &dwc_otg_setup_rx; in dwc_otg_setup_standard_chain()
3059 temp.len = xfer->frlengths[0]; in dwc_otg_setup_standard_chain()
3060 temp.pc = xfer->frbuffers + 0; in dwc_otg_setup_standard_chain()
3061 temp.short_pkt = temp.len ? 1 : 0; in dwc_otg_setup_standard_chain()
3067 temp.setup_alt_next = 0; in dwc_otg_setup_standard_chain()
3070 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3080 temp.func = &dwc_otg_host_data_rx; in dwc_otg_setup_standard_chain()
3083 temp.func = &dwc_otg_data_tx; in dwc_otg_setup_standard_chain()
3088 temp.func = &dwc_otg_host_data_tx; in dwc_otg_setup_standard_chain()
3091 temp.func = &dwc_otg_data_rx; in dwc_otg_setup_standard_chain()
3097 temp.pc = xfer->frbuffers + x; in dwc_otg_setup_standard_chain()
3105 temp.len = xfer->frlengths[x]; in dwc_otg_setup_standard_chain()
3112 temp.setup_alt_next = 0; in dwc_otg_setup_standard_chain()
3115 temp.setup_alt_next = 0; in dwc_otg_setup_standard_chain()
3118 if (temp.len == 0) { in dwc_otg_setup_standard_chain()
3122 temp.short_pkt = 0; in dwc_otg_setup_standard_chain()
3128 temp.short_pkt = (xfer->flags.force_short_xfer ? 0 : 1); in dwc_otg_setup_standard_chain()
3131 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3134 temp.offset += temp.len; in dwc_otg_setup_standard_chain()
3137 temp.pc = xfer->frbuffers + x; in dwc_otg_setup_standard_chain()
3144 temp.pc = xfer->frbuffers + 0; in dwc_otg_setup_standard_chain()
3145 temp.len = 0; in dwc_otg_setup_standard_chain()
3146 temp.short_pkt = 0; in dwc_otg_setup_standard_chain()
3147 temp.setup_alt_next = 0; in dwc_otg_setup_standard_chain()
3152 temp.func = &dwc_otg_data_tx_sync; in dwc_otg_setup_standard_chain()
3153 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3165 temp.func = &dwc_otg_host_data_tx; in dwc_otg_setup_standard_chain()
3168 temp.func = &dwc_otg_data_rx; in dwc_otg_setup_standard_chain()
3173 temp.func = &dwc_otg_host_data_rx; in dwc_otg_setup_standard_chain()
3176 temp.func = &dwc_otg_data_tx; in dwc_otg_setup_standard_chain()
3181 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3184 td = temp.td; in dwc_otg_setup_standard_chain()
3189 temp.func = &dwc_otg_data_tx_sync; in dwc_otg_setup_standard_chain()
3190 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3197 temp.pc = xfer->frbuffers + 0; in dwc_otg_setup_standard_chain()
3198 temp.len = 0; in dwc_otg_setup_standard_chain()
3199 temp.short_pkt = 0; in dwc_otg_setup_standard_chain()
3200 temp.setup_alt_next = 0; in dwc_otg_setup_standard_chain()
3203 temp.func = &dwc_otg_data_tx_sync; in dwc_otg_setup_standard_chain()
3204 dwc_otg_setup_standard_chain_sub(&temp); in dwc_otg_setup_standard_chain()
3209 td = temp.td; in dwc_otg_setup_standard_chain()
3566 uint32_t temp; in dwc_otg_set_stall() local
3589 temp = sc->sc_in_ctl[ep_no & UE_ADDR]; in dwc_otg_set_stall()
3592 temp = sc->sc_out_ctl[ep_no & UE_ADDR]; in dwc_otg_set_stall()
3596 DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); in dwc_otg_set_stall()
3597 DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_STALL); in dwc_otg_set_stall()
3622 uint32_t temp; in dwc_otg_clear_stall_sub_locked() local
3640 temp = DIEPCTL_EPTYPE_SET( in dwc_otg_clear_stall_sub_locked()
3644 temp = DIEPCTL_EPTYPE_SET( in dwc_otg_clear_stall_sub_locked()
3648 temp = DIEPCTL_EPTYPE_SET( in dwc_otg_clear_stall_sub_locked()
3653 temp |= DIEPCTL_MPS_SET(mps); in dwc_otg_clear_stall_sub_locked()
3654 temp |= DIEPCTL_TXFNUM_SET(ep_no); in dwc_otg_clear_stall_sub_locked()
3657 sc->sc_in_ctl[ep_no] = temp; in dwc_otg_clear_stall_sub_locked()
3659 sc->sc_out_ctl[ep_no] = temp; in dwc_otg_clear_stall_sub_locked()
3661 DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_EPDIS); in dwc_otg_clear_stall_sub_locked()
3662 DWC_OTG_WRITE_4(sc, reg, temp | DOEPCTL_SETD0PID); in dwc_otg_clear_stall_sub_locked()
3663 DWC_OTG_WRITE_4(sc, reg, temp | DIEPCTL_SNAK); in dwc_otg_clear_stall_sub_locked()
3753 uint32_t temp; in dwc_otg_init() local
3769 temp = DWC_OTG_READ_4(sc, DOTG_GSNPSID); in dwc_otg_init()
3770 DPRINTF("Version = 0x%08x\n", temp); in dwc_otg_init()
3787 temp = GUSBCFG_FORCEDEVMODE; in dwc_otg_init()
3790 temp = GUSBCFG_FORCEHOSTMODE; in dwc_otg_init()
3793 temp = 0; in dwc_otg_init()
3802 GUSBCFG_TRD_TIM_SET(5) | temp); in dwc_otg_init()
3806 temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); in dwc_otg_init()
3808 temp & ~GLPMCFG_HSIC_CONN); in dwc_otg_init()
3810 temp | GLPMCFG_HSIC_CONN); in dwc_otg_init()
3815 GUSBCFG_TRD_TIM_SET(5) | temp); in dwc_otg_init()
3818 temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); in dwc_otg_init()
3820 temp & ~GLPMCFG_HSIC_CONN); in dwc_otg_init()
3825 GUSBCFG_TRD_TIM_SET(5) | temp); in dwc_otg_init()
3828 temp = DWC_OTG_READ_4(sc, DOTG_GLPMCFG); in dwc_otg_init()
3830 temp & ~GLPMCFG_HSIC_CONN); in dwc_otg_init()
3832 temp = DWC_OTG_READ_4(sc, DOTG_GGPIO); in dwc_otg_init()
3833 temp &= ~(DOTG_GGPIO_NOVBUSSENS | DOTG_GGPIO_I2CPADEN); in dwc_otg_init()
3834 temp |= (DOTG_GGPIO_VBUSASEN | DOTG_GGPIO_VBUSBSEN | in dwc_otg_init()
3836 DWC_OTG_WRITE_4(sc, DOTG_GGPIO, temp); in dwc_otg_init()
3859 temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG3); in dwc_otg_init()
3861 sc->sc_fifo_size = 4 * GHWCFG3_DFIFODEPTH_GET(temp); in dwc_otg_init()
3863 temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); in dwc_otg_init()
3865 sc->sc_dev_ep_max = GHWCFG2_NUMDEVEPS_GET(temp); in dwc_otg_init()
3870 sc->sc_host_ch_max = GHWCFG2_NUMHSTCHNL_GET(temp); in dwc_otg_init()
3875 temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG4); in dwc_otg_init()
3877 sc->sc_dev_in_ep_max = GHWCFG4_NUM_IN_EP_GET(temp); in dwc_otg_init()
3896 temp = DWC_OTG_READ_4(sc, DOTG_GHWCFG2); in dwc_otg_init()
3897 if (temp & GHWCFG2_MPI) { in dwc_otg_init()
3916 temp = DWC_OTG_READ_4(sc, DOTG_HCFG); in dwc_otg_init()
3917 temp &= ~(HCFG_FSLSSUPP | HCFG_FSLSPCLKSEL_MASK); in dwc_otg_init()
3918 temp |= (1 << HCFG_FSLSPCLKSEL_SHIFT); in dwc_otg_init()
3919 DWC_OTG_WRITE_4(sc, DOTG_HCFG, temp); in dwc_otg_init()
3931 temp = DWC_OTG_READ_4(sc, DOTG_GOTGCTL); in dwc_otg_init()
3933 DPRINTFN(5, "GOTCTL=0x%08x\n", temp); in dwc_otg_init()
3936 (temp & (GOTGCTL_ASESVLD | GOTGCTL_BSESVLD)) ? 1 : 0); in dwc_otg_init()
4068 uint32_t temp; in dwc_otg_device_isoc_start() local
4077 temp = DWC_OTG_READ_4(sc, DOTG_HFNUM); in dwc_otg_device_isoc_start()
4080 framenum = (temp & HFNUM_FRNUM_MASK); in dwc_otg_device_isoc_start()
4082 temp = DWC_OTG_READ_4(sc, DOTG_DSTS); in dwc_otg_device_isoc_start()
4085 framenum = DSTS_SOFFN_GET(temp); in dwc_otg_device_isoc_start()
4106 temp = (framenum - xfer->endpoint->isoc_next) & DWC_OTG_FRAME_MASK; in dwc_otg_device_isoc_start()
4108 if ((xfer->endpoint->is_synced == 0) || (temp < msframes)) { in dwc_otg_device_isoc_start()
4123 temp = (xfer->endpoint->isoc_next - framenum) & DWC_OTG_FRAME_MASK; in dwc_otg_device_isoc_start()
4129 usb_isoc_time_expand(&sc->sc_bus, framenum) + temp + msframes; in dwc_otg_device_isoc_start()