Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: rtsx: add rts5264 to support sd express card

rts5264 can support sd express card, so add the id in sd express card init
to do rts5264 register setting when the sd express card insert

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
Link: https://lore.kernel.org/r/20231208032145.2143580-4-ricky_wu@realtek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricky Wu and committed by
Greg Kroah-Hartman
117cc0ef 6a511c9b

+16 -1
+16 -1
drivers/mmc/host/rtsx_pci_sdmmc.c
··· 7 7 * Wei WANG <wei_wang@realsil.com.cn> 8 8 */ 9 9 10 + #include <linux/pci.h> 10 11 #include <linux/module.h> 11 12 #include <linux/slab.h> 12 13 #include <linux/highmem.h> ··· 948 947 /* send at least 74 clocks */ 949 948 rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN); 950 949 951 - if (PCI_PID(pcr) == PID_5261) { 950 + if ((PCI_PID(pcr) == PID_5261) || (PCI_PID(pcr) == PID_5264)) { 952 951 /* 953 952 * If test mode is set switch to SD Express mandatorily, 954 953 * this is only for factory testing. ··· 1365 1364 struct realtek_pci_sdmmc *host = mmc_priv(mmc); 1366 1365 struct rtsx_pcr *pcr = host->pcr; 1367 1366 1367 + if (PCI_PID(pcr) == PID_5264) { 1368 + pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL2, 1369 + PCI_EXP_LNKCTL2_TLS, PCI_EXP_LNKCTL2_TLS_2_5GT); 1370 + pci_write_config_byte(pcr->pci, 0x80e, 0x02); 1371 + pcie_capability_clear_and_set_word(pcr->pci, PCI_EXP_LNKCTL2, 1372 + PCI_EXP_LNKCTL2_TLS, PCI_EXP_LNKCTL2_TLS_5_0GT); 1373 + } 1374 + 1368 1375 /* Set relink_time for changing to PCIe card */ 1369 1376 relink_time = 0x8FFF; 1370 1377 ··· 1387 1378 1388 1379 if (pcr->ops->disable_auto_blink) 1389 1380 pcr->ops->disable_auto_blink(pcr); 1381 + 1382 + if (PCI_PID(pcr) == PID_5264) { 1383 + rtsx_pci_write_register(pcr, RTS5264_AUTOLOAD_CFG2, 1384 + RTS5264_CHIP_RST_N_SEL, RTS5264_CHIP_RST_N_SEL); 1385 + rtsx_pci_write_register(pcr, GPIO_CTL, 0x02, 0x00); 1386 + } 1390 1387 1391 1388 /* For PCIe/NVMe mode can't enter delink issue */ 1392 1389 pcr->hw_param.interrupt_en &= ~(SD_INT_EN);