diff --git a/arch/sw_64/include/asm/platform.h b/arch/sw_64/include/asm/platform.h index 5cbf634fb34e4e584f990a972a7f2ede6394c5b7..c52e7fd7a03993fb758190fbd4d0f8d35cfb637e 100644 --- a/arch/sw_64/include/asm/platform.h +++ b/arch/sw_64/include/asm/platform.h @@ -23,5 +23,6 @@ extern void (*pm_restart)(void); extern void (*pm_halt)(void); extern int i2c_set_adapter(void); extern void cpld_write(uint8_t slave_addr, uint8_t reg, uint8_t data); +extern void fix_jm585_reset(void); #endif /* _ASM_SW64_PLATFORM_H */ diff --git a/arch/sw_64/kernel/reset.c b/arch/sw_64/kernel/reset.c index 51ca362e9e63c792b4d4e3d0b5192927d9fe3d81..7f91a97d9d1269e3a4236456bcd9cebc2482d3e6 100644 --- a/arch/sw_64/kernel/reset.c +++ b/arch/sw_64/kernel/reset.c @@ -15,7 +15,27 @@ #include #include +#include +void fix_jm585_reset(void) +{ + struct pci_dev *pdev; + struct pci_controller *hose; + int val; + + 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); + } + +} static void default_halt(void) { local_irq_disable(); @@ -42,6 +62,7 @@ static void default_restart(void) /* No point in taking interrupts anymore. */ local_irq_disable(); + fix_jm585_reset(); #ifdef CONFIG_EFI if (efi_capsule_pending(NULL)) efi_reboot(REBOOT_WARM, NULL); diff --git a/drivers/platform/sw64/legacy_xuelang.c b/drivers/platform/sw64/legacy_xuelang.c index cf78d1088f11c97e6e7e6f09f06e08b9d9c895ac..803bea9467301bcf309390c6df1d03d72a06e764 100644 --- a/drivers/platform/sw64/legacy_xuelang.c +++ b/drivers/platform/sw64/legacy_xuelang.c @@ -42,22 +42,8 @@ void sw64_poweroff(void) void sw64_restart(void) { - struct pci_dev *pdev; - struct pci_controller *hose; - int val; - if (is_in_host()) { - 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); - } + fix_jm585_reset(); cpld_write(0x64, 0x00, 0xc3); } else vt_mode_kill_arch(LINUX_REBOOT_CMD_RESTART);