You need to sign in or sign up before continuing.
提交 e73f0bff 编写于 作者: Z Zhu Donghong 提交者: guzitao

sw64: deliver a hot reset to Root Complex with plugin JMicron 585 card

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5GFPA

--------------------------------

On SW64 platform, JMicron 585 SATA card directly connected to Root
Complex may raise DMA failure when reboot, so we force a hot reset
to Root Complex to fix can not access JMicron 585 SATA card.
Signed-off-by: NZhu Donghong <zhudonghong@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 993a93c8
......@@ -26,9 +26,25 @@ extern void cpld_write(uint8_t slave_addr, uint8_t reg, uint8_t data);
static void xuelang_kill_arch(int mode)
{
struct pci_dev *pdev;
struct pci_controller *hose;
int val;
if (is_in_host()) {
switch (mode) {
case LINUX_REBOOT_CMD_RESTART:
pdev = pci_get_device(PCI_VENDOR_ID_JMICRON,
0x0585, NULL);
if (pdev) {
hose = (struct pci_controller *)pdev->sysdata;
val = read_rc_conf(hose->node, hose->index,
RC_PORT_LINK_CTL);
write_rc_conf(hose->node, hose->index,
RC_PORT_LINK_CTL, val | 0x8);
write_rc_conf(hose->node, hose->index,
RC_PORT_LINK_CTL, val);
}
cpld_write(0x64, 0x00, 0xc3);
mb();
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册