Lines Matching +full:0 +full:xff0000
45 { PCI_DEVICE(0x10EC, 0x5209), PCI_CLASS_OTHERS << 16, 0xFF0000 },
46 { PCI_DEVICE(0x10EC, 0x5229), PCI_CLASS_OTHERS << 16, 0xFF0000 },
47 { PCI_DEVICE(0x10EC, 0x5289), PCI_CLASS_OTHERS << 16, 0xFF0000 },
48 { PCI_DEVICE(0x10EC, 0x5227), PCI_CLASS_OTHERS << 16, 0xFF0000 },
49 { PCI_DEVICE(0x10EC, 0x522A), PCI_CLASS_OTHERS << 16, 0xFF0000 },
50 { PCI_DEVICE(0x10EC, 0x5249), PCI_CLASS_OTHERS << 16, 0xFF0000 },
51 { PCI_DEVICE(0x10EC, 0x5287), PCI_CLASS_OTHERS << 16, 0xFF0000 },
52 { PCI_DEVICE(0x10EC, 0x5286), PCI_CLASS_OTHERS << 16, 0xFF0000 },
53 { PCI_DEVICE(0x10EC, 0x524A), PCI_CLASS_OTHERS << 16, 0xFF0000 },
54 { PCI_DEVICE(0x10EC, 0x525A), PCI_CLASS_OTHERS << 16, 0xFF0000 },
55 { PCI_DEVICE(0x10EC, 0x5260), PCI_CLASS_OTHERS << 16, 0xFF0000 },
56 { PCI_DEVICE(0x10EC, 0x5261), PCI_CLASS_OTHERS << 16, 0xFF0000 },
57 { PCI_DEVICE(0x10EC, 0x5228), PCI_CLASS_OTHERS << 16, 0xFF0000 },
58 { PCI_DEVICE(0x10EC, 0x5264), PCI_CLASS_OTHERS << 16, 0xFF0000 },
59 { 0, }
67 MASK_8_BIT_DEF, (u8) (latency & 0xFF)); in rtsx_comm_set_ltr_latency()
69 MASK_8_BIT_DEF, (u8)((latency >> 8) & 0xFF)); in rtsx_comm_set_ltr_latency()
71 MASK_8_BIT_DEF, (u8)((latency >> 16) & 0xFF)); in rtsx_comm_set_ltr_latency()
73 MASK_8_BIT_DEF, (u8)((latency >> 24) & 0xFF)); in rtsx_comm_set_ltr_latency()
77 return 0; in rtsx_comm_set_ltr_latency()
93 enable ? pcr->aspm_en : 0); in rtsx_comm_set_aspm()
95 if (pcr->aspm_en & 0x02) in rtsx_comm_set_aspm()
97 FORCE_ASPM_CTL1, enable ? 0 : FORCE_ASPM_CTL0 | FORCE_ASPM_CTL1); in rtsx_comm_set_aspm()
103 if (!enable && (pcr->aspm_en & 0x02)) in rtsx_comm_set_aspm()
119 rtsx_pci_write_register(pcr, L1SUB_CONFIG3, 0xFF, val); in rtsx_set_l1off_sub()
121 return 0; in rtsx_set_l1off_sub()
171 val |= (u32)(addr & 0x3FFF) << 16; in rtsx_pci_write_register()
177 for (i = 0; i < MAX_RW_REG_CNT; i++) { in rtsx_pci_write_register()
179 if ((val & HAIMR_TRANS_END) == 0) { in rtsx_pci_write_register()
182 return 0; in rtsx_pci_write_register()
195 val |= (u32)(addr & 0x3FFF) << 16; in rtsx_pci_read_register()
198 for (i = 0; i < MAX_RW_REG_CNT; i++) { in rtsx_pci_read_register()
200 if ((val & HAIMR_TRANS_END) == 0) in rtsx_pci_read_register()
208 *data = (u8)(val & 0xFF); in rtsx_pci_read_register()
210 return 0; in rtsx_pci_read_register()
216 int err, i, finished = 0; in __rtsx_pci_write_phy_register()
219 rtsx_pci_write_register(pcr, PHYDATA0, 0xFF, (u8)val); in __rtsx_pci_write_phy_register()
220 rtsx_pci_write_register(pcr, PHYDATA1, 0xFF, (u8)(val >> 8)); in __rtsx_pci_write_phy_register()
221 rtsx_pci_write_register(pcr, PHYADDR, 0xFF, addr); in __rtsx_pci_write_phy_register()
222 rtsx_pci_write_register(pcr, PHYRWCTL, 0xFF, 0x81); in __rtsx_pci_write_phy_register()
224 for (i = 0; i < 100000; i++) { in __rtsx_pci_write_phy_register()
226 if (err < 0) in __rtsx_pci_write_phy_register()
229 if (!(tmp & 0x80)) { in __rtsx_pci_write_phy_register()
238 return 0; in __rtsx_pci_write_phy_register()
252 int err, i, finished = 0; in __rtsx_pci_read_phy_register()
256 rtsx_pci_write_register(pcr, PHYADDR, 0xFF, addr); in __rtsx_pci_read_phy_register()
257 rtsx_pci_write_register(pcr, PHYRWCTL, 0xFF, 0x80); in __rtsx_pci_read_phy_register()
259 for (i = 0; i < 100000; i++) { in __rtsx_pci_read_phy_register()
261 if (err < 0) in __rtsx_pci_read_phy_register()
264 if (!(tmp & 0x80)) { in __rtsx_pci_read_phy_register()
280 return 0; in __rtsx_pci_read_phy_register()
300 rtsx_pci_write_register(pcr, DMACTL, 0x80, 0x80); in rtsx_pci_stop_cmd()
301 rtsx_pci_write_register(pcr, RBCTL, 0x80, 0x80); in rtsx_pci_stop_cmd()
309 u32 val = 0; in rtsx_pci_add_cmd()
312 val |= (u32)(cmd_type & 0x03) << 30; in rtsx_pci_add_cmd()
313 val |= (u32)(reg_addr & 0x3FFF) << 16; in rtsx_pci_add_cmd()
334 val |= (u32)(pcr->ci * 4) & 0x00FFFFFF; in rtsx_pci_send_cmd_no_wait()
336 val |= 0x40000000; in rtsx_pci_send_cmd_no_wait()
347 int err = 0; in rtsx_pci_send_cmd()
358 val |= (u32)(pcr->ci * 4) & 0x00FFFFFF; in rtsx_pci_send_cmd()
360 val |= 0x40000000; in rtsx_pci_send_cmd()
368 if (timeleft <= 0) { in rtsx_pci_send_cmd()
378 err = 0; in rtsx_pci_send_cmd()
388 if ((err < 0) && (err != -ENODEV)) in rtsx_pci_send_cmd()
405 pcr_dbg(pcr, "DMA addr: 0x%x, Len: 0x%x\n", (unsigned int)addr, len); in rtsx_pci_add_sg_tbl()
411 if (len > 0xFFFF) in rtsx_pci_add_sg_tbl()
412 val = ((u64)addr << 32) | (((u64)len & 0xFFFF) << 16) in rtsx_pci_add_sg_tbl()
426 int err = 0, count; in rtsx_pci_transfer_data()
450 if ((sglist == NULL) || (num_sg <= 0)) in rtsx_pci_dma_map_sg()
475 int i, err = 0; in rtsx_pci_dma_transfer()
485 val = ((u32)(dir & 0x01) << 29) | TRIG_DMA | ADMA_MODE; in rtsx_pci_dma_transfer()
486 pcr->sgi = 0; in rtsx_pci_dma_transfer()
505 if (timeleft <= 0) { in rtsx_pci_dma_transfer()
527 if ((err < 0) && (err != -ENODEV)) in rtsx_pci_dma_transfer()
549 for (i = 0; i < buf_len / 256; i++) { in rtsx_pci_read_ppbuf()
552 for (j = 0; j < 256; j++) in rtsx_pci_read_ppbuf()
553 rtsx_pci_add_cmd(pcr, READ_REG_CMD, reg++, 0, 0); in rtsx_pci_read_ppbuf()
556 if (err < 0) in rtsx_pci_read_ppbuf()
566 for (j = 0; j < buf_len % 256; j++) in rtsx_pci_read_ppbuf()
567 rtsx_pci_add_cmd(pcr, READ_REG_CMD, reg++, 0, 0); in rtsx_pci_read_ppbuf()
570 if (err < 0) in rtsx_pci_read_ppbuf()
576 return 0; in rtsx_pci_read_ppbuf()
592 for (i = 0; i < buf_len / 256; i++) { in rtsx_pci_write_ppbuf()
595 for (j = 0; j < 256; j++) { in rtsx_pci_write_ppbuf()
597 reg++, 0xFF, *ptr); in rtsx_pci_write_ppbuf()
602 if (err < 0) in rtsx_pci_write_ppbuf()
609 for (j = 0; j < buf_len % 256; j++) { in rtsx_pci_write_ppbuf()
611 reg++, 0xFF, *ptr); in rtsx_pci_write_ppbuf()
616 if (err < 0) in rtsx_pci_write_ppbuf()
620 return 0; in rtsx_pci_write_ppbuf()
628 while (*tbl & 0xFFFF0000) { in rtsx_pci_set_pull_ctl()
630 (u16)(*tbl >> 16), 0xFF, (u8)(*tbl)); in rtsx_pci_set_pull_ctl()
680 pcr_dbg(pcr, "RTSX_BIER: 0x%08x\n", pcr->bier); in rtsx_pci_enable_bus_int()
732 if (err < 0) in rtsx_pci_switch_clock()
752 return 0; in rtsx_pci_switch_clock()
791 0xFF, (div << 4) | mcu_cnt); in rtsx_pci_switch_clock()
792 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL1, SSC_RSTB, 0); in rtsx_pci_switch_clock()
795 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_DIV_N_0, 0xFF, n); in rtsx_pci_switch_clock()
799 PHASE_NOT_RESET, 0); in rtsx_pci_switch_clock()
805 if (err < 0) in rtsx_pci_switch_clock()
810 err = rtsx_pci_write_register(pcr, CLK_CTL, CLK_LOW_FREQ, 0); in rtsx_pci_switch_clock()
811 if (err < 0) in rtsx_pci_switch_clock()
815 return 0; in rtsx_pci_switch_clock()
824 return 0; in rtsx_pci_card_power_on()
833 return 0; in rtsx_pci_card_power_off()
852 return 0; in rtsx_pci_card_exclusive_check()
861 return 0; in rtsx_pci_switch_output_voltage()
901 unsigned int card_detect = 0, card_inserted, card_removed; in rtsx_pci_card_detect()
913 pcr_dbg(pcr, "irq_status: 0x%08x\n", irq_status); in rtsx_pci_card_detect()
918 pcr->card_inserted = 0; in rtsx_pci_card_detect()
919 pcr->card_removed = 0; in rtsx_pci_card_detect()
924 pcr_dbg(pcr, "card_inserted: 0x%x, card_removed: 0x%x\n", in rtsx_pci_card_detect()
956 rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, 0); in rtsx_pci_process_ocp()
958 pcr->ocp_stat = 0; in rtsx_pci_process_ocp()
968 return 0; in rtsx_pci_process_ocp_interrupt()
984 if ((int_reg & pcr->bier) == 0) { in rtsx_pci_isr()
988 if (int_reg == 0xFFFFFFFF) { in rtsx_pci_isr()
993 int_reg &= (pcr->bier | 0x7FFFFF); in rtsx_pci_isr()
1009 RTS5261_EXPRESS_LINK_FAIL_MASK, 0); in rtsx_pci_isr()
1013 pcr->dma_error_count = 0; in rtsx_pci_isr()
1051 pcr->msi_en ? 0 : IRQF_SHARED, in rtsx_pci_acquire_irq()
1062 return 0; in rtsx_pci_acquire_irq()
1067 /* Set relink_time to 0 */ in rtsx_base_force_power_down()
1068 rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 1, MASK_8_BIT_DEF, 0); in rtsx_base_force_power_down()
1069 rtsx_pci_write_register(pcr, AUTOLOAD_CFG_BASE + 2, MASK_8_BIT_DEF, 0); in rtsx_base_force_power_down()
1071 RELINK_TIME_MASK, 0); in rtsx_base_force_power_down()
1084 rtsx_pci_writel(pcr, RTSX_BIER, 0); in rtsx_pci_power_off()
1085 pcr->bier = 0; in rtsx_pci_power_off()
1087 rtsx_pci_write_register(pcr, PETXCFG, 0x08, 0x08); in rtsx_pci_power_off()
1088 rtsx_pci_write_register(pcr, HOST_SLEEP_STATE, 0x03, pm_state); in rtsx_pci_power_off()
1103 rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN, 0); in rtsx_pci_enable_ocp()
1104 rtsx_pci_write_register(pcr, REG_OCPCTL, 0xFF, val); in rtsx_pci_enable_ocp()
1116 rtsx_pci_write_register(pcr, REG_OCPCTL, mask, 0); in rtsx_pci_disable_ocp()
1132 rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN, 0); in rtsx_pci_init_ocp()
1162 rtsx_pci_write_register(pcr, REG_OCPCTL, mask, 0); in rtsx_pci_clear_ocpstat()
1173 rtsx_pci_read_phy_register(pcr, 0x01, &val); in rtsx_pci_enable_oobs_polling()
1175 rtsx_pci_write_phy_register(pcr, 0x01, val); in rtsx_pci_enable_oobs_polling()
1177 rtsx_pci_write_register(pcr, REG_CFG_OOBS_OFF_TIMER, 0xFF, 0x32); in rtsx_pci_enable_oobs_polling()
1178 rtsx_pci_write_register(pcr, REG_CFG_OOBS_ON_TIMER, 0xFF, 0x05); in rtsx_pci_enable_oobs_polling()
1179 rtsx_pci_write_register(pcr, REG_CFG_VCM_ON_TIMER, 0xFF, 0x83); in rtsx_pci_enable_oobs_polling()
1180 rtsx_pci_write_register(pcr, REG_CFG_OOBS_POLLING, 0xFF, 0xDE); in rtsx_pci_enable_oobs_polling()
1191 rtsx_pci_read_phy_register(pcr, 0x01, &val); in rtsx_pci_disable_oobs_polling()
1193 rtsx_pci_write_phy_register(pcr, 0x01, val); in rtsx_pci_disable_oobs_polling()
1195 rtsx_pci_write_register(pcr, REG_CFG_VCM_ON_TIMER, 0xFF, 0x03); in rtsx_pci_disable_oobs_polling()
1196 rtsx_pci_write_register(pcr, REG_CFG_OOBS_POLLING, 0xFF, 0x00); in rtsx_pci_disable_oobs_polling()
1203 MS_CLK_EN | SD40_CLK_EN, 0); in rtsx_sd_power_off_card3v3()
1204 rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, 0); in rtsx_sd_power_off_card3v3()
1211 return 0; in rtsx_sd_power_off_card3v3()
1217 MS_CLK_EN | SD40_CLK_EN, 0); in rtsx_ms_power_off_card3v3()
1221 rtsx_pci_write_register(pcr, CARD_OE, MS_OUTPUT_EN, 0); in rtsx_ms_power_off_card3v3()
1224 return 0; in rtsx_ms_power_off_card3v3()
1244 RTS5261_MCU_CLOCK_GATING, 0); in rtsx_pci_init_hw()
1246 SSC_POWER_DOWN, 0); in rtsx_pci_init_hw()
1248 err = rtsx_pci_write_register(pcr, FPDCTL, SSC_POWER_DOWN, 0); in rtsx_pci_init_hw()
1250 if (err < 0) in rtsx_pci_init_hw()
1259 if (err < 0) in rtsx_pci_init_hw()
1266 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CLK_DIV, 0x07, 0x07); in rtsx_pci_init_hw()
1268 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, HOST_SLEEP_STATE, 0x03, 0x00); in rtsx_pci_init_hw()
1270 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_CLK_EN, 0x1E, 0); in rtsx_pci_init_hw()
1272 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CHANGE_LINK_STATE, 0x0A, 0); in rtsx_pci_init_hw()
1275 0xFF, pcr->card_drive_sel); in rtsx_pci_init_hw()
1278 0xFF, SSC_8X_EN | SSC_SEL_4M); in rtsx_pci_init_hw()
1280 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL2, 0xFF, in rtsx_pci_init_hw()
1283 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL2, 0xFF, in rtsx_pci_init_hw()
1285 else if (is_version(pcr, 0x5264, IC_VER_A)) in rtsx_pci_init_hw()
1286 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL1, SSC_RSTB, 0); in rtsx_pci_init_hw()
1288 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL2, 0xFF, in rtsx_pci_init_hw()
1291 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, SSC_CTL2, 0xFF, 0x12); in rtsx_pci_init_hw()
1294 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CHANGE_LINK_STATE, 0x16, 0x10); in rtsx_pci_init_hw()
1301 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, PERST_GLITCH_WIDTH, 0xFF, 0x80); in rtsx_pci_init_hw()
1303 * bit[0] F_HIGH: for RC oscillator, Rst_value is 1'b1 in rtsx_pci_init_hw()
1304 * 1: 2M 0: 400k in rtsx_pci_init_hw()
1306 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, RCCTL, 0x01, 0x00); in rtsx_pci_init_hw()
1309 * 1: Enable ELBI interrupt[31:22] & [7:0] flag read clear in rtsx_pci_init_hw()
1310 * 0: ELBI interrupt flag[31:22] & [7:0] only can be write clear in rtsx_pci_init_hw()
1312 rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, NFTS_TX_CTRL, 0x02, 0); in rtsx_pci_init_hw()
1315 if (err < 0) in rtsx_pci_init_hw()
1337 0, PCI_EXP_LNKCTL_CLKREQ_EN); in rtsx_pci_init_hw()
1339 pci_write_config_byte(pdev, 0x70F, 0x5B); in rtsx_pci_init_hw()
1343 if (err < 0) in rtsx_pci_init_hw()
1348 rtsx_pci_write_register(pcr, ASPM_FORCE_CTL, 0x30, 0x30); in rtsx_pci_init_hw()
1358 return 0; in rtsx_pci_init_hw()
1374 case 0x5209: in rtsx_pci_init_chip()
1378 case 0x5229: in rtsx_pci_init_chip()
1382 case 0x5289: in rtsx_pci_init_chip()
1386 case 0x5227: in rtsx_pci_init_chip()
1390 case 0x522A: in rtsx_pci_init_chip()
1394 case 0x5249: in rtsx_pci_init_chip()
1398 case 0x524A: in rtsx_pci_init_chip()
1402 case 0x525A: in rtsx_pci_init_chip()
1406 case 0x5287: in rtsx_pci_init_chip()
1410 case 0x5286: in rtsx_pci_init_chip()
1414 case 0x5260: in rtsx_pci_init_chip()
1418 case 0x5261: in rtsx_pci_init_chip()
1422 case 0x5228: in rtsx_pci_init_chip()
1426 case 0x5264: in rtsx_pci_init_chip()
1431 pcr_dbg(pcr, "PID: 0x%04x, IC version: 0x%02x\n", in rtsx_pci_init_chip()
1499 pcr_dbg(pcr, "pcr->aspm_en = 0x%x\n", pcr->aspm_en); in rtsx_pci_init_chip()
1500 pcr_dbg(pcr, "pcr->sd30_drive_sel_1v8 = 0x%x\n", in rtsx_pci_init_chip()
1502 pcr_dbg(pcr, "pcr->sd30_drive_sel_3v3 = 0x%x\n", in rtsx_pci_init_chip()
1504 pcr_dbg(pcr, "pcr->card_drive_sel = 0x%x\n", in rtsx_pci_init_chip()
1506 pcr_dbg(pcr, "pcr->flags = 0x%x\n", pcr->flags); in rtsx_pci_init_chip()
1510 if (err < 0) { in rtsx_pci_init_chip()
1515 return 0; in rtsx_pci_init_chip()
1524 int ret, i, bar = 0; in rtsx_pci_probe()
1532 if (ret < 0) in rtsx_pci_probe()
1558 ret = idr_alloc(&rtsx_pci_idr, pcr, 0, 0, GFP_NOWAIT); in rtsx_pci_probe()
1559 if (ret >= 0) in rtsx_pci_probe()
1563 if (ret < 0) in rtsx_pci_probe()
1569 if ((CHK_PCI_PID(pcr, 0x525A)) || (CHK_PCI_PID(pcr, 0x5264))) in rtsx_pci_probe()
1590 pcr->card_inserted = 0; in rtsx_pci_probe()
1591 pcr->card_removed = 0; in rtsx_pci_probe()
1602 if (ret < 0) in rtsx_pci_probe()
1609 if (ret < 0) in rtsx_pci_probe()
1612 for (i = 0; i < ARRAY_SIZE(rtsx_pcr_cells); i++) { in rtsx_pci_probe()
1619 ARRAY_SIZE(rtsx_pcr_cells), NULL, 0, NULL); in rtsx_pci_probe()
1620 if (ret < 0) in rtsx_pci_probe()
1626 return 0; in rtsx_pci_probe()
1667 rtsx_pci_writel(pcr, RTSX_BIER, 0); in rtsx_pci_remove()
1668 pcr->bier = 0; in rtsx_pci_remove()
1713 return 0; in rtsx_pci_suspend()
1721 int ret = 0; in rtsx_pci_resume()
1727 ret = rtsx_pci_write_register(pcr, HOST_SLEEP_STATE, 0x03, 0x00); in rtsx_pci_resume()
1764 rtsx_set_l1off_sub_cfg_d0(pcr, 0); in rtsx_comm_pm_power_saving()
1831 return 0; in rtsx_pci_runtime_suspend()
1844 rtsx_pci_write_register(pcr, HOST_SLEEP_STATE, 0x03, 0x00); in rtsx_pci_runtime_resume()
1854 return 0; in rtsx_pci_runtime_resume()