Lines Matching refs:sdh

96 extern void bcmsdh_waitfor_iodrain(void *sdh);
97 extern void bcmsdh_reject_ioreqs(void *sdh, bool reject);
98 extern bool bcmsdh_fatal_error(void *sdh);
283 bcmsdh_info_t *sdh; /* Handle for BCMSDH calls */ member
587 extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable);
634 } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
650 } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
698 #define PKT_AVAILABLE(bus, intstatus) (bcmsdh_get_dstatus(bus->sdh) & STATUS_F2_PKT_AVAILABLE)
704 uint32 dstatussw = bcmsdh_get_dstatus((void *)bus->sdh); \
705 uint32 dstatushw = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0, SPID_STATUS_REG, NULL); \
776 static bool dhdsdio_probe_attach(dhd_bus_t *bus, osl_t *osh, void *sdh,
778 static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh);
779 static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh);
796 static int dhdsdio_download_firmware(dhd_bus_t *bus, osl_t *osh, void *sdh);
817 static int dhdsdio_download_btfw(struct dhd_bus *bus, osl_t *osh, void *sdh);
852 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, wm, &err); in dhdsdio_tune_fifoparam()
854 devctl = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_tune_fifoparam()
856 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_tune_fifoparam()
861 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, in dhdsdio_tune_fifoparam()
866 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err), in dhdsdio_tune_fifoparam()
867 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, &err), in dhdsdio_tune_fifoparam()
868 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, &err))); in dhdsdio_tune_fifoparam()
887 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW, in dhdsdio_set_siaddr_window()
890 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRMID, in dhdsdio_set_siaddr_window()
893 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRHIGH, in dhdsdio_set_siaddr_window()
904 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_wkwlan() local
908 regdata = bcmsdh_cfg_read_word(sdh, SDIO_FUNC_0, SPID_CONFIG, NULL); in dhdsdio_wkwlan()
916 bcmsdh_cfg_write_word(sdh, SDIO_FUNC_0, SPID_CONFIG, regdata, &err); in dhdsdio_wkwlan()
927 bcmsdh_gpioouten(bus->sdh, GPIO_DEV_WAKEUP); in dhdsdio_oobwakeup_init()
933 bcmsdh_reg_write(bus->sdh, addr, 4, 2); in dhdsdio_oobwakeup_init()
934 val = bcmsdh_reg_read(bus->sdh, data, 4); in dhdsdio_oobwakeup_init()
936 bcmsdh_reg_write(bus->sdh, data, 4, val); in dhdsdio_oobwakeup_init()
965 if (bcmsdh_reg_read(bus->sdh, addr, 4) != 0) in dhdsdio_sr_cap()
989 core_capext = bcmsdh_reg_read(bus->sdh, in dhdsdio_sr_cap()
1007 bcmsdh_reg_write(bus->sdh, addr, 4, CC_PMUCC3); in dhdsdio_sr_cap()
1008 enabval = bcmsdh_reg_read(bus->sdh, data, 4); in dhdsdio_sr_cap()
1019 data = bcmsdh_reg_read(bus->sdh, in dhdsdio_sr_cap()
1038 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1040 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, in dhdsdio_sr_init()
1042 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1044 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1046 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, in dhdsdio_sr_init()
1048 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WAKEUPCTRL, NULL); in dhdsdio_sr_init()
1078 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhdsdio_sr_init()
1081 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhdsdio_sr_init()
1108 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, NULL); in dhdsdio_clk_kso_init()
1111 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, val, &err); in dhdsdio_clk_kso_init()
1140 struct sdioh_info *sd = (struct sdioh_info *)(bus->sdh->sdioh); in dhdsdio_clk_kso_enab()
1165 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); in dhdsdio_clk_kso_enab()
1190 rd_val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); in dhdsdio_clk_kso_enab()
1201 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, wr_val, &err); in dhdsdio_clk_kso_enab()
1243 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_kso_iovar()
1273 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SLEEPCSR, &err); in dhdsdio_sleepcsr_get()
1283 return bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_BRCM_CARDCAP, NULL); in dhdsdio_devcap_get()
1291 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_BRCM_CARDCAP, cap, &err); in dhdsdio_devcap_set()
1315 val = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_clk_devsleep_iovar()
1321 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhdsdio_clk_devsleep_iovar()
1324 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1330 bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1333 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1345 err = bcmsdh_gpioout(bus->sdh, GPIO_DEV_WAKEUP, FALSE); /* GPIO_1 is off */ in dhdsdio_clk_devsleep_iovar()
1362 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1368 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1370 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1377 err = bcmsdh_sleep(bus->sdh, TRUE); in dhdsdio_clk_devsleep_iovar()
1379 err = bcmsdh_sleep(bus->sdh, FALSE); in dhdsdio_clk_devsleep_iovar()
1391 err = bcmsdh_gpioout(bus->sdh, GPIO_DEV_WAKEUP, TRUE); /* GPIO_1 is on */ in dhdsdio_clk_devsleep_iovar()
1429 (((csr = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, in dhdsdio_clk_devsleep_iovar()
1463 bcmsdh_info_t *sdh; in dhdsdio_htclk() local
1468 sdh = bus->sdh; in dhdsdio_htclk()
1486 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err); in dhdsdio_htclk()
1505 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhdsdio_htclk()
1515 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1523 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1532 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1534 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1541 ((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, in dhdsdio_htclk()
1582 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err); in dhdsdio_htclk()
1584 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err); in dhdsdio_htclk()
1589 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err); in dhdsdio_htclk()
1610 err = bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0, in dhdsdio_set_sdmode()
1634 err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0, in dhdsdio_sdclk()
1645 err = bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhdsdio_sdclk()
1663 err = bcmsdh_iovar_op(bus->sdh, "sd_clock", NULL, 0, in dhdsdio_sdclk()
1673 err = bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhdsdio_sdclk()
1807 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_bussleep() local
1858 bcmsdh_intr_disable(bus->sdh); in dhdsdio_bussleep()
1871 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhdsdio_bussleep()
1875 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, in dhdsdio_bussleep()
1888 err = bcmsdh_iovar_op(bus->sdh, "sd3_tuning_disable", NULL, 0, in dhdsdio_bussleep()
1898 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0, &err); in dhdsdio_bussleep()
1901 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, 0, NULL); in dhdsdio_bussleep()
1920 bcmsdh_intr_enable(bus->sdh); in dhdsdio_bussleep()
1946 err = bcmsdh_iovar_op(bus->sdh, "sd3_tuning_disable", NULL, 0, in dhdsdio_bussleep()
2070 bcmsdh_intr_enable(bus->sdh); in dhd_enable_oob_intr()
2072 bcmsdh_enable_hw_oob_intr(bus->sdh, enable); in dhd_enable_oob_intr()
2529 bcmsdh_info_t *sdh; in dhdsdio_txpkt() local
2546 sdh = bus->sdh; in dhdsdio_txpkt()
2600 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_txpkt()
2745 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_sendfromq()
2774 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_sendpendctl() local
2788 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_sendpendctl()
2887 if (!TXCTLOK(bus) || !dhd_ulp_f2_ready(bus->dhd, bus->sdh)) in dhd_bus_txctl()
2956 dhd_ulp_enable_cached_sbwad(bus->dhd, bus->sdh); in dhd_bus_txctl()
3242 bcmsdh_get_total_wake(bus->sdh), bus->wake_counts.rxwake, in dhd_bus_dump()
3330 bus->dpc_sched, (bcmsdh_intr_pending(bus->sdh) ? " " : " not ")); in dhd_bus_dump()
3477 if ((bcmerror = bcmsdh_rwdata(bus->sdh, write, offset, bus->membuf, nbytes))) { in dhdsdio_membytes()
3495 if ((bcmerror = bcmsdh_rwdata(bus->sdh, write, sdaddr, data, dsize))) { in dhdsdio_membytes()
3516 if (dhdsdio_set_siaddr_window(bus, bcmsdh_cur_sbwad(bus->sdh))) { in dhdsdio_membytes()
3518 bcmsdh_cur_sbwad(bus->sdh))); in dhdsdio_membytes()
4104 bcmsdh_reg_write(bus->sdh, addr, 4, 1); in dhd_serialconsole()
4105 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4109 int_val = bcmsdh_reg_read(bus->sdh, data, 4); in dhd_serialconsole()
4110 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4121 bcmsdh_reg_write(bus->sdh, data, 4, int_val); in dhd_serialconsole()
4122 if (bcmsdh_regfail(bus->sdh)) { in dhd_serialconsole()
4210 bcmsdh_intr_enable(bus->sdh); in dhdsdio_doiovar()
4213 bcmsdh_intr_disable(bus->sdh); in dhdsdio_doiovar()
4446 int_val = (int32)bcmsdh_reg_read(bus->sdh, addr, size); in dhdsdio_doiovar()
4447 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4463 bcmsdh_reg_write(bus->sdh, addr, size, sd_ptr->value); in dhdsdio_doiovar()
4464 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4479 int_val = (int32)bcmsdh_reg_read(bus->sdh, addr, size); in dhdsdio_doiovar()
4480 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4495 bcmsdh_reg_write(bus->sdh, addr, size, sdreg.value); in dhdsdio_doiovar()
4496 if (bcmsdh_regfail(bus->sdh)) in dhdsdio_doiovar()
4506 bcmsdh_cis_read(bus->sdh, 0x10, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
4508 bcmsdh_cis_read(bus->sdh, 0x11, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
4510 bcmsdh_cis_read(bus->sdh, 0x12, (uint8 *)arg + strlen(arg), SBSDIO_CIS_SIZE_LIMIT); in dhdsdio_doiovar()
4595 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, (uint8)watermark, NULL); in dhdsdio_doiovar()
4608 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_MESBUSYCTRL, in dhdsdio_doiovar()
4880 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
4892 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
5111 if (bcmsdh_regfail(bus->sdh)) { in dhdsdio_download_state()
5319 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, offset, ((*buffer) >> 0) in dhdsdio_cfg_write_buffer()
5322 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, offset+1, ((*buffer) >> 8) in dhdsdio_cfg_write_buffer()
5326 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, offset+2, ((*buffer) >> 16) in dhdsdio_cfg_write_buffer()
5330 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, offset+3, ((*buffer) >> 24) in dhdsdio_cfg_write_buffer()
5340 *buffer = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, offset+0, NULL) << 0; in dhdsdio_cfg_read_buffer()
5341 *buffer = *buffer | bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, offset+1, NULL) << 8; in dhdsdio_cfg_read_buffer()
5342 *buffer = *buffer | bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, offset+2, NULL) << 16; in dhdsdio_cfg_read_buffer()
5343 *buffer = *buffer | bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, offset+3, NULL) << 24; in dhdsdio_cfg_read_buffer()
5410 bcmerror = bcmsdh_iovar_op(bus->sdh, name, params, plen, arg, len, set); in dhd_bus_iovar_op()
5416 if (bcmsdh_iovar_op(bus->sdh, "sd_divisor", NULL, 0, in dhd_bus_iovar_op()
5427 if (bcmsdh_iovar_op(bus->sdh, "sd_mode", NULL, 0, in dhd_bus_iovar_op()
5439 if (bcmsdh_iovar_op(bus->sdh, "sd_blocksize", &fnum, sizeof(int32), in dhd_bus_iovar_op()
5507 bcmsdh_waitlockfree(bus->sdh); in dhd_bus_stop()
5517 bcmsdh_intr_disable(bus->sdh); in dhd_bus_stop()
5539 saveclk = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhd_bus_stop()
5541 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_stop()
5551 bcmsdh_intr_disable(bus->sdh); in dhd_bus_stop()
5553 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, SDIO_FUNC_ENABLE_1, NULL); in dhd_bus_stop()
5693 dstatus = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0, SPID_STATUS_REG, NULL); in dhd_bus_init()
5710 saveclk = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err); in dhd_bus_init()
5716 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_init()
5719 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, in dhd_bus_init()
5735 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, NULL); in dhd_bus_init()
5742 ready = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL); in dhd_bus_init()
5774 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK, in dhd_bus_init()
5794 bcmsdh_intr_enable(bus->sdh); in dhd_bus_init()
5798 bcmsdh_intr_disable(bus->sdh); in dhd_bus_init()
5808 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, NULL); in dhd_bus_init()
5826 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, in dhd_bus_init()
5856 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_rxfail() local
5872 bcmsdh_abort(sdh, SDIO_FUNC_2); in dhdsdio_rxfail()
5875 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM, &err); in dhdsdio_rxfail()
5884 hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCHI, NULL); in dhdsdio_rxfail()
5885 lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCLO, &err); in dhdsdio_rxfail()
5923 if (err || bcmsdh_regfail(sdh)) { in dhdsdio_rxfail()
5932 bcmsdh_info_t *sdh = bus->sdh; in dhdsdio_read_control() local
5998 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC, in dhdsdio_read_control()
6164 bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_rxglom()
6169 bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2, in dhdsdio_rxglom()
6458 bcmsdh_info_t *sdh = bus->sdh; local
6513 dstatus = bcmsdh_get_dstatus(bus->sdh);
6520 bcmsdh_get_dstatus((void *)bus->sdh)));
6630 bcmsdh_cur_sbwad(sdh),
6638 if (bcmsdh_get_dstatus((void *)bus->sdh) &
6680 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh),
6687 if (bcmsdh_get_dstatus((void *)bus->sdh) & STATUS_UNDERFLOW) {
6794 dstatus = bcmsdh_get_dstatus((void *)bus->sdh);
6796 bcmsdh_get_dstatus((void *)bus->sdh)));
6927 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC,
7081 sdret = dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC,
7306 bcmsdh_info_t *sdh = bus->sdh; local
7349 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err);
7360 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err);
7370 devctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err);
7378 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err);
7407 if (bcmsdh_regfail(bus->sdh))
7450 bcmsdh_force_sbwad_calc(bus->sdh, FALSE);
7452 if (dhd_ulp_pre_redownload_check(bus->dhd, bus->sdh, hmbdata)) {
7528 if (bus->intr && bus->intdis && !bcmsdh_regfail(sdh)) {
7533 bcmsdh_oob_intr_set(bus->sdh, TRUE);
7535 bcmsdh_intr_enable(sdh);
7538 bcmsdh_oob_intr_set(bus->sdh, TRUE);
7550 if (bcmsdh_regfail(bus->sdh))
7570 if (dhd_ulp_f2_ready(bus->dhd, bus->sdh)) {
7591 if ((bus->dhd->busstate == DHD_BUS_DOWN) || bcmsdh_regfail(sdh)) {
7670 bcmsdh_info_t *sdh; local
7678 sdh = bus->sdh;
7709 bcmsdh_oob_intr_set(bus->sdh, FALSE);
7711 bcmsdh_intr_disable(sdh);
8033 err = bcmsdh_oob_intr_register(dhdp->bus->sdh, dhdsdio_isr, dhdp->bus);
8041 bcmsdh_oob_intr_unregister(dhdp->bus->sdh);
8048 bcmsdh_oob_intr_set(dhdp->bus->sdh, enable);
8054 bcmsdh_dev_pm_stay_awake(dhdpub->bus->sdh);
8059 bcmsdh_dev_relax(dhdpub->bus->sdh);
8066 enabled = bcmsdh_dev_pm_enabled(dhdpub->bus->sdh);
8116 devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0,
8123 devpend = bcmsdh_cfg_read_word(bus->sdh, SDIO_FUNC_0,
8134 bcmsdh_intr_disable(bus->sdh);
8386 uint16 func, uint bustype, void *regsva, osl_t * osh, void *sdh) argument
8466 if (!(osh = osl_attach(sdh, DHD_BUS, TRUE))) {
8482 bus->sdh = sdh;
8498 if (!(dhdsdio_probe_attach(bus, osh, sdh, regsva, devid))) {
8510 if (!(dhdsdio_probe_malloc(bus, osh, sdh))) {
8515 if (!(dhdsdio_probe_init(bus, osh, sdh))) {
8523 bcmsdh_intr_disable(sdh);
8524 if ((ret = bcmsdh_intr_reg(sdh, dhdsdio_isr, bus)) != 0) {
8575 bcmsdh_reg_write(bus->sdh, 0x18000620, 2, 11);
8576 bcmsdh_reg_write(bus->sdh, 0x18000628, 4, 0x00F80001);
8599 dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, argument
8620 spidreg = bcmsdh_cfg_read_word(sdh, SDIO_FUNC_0, SPID_RESET_BP, NULL);
8653 bus->regs = si_get_sdio_addrbase(sdh);
8667 bcmsdh_reg_read(bus->sdh, si_enum_base(devid), 4)));
8675 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, DHD_INIT_CLKCTL1, &err);
8677 clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err);
8691 if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fn, sizeof(int32),
8704 if (bcmsdh_iovar_op(sdh, "sd_blocksize", NULL, 0, &value,
8713 numfn = bcmsdh_query_iofnum(sdh);
8717 SPINWAIT(((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
8722 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
8733 if ((err = bcmsdh_cis_read(sdh, fn, cis[fn],
8752 if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fn, sizeof(int32),
8765 if (bcmsdh_iovar_op(sdh, "sd_blocksize", NULL, 0, &value,
8789 if (bcmsdh_iovar_op(sdh, "sd_blocksize",
8818 if (!(bus->sih = si_attach((uint)devid, osh, regsva, DHD_BUS, sdh,
8833 bcmsdh_chipinfo(sdh, bus->sih->chip, bus->sih->chiprev);
8901 if (bcmsdh_iovar_op(sdh, "sd_blocksize",
9013 dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh) argument
9065 dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh) argument
9079 bcmsdh_cfg_write(sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, SDIO_FUNC_ENABLE_1, NULL);
9090 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
9099 if (bcmsdh_iovar_op(sdh, "sd_divisor", NULL, 0,
9109 if (bcmsdh_iovar_op(sdh, "sd_mode", NULL, 0,
9120 if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(int32),
9148 if (bcmsdh_iovar_op(sdh, "sd_rxchain", NULL, 0,
9172 ret = dhdsdio_download_firmware(bus, osh, bus->sdh);
9178 bcmsdh_dwordmode(bus->sdh, TRUE);
9188 dhdsdio_download_firmware(struct dhd_bus *bus, osl_t *osh, void *sdh) argument
9238 bcmsdh_intr_disable(bus->sdh);
9239 bcmsdh_intr_dereg(bus->sdh);
9345 cardctl = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0,
9349 bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0,
9354 bcmerror = bcmsdh_abort(bus->sdh, SDIO_FUNC_0 | 0x8);
9506 bcmsdh_oob_intr_set(bus->sdh, TRUE);
9907 status = bcmsdh_recv_buf(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete_fn, handle);
9919 bcmsdh_info_t *sdh; local
9926 sdh = bus->sdh;
9929 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_CHIP_CTRL_DATA, 0x80, NULL);
9931 ret = bcmsdh_send_buf(bus->sdh, addr, fn, flags, buf, nbytes,
9946 bcmsdh_abort(sdh, SDIO_FUNC_2);
9947 bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL,
9951 hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WFRAMEBCHI,
9953 lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_WFRAMEBCLO,
9969 bcmsdh_info_t *sdh; local
9973 sdh = bus->sdh;
9974 return (enable == bcmsdh_cfg_read(sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL));
10076 bcmsdh_oob_intr_set(bus->sdh, FALSE);
10077 bcmsdh_oob_intr_unregister(bus->sdh);
10109 bcmsdh_reset(bus->sdh);
10111 if (dhdsdio_probe_attach(bus, bus->dhd->osh, bus->sdh,
10121 if (dhdsdio_probe_init(bus, bus->dhd->osh, bus->sdh) &&
10122 dhdsdio_download_firmware(bus, bus->dhd->osh, bus->sdh) >= 0) {
10129 bcmsdh_oob_intr_register(bus->sdh,
10131 bcmsdh_oob_intr_set(bus->sdh, TRUE);
10180 return bcmsdh_stop(dhdpub->bus->sdh);
10185 return bcmsdh_start(dhdpub->bus->sdh, stage);
10526 rval = bcmsdh_reg_read(bus->sdh, addr, 4);
10542 bcmsdh_reg_write(bus->sdh, addr, 4, val);
10558 intrd = bcmsdh_cfg_read(bus->sdh, fun_num, addr, err);
10572 bcmsdh_cfg_write(bus->sdh, fun_num, addr, val, err);
10686 bcmsdh_reg_write(bus->sdh, bt2wlan_pwrup_adr, 4, BT2WLAN_PWRUP_WAKE);
10714 start_data = bcmsdh_reg_read(bus->sdh, start_addr, 4);
10728 end_data = bcmsdh_reg_read(bus->sdh, end_addr, 4);
10785 dhdsdio_download_btfw(struct dhd_bus *bus, osl_t *osh, void *sdh) argument
10811 ret = dhdsdio_download_btfw(bus, osh, bus->sdh);
10840 ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(((dhd_bus_t*)bus)->sdh),
10860 bcmsdh_reg_write(bus->sdh, SI_ENUM_BASE(bus->sih) + 0x618, 4, 0x3fcaf377);
10861 if (bcmsdh_regfail(bus->sdh)) {
10868 bcmsdh_reg_write(bus->sdh,
10871 if (bcmsdh_regfail(bus->sdh)) {
10890 bcmsdh_reg_write(bus->sdh, si_get_pmu_reg_addr(bus->sih,
10892 if (bcmsdh_regfail(bus->sdh)) {
10939 bcmsdh_oob_intr_set(bus->sdh, TRUE);
10965 *data = (int32)bcmsdh_reg_read(bus->sdh, addr, size);
10967 bcmsdh_reg_write(bus->sdh, addr, size, *data);
10970 if (bcmsdh_regfail(bus->sdh))
10990 return bcmsdh_set_get_wake(dhd->bus->sdh, 0);