aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-06-24 06:19:47 -0400
committerTejun Heo <tj@kernel.org>2014-07-01 17:24:40 -0400
commita6e726244c78e04d0af754c625036be8f92a9afd (patch)
tree7583dbbf0fcd4cefdb5be13fa0be9e2dd8943d57 /drivers
parentdcb1b29b0826c70a94f6fb8dcb1aef7fc66d118a (diff)
ata: ahci_imx: add disable for spread-spectrum
Spread-spectrum doesn't work with Cubox-i hardware, so we have to disable this feature. Add a DT property so that platforms can indicate that this feature should not be enabled. Having it as a negative property keeps existing DT files working. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci_imx.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index e032e95ddee3..685a4db030b1 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -368,6 +368,7 @@ struct reg_property {
368 const struct reg_value *values; 368 const struct reg_value *values;
369 size_t num_values; 369 size_t num_values;
370 u32 def_value; 370 u32 def_value;
371 u32 set_value;
371}; 372};
372 373
373static const struct reg_value gpr13_tx_level[] = { 374static const struct reg_value gpr13_tx_level[] = {
@@ -465,6 +466,10 @@ static const struct reg_property gpr13_props[] = {
465 .values = gpr13_rx_eq, 466 .values = gpr13_rx_eq,
466 .num_values = ARRAY_SIZE(gpr13_rx_eq), 467 .num_values = ARRAY_SIZE(gpr13_rx_eq),
467 .def_value = IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB, 468 .def_value = IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB,
469 }, {
470 .name = "fsl,no-spread-spectrum",
471 .def_value = IMX6Q_GPR13_SATA_MPLL_SS_EN,
472 .set_value = 0,
468 }, 473 },
469}; 474};
470 475
@@ -478,6 +483,14 @@ static u32 imx_ahci_parse_props(struct device *dev,
478 for (i = 0; i < num; i++, prop++) { 483 for (i = 0; i < num; i++, prop++) {
479 u32 of_val; 484 u32 of_val;
480 485
486 if (prop->num_values == 0) {
487 if (of_property_read_bool(np, prop->name))
488 reg_value |= prop->set_value;
489 else
490 reg_value |= prop->def_value;
491 continue;
492 }
493
481 if (of_property_read_u32(np, prop->name, &of_val)) { 494 if (of_property_read_u32(np, prop->name, &of_val)) {
482 dev_info(dev, "%s not specified, using %08x\n", 495 dev_info(dev, "%s not specified, using %08x\n",
483 prop->name, prop->def_value); 496 prop->name, prop->def_value);
@@ -549,7 +562,6 @@ static int imx_ahci_probe(struct platform_device *pdev)
549 IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M | 562 IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M |
550 IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_4F | 563 IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_4F |
551 IMX6Q_GPR13_SATA_SPD_MODE_3P0G | 564 IMX6Q_GPR13_SATA_SPD_MODE_3P0G |
552 IMX6Q_GPR13_SATA_MPLL_SS_EN |
553 reg_value; 565 reg_value;
554 } 566 }
555 567