0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <asm/delay.h>
0012 #include <linux/pci.h>
0013 #include <linux/interrupt.h>
0014 #include <asm/reboot_fixups.h>
0015 #include <asm/msr.h>
0016 #include <linux/cs5535.h>
0017
0018 static void cs5530a_warm_reset(struct pci_dev *dev)
0019 {
0020
0021
0022 pci_write_config_byte(dev, 0x44, 0x1);
0023 udelay(50);
0024 return;
0025 }
0026
0027 static void cs5536_warm_reset(struct pci_dev *dev)
0028 {
0029
0030 wrmsrl(MSR_DIVIL_SOFT_RESET, 1ULL);
0031 udelay(50);
0032 }
0033
0034 static void rdc321x_reset(struct pci_dev *dev)
0035 {
0036 unsigned i;
0037
0038 outl(0x80003840, 0xCF8);
0039
0040 i = inl(0xCFC);
0041
0042 i |= 0x1600;
0043 outl(i, 0xCFC);
0044 outb(1, 0x92);
0045 }
0046
0047 static void ce4100_reset(struct pci_dev *dev)
0048 {
0049 int i;
0050
0051 for (i = 0; i < 10; i++) {
0052 outb(0x2, 0xcf9);
0053 udelay(50);
0054 }
0055 }
0056
0057 struct device_fixup {
0058 unsigned int vendor;
0059 unsigned int device;
0060 void (*reboot_fixup)(struct pci_dev *);
0061 };
0062
0063
0064
0065
0066 #define PCI_DEVICE_ID_INTEL_CE4100 0x0708
0067
0068 static const struct device_fixup fixups_table[] = {
0069 { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
0070 { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, cs5536_warm_reset },
0071 { PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE, cs5530a_warm_reset },
0072 { PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6030, rdc321x_reset },
0073 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100, ce4100_reset },
0074 };
0075
0076
0077
0078
0079
0080
0081
0082 void mach_reboot_fixups(void)
0083 {
0084 const struct device_fixup *cur;
0085 struct pci_dev *dev;
0086 int i;
0087
0088
0089
0090 if (in_interrupt())
0091 return;
0092
0093 for (i=0; i < ARRAY_SIZE(fixups_table); i++) {
0094 cur = &(fixups_table[i]);
0095 dev = pci_get_device(cur->vendor, cur->device, NULL);
0096 if (!dev)
0097 continue;
0098
0099 cur->reboot_fixup(dev);
0100 pci_dev_put(dev);
0101 }
0102 }
0103