1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-14 10:40:38 +02:00
openwrt-xburst/target/linux/cns3xxx/patches-3.3/106-cns3xxx_sata_support.patch
juhosg 71f3abe21d cns3xxx: add support for 3.3
Compile tested only.

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31809 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-05-18 20:10:53 +00:00

98 lines
2.7 KiB
Diff

--- a/arch/arm/mach-cns3xxx/devices.c
+++ b/arch/arm/mach-cns3xxx/devices.c
@@ -41,7 +41,7 @@ static struct resource cns3xxx_ahci_reso
static u64 cns3xxx_ahci_dmamask = DMA_BIT_MASK(32);
static struct platform_device cns3xxx_ahci_pdev = {
- .name = "ahci",
+ .name = "ahci-cns3xxx",
.id = 0,
.resource = cns3xxx_ahci_resource,
.num_resources = ARRAY_SIZE(cns3xxx_ahci_resource),
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -27,6 +27,7 @@ enum ahci_type {
AHCI, /* standard platform ahci */
IMX53_AHCI, /* ahci on i.mx53 */
STRICT_AHCI, /* delayed DMA engine start */
+ CNS3XXX_AHCI, /* AHCI on cns3xxx */
};
static struct platform_device_id ahci_devtype[] = {
@@ -40,11 +41,32 @@ static struct platform_device_id ahci_de
.name = "strict-ahci",
.driver_data = STRICT_AHCI,
}, {
+ .name = "ahci-cns3xxx",
+ .driver_data = CNS3XXX_AHCI,
+ }, {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(platform, ahci_devtype);
+static int
+cns3xxx_ahci_softreset(struct ata_link *link, unsigned int *class,
+ unsigned long deadline)
+{
+ int pmp = sata_srst_pmp(link);
+ int ret;
+
+ ret = ahci_do_softreset(link, class, pmp, deadline, ahci_check_ready);
+ if (pmp && ret)
+ return ahci_do_softreset(link, class, 0, deadline,
+ ahci_check_ready);
+ return ret;
+}
+
+static struct ata_port_operations cns3xxx_ahci_ops = {
+ .inherits = &ahci_ops,
+ .softreset = cns3xxx_ahci_softreset,
+};
static const struct ata_port_info ahci_port_info[] = {
/* by features */
@@ -67,13 +89,19 @@ static const struct ata_port_info ahci_p
.udma_mask = ATA_UDMA6,
.port_ops = &ahci_ops,
},
+ [CNS3XXX_AHCI] = {
+ .flags = AHCI_FLAG_COMMON,
+ .pio_mask = ATA_PIO4,
+ .udma_mask = ATA_UDMA6,
+ .port_ops = &cns3xxx_ahci_ops,
+ }
};
static struct scsi_host_template ahci_platform_sht = {
AHCI_SHT("ahci_platform"),
};
-static int __init ahci_probe(struct platform_device *pdev)
+static int __devinit ahci_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct ahci_platform_data *pdata = dev_get_platdata(dev);
@@ -285,6 +313,7 @@ static const struct of_device_id ahci_of
MODULE_DEVICE_TABLE(of, ahci_of_match);
static struct platform_driver ahci_driver = {
+ .probe = ahci_probe,
.remove = __devexit_p(ahci_remove),
.driver = {
.name = "ahci",
@@ -299,7 +328,7 @@ static struct platform_driver ahci_drive
static int __init ahci_init(void)
{
- return platform_driver_probe(&ahci_driver, ahci_probe);
+ return platform_driver_register(&ahci_driver);
}
module_init(ahci_init);
@@ -312,4 +341,3 @@ module_exit(ahci_exit);
MODULE_DESCRIPTION("AHCI SATA platform driver");
MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:ahci");