Guest User

Untitled

a guest
Apr 5th, 2019
138
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -Nur orig/drivers/ata/ata_piix.c patch/drivers/ata/ata_piix.c
  2. --- orig/drivers/ata/ata_piix.c 2016-12-10 18:09:59.000000000 +0000
  3. +++ patch/drivers/ata/ata_piix.c    2016-12-14 01:05:40.795554265 +0000
  4. @@ -495,6 +495,7 @@
  5.     { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */
  6.     { 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */
  7.     { 0x27df, 0x104d, 0x900e }, /* ICH7 on Sony TZ-90 */
  8. +   { 0x27DF, 0x8086, 0x27df },     /* ICH7 on Intel SS4200 */
  9.     /* end marker */
  10.     { 0, }
  11.  };
  12. diff -Nur orig/drivers/pci/quirks.c patch/drivers/pci/quirks.c
  13. --- orig/drivers/pci/quirks.c   2016-12-10 18:09:59.000000000 +0000
  14. +++ patch/drivers/pci/quirks.c  2016-12-14 01:11:56.324180457 +0000
  15. @@ -3678,6 +3678,63 @@
  16.     return -ENOTTY;
  17.  }
  18.  
  19. +
  20. +// enable IDE feature of SS5200 NAS
  21. +static int quirk_ss4200_ide_enable(struct pci_dev *dev) {
  22. +   u32 rcba;
  23. +   void __iomem *rcba_base;
  24. +   u32 val0, val1;
  25. +   printk(KERN_INFO "ss4200_ide - enable\n");
  26. +
  27. +   // This is only going to be valid on an intel device!
  28. +   // function disable register control base address
  29. +   pci_read_config_dword(dev, 0xF0, &rcba);
  30. +   if (rcba==0) {
  31. +       printk(KERN_ALERT "ss4200_ide - unexpected RCBA=0\n");
  32. +       return -1;
  33. +   }
  34. +
  35. +   rcba_base = ioremap_nocache(rcba & 0xFFFFC000, 0x4000); // 16 alignment
  36. +   if (rcba_base == NULL) {
  37. +       printk(KERN_ALERT "ss4200_ide - unexpected RCBA_BASE=null\n");
  38. +       return -1;
  39. +   }
  40. +
  41. +   // read the Function Disable register, dword mode only
  42. +   val0 = readl(rcba_base + 0x3418);
  43. +   val1 = val0 & 0xFFFFFFFD; // enable the PATA device
  44. +   printk(KERN_INFO "ss4200_ide - function disable register %x -> %x\n",val0,val1);
  45. +   writel(val1, rcba_base + 0x3418);
  46. +   iounmap(rcba_base);
  47. +   return 0;
  48. +}
  49. +
  50. +
  51. +static void quirk_ss4200_ide_suspend(struct pci_dev *dev) {
  52. +   printk(KERN_INFO "ss4200_ide - suspend\n");
  53. +}
  54. +
  55. +static void quirk_ss4200_ide_resume_early(struct pci_dev *dev) {
  56. +   printk(KERN_INFO "ss4200_ide - resume early\n");
  57. +   quirk_ss4200_ide_enable(dev);
  58. +}
  59. +
  60. +static void quirk_ss4200_ide_resume(struct pci_dev *dev) {
  61. +   printk(KERN_INFO "ss4200_ide - resume\n");
  62. +   quirk_ss4200_ide_enable(dev);
  63. +}
  64. +
  65. +static void quirk_ss4200_ide(struct pci_dev *dev) {
  66. +   printk(KERN_INFO "ss4200_ide - start\n");
  67. +   quirk_ss4200_ide_enable(dev);
  68. +}
  69. +
  70. +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   quirk_ss4200_ide);
  71. +DECLARE_PCI_FIXUP_SUSPEND(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   quirk_ss4200_ide_suspend);
  72. +DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   quirk_ss4200_ide_resume);
  73. +DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_INTEL,   PCI_DEVICE_ID_INTEL_ICH7_0,   quirk_ss4200_ide_resume_early);
  74. +
  75. +
  76.  static void quirk_dma_func0_alias(struct pci_dev *dev)
  77.  {
  78.     if (PCI_FUNC(dev->devfn) != 0)
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×