Lines Matching refs:sdh
98 extern void bcmsdh_waitfor_iodrain(void *sdh);
99 extern void bcmsdh_reject_ioreqs(void *sdh, bool reject);
100 extern bool bcmsdh_fatal_error(void *sdh);
281 bcmsdh_info_t *sdh; /* Handle for BCMSDH calls */ member
626 extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable);
693 } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
709 } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
753 #define PKT_AVAILABLE(bus, intstatus) (bcmsdh_get_dstatus(bus->sdh) & STATUS_F2_PKT_AVAILABLE)
759 uint32 dstatussw = bcmsdh_get_dstatus((void *)bus->sdh); \
760 uint32 dstatushw = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0, SPID_STATUS_REG, NULL); \
808 static bool dhdsdio_probe_attach(dhd_bus_t *bus, osl_t *osh, void *sdh,
810 static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh);
811 static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh);
832 static int dhdsdio_download_firmware(dhd_bus_t *bus, osl_t *osh, void *sdh);
857 static int dhdsdio_download_btfw(struct dhd_bus *bus, osl_t *osh, void *sdh);
898 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, wm, &err); in dhdsdio_tune_fifoparam()
900 devctl = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_tune_fifoparam()
902 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_tune_fifoparam()
907 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, in dhdsdio_tune_fifoparam()
912 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err), in dhdsdio_tune_fifoparam()
913 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, &err), in dhdsdio_tune_fifoparam()
914 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, &err))); in dhdsdio_tune_fifoparam()
933 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW, in dhdsdio_set_siaddr_window()
936 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRMID, in dhdsdio_set_siaddr_window()
939 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRHIGH, in dhdsdio_set_siaddr_window()
950 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_wkwlan() local
956 regdata = bcmsdh_cfg_read_word(sdh, SDIO_FUNC_0, SPID_CONFIG, NULL); in dhdsdio_wkwlan()
964 bcmsdh_cfg_write_word(sdh, SDIO_FUNC_0, SPID_CONFIG, regdata, &err); in dhdsdio_wkwlan()
975 bcmsdh_gpioouten(bus->sdh, GPIO_DEV_WAKEUP); in dhdsdio_oobwakeup_init()
981 bcmsdh_reg_write(bus->sdh, addr, 4, 2); in dhdsdio_oobwakeup_init()
982 val = bcmsdh_reg_read(bus->sdh, data, 4); in dhdsdio_oobwakeup_init()
984 bcmsdh_reg_write(bus->sdh, data, 4, val); in dhdsdio_oobwakeup_init()
1006 if (bcmsdh_reg_read(bus->sdh, addr, 4) != 0) in dhdsdio_sr_cap()
1041 core_capext = bcmsdh_reg_read(bus->sdh, in dhdsdio_sr_cap()
1066 bcmsdh_reg_write(bus->sdh, addr, 4, CC_PMUCC3); in dhdsdio_sr_cap()
1067 enabval = bcmsdh_reg_read(bus->sdh, data, 4); in dhdsdio_sr_cap()
1084 data = bcmsdh_reg_read(bus->sdh, in dhdsdio_sr_cap()
1103 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1105 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, in dhdsdio_sr_init()
1107 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1109 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1111 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, in dhdsdio_sr_init()
1113 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1136 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhdsdio_sr_init()
1139 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhdsdio_sr_init()
1167 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, NULL); in dhdsdio_clk_kso_init()
1170 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, val, &err); in dhdsdio_clk_kso_init()
1209 struct sdioh_info *sd = (struct sdioh_info *)(bus->sdh->sdioh); in dhdsdio_clk_kso_enab()
1229 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); in dhdsdio_clk_kso_enab()
1255 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, in dhdsdio_clk_kso_enab()
1260 rd_val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); in dhdsdio_clk_kso_enab()
1290 rd_val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); in dhdsdio_clk_kso_enab()
1301 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); in dhdsdio_clk_kso_enab()
1369 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_kso_iovar()
1399 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); in dhdsdio_sleepcsr_get()
1410 return bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_BRCM_CARDCAP, NULL); in dhdsdio_devcap_get()
1418 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_BRCM_CARDCAP, cap, &err); in dhdsdio_devcap_set()
1446 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_clk_devsleep_iovar()
1452 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhdsdio_clk_devsleep_iovar()
1455 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1461 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1464 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1477 err = bcmsdh_gpioout(bus->sdh, GPIO_DEV_WAKEUP, FALSE); /* GPIO_1 is off */ in dhdsdio_clk_devsleep_iovar()
1495 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1505 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1507 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1518 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1520 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1537 err = bcmsdh_gpioout(bus->sdh, GPIO_DEV_WAKEUP, TRUE); /* GPIO_1 is on */ in dhdsdio_clk_devsleep_iovar()
1583 (((csr = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1617 bcmsdh_info_t *sdh; in dhdsdio_htclk() local
1622 sdh = bus->sdh; in dhdsdio_htclk()
1653 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err); in dhdsdio_htclk()
1672 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_htclk()
1682 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1690 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1699 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1701 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1708 ((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, in dhdsdio_htclk()
1753 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1755 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1760 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err); in dhdsdio_htclk()
1781 err = bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0, in dhdsdio_set_sdmode()
1805 err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0, in dhdsdio_sdclk()
1816 err = bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhdsdio_sdclk()
1834 err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0, in dhdsdio_sdclk()
1844 err = bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhdsdio_sdclk()
1977 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_bussleep() local
2040 bcmsdh_intr_disable(bus->sdh); in dhdsdio_bussleep()
2053 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhdsdio_bussleep()
2057 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, in dhdsdio_bussleep()
2076 err = bcmsdh_iovar_op(bus->sdh, "sd3_tuning_disable", NULL, 0, in dhdsdio_bussleep()
2088 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0, &err); in dhdsdio_bussleep()
2091 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, 0, NULL); in dhdsdio_bussleep()
2113 bcmsdh_intr_enable(bus->sdh); in dhdsdio_bussleep()
2145 err = bcmsdh_iovar_op(bus->sdh, "sd3_tuning_disable", NULL, 0, in dhdsdio_bussleep()
2269 bcmsdh_intr_enable(bus->sdh); in dhd_enable_oob_intr()
2271 bcmsdh_enable_hw_oob_intr(bus->sdh, enable); in dhd_enable_oob_intr()
2781 bcmsdh_info_t *sdh; in dhdsdio_txpkt() local
2798 sdh = bus->sdh; in dhdsdio_txpkt()
2861 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_txpkt()
3010 + bcmsdh_get_spend_time(bus->sdh))/(bus->tx_statics.glom_cnt[num_pkt-1] + 1); in dhdsdio_sendfromq()
3028 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_sendfromq()
3059 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_sendpendctl() local
3073 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_sendpendctl()
3609 bcmsdh_get_total_wake(bus->sdh), bus->wake_counts.rxwake, in dhd_bus_dump()
3698 bus->dpc_sched, (bcmsdh_intr_pending(bus->sdh) ? " " : " not ")); in dhd_bus_dump()
3851 if ((bcmerror = bcmsdh_rwdata(bus->sdh, write, sdaddr, pdata, dsize))) { in dhdsdio_membytes()
3874 if (dhdsdio_set_siaddr_window(bus, bcmsdh_cur_sbwad(bus->sdh))) { in dhdsdio_membytes()
3876 bcmsdh_cur_sbwad(bus->sdh))); in dhdsdio_membytes()
4458 bcmsdh_reg_write(bus->sdh, addr, 4, 1); in dhd_serialconsole()
4459 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4463 int_val = bcmsdh_reg_read(bus->sdh, data, 4); in dhd_serialconsole()
4464 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4475 bcmsdh_reg_write(bus->sdh, data, 4, int_val); in dhd_serialconsole()
4476 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4581 bcmsdh_intr_enable(bus->sdh); in dhdsdio_doiovar()
4584 bcmsdh_intr_disable(bus->sdh); in dhdsdio_doiovar()
4776 int_val = (int32)bcmsdh_reg_read(bus->sdh, addr, size); in dhdsdio_doiovar()
4777 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4793 bcmsdh_reg_write(bus->sdh, addr, size, sd_ptr->value); in dhdsdio_doiovar()
4794 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4810 int_val = (int32)bcmsdh_reg_read(bus->sdh, addr, size); in dhdsdio_doiovar()
4811 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4826 bcmsdh_reg_write(bus->sdh, addr, size, sdreg.value); in dhdsdio_doiovar()
4827 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4838 bcmsdh_cis_read(bus->sdh, 0x10, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
4840 bcmsdh_cis_read(bus->sdh, 0x11, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
4842 bcmsdh_cis_read(bus->sdh, 0x12, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
5001 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, (uint8)watermark, NULL); in dhdsdio_doiovar()
5014 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, in dhdsdio_doiovar()
5044 bcmsdh_intr_enable(bus->sdh); in dhdsdio_doiovar()
5081 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_doiovar()
5084 ret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_doiovar()
5111 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
5138 bcmsdh_reset(bus->sdh); in dhdsdio_doiovar()
5143 bcmsdh_abort(bus->sdh, int_val); in dhdsdio_doiovar()
5459 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
5471 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
5602 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
5651 bcmerror = bcmsdh_iovar_op(bus->sdh, name, params, plen, arg, len, set); in dhd_bus_iovar_op()
5657 if (bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhd_bus_iovar_op()
5668 if (bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0, in dhd_bus_iovar_op()
5680 if (bcmsdh_iovar_op(bus->sdh, "sd_blocksize", &fnum, sizeof(int32), in dhd_bus_iovar_op()
5747 bcmsdh_waitlockfree(bus->sdh); in dhd_bus_stop()
5757 bcmsdh_intr_disable(bus->sdh); in dhd_bus_stop()
5773 saveclk = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhd_bus_stop()
5775 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_stop()
5788 bcmsdh_intr_disable(bus->sdh); /* XXX bcmsdh_intr_mask(bus->sdh); */ in dhd_bus_stop()
5791 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, SDIO_FUNC_ENABLE_1, NULL); in dhd_bus_stop()
5893 bcmsdh_set_mode(bus->sdh, bus->dhd->conf->txglom_mode); in dhd_txglom_enable()
5943 dstatus = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0, SPID_STATUS_REG, NULL); in dhd_bus_init()
5960 saveclk = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhd_bus_init()
5968 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_init()
5973 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_init()
5990 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, NULL); in dhd_bus_init()
6001 ready = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL); in dhd_bus_init()
6010 intr_extn = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTR_EXTN, NULL); in dhd_bus_init()
6013 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTR_EXTN, intr_extn, NULL); in dhd_bus_init()
6050 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, in dhd_bus_init()
6068 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, in dhd_bus_init()
6072 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, in dhd_bus_init()
6091 bcmsdh_intr_enable(bus->sdh); in dhd_bus_init()
6095 bcmsdh_intr_disable(bus->sdh); in dhd_bus_init()
6105 hostpending = bcmsdh_intr_pending(bus->sdh); in dhd_bus_init()
6106 devena = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTEN, NULL); in dhd_bus_init()
6107 devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTPEND, NULL); in dhd_bus_init()
6129 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, NULL); in dhd_bus_init()
6140 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhd_bus_init()
6160 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_rxfail() local
6176 bcmsdh_abort(sdh, SDIO_FUNC_2); in dhdsdio_rxfail()
6179 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM, &err); in dhdsdio_rxfail()
6188 hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCHI, NULL); in dhdsdio_rxfail()
6189 lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCLO, &err); in dhdsdio_rxfail()
6227 if (err || bcmsdh_regfail(sdh)) { in dhdsdio_rxfail()
6236 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_read_control() local
6304 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_read_control()
6470 bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_rxglom()
6475 bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_rxglom()
6764 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_readframes() local
6819 dstatus = bcmsdh_get_dstatus(bus->sdh); in dhdsdio_readframes()
6826 bcmsdh_get_dstatus((void *)bus->sdh))); in dhdsdio_readframes()
6937 bcmsdh_cur_sbwad(sdh), in dhdsdio_readframes()
6948 if (bcmsdh_get_dstatus((void *)bus->sdh) & in dhdsdio_readframes()
6991 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), in dhdsdio_readframes()
7001 if (bcmsdh_get_dstatus((void *)bus->sdh) & STATUS_UNDERFLOW) { in dhdsdio_readframes()
7109 dstatus = bcmsdh_get_dstatus((void *)bus->sdh); in dhdsdio_readframes()
7111 bcmsdh_get_dstatus((void *)bus->sdh))); in dhdsdio_readframes()
7242 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_readframes()
7405 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_readframes()
7639 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_read_intstatus_byte() local
7655 if (!bcmsdh_regfail(bus->sdh)) { in dhdsdio_read_intstatus_byte()
7659 intstatus_byte = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_read_intstatus_byte()
7663 intstatus_byte = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_read_intstatus_byte()
7667 intstatus_byte |= bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_read_intstatus_byte()
7671 intstatus_byte |= bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_read_intstatus_byte()
7677 sdh->regfail = FALSE; in dhdsdio_read_intstatus_byte()
7691 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_dpc() local
7734 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_dpc()
7745 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_dpc()
7755 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_dpc()
7763 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_dpc()
7796 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_dpc()
7900 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7902 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7910 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7914 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7918 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7922 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7930 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7933 if (bcmsdh_regfail(bus->sdh)) regerrs++; in dhdsdio_dpc()
7963 if (bus->intr && bus->intdis && !bcmsdh_regfail(sdh) && in dhdsdio_dpc()
7969 bcmsdh_oob_intr_set(bus->sdh, TRUE); in dhdsdio_dpc()
7972 bcmsdh_intr_enable(sdh); in dhdsdio_dpc()
7976 bcmsdh_oob_intr_set(bus->sdh, TRUE); in dhdsdio_dpc()
7988 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_dpc()
8046 if ((bus->dhd->busstate == DHD_BUS_DOWN) || bcmsdh_regfail(sdh)) { in dhdsdio_dpc()
8094 if (bus->intr && bus->intdis && !bcmsdh_regfail(sdh) && in dhdsdio_dpc()
8100 bcmsdh_oob_intr_set(bus->sdh, TRUE); in dhdsdio_dpc()
8102 bcmsdh_intr_enable(sdh); in dhdsdio_dpc()
8157 bcmsdh_info_t *sdh; in dhdsdio_isr() local
8163 sdh = bus->sdh; in dhdsdio_isr()
8200 bcmsdh_oob_intr_set(bus->sdh, FALSE); in dhdsdio_isr()
8203 bcmsdh_intr_disable(sdh); /* XXX New API: bcmsdh_intr_mask()? */ in dhdsdio_isr()
8618 err = bcmsdh_oob_intr_register(dhdp->bus->sdh, dhdsdio_isr, dhdp->bus); in dhd_bus_oob_intr_register()
8626 bcmsdh_oob_intr_unregister(dhdp->bus->sdh); in dhd_bus_oob_intr_unregister()
8633 bcmsdh_oob_intr_set(dhdp->bus->sdh, enable); in dhd_bus_oob_intr_set()
8641 irq_num = bcmsdh_get_oob_intr_num(dhdp->bus->sdh); in dhd_bus_get_oob_irq_num()
8649 return (struct device *)bcmsdh_get_dev(bus->sdh); in dhd_bus_to_dev()
8656 bcmsdh_dev_pm_stay_awake(dhdpub->bus->sdh); in dhd_bus_dev_pm_stay_awake()
8663 bcmsdh_dev_relax(dhdpub->bus->sdh); in dhd_bus_dev_pm_relax()
8672 enabled = bcmsdh_dev_pm_enabled(dhdpub->bus->sdh); in dhd_bus_dev_pm_enabled()
8728 hostpending = bcmsdh_intr_pending(bus->sdh); in dhd_bus_watchdog()
8729 devena = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTEN, NULL); in dhd_bus_watchdog()
8730 devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_INTPEND, NULL); in dhd_bus_watchdog()
8745 devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, in dhd_bus_watchdog()
8752 devpend = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0, in dhd_bus_watchdog()
8763 bcmsdh_intr_disable(bus->sdh); in dhd_bus_watchdog()
9122 uint16 func, uint bustype, void *regsva, osl_t * osh, void *sdh) in dhdsdio_probe() argument
9208 bus->sdh = sdh; in dhdsdio_probe()
9225 if (!(dhdsdio_probe_attach(bus, osh, sdh, regsva, devid))) { in dhdsdio_probe()
9237 dhd_conf_get_otp(bus->dhd, sdh, bus->sih); in dhdsdio_probe()
9241 if (!(dhdsdio_probe_malloc(bus, osh, sdh))) { in dhdsdio_probe()
9246 if (!(dhdsdio_probe_init(bus, osh, sdh))) { in dhdsdio_probe()
9254 bcmsdh_intr_disable(sdh); /* XXX New API: bcmsdh_intr_mask()? */ in dhdsdio_probe()
9255 if ((ret = bcmsdh_intr_reg(sdh, dhdsdio_isr, bus)) != 0) { in dhdsdio_probe()
9311 bcmsdh_reg_write(bus->sdh, 0x18000620, 2, 11); in dhdsdio_probe()
9312 bcmsdh_reg_write(bus->sdh, 0x18000628, 4, 0x00F80001); in dhdsdio_probe()
9332 dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, in dhdsdio_probe_attach() argument
9350 bcmsdh_reg_read(bus->sdh, si_enum_base(devid), 4))); in dhdsdio_probe_attach()
9370 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, DHD_INIT_CLKCTL1, &err); in dhdsdio_probe_attach()
9372 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_probe_attach()
9389 numfn = bcmsdh_query_iofnum(sdh); in dhdsdio_probe_attach()
9393 SPINWAIT(((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, in dhdsdio_probe_attach()
9398 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhdsdio_probe_attach()
9413 if ((err = bcmsdh_cis_read(sdh, fn, cis, in dhdsdio_probe_attach()
9434 if (!(bus->sih = si_attach((uint)devid, osh, regsva, DHD_BUS, sdh, in dhdsdio_probe_attach()
9448 bcmsdh_chipinfo(sdh, bus->sih->chip, bus->sih->chiprev); in dhdsdio_probe_attach()
9624 dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh) in dhdsdio_probe_malloc() argument
9676 dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh) in dhdsdio_probe_init() argument
9692 bcmsdh_cfg_write(sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, SDIO_FUNC_ENABLE_1, NULL); in dhdsdio_probe_init()
9703 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL); in dhdsdio_probe_init()
9712 if (bcmsdh_iovar_op(sdh, "sd_divisor", NULL, 0, in dhdsdio_probe_init()
9722 if (bcmsdh_iovar_op(sdh, "sd_mode", NULL, 0, in dhdsdio_probe_init()
9733 if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(int32), in dhdsdio_probe_init()
9761 if (bcmsdh_iovar_op(sdh, "sd_rxchain", NULL, 0, in dhdsdio_probe_init()
9792 ret = dhdsdio_download_firmware(bus, osh, bus->sdh); in dhd_bus_download_firmware()
9845 dhdsdio_download_firmware(struct dhd_bus *bus, osl_t *osh, void *sdh) in dhdsdio_download_firmware() argument
9902 bcmsdh_intr_disable(bus->sdh); in dhdsdio_release()
9903 bcmsdh_intr_dereg(bus->sdh); in dhdsdio_release()
10128 bcmsdh_oob_intr_set(bus->sdh, TRUE); in dhdsdio_resume()
10819 status = bcmsdh_recv_buf(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete_fn, handle); in dhd_bcmsdh_recv_buf()
10831 bcmsdh_info_t *sdh; in dhd_bcmsdh_send_buf() local
10838 sdh = bus->sdh; in dhd_bcmsdh_send_buf()
10840 ret = bcmsdh_send_buf(bus->sdh, addr, fn, flags, buf, nbytes, in dhd_bcmsdh_send_buf()
10855 bcmsdh_abort(sdh, SDIO_FUNC_2); in dhd_bcmsdh_send_buf()
10856 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL, in dhd_bcmsdh_send_buf()
10860 hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WFRAMEBCHI, in dhd_bcmsdh_send_buf()
10862 lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WFRAMEBCLO, in dhd_bcmsdh_send_buf()
10878 bcmsdh_info_t *sdh; in dhd_bus_is_ioready() local
10882 sdh = bus->sdh; in dhd_bus_is_ioready()
10883 return (enable == bcmsdh_cfg_read(sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL)); in dhd_bus_is_ioready()
11015 bcmsdh_oob_intr_set(bus->sdh, FALSE); in dhd_bus_devreset()
11016 bcmsdh_oob_intr_unregister(bus->sdh); in dhd_bus_devreset()
11046 bcmsdh_reset(bus->sdh); in dhd_bus_devreset()
11049 if (dhdsdio_probe_attach(bus, bus->dhd->osh, bus->sdh, in dhd_bus_devreset()
11058 if (dhdsdio_probe_init(bus, bus->dhd->osh, bus->sdh) && in dhd_bus_devreset()
11059 dhdsdio_download_firmware(bus, bus->dhd->osh, bus->sdh) >= 0) { in dhd_bus_devreset()
11066 bcmsdh_oob_intr_register(bus->sdh, in dhd_bus_devreset()
11068 bcmsdh_oob_intr_set(bus->sdh, TRUE); in dhd_bus_devreset()
11108 dhd_conf_set_hw_oob_intr(bus->sdh, bus->sih); // terence 20120615: fix for OOB initial issue in dhd_bus_devreset()
11126 return bcmsdh_stop(dhdpub->bus->sdh); in dhd_bus_suspend()
11131 return bcmsdh_start(dhdpub->bus->sdh, stage); in dhd_bus_resume()
11390 bcmsdh_reject_ioreqs(dhdp->bus->sdh, reject); in dhd_bus_reject_ioreqs()
11399 bcmsdh_waitfor_iodrain(dhdp->bus->sdh); in dhd_bus_waitfor_iodrain()
11503 rval = bcmsdh_reg_read(bus->sdh, addr, 4); in dhd_sdio_reg_read()
11519 bcmsdh_reg_write(bus->sdh, addr, 4, val); in dhd_sdio_reg_write()
11560 intrd = bcmsdh_cfg_read(bus->sdh, fun_num, addr, err); in dhd_bus_cfg_read()
11574 bcmsdh_cfg_write(bus->sdh, fun_num, addr, val, err); in dhd_bus_cfg_write()
11690 bcmsdh_reg_write(bus->sdh, bt2wlan_pwrup_adr, 4, BT2WLAN_PWRUP_WAKE); in _dhdsdio_download_btfw()
11718 start_data = bcmsdh_reg_read(bus->sdh, start_addr, 4); in _dhdsdio_download_btfw()
11732 end_data = bcmsdh_reg_read(bus->sdh, end_addr, 4); in _dhdsdio_download_btfw()
11789 dhdsdio_download_btfw(struct dhd_bus *bus, osl_t *osh, void *sdh) in dhdsdio_download_btfw() argument
11815 ret = dhdsdio_download_btfw(bus, osh, bus->sdh); in dhd_bus_download_btfw()
11844 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(((dhd_bus_t*)bus)->sdh), in dhd_bcmsdh_send_buffer()
11864 bcmsdh_reg_write(bus->sdh, SI_ENUM_BASE(bus->sih) + 0x618, 4, 0x3fcaf377); in dhd_bus_set_default_min_res_mask()
11865 if (bcmsdh_regfail(bus->sdh)) { in dhd_bus_set_default_min_res_mask()
11874 bcmsdh_reg_write(bus->sdh, in dhd_bus_set_default_min_res_mask()
11877 if (bcmsdh_regfail(bus->sdh)) { in dhd_bus_set_default_min_res_mask()
11896 bcmsdh_reg_write(bus->sdh, si_get_pmu_reg_addr(bus->sih, in dhd_bus_pmu_reg_reset()
11898 if (bcmsdh_regfail(bus->sdh)) { in dhd_bus_pmu_reg_reset()
11910 *data = (int32)bcmsdh_reg_read(bus->sdh, addr, size); in dhd_bus_readwrite_bp_addr()
11912 bcmsdh_reg_write(bus->sdh, addr, size, *data); in dhd_bus_readwrite_bp_addr()
11915 if (bcmsdh_regfail(bus->sdh)) in dhd_bus_readwrite_bp_addr()
11938 return bcmsdh_set_get_wake(dhd->bus->sdh, 0); in dhd_bus_get_bus_wake()