aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 09:31:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 09:31:43 -0400
commit0a95d92c0054e74fb79607ac2df958b7bf295706 (patch)
treee2c5f836e799dcfd72904949be47595af91432e7 /drivers/ata
parent08351fc6a75731226e1112fc7254542bd3a2912e (diff)
parent831532035b12a5f7b600515a6f4da0b207b82d6e (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (62 commits) powerpc/85xx: Fix signedness bug in cache-sram powerpc/fsl: 85xx: document cache sram bindings powerpc/fsl: define binding for fsl mpic interrupt controllers powerpc/fsl_msi: Handle msi-available-ranges better drivers/serial/ucc_uart.c: Add of_node_put to avoid memory leak powerpc/85xx: Fix SPE float to integer conversion failure powerpc/85xx: Update sata controller compatible for p1022ds board ATA: Add FSL sata v2 controller support powerpc/mpc8xxx_gpio: simplify searching for 'fsl, qoriq-gpio' compatiable powerpc/8xx: remove obsolete mgsuvd board powerpc/82xx: rename and update mgcoge board support powerpc/83xx: rename and update kmeter1 powerpc/85xx: Workaroudn e500 CPU erratum A005 powerpc/fsl_pci: Add support for FSL PCIe controllers v2.x powerpc/85xx: Fix writing to spin table 'cpu-release-addr' on ppc64e powerpc/pseries: Disable MSI using new interface if possible powerpc: Enable GENERIC_HARDIRQS_NO_DEPRECATED. powerpc: core irq_data conversion. powerpc: sysdev/xilinx_intc irq_data conversion. powerpc: sysdev/uic irq_data conversion. ... Fix up conflicts in arch/powerpc/sysdev/fsl_msi.c (due to getting rid of of_platform_driver in arch/powerpc)
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_fsl.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index ef3ce26bb1f0..0f91e583892e 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -6,7 +6,7 @@
6 * Author: Ashish Kalra <ashish.kalra@freescale.com> 6 * Author: Ashish Kalra <ashish.kalra@freescale.com>
7 * Li Yang <leoli@freescale.com> 7 * Li Yang <leoli@freescale.com>
8 * 8 *
9 * Copyright (c) 2006-2007 Freescale Semiconductor, Inc. 9 * Copyright (c) 2006-2007, 2011 Freescale Semiconductor, Inc.
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify it 11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the 12 * under the terms of the GNU General Public License as published by the
@@ -157,7 +157,8 @@ enum {
157 IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, 157 IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE,
158 158
159 EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), 159 EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31),
160 DATA_SNOOP_ENABLE = (1 << 22), 160 DATA_SNOOP_ENABLE_V1 = (1 << 22),
161 DATA_SNOOP_ENABLE_V2 = (1 << 28),
161}; 162};
162 163
163/* 164/*
@@ -260,6 +261,7 @@ struct sata_fsl_host_priv {
260 void __iomem *ssr_base; 261 void __iomem *ssr_base;
261 void __iomem *csr_base; 262 void __iomem *csr_base;
262 int irq; 263 int irq;
264 int data_snoop;
263}; 265};
264 266
265static inline unsigned int sata_fsl_tag(unsigned int tag, 267static inline unsigned int sata_fsl_tag(unsigned int tag,
@@ -312,7 +314,8 @@ static void sata_fsl_setup_cmd_hdr_entry(struct sata_fsl_port_priv *pp,
312} 314}
313 315
314static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc, 316static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
315 u32 *ttl, dma_addr_t cmd_desc_paddr) 317 u32 *ttl, dma_addr_t cmd_desc_paddr,
318 int data_snoop)
316{ 319{
317 struct scatterlist *sg; 320 struct scatterlist *sg;
318 unsigned int num_prde = 0; 321 unsigned int num_prde = 0;
@@ -362,8 +365,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
362 365
363 ttl_dwords += sg_len; 366 ttl_dwords += sg_len;
364 prd->dba = cpu_to_le32(sg_addr); 367 prd->dba = cpu_to_le32(sg_addr);
365 prd->ddc_and_ext = 368 prd->ddc_and_ext = cpu_to_le32(data_snoop | (sg_len & ~0x03));
366 cpu_to_le32(DATA_SNOOP_ENABLE | (sg_len & ~0x03));
367 369
368 VPRINTK("sg_fill, ttl=%d, dba=0x%x, ddc=0x%x\n", 370 VPRINTK("sg_fill, ttl=%d, dba=0x%x, ddc=0x%x\n",
369 ttl_dwords, prd->dba, prd->ddc_and_ext); 371 ttl_dwords, prd->dba, prd->ddc_and_ext);
@@ -378,7 +380,7 @@ static unsigned int sata_fsl_fill_sg(struct ata_queued_cmd *qc, void *cmd_desc,
378 /* set indirect extension flag along with indirect ext. size */ 380 /* set indirect extension flag along with indirect ext. size */
379 prd_ptr_to_indirect_ext->ddc_and_ext = 381 prd_ptr_to_indirect_ext->ddc_and_ext =
380 cpu_to_le32((EXT_INDIRECT_SEG_PRD_FLAG | 382 cpu_to_le32((EXT_INDIRECT_SEG_PRD_FLAG |
381 DATA_SNOOP_ENABLE | 383 data_snoop |
382 (indirect_ext_segment_sz & ~0x03))); 384 (indirect_ext_segment_sz & ~0x03)));
383 } 385 }
384 386
@@ -421,7 +423,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc)
421 423
422 if (qc->flags & ATA_QCFLAG_DMAMAP) 424 if (qc->flags & ATA_QCFLAG_DMAMAP)
423 num_prde = sata_fsl_fill_sg(qc, (void *)cd, 425 num_prde = sata_fsl_fill_sg(qc, (void *)cd,
424 &ttl_dwords, cd_paddr); 426 &ttl_dwords, cd_paddr,
427 host_priv->data_snoop);
425 428
426 if (qc->tf.protocol == ATA_PROT_NCQ) 429 if (qc->tf.protocol == ATA_PROT_NCQ)
427 desc_info |= FPDMA_QUEUED_CMD; 430 desc_info |= FPDMA_QUEUED_CMD;
@@ -1349,6 +1352,11 @@ static int sata_fsl_probe(struct platform_device *ofdev)
1349 } 1352 }
1350 host_priv->irq = irq; 1353 host_priv->irq = irq;
1351 1354
1355 if (of_device_is_compatible(ofdev->dev.of_node, "fsl,pq-sata-v2"))
1356 host_priv->data_snoop = DATA_SNOOP_ENABLE_V2;
1357 else
1358 host_priv->data_snoop = DATA_SNOOP_ENABLE_V1;
1359
1352 /* allocate host structure */ 1360 /* allocate host structure */
1353 host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS); 1361 host = ata_host_alloc_pinfo(&ofdev->dev, ppi, SATA_FSL_MAX_PORTS);
1354 1362
@@ -1431,6 +1439,9 @@ static struct of_device_id fsl_sata_match[] = {
1431 { 1439 {
1432 .compatible = "fsl,pq-sata", 1440 .compatible = "fsl,pq-sata",
1433 }, 1441 },
1442 {
1443 .compatible = "fsl,pq-sata-v2",
1444 },
1434 {}, 1445 {},
1435}; 1446};
1436 1447