* [PATCH 1/9] spi: rspi: Add missing clk_disable() calls in error and cleanup paths
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
[not found] ` <1389525222-3482-2-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
2014-01-12 11:13 ` [PATCH 2/9] spi: rspi: Convert to clk_prepare_enable/disable_unprepare Geert Uytterhoeven
` (6 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
drivers/spi/spi-rspi.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 04d512e1e894..5ce2127b2b43 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1066,6 +1066,7 @@ static int rspi_remove(struct platform_device *pdev)
struct rspi_data *rspi = platform_get_drvdata(pdev);
rspi_release_dma(rspi);
+ clk_disable(rspi->clk);
return 0;
}
@@ -1135,7 +1136,7 @@ static int rspi_probe(struct platform_device *pdev)
ret = ops->parse_platform_data(rspi, rspi_pd);
if (ret < 0) {
dev_err(&pdev->dev, "rspi invalid platform data.\n");
- goto error1;
+ goto error2;
}
for (i = 0; i < MAX_NUM_IRQ; i++) {
@@ -1145,13 +1146,13 @@ static int rspi_probe(struct platform_device *pdev)
break;
dev_err(&pdev->dev, "platform_get_irq error\n");
ret = -ENODEV;
- goto error1;
+ goto error2;
}
ret = devm_request_irq(&pdev->dev, irq, rspi_irq, 0,
dev_name(&pdev->dev), rspi);
if (ret < 0) {
dev_err(&pdev->dev, "request_irq %d error\n", irq);
- goto error1;
+ goto error2;
}
rspi->irqs[i] = irq;
rspi->num_irqs++;
@@ -1160,21 +1161,23 @@ static int rspi_probe(struct platform_device *pdev)
ret = rspi_request_dma(rspi, pdev);
if (ret < 0) {
dev_err(&pdev->dev, "rspi_request_dma failed.\n");
- goto error2;
+ goto error3;
}
ret = devm_spi_register_master(&pdev->dev, master);
if (ret < 0) {
dev_err(&pdev->dev, "spi_register_master error.\n");
- goto error2;
+ goto error3;
}
dev_info(&pdev->dev, "probed\n");
return 0;
-error2:
+error3:
rspi_release_dma(rspi);
+error2:
+ clk_disable(rspi->clk);
error1:
spi_master_put(master);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/9] spi: rspi: Convert to clk_prepare_enable/disable_unprepare
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 1/9] spi: rspi: Add missing clk_disable() calls in error and cleanup paths Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH V3 4/9] spi: rspi: Add DT support Geert Uytterhoeven
` (5 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Get the driver ready for the migration to the common clock framework by
calling clk_prepare_enable() and clk_disable_unprepare().
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
drivers/spi/spi-rspi.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 5ce2127b2b43..b6439c9505ac 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1066,7 +1066,7 @@ static int rspi_remove(struct platform_device *pdev)
struct rspi_data *rspi = platform_get_drvdata(pdev);
rspi_release_dma(rspi);
- clk_disable(rspi->clk);
+ clk_disable_unprepare(rspi->clk);
return 0;
}
@@ -1115,7 +1115,12 @@ static int rspi_probe(struct platform_device *pdev)
ret = PTR_ERR(rspi->clk);
goto error1;
}
- clk_enable(rspi->clk);
+
+ ret = clk_prepare_enable(rspi->clk);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "unable to prepare/enable clock\n");
+ goto error1;
+ }
INIT_LIST_HEAD(&rspi->queue);
spin_lock_init(&rspi->lock);
@@ -1177,7 +1182,7 @@ static int rspi_probe(struct platform_device *pdev)
error3:
rspi_release_dma(rspi);
error2:
- clk_disable(rspi->clk);
+ clk_disable_unprepare(rspi->clk);
error1:
spi_master_put(master);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V3 4/9] spi: rspi: Add DT support
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 1/9] spi: rspi: Add missing clk_disable() calls in error and cleanup paths Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 2/9] spi: rspi: Convert to clk_prepare_enable/disable_unprepare Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
[not found] ` <1389525222-3482-5-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
2014-01-12 11:13 ` [PATCH 5/9] ARM: shmobile: r7s72100: Add RSPI clocks for DT Geert Uytterhoeven
` (4 subsequent siblings)
7 siblings, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
V2:
- Clarify RSPI/QSPI
- Add interrupt-parent
- s/should/must/ for #address-cells and #size-cells
V3:
- Add renesas,rspi-sh
- Drop -rcar suffix for QSPI
- Clarify num-cs
- Implement DT support in driver
- Changed one-line summary from "Documentation: dt: Add Renesas RSPI/QSPI
bindings" to "spi: rspi: Add DT support"
---
Documentation/devicetree/bindings/spi/spi-rspi.txt | 33 +++++
drivers/spi/spi-rspi.c | 131 +++++++++++++++++---
2 files changed, 145 insertions(+), 19 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/spi-rspi.txt
diff --git a/Documentation/devicetree/bindings/spi/spi-rspi.txt b/Documentation/devicetree/bindings/spi/spi-rspi.txt
new file mode 100644
index 000000000000..19854eeee579
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-rspi.txt
@@ -0,0 +1,33 @@
+Device tree configuration for Renesas RSPI/QSPI driver
+
+Required properties:
+- compatible : For Renesas Serial Peripheral Interface on SH:
+ "renesas,rspi-<soctype>", "renesas,rspi-sh" as fallback.
+ For Renesas Serial Peripheral Interface on ARM:
+ "renesas,rspi-<soctype>", "renesas,rspi-rz" as fallback.
+ For Quad Serial Peripheral Interface:
+ "renesas,qspi-<soctype>", "renesas,qspi" as fallback.
+- reg : Address start and address range size of device
+- interrupts : Up to 3 interrupts for RSPI (SPEI, SPRI, SPTI),
+ 1 interrupt for QSPI
+- interrupt-parent : The phandle for the interrupt controller that
+ services interrupts for this device.
+- num-cs : Number of chip selects. Some RSPI cores have more than 1.
+- #address-cells : Must be <1>
+- #size-cells : Must be <0>
+
+Pinctrl properties might be needed, too. See there.
+
+Example:
+
+ spi0: spi@e800c800 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800c800 0x24>;
+ interrupts = <0 238 IRQ_TYPE_LEVEL_HIGH>,
+ <0 239 IRQ_TYPE_LEVEL_HIGH>,
+ <0 240 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-parent = <&gic>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 6fd4770d22bd..dd3e9fd936ba 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -33,6 +33,7 @@
#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
+#include <linux/of_device.h>
#include <linux/sh_dma.h>
#include <linux/spi/spi.h>
#include <linux/spi/rspi.h>
@@ -1071,6 +1072,101 @@ static int rspi_remove(struct platform_device *pdev)
return 0;
}
+static const struct spi_ops rspi_ops = {
+ .parse_platform_data = rspi_parse_platform_data,
+ .set_config_register = rspi_set_config_register,
+ .send_pio = rspi_send_pio,
+ .receive_pio = rspi_receive_pio,
+ .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP,
+};
+
+static const struct spi_ops qspi_ops = {
+ .parse_platform_data = qspi_parse_platform_data,
+ .set_config_register = qspi_set_config_register,
+ .send_pio = qspi_send_pio,
+ .receive_pio = qspi_receive_pio,
+ .mode_bits = SPI_CPHA | SPI_CPOL,
+};
+
+#ifdef CONFIG_OF
+struct rspi_of_data {
+ const struct rspi_plat_data *template;
+ const struct spi_ops *spi_ops;
+};
+
+static const struct rspi_plat_data rspi_sh_template = {
+ .data_width = 0, /* legacy 16 bit */
+ .txmode = true, /* TX only mode */
+ .spcr2 = true, /* Parity register */
+};
+
+static const struct rspi_plat_data rspi_arm_template = {
+ .data_width = 8, /* fixed 8-bit */
+ .txmode = false, /* No TX only mode */
+ .spcr2 = false, /* No parity register */
+};
+
+static const struct rspi_of_data rspi_sh_of_data = {
+ .spi_ops = &rspi_ops,
+ .template = &rspi_sh_template,
+};
+
+static const struct rspi_of_data rspi_rz_of_data = {
+ .spi_ops = &rspi_ops,
+ .template = &rspi_arm_template,
+};
+
+static const struct rspi_of_data qspi_of_data = {
+ .spi_ops = &qspi_ops,
+ .template = &rspi_arm_template,
+};
+
+static const struct of_device_id rspi_of_match[] = {
+ /* RSPI on legacy SH */
+ { .compatible = "renesas,rspi-sh7757", .data = &rspi_sh_of_data },
+ { .compatible = "renesas,rspi-sh", .data = &rspi_sh_of_data },
+ /* RSPI on RZ */
+ { .compatible = "renesas,rspi-r7s72100", .data = &rspi_rz_of_data },
+ { .compatible = "renesas,rspi-rz", .data = &rspi_rz_of_data },
+ /* QSPI on R-Car Gen2 */
+ { .compatible = "renesas,qspi-r8a7790", .data = &qspi_of_data },
+ { .compatible = "renesas,qspi-r8a7791", .data = &qspi_of_data },
+ { .compatible = "renesas,qspi", .data = &qspi_of_data },
+ { /* sentinel */ }
+};
+
+MODULE_DEVICE_TABLE(of, rspi_of_match);
+
+static int rspi_parse_dt(struct device *dev, const struct rspi_of_data *od,
+ const struct rspi_plat_data **pd_out,
+ const struct spi_ops **ops_out)
+{
+ struct rspi_plat_data *pd;
+ u32 num_cs;
+ int error;
+
+ pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
+ if (!pd) {
+ dev_err(dev, "failed to allocate platform data\n");
+ return -ENOMEM;
+ }
+
+ /* Setup defaults from template */
+ memcpy(pd, od->template, sizeof(*pd));
+
+ /* Parse DT properties */
+ error = of_property_read_u32(dev->of_node, "num-cs", &num_cs);
+ if (error)
+ return error;
+ pd->num_chipselect = num_cs;
+
+ *pd_out = pd;
+ *ops_out = od->spi_ops;
+ return 0;
+}
+
+#endif /* CONFIG_OF */
+
static int rspi_probe(struct platform_device *pdev)
{
struct resource *res;
@@ -1078,11 +1174,22 @@ static int rspi_probe(struct platform_device *pdev)
struct rspi_data *rspi;
int ret, irq;
unsigned int i;
- const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev);
+ const struct of_device_id *of_id;
+ const struct rspi_plat_data *rspi_pd;
const struct spi_ops *ops;
- const struct platform_device_id *id_entry = pdev->id_entry;
- ops = (struct spi_ops *)id_entry->driver_data;
+ of_id = of_match_device(rspi_of_match, &pdev->dev);
+ if (of_id) {
+ ret = rspi_parse_dt(&pdev->dev, of_id->data, &rspi_pd, &ops);
+ if (ret) {
+ dev_err(&pdev->dev, "rspi_parse_dt failed %d\n", ret);
+ return ret;
+ }
+ } else {
+ ops = (struct spi_ops *)pdev->id_entry->driver_data;
+ rspi_pd = dev_get_platdata(&pdev->dev);
+ };
+
/* ops parameter check */
if (!ops->set_config_register) {
dev_err(&pdev->dev, "there is no set_config_register\n");
@@ -1135,6 +1242,7 @@ static int rspi_probe(struct platform_device *pdev)
master->transfer = rspi_transfer;
master->cleanup = rspi_cleanup;
master->mode_bits = ops->mode_bits;
+ master->dev.of_node = pdev->dev.of_node;
ret = ops->parse_platform_data(rspi, rspi_pd);
if (ret < 0) {
@@ -1187,22 +1295,6 @@ error1:
return ret;
}
-static struct spi_ops rspi_ops = {
- .parse_platform_data = rspi_parse_platform_data,
- .set_config_register = rspi_set_config_register,
- .send_pio = rspi_send_pio,
- .receive_pio = rspi_receive_pio,
- .mode_bits = SPI_CPHA | SPI_CPOL | SPI_LOOP,
-};
-
-static struct spi_ops qspi_ops = {
- .parse_platform_data = qspi_parse_platform_data,
- .set_config_register = qspi_set_config_register,
- .send_pio = qspi_send_pio,
- .receive_pio = qspi_receive_pio,
- .mode_bits = SPI_CPHA | SPI_CPOL,
-};
-
static struct platform_device_id spi_driver_ids[] = {
{ "rspi", (kernel_ulong_t)&rspi_ops },
{ "qspi", (kernel_ulong_t)&qspi_ops },
@@ -1218,6 +1310,7 @@ static struct platform_driver rspi_driver = {
.driver = {
.name = "renesas_spi",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(rspi_of_match),
},
};
module_platform_driver(rspi_driver);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/9] ARM: shmobile: r7s72100: Add RSPI clocks for DT
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
` (2 preceding siblings ...)
2014-01-12 11:13 ` [PATCH V3 4/9] spi: rspi: Add DT support Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH V3 6/9] ARM: shmobile: r7s72100 dtsi: Add RSPI nodes Geert Uytterhoeven
` (3 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Add DT-style ("%08x.spi") clocks, as Genmai doesn't use the common
clockframe yet.
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
arch/arm/mach-shmobile/clock-r7s72100.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index 6ae341ca713c..f5bf95cec6cf 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -194,6 +194,11 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("rspi.2", &mstp_clks[MSTP105]),
CLKDEV_DEV_ID("rspi.3", &mstp_clks[MSTP104]),
CLKDEV_DEV_ID("rspi.4", &mstp_clks[MSTP103]),
+ CLKDEV_DEV_ID("e800c800.spi", &mstp_clks[MSTP107]),
+ CLKDEV_DEV_ID("e800d000.spi", &mstp_clks[MSTP106]),
+ CLKDEV_DEV_ID("e800d800.spi", &mstp_clks[MSTP105]),
+ CLKDEV_DEV_ID("e800e000.spi", &mstp_clks[MSTP104]),
+ CLKDEV_DEV_ID("e800e800.spi", &mstp_clks[MSTP103]),
CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V3 6/9] ARM: shmobile: r7s72100 dtsi: Add RSPI nodes
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
` (3 preceding siblings ...)
2014-01-12 11:13 ` [PATCH 5/9] ARM: shmobile: r7s72100: Add RSPI clocks for DT Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH V3 7/9] ARM: shmobile: genmai reference: " Geert Uytterhoeven
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
V2:
- No changes
V3:
- No changes
arch/arm/boot/dts/r7s72100.dtsi | 65 +++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ff0bd6be454f..42e9b423476c 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -34,6 +34,11 @@
gpio10 = &port10;
gpio11 = &port11;
gpio12 = &jtagport0;
+ spi0 = &spi0;
+ spi1 = &spi1;
+ spi2 = &spi2;
+ spi3 = &spi3;
+ spi4 = &spi4;
};
cpus {
@@ -289,4 +294,64 @@
clock-frequency = <100000>;
status = "disabled";
};
+
+ spi0: spi@e800c800 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800c800 0x24>;
+ interrupts = <0 238 IRQ_TYPE_LEVEL_HIGH>,
+ <0 239 IRQ_TYPE_LEVEL_HIGH>,
+ <0 240 IRQ_TYPE_LEVEL_HIGH>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ spi1: spi@e800d000 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800d000 0x24>;
+ interrupts = <0 241 IRQ_TYPE_LEVEL_HIGH>,
+ <0 242 IRQ_TYPE_LEVEL_HIGH>,
+ <0 243 IRQ_TYPE_LEVEL_HIGH>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ spi2: spi@e800d800 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800d800 0x24>;
+ interrupts = <0 244 IRQ_TYPE_LEVEL_HIGH>,
+ <0 245 IRQ_TYPE_LEVEL_HIGH>,
+ <0 246 IRQ_TYPE_LEVEL_HIGH>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ spi3: spi@e800e000 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800e000 0x24>;
+ interrupts = <0 247 IRQ_TYPE_LEVEL_HIGH>,
+ <0 248 IRQ_TYPE_LEVEL_HIGH>,
+ <0 249 IRQ_TYPE_LEVEL_HIGH>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
+
+ spi4: spi@e800e800 {
+ compatible = "renesas,rspi-r7s72100", "renesas,rspi-rz";
+ reg = <0xe800e800 0x24>;
+ interrupts = <0 250 IRQ_TYPE_LEVEL_HIGH>,
+ <0 251 IRQ_TYPE_LEVEL_HIGH>,
+ <0 252 IRQ_TYPE_LEVEL_HIGH>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH V3 7/9] ARM: shmobile: genmai reference: Add RSPI nodes
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
` (4 preceding siblings ...)
2014-01-12 11:13 ` [PATCH V3 6/9] ARM: shmobile: r7s72100 dtsi: Add RSPI nodes Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 8/9] ARM: shmobile: r8a7791 dtsi: Add QSPI node Geert Uytterhoeven
[not found] ` <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
7 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Add pinctrl and SPI devices for RSPI on Genmai.
On this board, only rspi4 is in use. Its bus contains a single device
(a wm8978 audio codec), for which no bindings are defined yet.
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
V2:
- Use generic "codec" instead of specific "wm8978" node name.
V3:
- No changes
arch/arm/boot/dts/r7s72100-genmai-reference.dts | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/r7s72100-genmai-reference.dts b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
index 367af5c133e0..c2cc4bd5a470 100644
--- a/arch/arm/boot/dts/r7s72100-genmai-reference.dts
+++ b/arch/arm/boot/dts/r7s72100-genmai-reference.dts
@@ -43,7 +43,7 @@
};
&pfc {
- pinctrl-0 = <&scif2_pins ðernet_pins>;
+ pinctrl-0 = <&scif2_pins ðernet_pins &rspi4_pins>;
pinctrl-names = "default";
scif2_pins: serial2 {
@@ -73,6 +73,12 @@
"ethernet_int_p1_15";
renesas,function = "ethernet";
};
+
+ rspi4_pins: spi4 {
+ renesas,groups = "rspi4_rspck_p4_0", "rspi4_ssl0_p4_1",
+ "rspi4_mosi_p4_2", "rspi4_miso_p4_3";
+ renesas,function = "rspi4";
+ };
};
&i2c2 {
@@ -85,3 +91,13 @@
pagesize = <64>;
};
};
+
+&spi4 {
+ status = "okay";
+
+ codec: codec@0 {
+ compatible = "wlf,wm8978";
+ reg = <0>;
+ spi-max-frequency = <5000000>;
+ };
+};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 8/9] ARM: shmobile: r8a7791 dtsi: Add QSPI node
2014-01-12 11:13 [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
` (5 preceding siblings ...)
2014-01-12 11:13 ` [PATCH V3 7/9] ARM: shmobile: genmai reference: " Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
[not found] ` <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
7 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi, devicetree, linux-sh, linux-arm-kernel,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
---
arch/arm/boot/dts/r8a7791.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi
index 00ed0e0a9bcb..3233041d8a44 100644
--- a/arch/arm/boot/dts/r8a7791.dtsi
+++ b/arch/arm/boot/dts/r8a7791.dtsi
@@ -687,4 +687,16 @@
clock-output-names = "scifa3", "scifa4", "scifa5";
};
};
+
+ spi: spi@e6b10000 {
+ compatible = "renesas,qspi-r8a7791", "renesas,qspi";
+ reg = <0 0xe6b10000 0 0x2c>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&mstp9_clks R8A7791_CLK_QSPI_MOD>;
+ num-cs = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ };
};
--
1.7.9.5
^ permalink raw reply related [flat|nested] 19+ messages in thread
[parent not found: <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>]
* [PATCH 3/9] spi: rspi: Use NULL as the clock ID
[not found] ` <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 9/9] ARM: shmobile: koelsch: Add QSPI nodes Geert Uytterhoeven
2014-01-12 12:55 ` [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
2 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-sh-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
There's only one RSPI/QSPI clock, so we can use NULL as the clock ID
Signed-off-by: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
---
drivers/spi/spi-rspi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index b6439c9505ac..6fd4770d22bd 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1078,7 +1078,6 @@ static int rspi_probe(struct platform_device *pdev)
struct rspi_data *rspi;
int ret, irq;
unsigned int i;
- char clk_name[16];
const struct rspi_plat_data *rspi_pd = dev_get_platdata(&pdev->dev);
const struct spi_ops *ops;
const struct platform_device_id *id_entry = pdev->id_entry;
@@ -1108,8 +1107,7 @@ static int rspi_probe(struct platform_device *pdev)
goto error1;
}
- snprintf(clk_name, sizeof(clk_name), "%s%d", id_entry->name, pdev->id);
- rspi->clk = devm_clk_get(&pdev->dev, clk_name);
+ rspi->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(rspi->clk)) {
dev_err(&pdev->dev, "cannot get clock\n");
ret = PTR_ERR(rspi->clk);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 9/9] ARM: shmobile: koelsch: Add QSPI nodes
[not found] ` <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
2014-01-12 11:13 ` [PATCH 3/9] spi: rspi: Use NULL as the clock ID Geert Uytterhoeven
@ 2014-01-12 11:13 ` Geert Uytterhoeven
2014-01-12 12:55 ` [PATCH 0/9] Renesas RSPI/QSPI DT support Geert Uytterhoeven
2 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 11:13 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-sh-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Geert Uytterhoeven
From: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Add pinctrl and SPI devices for QSPI on Koelsch.
Add Spansion s25fl512s SPI FLASH and MTD partitions.
Signed-off-by: Geert Uytterhoeven <geert+renesas-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
---
arch/arm/boot/dts/r8a7791-koelsch.dts | 36 +++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index d5e42b396ef7..885b61e09638 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -123,6 +123,11 @@
renesas,groups = "scif1_data_d";
renesas,function = "scif1";
};
+
+ qspi_pins: spi {
+ renesas,groups = "qspi_ctrl", "qspi_data4";
+ renesas,function = "qspi";
+ };
};
&scif0 {
@@ -138,3 +143,34 @@
status = "okay";
};
+
+&spi {
+ pinctrl-0 = <&qspi_pins>;
+ pinctrl-names = "default";
+
+ status = "okay";
+
+ flash: flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "spansion,s25fl512s";
+ reg = <0>;
+ spi-max-frequency = <30000000>;
+ m25p,fast-read;
+
+ partition@0 {
+ label = "loader";
+ reg = <0x00000000 0x00080000>;
+ read-only;
+ };
+ partition@80000 {
+ label = "bootenv";
+ reg = <0x00080000 0x00080000>;
+ read-only;
+ };
+ partition@100000 {
+ label = "data";
+ reg = <0x00100000 0x03f00000>;
+ };
+ };
+};
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH 0/9] Renesas RSPI/QSPI DT support
[not found] ` <1389525222-3482-1-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
2014-01-12 11:13 ` [PATCH 3/9] spi: rspi: Use NULL as the clock ID Geert Uytterhoeven
2014-01-12 11:13 ` [PATCH 9/9] ARM: shmobile: koelsch: Add QSPI nodes Geert Uytterhoeven
@ 2014-01-12 12:55 ` Geert Uytterhoeven
[not found] ` <CAMuHMdWmFa-XsderYDp4jMw6r7fnwpm5XgQGfz8gEbCryXEkHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2 siblings, 1 reply; 19+ messages in thread
From: Geert Uytterhoeven @ 2014-01-12 12:55 UTC (permalink / raw)
To: Mark Brown, Simon Horman, Magnus Damm
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux-sh list,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
On Sun, Jan 12, 2014 at 12:13 PM, Geert Uytterhoeven
<geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
> [5/9] ARM: shmobile: r7s72100: Add RSPI clocks for DT
> [6/9][V3] ARM: shmobile: r7s72100 dtsi: Add RSPI nodes
> [7/9][V3] ARM: shmobile: genmai reference: Add RSPI nodes
> [8/9] ARM: shmobile: r8a7791 dtsi: Add QSPI node
> [9/9] ARM: shmobile: koelsch: Add QSPI nodes
Forgot to mention:
The ARM/shmobile part is based on renesas-devel-v3.13-rc7-20140109v2, with
Magnus' pinctrl, Wolfram's riic, Simon's sh_eth, Valentine's i2c pinctrl
and Laurent's SCIF DT work applied on top.
[Simon: I don't know in which order you will merge these. If you want me
to rebase my patches, just ask! Thanks!]
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 19+ messages in thread