diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 21:16:08 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-21 21:16:08 -0500 |
| commit | fbd918a2026d0464ce9c23f57b7de4bcfccdc2e6 (patch) | |
| tree | 5450f3ae050870b48ad8612d0007eacf0b30d9c7 | |
| parent | f075e0f6993f41c72dbb1d3e7a2d7740f14e89e2 (diff) | |
| parent | b7db4f2e15603c394da56a0536a33669f4c87c4f (diff) | |
Merge branch 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata updates from Tejun Heo:
"Support for some new embedded controllers.
A couple late (<= a week) fixes have stable cc'd and one patch ("SATA:
MV: Add support for the optional PHYs") got committed yesterday
because otherwise the resulting kernel would fail boot on an embedded
board due to interdependent changes in its platform tree.
Other than that, nothing too noteworthy"
* 'for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
SATA: MV: Add support for the optional PHYs
sata-highbank: Remove unnecessary ahci_platform.h include
libata: disable LPM for some WD SATA-I devices
ARM: mvebu: update the SATA compatible string for Armada 370/XP
ata: sata_mv: fix disk hotplug for Armada 370/XP SoCs
ata: sata_mv: introduce compatible string "marvell, armada-370-sata"
ata: pata_samsung_cf: Remove unused macros
ata: pata_samsung_cf: Use devm_ioremap_resource()
ata: pata_samsung_cf: Merge pata_samsung_cf.h into pata_samsung_cf.c
ata: pata_samsung_cf: Move plat/regs-ata.h to drivers/ata
drivers: ata: Mark the function as static in libahci.c
drivers: ata: Mark the function ahci_init_interrupts() as static in ahci.c
ahci: imx: fix the error handling in imx_ahci_probe()
ahci: imx: ahci_imx_softreset() can be static
ahci: imx: Add i.MX53 support
ahci: imx: Pull out the clock enable/disable calls
libata, dt: Document sata_rcar bindings
sata_rcar: Add R-Car Gen2 SATA PHY support
ahci: mcp89: enter AHCI mode under Apple BIOS emulation
ata: libata-eh: Remove unnecessary snprintf arithmetic
| -rw-r--r-- | Documentation/devicetree/bindings/ata/marvell.txt | 2 | ||||
| -rw-r--r-- | Documentation/devicetree/bindings/ata/sata_rcar.txt | 18 | ||||
| -rw-r--r-- | arch/arm/boot/dts/armada-370-xp.dtsi | 2 | ||||
| -rw-r--r-- | arch/arm/plat-samsung/include/plat/regs-ata.h | 56 | ||||
| -rw-r--r-- | drivers/ata/ahci.c | 62 | ||||
| -rw-r--r-- | drivers/ata/ahci_imx.c | 242 | ||||
| -rw-r--r-- | drivers/ata/ata_generic.c | 7 | ||||
| -rw-r--r-- | drivers/ata/libahci.c | 4 | ||||
| -rw-r--r-- | drivers/ata/libata-core.c | 27 | ||||
| -rw-r--r-- | drivers/ata/libata-eh.c | 5 | ||||
| -rw-r--r-- | drivers/ata/libata-scsi.c | 18 | ||||
| -rw-r--r-- | drivers/ata/pata_samsung_cf.c | 43 | ||||
| -rw-r--r-- | drivers/ata/sata_highbank.c | 1 | ||||
| -rw-r--r-- | drivers/ata/sata_mv.c | 52 | ||||
| -rw-r--r-- | drivers/ata/sata_rcar.c | 118 | ||||
| -rw-r--r-- | include/linux/libata.h | 2 |
16 files changed, 458 insertions, 201 deletions
diff --git a/Documentation/devicetree/bindings/ata/marvell.txt b/Documentation/devicetree/bindings/ata/marvell.txt index b5cdd20cde9c..1c8351604d38 100644 --- a/Documentation/devicetree/bindings/ata/marvell.txt +++ b/Documentation/devicetree/bindings/ata/marvell.txt | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | * Marvell Orion SATA | 1 | * Marvell Orion SATA |
| 2 | 2 | ||
| 3 | Required Properties: | 3 | Required Properties: |
| 4 | - compatibility : "marvell,orion-sata" | 4 | - compatibility : "marvell,orion-sata" or "marvell,armada-370-sata" |
| 5 | - reg : Address range of controller | 5 | - reg : Address range of controller |
| 6 | - interrupts : Interrupt controller is using | 6 | - interrupts : Interrupt controller is using |
| 7 | - nr-ports : Number of SATA ports in use. | 7 | - nr-ports : Number of SATA ports in use. |
diff --git a/Documentation/devicetree/bindings/ata/sata_rcar.txt b/Documentation/devicetree/bindings/ata/sata_rcar.txt new file mode 100644 index 000000000000..1e6111333fa8 --- /dev/null +++ b/Documentation/devicetree/bindings/ata/sata_rcar.txt | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | * Renesas R-Car SATA | ||
| 2 | |||
| 3 | Required properties: | ||
| 4 | - compatible : should contain one of the following: | ||
| 5 | - "renesas,sata-r8a7779" for R-Car H1 | ||
| 6 | - "renesas,sata-r8a7790" for R-Car H2 | ||
| 7 | - "renesas,sata-r8a7791" for R-Car M2 | ||
| 8 | - reg : address and length of the SATA registers; | ||
| 9 | - interrupts : must consist of one interrupt specifier. | ||
| 10 | |||
| 11 | Example: | ||
| 12 | |||
| 13 | sata: sata@fc600000 { | ||
| 14 | compatible = "renesas,sata-r8a7779"; | ||
| 15 | reg = <0xfc600000 0x2000>; | ||
| 16 | interrupt-parent = <&gic>; | ||
| 17 | interrupts = <0 100 IRQ_TYPE_LEVEL_HIGH>; | ||
| 18 | }; | ||
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi index 7f10f627ae5b..80ffacd128f8 100644 --- a/arch/arm/boot/dts/armada-370-xp.dtsi +++ b/arch/arm/boot/dts/armada-370-xp.dtsi | |||
| @@ -152,7 +152,7 @@ | |||
| 152 | }; | 152 | }; |
| 153 | 153 | ||
| 154 | sata@a0000 { | 154 | sata@a0000 { |
| 155 | compatible = "marvell,orion-sata"; | 155 | compatible = "marvell,armada-370-sata"; |
| 156 | reg = <0xa0000 0x5000>; | 156 | reg = <0xa0000 0x5000>; |
| 157 | interrupts = <55>; | 157 | interrupts = <55>; |
| 158 | clocks = <&gateclk 15>, <&gateclk 30>; | 158 | clocks = <&gateclk 15>, <&gateclk 30>; |
diff --git a/arch/arm/plat-samsung/include/plat/regs-ata.h b/arch/arm/plat-samsung/include/plat/regs-ata.h deleted file mode 100644 index f5df92fdae26..000000000000 --- a/arch/arm/plat-samsung/include/plat/regs-ata.h +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-samsung/include/plat/regs-ata.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
| 4 | * http://www.samsung.com | ||
| 5 | * | ||
| 6 | * Samsung CF-ATA register definitions | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __ASM_PLAT_REGS_ATA_H | ||
| 14 | #define __ASM_PLAT_REGS_ATA_H __FILE__ | ||
| 15 | |||
| 16 | #define S3C_CFATA_REG(x) (x) | ||
| 17 | |||
| 18 | #define S3C_CFATA_MUX S3C_CFATA_REG(0x0) | ||
| 19 | |||
| 20 | #define S3C_ATA_CTRL S3C_CFATA_REG(0x0) | ||
| 21 | #define S3C_ATA_STATUS S3C_CFATA_REG(0x4) | ||
| 22 | #define S3C_ATA_CMD S3C_CFATA_REG(0x8) | ||
| 23 | #define S3C_ATA_SWRST S3C_CFATA_REG(0xc) | ||
| 24 | #define S3C_ATA_IRQ S3C_CFATA_REG(0x10) | ||
| 25 | #define S3C_ATA_IRQ_MSK S3C_CFATA_REG(0x14) | ||
| 26 | #define S3C_ATA_CFG S3C_CFATA_REG(0x18) | ||
| 27 | |||
| 28 | #define S3C_ATA_MDMA_TIME S3C_CFATA_REG(0x28) | ||
| 29 | #define S3C_ATA_PIO_TIME S3C_CFATA_REG(0x2c) | ||
| 30 | #define S3C_ATA_UDMA_TIME S3C_CFATA_REG(0x30) | ||
| 31 | #define S3C_ATA_XFR_NUM S3C_CFATA_REG(0x34) | ||
| 32 | #define S3C_ATA_XFR_CNT S3C_CFATA_REG(0x38) | ||
| 33 | #define S3C_ATA_TBUF_START S3C_CFATA_REG(0x3c) | ||
| 34 | #define S3C_ATA_TBUF_SIZE S3C_CFATA_REG(0x40) | ||
| 35 | #define S3C_ATA_SBUF_START S3C_CFATA_REG(0x44) | ||
| 36 | #define S3C_ATA_SBUF_SIZE S3C_CFATA_REG(0x48) | ||
| 37 | #define S3C_ATA_CADR_TBUF S3C_CFATA_REG(0x4c) | ||
| 38 | #define S3C_ATA_CADR_SBUF S3C_CFATA_REG(0x50) | ||
| 39 | #define S3C_ATA_PIO_DTR S3C_CFATA_REG(0x54) | ||
| 40 | #define S3C_ATA_PIO_FED S3C_CFATA_REG(0x58) | ||
| 41 | #define S3C_ATA_PIO_SCR S3C_CFATA_REG(0x5c) | ||
| 42 | #define S3C_ATA_PIO_LLR S3C_CFATA_REG(0x60) | ||
| 43 | #define S3C_ATA_PIO_LMR S3C_CFATA_REG(0x64) | ||
| 44 | #define S3C_ATA_PIO_LHR S3C_CFATA_REG(0x68) | ||
| 45 | #define S3C_ATA_PIO_DVR S3C_CFATA_REG(0x6c) | ||
| 46 | #define S3C_ATA_PIO_CSD S3C_CFATA_REG(0x70) | ||
| 47 | #define S3C_ATA_PIO_DAD S3C_CFATA_REG(0x74) | ||
| 48 | #define S3C_ATA_PIO_READY S3C_CFATA_REG(0x78) | ||
| 49 | #define S3C_ATA_PIO_RDATA S3C_CFATA_REG(0x7c) | ||
| 50 | |||
| 51 | #define S3C_CFATA_MUX_TRUEIDE 0x01 | ||
| 52 | |||
| 53 | #define S3C_ATA_CFG_SWAP 0x40 | ||
| 54 | #define S3C_ATA_CFG_IORDYEN 0x02 | ||
| 55 | |||
| 56 | #endif /* __ASM_PLAT_REGS_ATA_H */ | ||
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index e3a92a6da39a..74911c2cb1dd 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -83,6 +83,8 @@ enum board_ids { | |||
| 83 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 83 | static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
| 84 | static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, | 84 | static int ahci_vt8251_hardreset(struct ata_link *link, unsigned int *class, |
| 85 | unsigned long deadline); | 85 | unsigned long deadline); |
| 86 | static void ahci_mcp89_apple_enable(struct pci_dev *pdev); | ||
| 87 | static bool is_mcp89_apple(struct pci_dev *pdev); | ||
| 86 | static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, | 88 | static int ahci_p5wdh_hardreset(struct ata_link *link, unsigned int *class, |
| 87 | unsigned long deadline); | 89 | unsigned long deadline); |
| 88 | #ifdef CONFIG_PM | 90 | #ifdef CONFIG_PM |
| @@ -664,6 +666,10 @@ static int ahci_pci_device_resume(struct pci_dev *pdev) | |||
| 664 | if (rc) | 666 | if (rc) |
| 665 | return rc; | 667 | return rc; |
| 666 | 668 | ||
| 669 | /* Apple BIOS helpfully mangles the registers on resume */ | ||
| 670 | if (is_mcp89_apple(pdev)) | ||
| 671 | ahci_mcp89_apple_enable(pdev); | ||
| 672 | |||
| 667 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { | 673 | if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { |
| 668 | rc = ahci_pci_reset_controller(host); | 674 | rc = ahci_pci_reset_controller(host); |
| 669 | if (rc) | 675 | if (rc) |
| @@ -780,6 +786,48 @@ static void ahci_p5wdh_workaround(struct ata_host *host) | |||
| 780 | } | 786 | } |
| 781 | } | 787 | } |
| 782 | 788 | ||
| 789 | /* | ||
| 790 | * Macbook7,1 firmware forcibly disables MCP89 AHCI and changes PCI ID when | ||
| 791 | * booting in BIOS compatibility mode. We restore the registers but not ID. | ||
| 792 | */ | ||
| 793 | static void ahci_mcp89_apple_enable(struct pci_dev *pdev) | ||
| 794 | { | ||
| 795 | u32 val; | ||
| 796 | |||
| 797 | printk(KERN_INFO "ahci: enabling MCP89 AHCI mode\n"); | ||
| 798 | |||
| 799 | pci_read_config_dword(pdev, 0xf8, &val); | ||
| 800 | val |= 1 << 0x1b; | ||
| 801 | /* the following changes the device ID, but appears not to affect function */ | ||
| 802 | /* val = (val & ~0xf0000000) | 0x80000000; */ | ||
| 803 | pci_write_config_dword(pdev, 0xf8, val); | ||
| 804 | |||
| 805 | pci_read_config_dword(pdev, 0x54c, &val); | ||
| 806 | val |= 1 << 0xc; | ||
| 807 | pci_write_config_dword(pdev, 0x54c, val); | ||
| 808 | |||
| 809 | pci_read_config_dword | ||
