Commit a6e72624 authored by Russell King's avatar Russell King Committed by Tejun Heo

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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Reviewed-by: default avatarShawn Guo <shawn.guo@freescale.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent dcb1b29b
...@@ -368,6 +368,7 @@ struct reg_property { ...@@ -368,6 +368,7 @@ struct reg_property {
const struct reg_value *values; const struct reg_value *values;
size_t num_values; size_t num_values;
u32 def_value; u32 def_value;
u32 set_value;
}; };
static const struct reg_value gpr13_tx_level[] = { static const struct reg_value gpr13_tx_level[] = {
...@@ -465,6 +466,10 @@ static const struct reg_property gpr13_props[] = { ...@@ -465,6 +466,10 @@ static const struct reg_property gpr13_props[] = {
.values = gpr13_rx_eq, .values = gpr13_rx_eq,
.num_values = ARRAY_SIZE(gpr13_rx_eq), .num_values = ARRAY_SIZE(gpr13_rx_eq),
.def_value = IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB, .def_value = IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB,
}, {
.name = "fsl,no-spread-spectrum",
.def_value = IMX6Q_GPR13_SATA_MPLL_SS_EN,
.set_value = 0,
}, },
}; };
...@@ -478,6 +483,14 @@ static u32 imx_ahci_parse_props(struct device *dev, ...@@ -478,6 +483,14 @@ static u32 imx_ahci_parse_props(struct device *dev,
for (i = 0; i < num; i++, prop++) { for (i = 0; i < num; i++, prop++) {
u32 of_val; u32 of_val;
if (prop->num_values == 0) {
if (of_property_read_bool(np, prop->name))
reg_value |= prop->set_value;
else
reg_value |= prop->def_value;
continue;
}
if (of_property_read_u32(np, prop->name, &of_val)) { if (of_property_read_u32(np, prop->name, &of_val)) {
dev_info(dev, "%s not specified, using %08x\n", dev_info(dev, "%s not specified, using %08x\n",
prop->name, prop->def_value); prop->name, prop->def_value);
...@@ -549,7 +562,6 @@ static int imx_ahci_probe(struct platform_device *pdev) ...@@ -549,7 +562,6 @@ static int imx_ahci_probe(struct platform_device *pdev)
IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M | IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M |
IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_4F | IMX6Q_GPR13_SATA_RX_DPLL_MODE_2P_4F |
IMX6Q_GPR13_SATA_SPD_MODE_3P0G | IMX6Q_GPR13_SATA_SPD_MODE_3P0G |
IMX6Q_GPR13_SATA_MPLL_SS_EN |
reg_value; reg_value;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment