* [PATCH 1/7] Documentation: devicetree: fix up pl011 clocks
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree
Cc: Mark Rutland, Russell King, pawel.moll, Arnd Bergmann, robh+dt,
linux-arm-kernel
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland@arm.com>
The "arm,pl011" device tree binding only describes the apb_pclk clock
input, which is not sufficient to use the device. Knowledge of the
uartclk clock input is required to be able to change the baud rate, as
the baud rate is derived from the reference uartclk input. On systems
where the uartclk input is not initially enabled, it is also required to
use the device in any fashion.
This patch adds the uartclk input to the pl011 device tree binding. The
clock-names property is also described, as it is an implied requirement
of the primecell binding the pl011 binding is derived from.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
---
Documentation/devicetree/bindings/serial/pl011.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/serial/pl011.txt b/Documentation/devicetree/bindings/serial/pl011.txt
index 5d2e840..f0a9e77 100644
--- a/Documentation/devicetree/bindings/serial/pl011.txt
+++ b/Documentation/devicetree/bindings/serial/pl011.txt
@@ -8,8 +8,10 @@ Required properties:
Optional properties:
- pinctrl: When present, must have one state named "sleep"
and one state named "default"
-- clocks: When present, must refer to exactly one clock named
- "apb_pclk"
+- clocks: When present, must refer to a clock named
+ "apb_pclk", and optionally "uartclk".
+- clock-names: When present, should include "apb_pclk" and
+ "uartclk", matching the clocks property.
- dmas: When present, may have one or two dma channels.
The first one must be named "rx", the second one
must be named "tx".
--
1.8.1.1
^ permalink raw reply related
* [PATCH 2/7] serial: amba-pl011: attempt to get uartclk by name
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Russell King, Arnd Bergmann
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
The primecell device tree binding (from which the pl011 binding is
derived from) states that the apb_pclk clock input should be listed
first for all primecell devices. The amba-pl011 driver requires the
uartclk clock input to enable the uart and calculate the correct uart
baud rate, but the way it currently grabs the clock means that it always
gets the first clock (which should be apb_pclk).
As the AMBA bus code grabs apb_pclk by name, some existing dts provide
uartclk then apb_pclk by name to work around this, in violation of both
the primecell binding and the pl011 binding. Some dtbs only provide
apb_pclk, which is evidently at a similar enough frequency to uartclk on
those platforms to allow the driver to function.
This patch attempts to fix the mess my having the amba-pl011 driver
first attempt to get uartclk by name. If this fails, it falls back to
the old behaviour of simply acquiring the first clock. This is
compatible with any old dtb, whether it lists uartclk by name or not,
and allows the driver to support dtbs which do not violate either
binding.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
drivers/tty/serial/amba-pl011.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index d58783d..067952a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2123,7 +2123,14 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
goto out;
}
- uap->clk = devm_clk_get(&dev->dev, NULL);
+ /*
+ * For compatibility with old DTBs and platform data, fall back to the
+ * first clock if there's not an explicitly named "uartclk" entry.
+ */
+ uap->clk = devm_clk_get(&dev->dev, "uartclk");
+ if (IS_ERR(uap->clk))
+ uap->clk = devm_clk_get(&dev->dev, NULL);
+
if (IS_ERR(uap->clk)) {
ret = PTR_ERR(uap->clk);
goto out;
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 3/7] Documentation: devicetree: fix up pl022 clocks
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Mark Brown, Linus Walleij, Arnd Bergmann
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
Currently the pl022 driver expects clocks, and dts provide them, yet the
binding does not mention clocks at all.
This patch adds a description of the clocks, "apb_pclk" (as required by
the primecell binding) and "sspclk" for the pl022 itself. The "sspclk"
name was chosen to match the official documentation, as currently a
variety of names are used in its place; it is expected that any
operating system supporting these can continue to do so in the absence
of an "sspclk" entry.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
Documentation/devicetree/bindings/spi/spi_pl022.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/spi_pl022.txt b/Documentation/devicetree/bindings/spi/spi_pl022.txt
index 22ed679..326e8e2 100644
--- a/Documentation/devicetree/bindings/spi/spi_pl022.txt
+++ b/Documentation/devicetree/bindings/spi/spi_pl022.txt
@@ -21,6 +21,8 @@ Optional properties:
- dma-names: Names for the dma channels, if present. There must be at
least one channel named "tx" for transmit and named "rx" for
receive.
+- clocks: phandle + clock-specifiers, one for each entry in clock-names.
+- clock-names: should contain "apb_pclk" and "sspclk".
SPI slave nodes must be children of the SPI master node and can
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 4/7] spi: pl022: attempt to get sspclk by name
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Mark Brown, Linus Walleij, Arnd Bergmann
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
The primecell device tree binding (from which the pl022 binding is
derived from) states that the apb_pclk clock input should be listed
first for all primecell devices. The spi-pl022 driver requires the
sspclk clock input to enable the SPI bus, but the way it currently grabs
the clock means that it always gets the first clock (which should be
apb_pclk).
As the AMBA bus code grabs apb_pclk by name, some existing dts provide
apb_pclk as the second clock in the clocks list to work around this, in
violation of both the primecell binding. The pl022 binding does not
mention clocks at all, so the first clock (SSPCLK) is given an arbitrary
name.
This patch attempts to fix the mess my having the spi-pl022 driver first
attempt to get sspclk by name. If this fails, it falls back to the old
behaviour of simply acquiring the first clock. This is compatible with
any old dtb, whether it lists sspclk by name or not, and allows the
driver to support dtbs which do not violate the bindings. Hopefully this
will lead to future uniformity across dtbs.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
drivers/spi/spi-pl022.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 2789b45..4b3941a 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2176,7 +2176,14 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
dev_info(&adev->dev, "mapped registers from %pa to %p\n",
&adev->res.start, pl022->virtbase);
- pl022->clk = devm_clk_get(&adev->dev, NULL);
+ /*
+ * For compatibility with old DTBs and platform data, fall back to the
+ * first clock if there's not an explicitly named "sspclk" entry.
+ */
+ pl022->clk = devm_clk_get(&adev->dev, "sspclk");
+ if (IS_ERR(pl022->clk))
+ pl022->clk = devm_clk_get(&adev->dev, NULL);
+
if (IS_ERR(pl022->clk)) {
status = PTR_ERR(pl022->clk);
dev_err(&adev->dev, "could not retrieve SSP/SPI bus clock\n");
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 5/7] Documentation: devicetree: fix up pl18x clocks
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Russell King, Arnd Bergmann, Chris Ball
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
Currently the pl18x driver expects clocks, and dts provide them, yet the
binding does not mention clocks at all.
This patch adds a description of the clocks, "apb_pclk" (as required by
the primecell binding) and "mclk" for the pl18x itself. The "mclk"
name was chosen to match the official documentation, as currently a
variety of names are used in its place; it is expected that any
operating system supporting these can continue to do so in the absence
of an "mclk" entry.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
Documentation/devicetree/bindings/mmc/mmci.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/mmc/mmci.txt b/Documentation/devicetree/bindings/mmc/mmci.txt
index 2b584ca..1b72d4d 100644
--- a/Documentation/devicetree/bindings/mmc/mmci.txt
+++ b/Documentation/devicetree/bindings/mmc/mmci.txt
@@ -9,6 +9,10 @@ by mmc.txt and the properties used by the mmci driver.
Required properties:
- compatible : contains "arm,pl18x", "arm,primecell".
- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
+- clocks : a list of phandles + clock-specifiers, one for each entry in
+ clock-names.
+- clock-names : should contain "apb_pclk" and "mclk".
+
Optional properties:
- mmc-cap-mmc-highspeed : indicates whether MMC is high speed capable
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 6/7] mmc: arm-mmci: attempt to get mclk by name
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Russell King, Arnd Bergmann, Chris Ball
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
The primecell device tree binding (from which the pl18x binding is
derived from) states that the apb_pclk clock input should be listed
first for all primecell devices. The arm-mmci driver requires the mclk
clock input, but the way it currently grabs the clock means that it
always gets the first clock (which should be apb_pclk).
As the AMBA bus code grabs apb_pclk by name, some existing dts provide
apb_pclk as the second clock in the clocks list to work around this, in
violation of both the primecell binding. The pl18x binding does not
mention clocks at all, so the first clock (MCLK) is given an arbitrary
name.
This patch attempts to fix the mess my having the arm-mmci driver first
attempt to get mclk by name. If this fails, it falls back to the old
behaviour of simply acquiring the first clock. This is compatible with
any old dtb, whether it lists mclk by name or not, and allows the driver
to support dtbs which do not violate the bindings. Hopefully this will
lead to future uniformity across dtbs.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
drivers/mmc/host/mmci.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index b931226..4af962c 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1470,7 +1470,14 @@ static int mmci_probe(struct amba_device *dev,
dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer);
dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision);
- host->clk = devm_clk_get(&dev->dev, NULL);
+ /*
+ * For compatibility with old DTBs and platform data, fall back to the
+ * first clock if there's not an explicitly named "mclk" entry.
+ */
+ host->clk = devm_clk_get(&dev->dev, "mclk");
+ if (IS_ERR(host->clk))
+ host->clk = devm_clk_get(&dev->dev, NULL);
+
if (IS_ERR(host->clk)) {
ret = PTR_ERR(host->clk);
goto host_free;
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [PATCH 7/7] Documentation: devicetree: loosen primecell clock requirements
From: Mark Rutland @ 2014-02-11 11:37 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Mark Rutland, Grant Likely, Arnd Bergmann
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
The primecell binding requires the APB PCLK (named "apb_pclk") to be the
first entry in the clocks list, yet existing drivers and dts files
expect other clocks first, in clear violation of this requirement.
Additionally, the code handling the apb_pclk always acquires the clock
by name rather than index, making the requirement irrelevant.
As there are no other implementations handling the primecell bindings,
this patch loosens the requirements to an apb_pclk entry existing in the
clocks list. This is compatible with existing software, and any new
software handling the weaker requirements will be able to use existing
dts. Any software relying on the original stricter requirements will be
unable to use many existing dts, so the loosened requirement aids
compatibility rather than hindering it.
Signed-off-by: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
---
Documentation/devicetree/bindings/arm/primecell.txt | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/primecell.txt b/Documentation/devicetree/bindings/arm/primecell.txt
index 0df6aca..0a66506 100644
--- a/Documentation/devicetree/bindings/arm/primecell.txt
+++ b/Documentation/devicetree/bindings/arm/primecell.txt
@@ -13,9 +13,10 @@ Required properties:
Optional properties:
- arm,primecell-periphid : Value to override the h/w value with
-- clocks : From common clock binding. First clock is phandle to clock for apb
- pclk. Additional clocks are optional and specific to those peripherals.
-- clock-names : From common clock binding. Shall be "apb_pclk" for first clock.
+- clocks : From common clock binding. One clock must be the apb pclk.
+ Additional clocks are optional and specific to those peripherals.
+- clock-names : From common clock binding. Shall include "apb_pclk" for the apb
+ pclk.
- dmas : From common DMA binding. If present, refers to one or more dma channels.
- dma-names : From common DMA binding, needs to match the 'dmas' property.
Devices with exactly one receive and transmit channel shall name
@@ -31,8 +32,8 @@ serial@fff36000 {
compatible = "arm,pl011", "arm,primecell";
arm,primecell-periphid = <0x00341011>;
- clocks = <&pclk>;
- clock-names = "apb_pclk";
+ clocks = <&refclk>, <&pclk>;
+ clock-names = "uartclk", "apb_pclk";
dmas = <&dma-controller 4>, <&dma-controller 5>;
dma-names = "rx", "tx";
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* [RFC PATCH] [media]: of: move graph helpers from drivers/media/v4l2-core to drivers/of
From: Philipp Zabel @ 2014-02-11 11:45 UTC (permalink / raw)
To: Russell King - ARM Linux, Mauro Carvalho Chehab
Cc: Grant Likely, Rob Herring, Sylwester Nawrocki, Laurent Pinchart,
Tomi Valkeinen, Kyungmin Park, linux-kernel, linux-media,
devicetree, Philipp Zabel, Philipp Zabel
From: Philipp Zabel <philipp.zabel@gmail.com>
This patch moves the parsing helpers used to parse connected graphs
in the device tree, like the video interface bindings documented in
Documentation/devicetree/bindings/media/video-interfaces.txt, from
drivers/media/v4l2-core to drivers/of.
This allows to reuse the same parser code from outside the V4L2 framework,
most importantly from display drivers. There have been patches that duplicate
the code (and I am going to send one of my own), such as
http://lists.freedesktop.org/archives/dri-devel/2013-August/043308.html
and others that parse the same binding in a different way:
https://www.mail-archive.com/linux-omap@vger.kernel.org/msg100761.html
I think that all common video interface parsing helpers should be moved to a
single place, outside of the specific subsystems, so that it can be reused
by all drivers.
I moved v4l2_of_get_next_endpoint, v4l2_of_get_remote_port,
and v4l2_of_get_remote_port_parent. They are renamed to
of_graph_get_next_endpoint, of_graph_get_remote_port, and
of_graph_get_remote_port_parent, respectively.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/media/Kconfig | 1 +
drivers/media/v4l2-core/v4l2-of.c | 117 ---------------------------------
drivers/of/Kconfig | 3 +
drivers/of/Makefile | 1 +
drivers/of/of_graph.c | 133 ++++++++++++++++++++++++++++++++++++++
include/linux/of_graph.h | 23 +++++++
include/media/v4l2-of.h | 16 ++---
7 files changed, 167 insertions(+), 127 deletions(-)
create mode 100644 drivers/of/of_graph.c
create mode 100644 include/linux/of_graph.h
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 1d0758a..882faeb 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -96,6 +96,7 @@ config VIDEO_DEV
tristate
depends on MEDIA_SUPPORT
depends on MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT
+ select OF_GRAPH if OF
default y
config VIDEO_V4L2_SUBDEV_API
diff --git a/drivers/media/v4l2-core/v4l2-of.c b/drivers/media/v4l2-core/v4l2-of.c
index 42e3e8a..f919db3 100644
--- a/drivers/media/v4l2-core/v4l2-of.c
+++ b/drivers/media/v4l2-core/v4l2-of.c
@@ -152,120 +152,3 @@ int v4l2_of_parse_endpoint(const struct device_node *node,
return 0;
}
EXPORT_SYMBOL(v4l2_of_parse_endpoint);
-
-/**
- * v4l2_of_get_next_endpoint() - get next endpoint node
- * @parent: pointer to the parent device node
- * @prev: previous endpoint node, or NULL to get first
- *
- * Return: An 'endpoint' node pointer with refcount incremented. Refcount
- * of the passed @prev node is not decremented, the caller have to use
- * of_node_put() on it when done.
- */
-struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
- struct device_node *prev)
-{
- struct device_node *endpoint;
- struct device_node *port = NULL;
-
- if (!parent)
- return NULL;
-
- if (!prev) {
- struct device_node *node;
- /*
- * It's the first call, we have to find a port subnode
- * within this node or within an optional 'ports' node.
- */
- node = of_get_child_by_name(parent, "ports");
- if (node)
- parent = node;
-
- port = of_get_child_by_name(parent, "port");
-
- if (port) {
- /* Found a port, get an endpoint. */
- endpoint = of_get_next_child(port, NULL);
- of_node_put(port);
- } else {
- endpoint = NULL;
- }
-
- if (!endpoint)
- pr_err("%s(): no endpoint nodes specified for %s\n",
- __func__, parent->full_name);
- of_node_put(node);
- } else {
- port = of_get_parent(prev);
- if (!port)
- /* Hm, has someone given us the root node ?... */
- return NULL;
-
- /* Avoid dropping prev node refcount to 0. */
- of_node_get(prev);
- endpoint = of_get_next_child(port, prev);
- if (endpoint) {
- of_node_put(port);
- return endpoint;
- }
-
- /* No more endpoints under this port, try the next one. */
- do {
- port = of_get_next_child(parent, port);
- if (!port)
- return NULL;
- } while (of_node_cmp(port->name, "port"));
-
- /* Pick up the first endpoint in this port. */
- endpoint = of_get_next_child(port, NULL);
- of_node_put(port);
- }
-
- return endpoint;
-}
-EXPORT_SYMBOL(v4l2_of_get_next_endpoint);
-
-/**
- * v4l2_of_get_remote_port_parent() - get remote port's parent node
- * @node: pointer to a local endpoint device_node
- *
- * Return: Remote device node associated with remote endpoint node linked
- * to @node. Use of_node_put() on it when done.
- */
-struct device_node *v4l2_of_get_remote_port_parent(
- const struct device_node *node)
-{
- struct device_node *np;
- unsigned int depth;
-
- /* Get remote endpoint node. */
- np = of_parse_phandle(node, "remote-endpoint", 0);
-
- /* Walk 3 levels up only if there is 'ports' node. */
- for (depth = 3; depth && np; depth--) {
- np = of_get_next_parent(np);
- if (depth == 2 && of_node_cmp(np->name, "ports"))
- break;
- }
- return np;
-}
-EXPORT_SYMBOL(v4l2_of_get_remote_port_parent);
-
-/**
- * v4l2_of_get_remote_port() - get remote port node
- * @node: pointer to a local endpoint device_node
- *
- * Return: Remote port node associated with remote endpoint node linked
- * to @node. Use of_node_put() on it when done.
- */
-struct device_node *v4l2_of_get_remote_port(const struct device_node *node)
-{
- struct device_node *np;
-
- /* Get remote endpoint node. */
- np = of_parse_phandle(node, "remote-endpoint", 0);
- if (!np)
- return NULL;
- return of_get_next_parent(np);
-}
-EXPORT_SYMBOL(v4l2_of_get_remote_port);
diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
index c6973f1..1bfbb0e 100644
--- a/drivers/of/Kconfig
+++ b/drivers/of/Kconfig
@@ -75,4 +75,7 @@ config OF_MTD
depends on MTD
def_bool y
+config OF_GRAPH
+ bool
+
endmenu # OF
diff --git a/drivers/of/Makefile b/drivers/of/Makefile
index efd0510..7ee8ab3 100644
--- a/drivers/of/Makefile
+++ b/drivers/of/Makefile
@@ -9,3 +9,4 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o
obj-$(CONFIG_OF_PCI) += of_pci.o
obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o
obj-$(CONFIG_OF_MTD) += of_mtd.o
+obj-$(CONFIG_OF_GRAPH) += of_graph.o
diff --git a/drivers/of/of_graph.c b/drivers/of/of_graph.c
new file mode 100644
index 0000000..aa526d7
--- /dev/null
+++ b/drivers/of/of_graph.c
@@ -0,0 +1,133 @@
+/*
+ * OF graph binding parsing library
+ *
+ * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd.
+ * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
+ *
+ * Copyright (C) 2012 Renesas Electronics Corp.
+ * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/types.h>
+
+/**
+ * of_graph_get_next_endpoint() - get next endpoint node
+ * @parent: pointer to the parent device node
+ * @prev: previous endpoint node, or NULL to get first
+ *
+ * Return: An 'endpoint' node pointer with refcount incremented. Refcount
+ * of the passed @prev node is not decremented, the caller have to use
+ * of_node_put() on it when done.
+ */
+struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
+ struct device_node *prev)
+{
+ struct device_node *endpoint;
+ struct device_node *port = NULL;
+
+ if (!parent)
+ return NULL;
+
+ if (!prev) {
+ struct device_node *node;
+ /*
+ * It's the first call, we have to find a port subnode
+ * within this node or within an optional 'ports' node.
+ */
+ node = of_get_child_by_name(parent, "ports");
+ if (node)
+ parent = node;
+
+ port = of_get_child_by_name(parent, "port");
+
+ if (port) {
+ /* Found a port, get an endpoint. */
+ endpoint = of_get_next_child(port, NULL);
+ of_node_put(port);
+ } else {
+ endpoint = NULL;
+ }
+
+ if (!endpoint)
+ pr_err("%s(): no endpoint nodes specified for %s\n",
+ __func__, parent->full_name);
+ of_node_put(node);
+ } else {
+ port = of_get_parent(prev);
+ if (!port)
+ /* Hm, has someone given us the root node ?... */
+ return NULL;
+
+ /* Avoid dropping prev node refcount to 0. */
+ of_node_get(prev);
+ endpoint = of_get_next_child(port, prev);
+ if (endpoint) {
+ of_node_put(port);
+ return endpoint;
+ }
+
+ /* No more endpoints under this port, try the next one. */
+ do {
+ port = of_get_next_child(parent, port);
+ if (!port)
+ return NULL;
+ } while (of_node_cmp(port->name, "port"));
+
+ /* Pick up the first endpoint in this port. */
+ endpoint = of_get_next_child(port, NULL);
+ of_node_put(port);
+ }
+
+ return endpoint;
+}
+EXPORT_SYMBOL(of_graph_get_next_endpoint);
+
+/**
+ * of_graph_get_remote_port_parent() - get remote port's parent node
+ * @node: pointer to a local endpoint device_node
+ *
+ * Return: Remote device node associated with remote endpoint node linked
+ * to @node. Use of_node_put() on it when done.
+ */
+struct device_node *of_graph_get_remote_port_parent(
+ const struct device_node *node)
+{
+ struct device_node *np;
+ unsigned int depth;
+
+ /* Get remote endpoint node. */
+ np = of_parse_phandle(node, "remote-endpoint", 0);
+
+ /* Walk 3 levels up only if there is 'ports' node. */
+ for (depth = 3; depth && np; depth--) {
+ np = of_get_next_parent(np);
+ if (depth == 2 && of_node_cmp(np->name, "ports"))
+ break;
+ }
+ return np;
+}
+EXPORT_SYMBOL(of_graph_get_remote_port_parent);
+
+/**
+ * of_graph_get_remote_port() - get remote port node
+ * @node: pointer to a local endpoint device_node
+ *
+ * Return: Remote port node associated with remote endpoint node linked
+ * to @node. Use of_node_put() on it when done.
+ */
+struct device_node *of_graph_get_remote_port(const struct device_node *node)
+{
+ struct device_node *np;
+
+ /* Get remote endpoint node. */
+ np = of_parse_phandle(node, "remote-endpoint", 0);
+ if (!np)
+ return NULL;
+ return of_get_next_parent(np);
+}
+EXPORT_SYMBOL(of_graph_get_remote_port);
diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h
new file mode 100644
index 0000000..352306a
--- /dev/null
+++ b/include/linux/of_graph.h
@@ -0,0 +1,23 @@
+/*
+ * OF graph binding parsing helpers
+ *
+ * Copyright (C) 2012 - 2013 Samsung Electronics Co., Ltd.
+ * Author: Sylwester Nawrocki <s.nawrocki@samsung.com>
+ *
+ * Copyright (C) 2012 Renesas Electronics Corp.
+ * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ */
+#ifndef __LINUX_OF_GRAPH_H
+#define __LINUX_OF_GRAPH_H
+
+struct device_node *of_graph_get_next_endpoint(const struct device_node *parent,
+ struct device_node *previous);
+struct device_node *of_graph_get_remote_port_parent(
+ const struct device_node *node);
+struct device_node *of_graph_get_remote_port(const struct device_node *node);
+
+#endif /* __LINUX_OF_GRAPH_H */
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 541cea4..404a493 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -17,6 +17,7 @@
#include <linux/list.h>
#include <linux/types.h>
#include <linux/errno.h>
+#include <linux/of_graph.h>
#include <media/v4l2-mediabus.h>
@@ -72,11 +73,6 @@ struct v4l2_of_endpoint {
#ifdef CONFIG_OF
int v4l2_of_parse_endpoint(const struct device_node *node,
struct v4l2_of_endpoint *endpoint);
-struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
- struct device_node *previous);
-struct device_node *v4l2_of_get_remote_port_parent(
- const struct device_node *node);
-struct device_node *v4l2_of_get_remote_port(const struct device_node *node);
#else /* CONFIG_OF */
static inline int v4l2_of_parse_endpoint(const struct device_node *node,
@@ -85,25 +81,25 @@ static inline int v4l2_of_parse_endpoint(const struct device_node *node,
return -ENOSYS;
}
+#endif /* CONFIG_OF */
+
static inline struct device_node *v4l2_of_get_next_endpoint(
const struct device_node *parent,
struct device_node *previous)
{
- return NULL;
+ return of_graph_get_next_endpoint(parent, previous);
}
static inline struct device_node *v4l2_of_get_remote_port_parent(
const struct device_node *node)
{
- return NULL;
+ return of_graph_get_remote_port_parent(node);
}
static inline struct device_node *v4l2_of_get_remote_port(
const struct device_node *node)
{
- return NULL;
+ return of_graph_get_remote_port(node);
}
-#endif /* CONFIG_OF */
-
#endif /* _V4L2_OF_H */
--
1.8.5.3
^ permalink raw reply related
* Re: [PATCH] can: xilinx CAN controller support.
From: Michal Simek @ 2014-02-11 11:45 UTC (permalink / raw)
To: Marc Kleine-Budde, robh+dt@kernel.org, Arnd Bergmann
Cc: Appana Durga Kedareswara Rao, wg@grandegger.com,
grant.likely@linaro.org, linux-can@vger.kernel.org,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
In-Reply-To: <52F4A960.10809@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 5007 bytes --]
Hi Marc,
On 02/07/2014 10:37 AM, Marc Kleine-Budde wrote:
> On 02/07/2014 09:42 AM, Appana Durga Kedareswara Rao wrote:
>>>> ---
>>>> This patch is rebased on the 3.14 rc1 kernel.
>>>> ---
>>>> .../devicetree/bindings/net/can/xilinx_can.txt | 43 +
>>>> drivers/net/can/Kconfig | 8 +
>>>> drivers/net/can/Makefile | 1 +
>>>> drivers/net/can/xilinx_can.c | 1150 ++++++++++++++++++++
>>>> 4 files changed, 1202 insertions(+), 0 deletions(-) create mode
>>>> 100644 Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>> create mode 100644 drivers/net/can/xilinx_can.c
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>> b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>> new file mode 100644
>>>> index 0000000..34f9643
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>> @@ -0,0 +1,43 @@
>>>> +Xilinx Axi CAN/Zynq CANPS controller Device Tree Bindings
>>>> +---------------------------------------------------------
>>>> +
>>>> +Required properties:
>>>> +- compatible : Should be "xlnx,zynq-can-1.00.a" for Zynq
>>> CAN
>>>> + controllers and "xlnx,axi-can-1.00.a" for Axi CAN
>>>> + controllers.
>>>> +- reg : Physical base address and size of the Axi CAN/Zynq
>>>> + CANPS registers map.
>>>> +- interrupts : Property with a value describing the interrupt
>>>> + number.
>>>> +- interrupt-parent : Must be core interrupt controller
>>>> +- clock-names : List of input clock names - "ref_clk",
>>> "aper_clk"
>>>> + (See clock bindings for details. Two clocks are
>>>> + required for Zynq CAN. For Axi CAN
>>>> + case it is one(ref_clk)).
>>>> +- clocks : Clock phandles (see clock bindings for details).
>>>> +- xlnx,can-tx-dpth : Can Tx fifo depth (Required for Axi CAN).
>>>> +- xlnx,can-rx-dpth : Can Rx fifo depth (Required for Axi CAN).
>>>> +
>>>> +
>>>> +Example:
>>>> +
>>>> +For Zynq CANPS Dts file:
>>>> + zynq_can_0: zynq-can@e0008000 {
>>>> + compatible = "xlnx,zynq-can-1.00.a";
>>>> + clocks = <&clkc 19>, <&clkc 36>;
>>>> + clock-names = "ref_clk", "aper_clk";
>>>> + reg = <0xe0008000 0x1000>;
>>>> + interrupts = <0 28 4>;
>>>> + interrupt-parent = <&intc>;
>>>
>>> Above xlnx,can-{rx,tx}-dpth is mentioned as required, but it's not in the
>>> Zynq example.
>>
>> One of the Difference b/w the AXI CAN and zynq CAN is in AXI CAN the fifo depth(tx,rx)
>> Is user configurable. But in case of ZYNQ CAN the fifo depth is fixed for tx and rx fifo's(64)
>> Xlnx,can-{rx,tx}-dpth is required only for AXI CAN case it is not required for zynq CAN.
>> That's why didn't putted that property in device tree.
>
> The device tree should be a hardware only description and should not
> hold any user configurable data. Please split your patch into two
> patches. The first one should add the driver with a fixed fifo size
> (e.g. 0x40) for the AXI, too. The second patch should make the fifo
> configurable via device tree.
can-rx/tx-dpth is not user configurable data as you think.
This is FPGA where you can configure this parameter in design tools.
It means these 2 values just describe real hardware and user can't just change it
for different software behaviour.
Also I don't think it is worth to create 2 patches for the same driver
where the first one is useless for axi can device. But if you think
that it is worth to do we can create 2 patches as you suggested.
Also what we can do is to define that this property is required also
for zynq which is 0x40 and change code according too.
> If it's acceptable to describe the fifo usage by device tree, I'd like
> to make it a generic CAN driver option. But we have to look around, e.g.
> what the Ethernet driver use to configure their hardware.
I think the real question is not if this is acceptable or not. It is just
reality that we can setup hardware fifo depth and driver has to reflect this
because without it driver just doesn't work for axi can.
The only remaining question is if we should create generic DT binding
for fifo depth. Arnd, Rob: Any opinion about it?
Definitely will be worth to have one generic binding if this is generic feature.
But if this is just specific feature for us then current properties should
be fine.
In general all these xlnx,XXX properties just reflect all configurable options
which you can setup in design tool which means that provide full hw description
with all variants and they are automatically generated from tools.
Please let me know what you think.
Thanks,
Michal
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]
^ permalink raw reply
* Re: [PATCH v2 1/5] drivers: of: add initialization code for reserved memory
From: Marek Szyprowski @ 2014-02-11 11:45 UTC (permalink / raw)
To: Grant Likely, linux-kernel, linux-arm-kernel, linaro-mm-sig,
devicetree, linux-doc
Cc: Kyungmin Park, Benjamin Herrenschmidt, Arnd Bergmann,
Michal Nazarewicz, Tomasz Figa, Sascha Hauer, Laura Abbott,
Rob Herring, Olof Johansson, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Tomasz Figa, Kumar Gala,
Nishanth Peethambaran, Marc, Josh Cartwright
In-Reply-To: <20140205110538.99E47C40A89@trevor.secretlab.ca>
Hello,
On 2014-02-05 12:05, Grant Likely wrote:
> On Tue, 04 Feb 2014 13:09:29 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> > This patch adds device tree support for contiguous and reserved memory
> > regions defined in device tree.
> >
> > Large memory blocks can be reliably reserved only during early boot.
> > This must happen before the whole memory management subsystem is
> > initialized, because we need to ensure that the given contiguous blocks
> > are not yet allocated by kernel. Also it must happen before kernel
> > mappings for the whole low memory are created, to ensure that there will
> > be no mappings (for reserved blocks) or mapping with special properties
> > can be created (for CMA blocks). This all happens before device tree
> > structures are unflattened, so we need to get reserved memory layout
> > directly from fdt.
> >
> > Later, those reserved memory regions are assigned to devices on each
> > device structure initialization.
> >
> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Cc: Laura Abbott <lauraa@codeaurora.org>
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > [joshc: rework to implement new DT binding, provide mechanism for
> > plugging in new reserved-memory node handlers via
> > RESERVEDMEM_OF_DECLARE]
> > Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
> > [mszyprow: little code cleanup]
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > ---
> > drivers/of/Kconfig | 6 +
> > drivers/of/Makefile | 1 +
> > drivers/of/of_reserved_mem.c | 219 +++++++++++++++++++++++++++++++++++++
> > drivers/of/platform.c | 7 ++
> > include/asm-generic/vmlinux.lds.h | 11 ++
> > include/linux/of_reserved_mem.h | 62 +++++++++++
> > 6 files changed, 306 insertions(+)
> > create mode 100644 drivers/of/of_reserved_mem.c
> > create mode 100644 include/linux/of_reserved_mem.h
> >
> > diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> > index c6973f101a3e..aba13df56f3a 100644
> > --- a/drivers/of/Kconfig
> > +++ b/drivers/of/Kconfig
> > @@ -75,4 +75,10 @@ config OF_MTD
> > depends on MTD
> > def_bool y
> >
> > +config OF_RESERVED_MEM
> > + depends on HAVE_MEMBLOCK
> > + def_bool y
> > + help
> > + Helpers to allow for reservation of memory regions
> > +
> > endmenu # OF
> > diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> > index efd05102c405..ed9660adad77 100644
> > --- a/drivers/of/Makefile
> > +++ b/drivers/of/Makefile
> > @@ -9,3 +9,4 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o
> > obj-$(CONFIG_OF_PCI) += of_pci.o
> > obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o
> > obj-$(CONFIG_OF_MTD) += of_mtd.o
> > +obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o
> > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> > new file mode 100644
> > index 000000000000..f17cd56e68d9
> > --- /dev/null
> > +++ b/drivers/of/of_reserved_mem.c
> > @@ -0,0 +1,219 @@
> > +/*
> > + * Device tree based initialization code for reserved memory.
> > + *
> > + * Copyright (c) 2013, The Linux Foundation. All Rights Reserved.
> > + * Copyright (c) 2013 Samsung Electronics Co., Ltd.
> > + * http://www.samsung.com
> > + * Author: Marek Szyprowski <m.szyprowski@samsung.com>
> > + * Author: Josh Cartwright <joshc@codeaurora.org>
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of the
> > + * License or (at your optional) any later version of the license.
> > + */
> > +#include <linux/memblock.h>
> > +#include <linux/err.h>
> > +#include <linux/of.h>
> > +#include <linux/of_fdt.h>
> > +#include <linux/of_platform.h>
> > +#include <linux/mm.h>
> > +#include <linux/sizes.h>
> > +#include <linux/of_reserved_mem.h>
> > +
> > +#define MAX_RESERVED_REGIONS 16
> > +static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
> > +static int reserved_mem_count;
> > +
> > +int __init of_parse_flat_dt_reg(unsigned long node, const char *uname,
> > + phys_addr_t *base, phys_addr_t *size)
>
> Useful utility function; move to drivers/of/fdt.c
>
> > +{
> > + unsigned long len;
> > + __be32 *prop;
> > +
> > + prop = of_get_flat_dt_prop(node, "reg", &len);
> > + if (!prop)
> > + return -EINVAL;
> > +
> > + if (len < (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32)) {
> > + pr_err("Reserved memory: invalid reg property in '%s' node.\n",
> > + uname);
> > + return -EINVAL;
> > + }
>
> This is /okay/ for an initial implementation, but it is naive. While I
> suggested making #address-cells and #size-cells equal the root node
> values for the purpose of simplicity, it should still be perfectly valid
> to have different values if the ranges property is correctly formed.
>
> > +
> > + *base = dt_mem_next_cell(dt_root_addr_cells, &prop);
> > + *size = dt_mem_next_cell(dt_root_size_cells, &prop);
>
> Future enhancement; allow for parsing more than just the first reg
> tuple.
One more question. Does it really makes any sense to support more than
one tuple
for reg property? For consistency we should also allow more than one
entry in
size, align and alloc-ranges property, but I don't see any benefits for
defining
more than one range for a single region. Same can be achieved by
defining more
regions instead if one really needs such configuration.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply
* [PATCH v2 0/2] Support of the kmcoge4 board
From: Valentin Longchamp @ 2014-02-11 11:50 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: Valentin Longchamp, devicetree
This series adds support for Keymile's COGE4 board, called kmcoge4. This
board is the reference design for further designs at Keymile around the
P2040/P2041 SoCs from Freescale. This reference design is internally
called kmp204x.
Changes in v2:
- add a patch so that the Zarlink vendor prefix is defined
- add some nodes on the localbus CS when possible
- only use the corenet_generic machine and add kmcoge4 to the supported
boards instead of defining a new kmp204x machine
- set better and more precise device nodes for the spi devices
- remove the partion layout for the spi_flash@0
Valentin Longchamp (2):
devicetree: bindings: add Zarlink to the vendor prefixes
powerpc/mpc85xx: add support for Keymile's kmcoge4 board
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/powerpc/boot/dts/kmcoge4.dts | 161 +++++++++++++++
arch/powerpc/configs/85xx/kmp204x_defconfig | 227 +++++++++++++++++++++
arch/powerpc/platforms/85xx/Kconfig | 2 +-
arch/powerpc/platforms/85xx/corenet_generic.c | 3 +-
5 files changed, 392 insertions(+), 2 deletions(-)
create mode 100644 arch/powerpc/boot/dts/kmcoge4.dts
create mode 100644 arch/powerpc/configs/85xx/kmp204x_defconfig
--
1.8.0.1
^ permalink raw reply
* [PATCH v2 1/2] devicetree: bindings: add Zarlink to the vendor prefixes
From: Valentin Longchamp @ 2014-02-11 11:50 UTC (permalink / raw)
To: Scott Wood, linuxppc-dev; +Cc: Valentin Longchamp, devicetree
In-Reply-To: <1392119407-29490-1-git-send-email-valentin.longchamp@keymile.com>
Even though the company belongs to Microsemi, many chips are still
labeled as Zarlink. Among them is the family of network clock generators,
the zl3034x.
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
Changes in v2:
- add a patch so that the Zarlink vendor prefix is defined
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index edbb8d8..35f1c9b 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -81,3 +81,4 @@ winbond Winbond Electronics corp.
wlf Wolfson Microelectronics
wm Wondermedia Technologies, Inc.
xlnx Xilinx
+zarlink Zarlink Semiconductor
--
1.8.0.1
^ permalink raw reply related
* Re: [PATCH v2 4/5] ARM: init: add support for reserved memory defined by device tree
From: Grant Likely @ 2014-02-11 11:50 UTC (permalink / raw)
To: Marek Szyprowski, linux-kernel, linux-arm-kernel, linaro-mm-sig,
devicetree, linux-doc
Cc: Kyungmin Park, Benjamin Herrenschmidt, Arnd Bergmann,
Michal Nazarewicz, Tomasz Figa, Sascha Hauer, Laura Abbott,
Rob Herring, Olof Johansson, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Tomasz Figa, Kumar Gala,
Nishanth Peethambaran, Marc, Josh Cartwright
In-Reply-To: <52FA00FA.1090400@samsung.com>
On Tue, 11 Feb 2014 11:52:42 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> On 2014-02-10 22:59, Grant Likely wrote:
> > On Thu, 06 Feb 2014 14:26:13 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> > > Hello,
> > >
> > > On 2014-02-05 11:15, Grant Likely wrote:
> > > > On Tue, 04 Feb 2014 13:09:32 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> > > > > Enable reserved memory initialization from device tree.
> > > > >
> > > > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > > > Cc: Laura Abbott <lauraa@codeaurora.org>
> > > > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > > > ---
> > > > > arch/arm/mm/init.c | 3 +++
> > > > > 1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> > > > > index 804d61566a53..ebafdb479410 100644
> > > > > --- a/arch/arm/mm/init.c
> > > > > +++ b/arch/arm/mm/init.c
> > > > > @@ -17,6 +17,7 @@
> > > > > #include <linux/nodemask.h>
> > > > > #include <linux/initrd.h>
> > > > > #include <linux/of_fdt.h>
> > > > > +#include <linux/of_reserved_mem.h>
> > > > > #include <linux/highmem.h>
> > > > > #include <linux/gfp.h>
> > > > > #include <linux/memblock.h>
> > > > > @@ -323,6 +324,8 @@ void __init arm_memblock_init(struct meminfo *mi,
> > > > > if (mdesc->reserve)
> > > > > mdesc->reserve();
> > > > >
> > > > > + early_init_dt_scan_reserved_mem();
> > > > > +
> > > >
> > > > The new binding is being made fundamental. If the reserved-memory node
> > > > is present, then it needs to be honored, even if the kernel doesn't know
> > > > how to use the regions. Therefore, This needs to be unconditional for
> > > > all architectures. The hook should be called in early_init_dt_scan()
> > > > (drivers/of/fdt.c) immediately after the early_init_dt_scan_memory()
> > > > hook.
> > >
> > > In theory this will be the best solution, but it practice there is a
> > > problem. early_init_dt_scan() is called as the first function from kernel
> > > booting code. That time there is no memory yet added to the system, so it
> > > would be really hard to reserve anything. Memory nodes are being added
> > > later either with memblock_add() or by some other arch specific way.
> >
> > Hmmm, depends on the architecture. On ARM the memory is loaded into the
> > meminfo structure first, and it isn't until arm_memblock_init() that
> > memblock_add() gets called on all the regions. Some architectures do the
> > memblock_add() directly from early_init_dt_add_memory_arch() function.
> >
> > The default early_init_dt_add_memory_arch() in drivers/of/fdt.c is
> > overridden by ARM and a number of other architectures. However...
> >
> > > Finally, once all memory has been added to the system we can parse and
> > > reserve all regions defined in the device tree. This really requires
> > > creating another function which will be called by arch specific code.
> >
> > ...Or it means getting rid of meminfo entirely so that memblock is
> > available earlier. Laura Abbott has just posted v2 of her series to do
> > exactly that. If you base on that then you should be able to do exactly
> > what I suggested.
>
> I've checked Laura's patches and in fact it is possible to do memory
> reservation as a last step in early_init_dt_scan_memory(). However still
> see some problem which I have no idea how to resolve. Right now I focus
> only on ARM, so I have no idea how it is solved by other architectures.
It isn't at the moment because no other architectures are doing dynamic
allocation of regions in this way.
> On of the key features of the new binding is the ability to automatically
> allocate reserved regions of the given size. However kernel, initrd, dt
> and other sub-arch specific critical regions are marked/allocated in
> arm_memblock_init(), which is called after setup_machine_fdt(). This
> might lead to some serious failures when automatically reserved region
> overlaps with some critical resources. Do you have any idea how to solve
> this without a new callback?
Not without moving the kernel/initrd/fdt reservation earlier, which can
certainly be done after Laura's series is applied. It would also be
possible to split up the fixed regions from the dynamic regions so that
the dynamic stuff would be done later.
However, I don't want to block this series on Laura's rework. Go ahead
and keep it as a separate hook, but make the other changes I suggested,
particularly with regard to making the hook architecture independent.
Further rework can be done later after Laura's series is merged.
g.
^ permalink raw reply
* [PATCH v5] clk: sunxi: Add Allwinner A20/A31 GMAC clock unit
From: Chen-Yu Tsai @ 2014-02-11 11:53 UTC (permalink / raw)
To: Emilio Lopez, Mike Turquette, Maxime Ripard
Cc: Chen-Yu Tsai, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Hans de Goede
The Allwinner A20/A31 clock module controls the transmit clock source
and interface type of the GMAC ethernet controller. Model this as
a single clock for GMAC drivers to use.
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
---
Hi,
This is v5 of the Allwinner A20 GMAC clock patch. Hans noted a
compiler warning: unused variable in the previous version.
The DT bits remain the same, and Maxime has already taken them.
The Allwinner A20 SoC integrates an early version of dwmac
IP from Synopsys. On top of that is a hardware glue layer.
This layer needs to be configured before the dwmac can be
used.
Part of the glue layer is a clock mux, which controls the
source and direction of the TX clock used by GMAC.
Changes since v4:
* Removed unused variable in GMAC clock driver left over from v3
Changes since v3:
* Rework error checking in GMAC clock driver
* Clarify required parent clock order for GMAC clock in DT bindings
* Rewrite commit log for "ARM: dts: sun7i: Add ethernet alias for GMAC"
* Corrected "a20-olinuxino-micro" in commit message
* Rewrite comments in sun7i dtsi to clarify purpose of dummy clocks
* Rebase onto Maxime's sunxi-next branch
Changes since v2:
* Added more comments on GMAC clock driver
* Drop CLK_SET_PARENT_GATE in GMAC clock driver
* Use macro for max clock parents
* Line wrapping
Changes since v1:
* Added optional reset control to stmmac driver core
* Added non CONFIG_RESET_CONROLLER routines for the above change
* Extended callback API, as discussed with Srinivas
* Used new stmmac_of_data to pass features and callbacks,
instead of platform data, as discussed
* Seperated clock module glue layer into clock driver
Cheers
ChenYu
---
Documentation/devicetree/bindings/clock/sunxi.txt | 30 +++++++
drivers/clk/sunxi/clk-sunxi.c | 96 +++++++++++++++++++++++
2 files changed, 126 insertions(+)
diff --git a/Documentation/devicetree/bindings/clock/sunxi.txt b/Documentation/devicetree/bindings/clock/sunxi.txt
index 0cf679b..28421d2 100644
--- a/Documentation/devicetree/bindings/clock/sunxi.txt
+++ b/Documentation/devicetree/bindings/clock/sunxi.txt
@@ -37,6 +37,7 @@ Required properties:
"allwinner,sun6i-a31-apb2-gates-clk" - for the APB2 gates on A31
"allwinner,sun4i-mod0-clk" - for the module 0 family of clocks
"allwinner,sun7i-a20-out-clk" - for the external output clocks
+ "allwinner,sun7i-a20-gmac-clk" - for the GMAC clock module on A20/A31
Required properties for all clocks:
- reg : shall be the control register address for the clock.
@@ -50,6 +51,9 @@ Required properties for all clocks:
If the clock module only has one output, the name shall be the
module name.
+For "allwinner,sun7i-a20-gmac-clk", the parent clocks shall be fixed rate
+dummy clocks at 25 MHz and 125 MHz, respectively. See example.
+
Clock consumers should specify the desired clocks they use with a
"clocks" phandle cell. Consumers that are using a gated clock should
provide an additional ID in their clock property. This ID is the
@@ -96,3 +100,29 @@ mmc0_clk: clk@01c20088 {
clocks = <&osc24M>, <&pll6 1>, <&pll5 1>;
clock-output-names = "mmc0";
};
+
+mii_phy_tx_clk: clk@2 {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <25000000>;
+ clock-output-names = "mii_phy_tx";
+};
+
+gmac_int_tx_clk: clk@3 {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <125000000>;
+ clock-output-names = "gmac_int_tx";
+};
+
+gmac_clk: clk@01c20164 {
+ #clock-cells = <0>;
+ compatible = "allwinner,sun7i-a20-gmac-clk";
+ reg = <0x01c20164 0x4>;
+ /*
+ * The first clock must be fixed at 25MHz;
+ * the second clock must be fixed at 125MHz
+ */
+ clocks = <&mii_phy_tx_clk>, <&gmac_int_tx_clk>;
+ clock-output-names = "gmac";
+};
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 736fb60..54a5d55 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -379,6 +379,102 @@ static void sun7i_a20_get_out_factors(u32 *freq, u32 parent_rate,
/**
+ * sun7i_a20_gmac_clk_setup - Setup function for A20/A31 GMAC clock module
+ *
+ * This clock looks something like this
+ * ________________________
+ * MII TX clock from PHY >-----|___________ _________|----> to GMAC core
+ * GMAC Int. RGMII TX clk >----|___________\__/__gate---|----> to PHY
+ * Ext. 125MHz RGMII TX clk >--|__divider__/ |
+ * |________________________|
+ *
+ * The external 125 MHz reference is optional, i.e. GMAC can use its
+ * internal TX clock just fine. The A31 GMAC clock module does not have
+ * the divider controls for the external reference.
+ *
+ * To keep it simple, let the GMAC use either the MII TX clock for MII mode,
+ * and its internal TX clock for GMII and RGMII modes. The GMAC driver should
+ * select the appropriate source and gate/ungate the output to the PHY.
+ *
+ * Only the GMAC should use this clock. Altering the clock so that it doesn't
+ * match the GMAC's operation parameters will result in the GMAC not being
+ * able to send traffic out. The GMAC driver should set the clock rate and
+ * enable/disable this clock to configure the required state. The clock
+ * driver then responds by auto-reparenting the clock.
+ */
+
+#define SUN7I_A20_GMAC_GPIT 2
+#define SUN7I_A20_GMAC_MASK 0x3
+#define SUN7I_A20_GMAC_PARENTS 2
+
+static void __init sun7i_a20_gmac_clk_setup(struct device_node *node)
+{
+ struct clk *clk;
+ struct clk_mux *mux;
+ struct clk_gate *gate;
+ const char *clk_name = node->name;
+ const char *parents[SUN7I_A20_GMAC_PARENTS];
+ void *reg;
+
+ if (of_property_read_string(node, "clock-output-names", &clk_name))
+ return;
+
+ /* allocate mux and gate clock structs */
+ mux = kzalloc(sizeof(struct clk_mux), GFP_KERNEL);
+ if (!mux)
+ return;
+
+ gate = kzalloc(sizeof(struct clk_gate), GFP_KERNEL);
+ if (!gate)
+ goto free_mux;
+
+ /* gmac clock requires exactly 2 parents */
+ parents[0] = of_clk_get_parent_name(node, 0);
+ parents[1] = of_clk_get_parent_name(node, 1);
+ if (!parents[0] || !parents[1])
+ goto free_gate;
+
+ reg = of_iomap(node, 0);
+ if (!reg)
+ goto free_gate;
+
+ /* set up gate and fixed rate properties */
+ gate->reg = reg;
+ gate->bit_idx = SUN7I_A20_GMAC_GPIT;
+ gate->lock = &clk_lock;
+ mux->reg = reg;
+ mux->mask = SUN7I_A20_GMAC_MASK;
+ mux->flags = CLK_MUX_INDEX_BIT;
+ mux->lock = &clk_lock;
+
+ clk = clk_register_composite(NULL, clk_name,
+ parents, SUN7I_A20_GMAC_PARENTS,
+ &mux->hw, &clk_mux_ops,
+ NULL, NULL,
+ &gate->hw, &clk_gate_ops,
+ 0);
+
+ if (IS_ERR(clk))
+ goto iounmap_reg;
+
+ of_clk_add_provider(node, of_clk_src_simple_get, clk);
+ clk_register_clkdev(clk, clk_name, NULL);
+
+ return;
+
+iounmap_reg:
+ iounmap(reg);
+free_gate:
+ kfree(gate);
+free_mux:
+ kfree(mux);
+}
+CLK_OF_DECLARE(sun7i_a20_gmac, "allwinner,sun7i-a20-gmac-clk",
+ sun7i_a20_gmac_clk_setup);
+
+
+
+/**
* sunxi_factors_clk_setup() - Setup function for factor clocks
*/
--
1.9.0.rc3
^ permalink raw reply related
* Re: [PATCH 4/7] spi: pl022: attempt to get sspclk by name
From: Mark Brown @ 2014-02-11 12:06 UTC (permalink / raw)
To: Mark Rutland
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
Linus Walleij, Arnd Bergmann
In-Reply-To: <1392118632-11312-5-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
On Tue, Feb 11, 2014 at 11:37:09AM +0000, Mark Rutland wrote:
> - pl022->clk = devm_clk_get(&adev->dev, NULL);
> + /*
> + * For compatibility with old DTBs and platform data, fall back to the
> + * first clock if there's not an explicitly named "sspclk" entry.
> + */
> + pl022->clk = devm_clk_get(&adev->dev, "sspclk");
> + if (IS_ERR(pl022->clk))
> + pl022->clk = devm_clk_get(&adev->dev, NULL);
> +
I'll just have a bit of a grumble here and point out that this sort of
stuff always worries me with the convention of using nameless clocks -
it causes hassle adding further clocks.
In any case you didn't CC me on the cover letter or any of the non-SPI
patches so I'm not sure what the dependencies are here (if there are
any), does the series need to go in as one?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 45/47] adv7604: Add DT support
From: Laurent Pinchart @ 2014-02-11 12:08 UTC (permalink / raw)
To: Hans Verkuil; +Cc: linux-media, Hans Verkuil, Lars-Peter Clausen, devicetree
In-Reply-To: <52F9EBF7.5020000@xs4all.nl>
Hi Hans,
On Tuesday 11 February 2014 10:23:03 Hans Verkuil wrote:
> On 02/05/14 17:42, Laurent Pinchart wrote:
> > Parse the device tree node to populate platform data.
> >
> > Cc: devicetree@vger.kernel.org
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > .../devicetree/bindings/media/i2c/adv7604.txt | 56 ++++++++++++
> > drivers/media/i2c/adv7604.c | 101 ++++++++++++++--
> > 2 files changed, 143 insertions(+), 14 deletions(-)
> > create mode 100644
> > Documentation/devicetree/bindings/media/i2c/adv7604.txt
> >
> > diff --git a/Documentation/devicetree/bindings/media/i2c/adv7604.txt
> > b/Documentation/devicetree/bindings/media/i2c/adv7604.txt new file mode
> > 100644
> > index 0000000..0845c50
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
> > @@ -0,0 +1,56 @@
> > +* Analog Devices ADV7604/11 video decoder with HDMI receiver
> > +
> > +The ADV7604 and ADV7611 are multiformat video decoders with an integrated
> > HDMI +receiver. The ADV7604 has four multiplexed HDMI inputs and one
> > analog input, +and the ADV7611 has one HDMI input and no analog input.
> > +
> > +Required Properties:
> > +
> > + - compatible: Must contain one of the following
> > + - "adi,adv7604" for the ADV7604
> > + - "adi,adv7611" for the ADV7611
> > +
> > + - reg: I2C slave address
> > +
> > + - hpd-gpios: References to the GPIOs that control the HDMI hot-plug
> > + detection pins, one per HDMI input. The active flag indicates the
> > GPIO
> > + level that enables hot-plug detection.
> > +
> > +Optional Properties:
> > +
> > + - reset-gpios: Reference to the GPIO connected to the device's reset
> > pin. +
> > + - adi,default-input: Index of the input to be configured as default.
> > Valid + values are 0..5 for the ADV7604 and 0 for the ADV7611.
> > +
> > + - adi,disable-power-down: Boolean property. When set forces the device
> > to + ignore the power-down pin. The property is valid for the ADV7604
> > only as + the ADV7611 has no power-down pin.
> > +
> > + - adi,disable-cable-reset: Boolean property. When set disables the HDMI
> > + receiver automatic reset when the HDMI cable is unplugged.
> > +
> > +Example:
> > +
> > + hdmi_receiver@4c {
> > + compatible = "adi,adv7611";
> > + reg = <0x4c>;
> > +
> > + reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
> > + hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
> > +
> > + adi,default-input = <0>;
> > +
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + port@0 {
> > + reg = <0>;
> > + };
> > + port@1 {
> > + reg = <1>;
> > + hdmi_in: endpoint {
> > + remote-endpoint = <&ccdc_in>;
> > + };
> > + };
> > + };
> > diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> > index e586c1c..cd8a2dc 100644
> > --- a/drivers/media/i2c/adv7604.c
> > +++ b/drivers/media/i2c/adv7604.c
> > @@ -32,6 +32,7 @@
> >
> > #include <linux/i2c.h>
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> >
> > +#include <linux/of_gpio.h>
> >
> > #include <linux/slab.h>
> > #include <linux/v4l2-dv-timings.h>
> > #include <linux/videodev2.h>
> >
> > @@ -2641,13 +2642,83 @@ static const struct adv7604_chip_info
> > adv7604_chip_info[] = {>
> > },
> >
> > };
> >
> > +static struct i2c_device_id adv7604_i2c_id[] = {
> > + { "adv7604", (kernel_ulong_t)&adv7604_chip_info[ADV7604] },
> > + { "adv7611", (kernel_ulong_t)&adv7604_chip_info[ADV7611] },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(i2c, adv7604_i2c_id);
> > +
> > +static struct of_device_id adv7604_of_id[] = {
> > + { .compatible = "adi,adv7604", .data = &adv7604_chip_info[ADV7604] },
> > + { .compatible = "adi,adv7611", .data = &adv7604_chip_info[ADV7611] },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, adv7604_of_id);
> > +
> > +static int adv7604_parse_dt(struct adv7604_state *state)
>
> Put this under #ifdef CONFIG_OF.
#ifdef CONFIG_OF has been discouraged. I'll add an IS_ENABLED(CONFIG_OF) to
condition the call of adv7604_parse_dt() and let the compiler optimize the
function out, but I've been recommended to fix compilation errors instead of
using conditional compilation.
> It fails to compile if CONFIG_OF is not set (as it is in my case since this
> driver is used with a PCIe card).
What's the compilation failure ?
> > +{
> > + struct device_node *np;
> > + unsigned int i;
> > + int ret;
> > +
> > + np = state->i2c_clients[ADV7604_PAGE_IO]->dev.of_node;
> > + state->info = of_match_node(adv7604_of_id, np)->data;
> > +
> > + state->pdata.disable_pwrdnb =
> > + of_property_read_bool(np, "adi,disable-power-down");
> > + state->pdata.disable_cable_det_rst =
> > + of_property_read_bool(np, "adi,disable-cable-reset");
> > +
> > + ret = of_property_read_u32(np, "adi,default-input",
> > + &state->pdata.default_input);
> > + if (ret < 0)
> > + state->pdata.default_input = -1;
> > +
> > + for (i = 0; i < state->info->num_dv_ports; ++i) {
> > + enum of_gpio_flags flags;
> > +
> > + state->pdata.hpd_gpio[i] =
> > + of_get_named_gpio_flags(np, "hpd-gpios", i, &flags);
> > + if (IS_ERR_VALUE(state->pdata.hpd_gpio[i]))
> > + continue;
> > +
> > + state->pdata.hpd_gpio_low[i] = flags == OF_GPIO_ACTIVE_LOW;
> > + }
> > +
> > + /* Disable the interrupt for now as no DT-based board uses it. */
> > + state->pdata.int1_config = ADV7604_INT1_CONFIG_DISABLED;
> > +
> > + /* Use the default I2C addresses. */
> > + state->pdata.i2c_addresses[ADV7604_PAGE_AVLINK] = 0x42;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_CEC] = 0x40;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_INFOFRAME] = 0x3e;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_ESDP] = 0x38;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_DPP] = 0x3c;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_AFE] = 0x26;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_REP] = 0x32;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_EDID] = 0x36;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_HDMI] = 0x34;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_TEST] = 0x30;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_CP] = 0x22;
> > + state->pdata.i2c_addresses[ADV7604_PAGE_VDP] = 0x24;
> > +
> > + /* HACK: Hardcode the remaining platform data fields. */
> > + state->pdata.blank_data = 1;
> > + state->pdata.op_656_range = 1;
> > + state->pdata.alt_data_sat = 1;
> > + state->pdata.insert_av_codes = 1;
> > + state->pdata.op_format_mode_sel = ADV7604_OP_FORMAT_MODE0;
> > +
> > + return 0;
> > +}
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH v2 1/5] drivers: of: add initialization code for reserved memory
From: Grant Likely @ 2014-02-11 12:13 UTC (permalink / raw)
To: Marek Szyprowski, linux-kernel, linux-arm-kernel, linaro-mm-sig,
devicetree, linux-doc
Cc: Kyungmin Park, Benjamin Herrenschmidt, Arnd Bergmann,
Michal Nazarewicz, Tomasz Figa, Sascha Hauer, Laura Abbott,
Rob Herring, Olof Johansson, Pawel Moll, Mark Rutland,
Stephen Warren, Ian Campbell, Tomasz Figa, Kumar Gala,
Nishanth Peethambaran, Marc, Josh Cartwright
In-Reply-To: <52FA0D6E.9090304@samsung.com>
On Tue, 11 Feb 2014 12:45:50 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> Hello,
>
> On 2014-02-05 12:05, Grant Likely wrote:
> > On Tue, 04 Feb 2014 13:09:29 +0100, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
> > > This patch adds device tree support for contiguous and reserved memory
> > > regions defined in device tree.
> > >
> > > Large memory blocks can be reliably reserved only during early boot.
> > > This must happen before the whole memory management subsystem is
> > > initialized, because we need to ensure that the given contiguous blocks
> > > are not yet allocated by kernel. Also it must happen before kernel
> > > mappings for the whole low memory are created, to ensure that there will
> > > be no mappings (for reserved blocks) or mapping with special properties
> > > can be created (for CMA blocks). This all happens before device tree
> > > structures are unflattened, so we need to get reserved memory layout
> > > directly from fdt.
> > >
> > > Later, those reserved memory regions are assigned to devices on each
> > > device structure initialization.
> > >
> > > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > > Cc: Laura Abbott <lauraa@codeaurora.org>
> > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > [joshc: rework to implement new DT binding, provide mechanism for
> > > plugging in new reserved-memory node handlers via
> > > RESERVEDMEM_OF_DECLARE]
> > > Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
> > > [mszyprow: little code cleanup]
> > > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > ---
> > > drivers/of/Kconfig | 6 +
> > > drivers/of/Makefile | 1 +
> > > drivers/of/of_reserved_mem.c | 219 +++++++++++++++++++++++++++++++++++++
> > > drivers/of/platform.c | 7 ++
> > > include/asm-generic/vmlinux.lds.h | 11 ++
> > > include/linux/of_reserved_mem.h | 62 +++++++++++
> > > 6 files changed, 306 insertions(+)
> > > create mode 100644 drivers/of/of_reserved_mem.c
> > > create mode 100644 include/linux/of_reserved_mem.h
> > >
> > > diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> > > index c6973f101a3e..aba13df56f3a 100644
> > > --- a/drivers/of/Kconfig
> > > +++ b/drivers/of/Kconfig
> > > @@ -75,4 +75,10 @@ config OF_MTD
> > > depends on MTD
> > > def_bool y
> > >
> > > +config OF_RESERVED_MEM
> > > + depends on HAVE_MEMBLOCK
> > > + def_bool y
> > > + help
> > > + Helpers to allow for reservation of memory regions
> > > +
> > > endmenu # OF
> > > diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> > > index efd05102c405..ed9660adad77 100644
> > > --- a/drivers/of/Makefile
> > > +++ b/drivers/of/Makefile
> > > @@ -9,3 +9,4 @@ obj-$(CONFIG_OF_MDIO) += of_mdio.o
> > > obj-$(CONFIG_OF_PCI) += of_pci.o
> > > obj-$(CONFIG_OF_PCI_IRQ) += of_pci_irq.o
> > > obj-$(CONFIG_OF_MTD) += of_mtd.o
> > > +obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o
> > > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> > > new file mode 100644
> > > index 000000000000..f17cd56e68d9
> > > --- /dev/null
> > > +++ b/drivers/of/of_reserved_mem.c
> > > @@ -0,0 +1,219 @@
> > > +/*
> > > + * Device tree based initialization code for reserved memory.
> > > + *
> > > + * Copyright (c) 2013, The Linux Foundation. All Rights Reserved.
> > > + * Copyright (c) 2013 Samsung Electronics Co., Ltd.
> > > + * http://www.samsung.com
> > > + * Author: Marek Szyprowski <m.szyprowski@samsung.com>
> > > + * Author: Josh Cartwright <joshc@codeaurora.org>
> > > + *
> > > + * This program is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU General Public License as
> > > + * published by the Free Software Foundation; either version 2 of the
> > > + * License or (at your optional) any later version of the license.
> > > + */
> > > +#include <linux/memblock.h>
> > > +#include <linux/err.h>
> > > +#include <linux/of.h>
> > > +#include <linux/of_fdt.h>
> > > +#include <linux/of_platform.h>
> > > +#include <linux/mm.h>
> > > +#include <linux/sizes.h>
> > > +#include <linux/of_reserved_mem.h>
> > > +
> > > +#define MAX_RESERVED_REGIONS 16
> > > +static struct reserved_mem reserved_mem[MAX_RESERVED_REGIONS];
> > > +static int reserved_mem_count;
> > > +
> > > +int __init of_parse_flat_dt_reg(unsigned long node, const char *uname,
> > > + phys_addr_t *base, phys_addr_t *size)
> >
> > Useful utility function; move to drivers/of/fdt.c
> >
> > > +{
> > > + unsigned long len;
> > > + __be32 *prop;
> > > +
> > > + prop = of_get_flat_dt_prop(node, "reg", &len);
> > > + if (!prop)
> > > + return -EINVAL;
> > > +
> > > + if (len < (dt_root_addr_cells + dt_root_size_cells) * sizeof(__be32)) {
> > > + pr_err("Reserved memory: invalid reg property in '%s' node.\n",
> > > + uname);
> > > + return -EINVAL;
> > > + }
> >
> > This is /okay/ for an initial implementation, but it is naive. While I
> > suggested making #address-cells and #size-cells equal the root node
> > values for the purpose of simplicity, it should still be perfectly valid
> > to have different values if the ranges property is correctly formed.
> >
> > > +
> > > + *base = dt_mem_next_cell(dt_root_addr_cells, &prop);
> > > + *size = dt_mem_next_cell(dt_root_size_cells, &prop);
> >
> > Future enhancement; allow for parsing more than just the first reg
> > tuple.
>
> One more question. Does it really makes any sense to support more than
> one tuple for reg property? For consistency we should also allow more
> than one entry in size, align and alloc-ranges property, but I don't
> see any benefits for defining more than one range for a single region.
> Same can be achieved by defining more regions instead if one really
> needs such configuration.
Yes, if only because it is an define usage of the reg property. If a
devtree has multiple tuples in reg, then all of those tuples should be
treated as reserved, even if the kernel doesn't know how to use them.
I would not do the same for size/align/alloc-ranges unless there is a
very specific use case that you can define. These ones are different
from the static regions because they aren't ever used to protect
something that already exists in the memory.
g.
^ permalink raw reply
* Re: [PATCH 45/47] adv7604: Add DT support
From: Hans Verkuil @ 2014-02-11 12:14 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Hans Verkuil, linux-media, Hans Verkuil, Lars-Peter Clausen,
devicetree
In-Reply-To: <2643485.CLBhVGBayq@avalon>
On 02/11/14 13:08, Laurent Pinchart wrote:
> Hi Hans,
>
> On Tuesday 11 February 2014 10:23:03 Hans Verkuil wrote:
>> On 02/05/14 17:42, Laurent Pinchart wrote:
>>> Parse the device tree node to populate platform data.
>>>
>>> Cc: devicetree@vger.kernel.org
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> ---
>>>
>>> .../devicetree/bindings/media/i2c/adv7604.txt | 56 ++++++++++++
>>> drivers/media/i2c/adv7604.c | 101 ++++++++++++++--
>>> 2 files changed, 143 insertions(+), 14 deletions(-)
>>> create mode 100644
>>> Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>> b/Documentation/devicetree/bindings/media/i2c/adv7604.txt new file mode
>>> 100644
>>> index 0000000..0845c50
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>> @@ -0,0 +1,56 @@
>>> +* Analog Devices ADV7604/11 video decoder with HDMI receiver
>>> +
>>> +The ADV7604 and ADV7611 are multiformat video decoders with an integrated
>>> HDMI +receiver. The ADV7604 has four multiplexed HDMI inputs and one
>>> analog input, +and the ADV7611 has one HDMI input and no analog input.
>>> +
>>> +Required Properties:
>>> +
>>> + - compatible: Must contain one of the following
>>> + - "adi,adv7604" for the ADV7604
>>> + - "adi,adv7611" for the ADV7611
>>> +
>>> + - reg: I2C slave address
>>> +
>>> + - hpd-gpios: References to the GPIOs that control the HDMI hot-plug
>>> + detection pins, one per HDMI input. The active flag indicates the
>>> GPIO
>>> + level that enables hot-plug detection.
>>> +
>>> +Optional Properties:
>>> +
>>> + - reset-gpios: Reference to the GPIO connected to the device's reset
>>> pin. +
>>> + - adi,default-input: Index of the input to be configured as default.
>>> Valid + values are 0..5 for the ADV7604 and 0 for the ADV7611.
>>> +
>>> + - adi,disable-power-down: Boolean property. When set forces the device
>>> to + ignore the power-down pin. The property is valid for the ADV7604
>>> only as + the ADV7611 has no power-down pin.
>>> +
>>> + - adi,disable-cable-reset: Boolean property. When set disables the HDMI
>>> + receiver automatic reset when the HDMI cable is unplugged.
>>> +
>>> +Example:
>>> +
>>> + hdmi_receiver@4c {
>>> + compatible = "adi,adv7611";
>>> + reg = <0x4c>;
>>> +
>>> + reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
>>> + hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
>>> +
>>> + adi,default-input = <0>;
>>> +
>>> + #address-cells = <1>;
>>> + #size-cells = <0>;
>>> +
>>> + port@0 {
>>> + reg = <0>;
>>> + };
>>> + port@1 {
>>> + reg = <1>;
>>> + hdmi_in: endpoint {
>>> + remote-endpoint = <&ccdc_in>;
>>> + };
>>> + };
>>> + };
>>> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
>>> index e586c1c..cd8a2dc 100644
>>> --- a/drivers/media/i2c/adv7604.c
>>> +++ b/drivers/media/i2c/adv7604.c
>>> @@ -32,6 +32,7 @@
>>>
>>> #include <linux/i2c.h>
>>> #include <linux/kernel.h>
>>> #include <linux/module.h>
>>>
>>> +#include <linux/of_gpio.h>
>>>
>>> #include <linux/slab.h>
>>> #include <linux/v4l2-dv-timings.h>
>>> #include <linux/videodev2.h>
>>>
>>> @@ -2641,13 +2642,83 @@ static const struct adv7604_chip_info
>>> adv7604_chip_info[] = {>
>>> },
>>>
>>> };
>>>
>>> +static struct i2c_device_id adv7604_i2c_id[] = {
>>> + { "adv7604", (kernel_ulong_t)&adv7604_chip_info[ADV7604] },
>>> + { "adv7611", (kernel_ulong_t)&adv7604_chip_info[ADV7611] },
>>> + { }
>>> +};
>>> +MODULE_DEVICE_TABLE(i2c, adv7604_i2c_id);
>>> +
>>> +static struct of_device_id adv7604_of_id[] = {
>>> + { .compatible = "adi,adv7604", .data = &adv7604_chip_info[ADV7604] },
>>> + { .compatible = "adi,adv7611", .data = &adv7604_chip_info[ADV7611] },
>>> + { }
>>> +};
>>> +MODULE_DEVICE_TABLE(of, adv7604_of_id);
>>> +
>>> +static int adv7604_parse_dt(struct adv7604_state *state)
>>
>> Put this under #ifdef CONFIG_OF.
>
> #ifdef CONFIG_OF has been discouraged. I'll add an IS_ENABLED(CONFIG_OF) to
> condition the call of adv7604_parse_dt() and let the compiler optimize the
> function out, but I've been recommended to fix compilation errors instead of
> using conditional compilation.
>
>> It fails to compile if CONFIG_OF is not set (as it is in my case since this
>> driver is used with a PCIe card).
>
> What's the compilation failure ?
drivers/media/i2c/adv7604.c: In function ‘adv7604_parse_dt’:
drivers/media/i2c/adv7604.c:2671:48: warning: dereferencing ‘void *’ pointer [enabled by default]
state->info = of_match_node(adv7604_of_id, np)->data;
^
drivers/media/i2c/adv7604.c:2671:48: error: request for member ‘data’ in something not a structure or union
make[3]: *** [drivers/media/i2c/adv7604.o] Error 1
>
>>> +{
>>> + struct device_node *np;
>>> + unsigned int i;
>>> + int ret;
>>> +
>>> + np = state->i2c_clients[ADV7604_PAGE_IO]->dev.of_node;
>>> + state->info = of_match_node(adv7604_of_id, np)->data;
>>> +
>>> + state->pdata.disable_pwrdnb =
>>> + of_property_read_bool(np, "adi,disable-power-down");
>>> + state->pdata.disable_cable_det_rst =
>>> + of_property_read_bool(np, "adi,disable-cable-reset");
>>> +
>>> + ret = of_property_read_u32(np, "adi,default-input",
>>> + &state->pdata.default_input);
>>> + if (ret < 0)
>>> + state->pdata.default_input = -1;
>>> +
>>> + for (i = 0; i < state->info->num_dv_ports; ++i) {
>>> + enum of_gpio_flags flags;
>>> +
>>> + state->pdata.hpd_gpio[i] =
>>> + of_get_named_gpio_flags(np, "hpd-gpios", i, &flags);
>>> + if (IS_ERR_VALUE(state->pdata.hpd_gpio[i]))
>>> + continue;
>>> +
>>> + state->pdata.hpd_gpio_low[i] = flags == OF_GPIO_ACTIVE_LOW;
>>> + }
>>> +
>>> + /* Disable the interrupt for now as no DT-based board uses it. */
>>> + state->pdata.int1_config = ADV7604_INT1_CONFIG_DISABLED;
>>> +
>>> + /* Use the default I2C addresses. */
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_AVLINK] = 0x42;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_CEC] = 0x40;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_INFOFRAME] = 0x3e;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_ESDP] = 0x38;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_DPP] = 0x3c;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_AFE] = 0x26;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_REP] = 0x32;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_EDID] = 0x36;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_HDMI] = 0x34;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_TEST] = 0x30;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_CP] = 0x22;
>>> + state->pdata.i2c_addresses[ADV7604_PAGE_VDP] = 0x24;
>>> +
>>> + /* HACK: Hardcode the remaining platform data fields. */
>>> + state->pdata.blank_data = 1;
>>> + state->pdata.op_656_range = 1;
>>> + state->pdata.alt_data_sat = 1;
>>> + state->pdata.insert_av_codes = 1;
>>> + state->pdata.op_format_mode_sel = ADV7604_OP_FORMAT_MODE0;
>>> +
>>> + return 0;
>>> +}
>
^ permalink raw reply
* Re: [PATCH 45/47] adv7604: Add DT support
From: Lars-Peter Clausen @ 2014-02-11 12:21 UTC (permalink / raw)
To: Hans Verkuil
Cc: Laurent Pinchart, Hans Verkuil, linux-media, Hans Verkuil,
devicetree
In-Reply-To: <52FA140F.9060200@cisco.com>
On 02/11/2014 01:14 PM, Hans Verkuil wrote:
>
>
> On 02/11/14 13:08, Laurent Pinchart wrote:
>> Hi Hans,
>>
>> On Tuesday 11 February 2014 10:23:03 Hans Verkuil wrote:
>>> On 02/05/14 17:42, Laurent Pinchart wrote:
>>>> Parse the device tree node to populate platform data.
>>>>
>>>> Cc: devicetree@vger.kernel.org
>>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>>> ---
>>>>
>>>> .../devicetree/bindings/media/i2c/adv7604.txt | 56 ++++++++++++
>>>> drivers/media/i2c/adv7604.c | 101 ++++++++++++++--
>>>> 2 files changed, 143 insertions(+), 14 deletions(-)
>>>> create mode 100644
>>>> Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>>> b/Documentation/devicetree/bindings/media/i2c/adv7604.txt new file mode
>>>> 100644
>>>> index 0000000..0845c50
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
>>>> @@ -0,0 +1,56 @@
>>>> +* Analog Devices ADV7604/11 video decoder with HDMI receiver
>>>> +
>>>> +The ADV7604 and ADV7611 are multiformat video decoders with an integrated
>>>> HDMI +receiver. The ADV7604 has four multiplexed HDMI inputs and one
>>>> analog input, +and the ADV7611 has one HDMI input and no analog input.
>>>> +
>>>> +Required Properties:
>>>> +
>>>> + - compatible: Must contain one of the following
>>>> + - "adi,adv7604" for the ADV7604
>>>> + - "adi,adv7611" for the ADV7611
>>>> +
>>>> + - reg: I2C slave address
>>>> +
>>>> + - hpd-gpios: References to the GPIOs that control the HDMI hot-plug
>>>> + detection pins, one per HDMI input. The active flag indicates the
>>>> GPIO
>>>> + level that enables hot-plug detection.
>>>> +
>>>> +Optional Properties:
>>>> +
>>>> + - reset-gpios: Reference to the GPIO connected to the device's reset
>>>> pin. +
>>>> + - adi,default-input: Index of the input to be configured as default.
>>>> Valid + values are 0..5 for the ADV7604 and 0 for the ADV7611.
>>>> +
>>>> + - adi,disable-power-down: Boolean property. When set forces the device
>>>> to + ignore the power-down pin. The property is valid for the ADV7604
>>>> only as + the ADV7611 has no power-down pin.
>>>> +
>>>> + - adi,disable-cable-reset: Boolean property. When set disables the HDMI
>>>> + receiver automatic reset when the HDMI cable is unplugged.
>>>> +
>>>> +Example:
>>>> +
>>>> + hdmi_receiver@4c {
>>>> + compatible = "adi,adv7611";
>>>> + reg = <0x4c>;
>>>> +
>>>> + reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
>>>> + hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
>>>> +
>>>> + adi,default-input = <0>;
>>>> +
>>>> + #address-cells = <1>;
>>>> + #size-cells = <0>;
>>>> +
>>>> + port@0 {
>>>> + reg = <0>;
>>>> + };
>>>> + port@1 {
>>>> + reg = <1>;
>>>> + hdmi_in: endpoint {
>>>> + remote-endpoint = <&ccdc_in>;
>>>> + };
>>>> + };
>>>> + };
>>>> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
>>>> index e586c1c..cd8a2dc 100644
>>>> --- a/drivers/media/i2c/adv7604.c
>>>> +++ b/drivers/media/i2c/adv7604.c
>>>> @@ -32,6 +32,7 @@
>>>>
>>>> #include <linux/i2c.h>
>>>> #include <linux/kernel.h>
>>>> #include <linux/module.h>
>>>>
>>>> +#include <linux/of_gpio.h>
>>>>
>>>> #include <linux/slab.h>
>>>> #include <linux/v4l2-dv-timings.h>
>>>> #include <linux/videodev2.h>
>>>>
>>>> @@ -2641,13 +2642,83 @@ static const struct adv7604_chip_info
>>>> adv7604_chip_info[] = {>
>>>> },
>>>>
>>>> };
>>>>
>>>> +static struct i2c_device_id adv7604_i2c_id[] = {
>>>> + { "adv7604", (kernel_ulong_t)&adv7604_chip_info[ADV7604] },
>>>> + { "adv7611", (kernel_ulong_t)&adv7604_chip_info[ADV7611] },
>>>> + { }
>>>> +};
>>>> +MODULE_DEVICE_TABLE(i2c, adv7604_i2c_id);
>>>> +
>>>> +static struct of_device_id adv7604_of_id[] = {
>>>> + { .compatible = "adi,adv7604", .data = &adv7604_chip_info[ADV7604] },
>>>> + { .compatible = "adi,adv7611", .data = &adv7604_chip_info[ADV7611] },
>>>> + { }
>>>> +};
>>>> +MODULE_DEVICE_TABLE(of, adv7604_of_id);
>>>> +
>>>> +static int adv7604_parse_dt(struct adv7604_state *state)
>>>
>>> Put this under #ifdef CONFIG_OF.
>>
>> #ifdef CONFIG_OF has been discouraged. I'll add an IS_ENABLED(CONFIG_OF) to
>> condition the call of adv7604_parse_dt() and let the compiler optimize the
>> function out, but I've been recommended to fix compilation errors instead of
>> using conditional compilation.
>>
>>> It fails to compile if CONFIG_OF is not set (as it is in my case since this
>>> driver is used with a PCIe card).
>>
>> What's the compilation failure ?
>
> drivers/media/i2c/adv7604.c: In function ‘adv7604_parse_dt’:
> drivers/media/i2c/adv7604.c:2671:48: warning: dereferencing ‘void *’ pointer [enabled by default]
> state->info = of_match_node(adv7604_of_id, np)->data;
> ^
> drivers/media/i2c/adv7604.c:2671:48: error: request for member ‘data’ in something not a structure or union
> make[3]: *** [drivers/media/i2c/adv7604.o] Error 1
That looks like a bug in the stubbed out version of of_match_node(). It
should be a inline function with a return type, rather than a macro.
- Lars
^ permalink raw reply
* Re: [PATCH 45/47] adv7604: Add DT support
From: Laurent Pinchart @ 2014-02-11 12:30 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Hans Verkuil, Hans Verkuil, linux-media, Hans Verkuil, devicetree
In-Reply-To: <52FA15E4.50001@metafoo.de>
Hi Lars,
On Tuesday 11 February 2014 13:21:56 Lars-Peter Clausen wrote:
> On 02/11/2014 01:14 PM, Hans Verkuil wrote:
> > On 02/11/14 13:08, Laurent Pinchart wrote:
> >> On Tuesday 11 February 2014 10:23:03 Hans Verkuil wrote:
> >>> On 02/05/14 17:42, Laurent Pinchart wrote:
> >>>> Parse the device tree node to populate platform data.
> >>>>
> >>>> Cc: devicetree@vger.kernel.org
> >>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >>>> ---
> >>>>
> >>>> .../devicetree/bindings/media/i2c/adv7604.txt | 56 ++++++++++++
> >>>> drivers/media/i2c/adv7604.c | 101 ++++++++++--
> >>>> 2 files changed, 143 insertions(+), 14 deletions(-)
> >>>> create mode 100644
> >>>> Documentation/devicetree/bindings/media/i2c/adv7604.txt
> >>>>
> >>>> diff --git a/Documentation/devicetree/bindings/media/i2c/adv7604.txt
> >>>> b/Documentation/devicetree/bindings/media/i2c/adv7604.txt new file mode
> >>>> 100644
> >>>> index 0000000..0845c50
> >>>> --- /dev/null
> >>>> +++ b/Documentation/devicetree/bindings/media/i2c/adv7604.txt
> >>>> @@ -0,0 +1,56 @@
> >>>> +* Analog Devices ADV7604/11 video decoder with HDMI receiver
> >>>> +
> >>>> +The ADV7604 and ADV7611 are multiformat video decoders with an
> >>>> integrated
> >>>> HDMI +receiver. The ADV7604 has four multiplexed HDMI inputs and one
> >>>> analog input, +and the ADV7611 has one HDMI input and no analog input.
> >>>> +
> >>>> +Required Properties:
> >>>> +
> >>>> + - compatible: Must contain one of the following
> >>>> + - "adi,adv7604" for the ADV7604
> >>>> + - "adi,adv7611" for the ADV7611
> >>>> +
> >>>> + - reg: I2C slave address
> >>>> +
> >>>> + - hpd-gpios: References to the GPIOs that control the HDMI hot-plug
> >>>> + detection pins, one per HDMI input. The active flag indicates the
> >>>> GPIO
> >>>> + level that enables hot-plug detection.
> >>>> +
> >>>> +Optional Properties:
> >>>> +
> >>>> + - reset-gpios: Reference to the GPIO connected to the device's reset
> >>>> pin. +
> >>>> + - adi,default-input: Index of the input to be configured as default.
> >>>> Valid + values are 0..5 for the ADV7604 and 0 for the ADV7611.
> >>>> +
> >>>> + - adi,disable-power-down: Boolean property. When set forces the
> >>>> device
> >>>> to + ignore the power-down pin. The property is valid for the
> >>>> ADV7604
> >>>> only as + the ADV7611 has no power-down pin.
> >>>> +
> >>>> + - adi,disable-cable-reset: Boolean property. When set disables the
> >>>> HDMI
> >>>> + receiver automatic reset when the HDMI cable is unplugged.
> >>>> +
> >>>> +Example:
> >>>> +
> >>>> + hdmi_receiver@4c {
> >>>> + compatible = "adi,adv7611";
> >>>> + reg = <0x4c>;
> >>>> +
> >>>> + reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
> >>>> + hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
> >>>> +
> >>>> + adi,default-input = <0>;
> >>>> +
> >>>> + #address-cells = <1>;
> >>>> + #size-cells = <0>;
> >>>> +
> >>>> + port@0 {
> >>>> + reg = <0>;
> >>>> + };
> >>>> + port@1 {
> >>>> + reg = <1>;
> >>>> + hdmi_in: endpoint {
> >>>> + remote-endpoint = <&ccdc_in>;
> >>>> + };
> >>>> + };
> >>>> + };
> >>>> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
> >>>> index e586c1c..cd8a2dc 100644
> >>>> --- a/drivers/media/i2c/adv7604.c
> >>>> +++ b/drivers/media/i2c/adv7604.c
> >>>> @@ -32,6 +32,7 @@
> >>>>
> >>>> #include <linux/i2c.h>
> >>>> #include <linux/kernel.h>
> >>>> #include <linux/module.h>
> >>>>
> >>>> +#include <linux/of_gpio.h>
> >>>>
> >>>> #include <linux/slab.h>
> >>>> #include <linux/v4l2-dv-timings.h>
> >>>> #include <linux/videodev2.h>
> >>>>
> >>>> @@ -2641,13 +2642,83 @@ static const struct adv7604_chip_info
> >>>> adv7604_chip_info[] = {>
> >>>>
> >>>> },
> >>>>
> >>>> };
> >>>>
> >>>> +static struct i2c_device_id adv7604_i2c_id[] = {
> >>>> + { "adv7604", (kernel_ulong_t)&adv7604_chip_info[ADV7604] },
> >>>> + { "adv7611", (kernel_ulong_t)&adv7604_chip_info[ADV7611] },
> >>>> + { }
> >>>> +};
> >>>> +MODULE_DEVICE_TABLE(i2c, adv7604_i2c_id);
> >>>> +
> >>>> +static struct of_device_id adv7604_of_id[] = {
> >>>> + { .compatible = "adi,adv7604", .data = &adv7604_chip_info[ADV7604] },
> >>>> + { .compatible = "adi,adv7611", .data = &adv7604_chip_info[ADV7611] },
> >>>> + { }
> >>>> +};
> >>>> +MODULE_DEVICE_TABLE(of, adv7604_of_id);
> >>>> +
> >>>> +static int adv7604_parse_dt(struct adv7604_state *state)
> >>>
> >>> Put this under #ifdef CONFIG_OF.
> >>
> >> #ifdef CONFIG_OF has been discouraged. I'll add an IS_ENABLED(CONFIG_OF)
> >> to condition the call of adv7604_parse_dt() and let the compiler optimize
> >> the function out, but I've been recommended to fix compilation errors
> >> instead of using conditional compilation.
> >>
> >>> It fails to compile if CONFIG_OF is not set (as it is in my case since
> >>> this driver is used with a PCIe card).
> >>
> >> What's the compilation failure ?
> >
> > drivers/media/i2c/adv7604.c: In function ‘adv7604_parse_dt’:
> > drivers/media/i2c/adv7604.c:2671:48: warning: dereferencing ‘void *’
> > pointer [enabled by default]>
> > state->info = of_match_node(adv7604_of_id, np)->data;
> >
> > drivers/media/i2c/adv7604.c:2671:48: error: request for member ‘data’ in
> > something not a structure or union make[3]: ***
> > [drivers/media/i2c/adv7604.o] Error 1
>
> That looks like a bug in the stubbed out version of of_match_node(). It
> should be a inline function with a return type, rather than a macro.
Indeed, I'll cook a patch up.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 0/7] primecell: make correct clock parsing possible
From: Russell King - ARM Linux @ 2014-02-11 12:33 UTC (permalink / raw)
To: Mark Rutland
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
pawel.moll-5wv7dgnIgG8,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <1392118632-11312-1-git-send-email-mark.rutland-5wv7dgnIgG8@public.gmane.org>
On Tue, Feb 11, 2014 at 11:37:05AM +0000, Mark Rutland wrote:
> These patches attempt to harmonize the bindings and the drivers with what's in
> use today, in a backwards compatible fashion, relieving us of our present
> Kafkaesque nightmare. Each peripheral's clock(s) are given explicit names which
> can be used, though code will fall back to the existing behaviour if said names
> are not provided. Additionally the currently unmet ordering requirement of
> apb_pclk is dropped, given all existing that code requires this to be named
> anyway.
The reason why these clocks ended up with NULL names was to force the
issue that clocks shall not be named solely by their connection IDs,
which was a major problem before DT. Now that we have DT, I'm happier
to reinstate the names, but I think we should just reinstate the names
we had previously. That should be in the git history.
The down-side is those names are all in capitals - but they were named
after the signal name(s) given in the Primecell documentation.
--
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* Re: [PATCH] can: xilinx CAN controller support.
From: Marc Kleine-Budde @ 2014-02-11 12:35 UTC (permalink / raw)
To: Michal Simek, robh+dt@kernel.org, Arnd Bergmann
Cc: Appana Durga Kedareswara Rao, wg@grandegger.com,
grant.likely@linaro.org, linux-can@vger.kernel.org,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
In-Reply-To: <da80c522-5524-4f53-9373-3f2bb6f81ddc@CO9EHSMHS015.ehs.local>
[-- Attachment #1: Type: text/plain, Size: 5805 bytes --]
On 02/11/2014 12:45 PM, Michal Simek wrote:
> Hi Marc,
>
> On 02/07/2014 10:37 AM, Marc Kleine-Budde wrote:
>> On 02/07/2014 09:42 AM, Appana Durga Kedareswara Rao wrote:
>>>>> ---
>>>>> This patch is rebased on the 3.14 rc1 kernel.
>>>>> ---
>>>>> .../devicetree/bindings/net/can/xilinx_can.txt | 43 +
>>>>> drivers/net/can/Kconfig | 8 +
>>>>> drivers/net/can/Makefile | 1 +
>>>>> drivers/net/can/xilinx_can.c | 1150 ++++++++++++++++++++
>>>>> 4 files changed, 1202 insertions(+), 0 deletions(-) create mode
>>>>> 100644 Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>>> create mode 100644 drivers/net/can/xilinx_can.c
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>>> b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>>> new file mode 100644
>>>>> index 0000000..34f9643
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/net/can/xilinx_can.txt
>>>>> @@ -0,0 +1,43 @@
>>>>> +Xilinx Axi CAN/Zynq CANPS controller Device Tree Bindings
>>>>> +---------------------------------------------------------
>>>>> +
>>>>> +Required properties:
>>>>> +- compatible : Should be "xlnx,zynq-can-1.00.a" for Zynq
>>>> CAN
>>>>> + controllers and "xlnx,axi-can-1.00.a" for Axi CAN
>>>>> + controllers.
>>>>> +- reg : Physical base address and size of the Axi CAN/Zynq
>>>>> + CANPS registers map.
>>>>> +- interrupts : Property with a value describing the interrupt
>>>>> + number.
>>>>> +- interrupt-parent : Must be core interrupt controller
>>>>> +- clock-names : List of input clock names - "ref_clk",
>>>> "aper_clk"
>>>>> + (See clock bindings for details. Two clocks are
>>>>> + required for Zynq CAN. For Axi CAN
>>>>> + case it is one(ref_clk)).
>>>>> +- clocks : Clock phandles (see clock bindings for details).
>>>>> +- xlnx,can-tx-dpth : Can Tx fifo depth (Required for Axi CAN).
>>>>> +- xlnx,can-rx-dpth : Can Rx fifo depth (Required for Axi CAN).
>>>>> +
>>>>> +
>>>>> +Example:
>>>>> +
>>>>> +For Zynq CANPS Dts file:
>>>>> + zynq_can_0: zynq-can@e0008000 {
>>>>> + compatible = "xlnx,zynq-can-1.00.a";
>>>>> + clocks = <&clkc 19>, <&clkc 36>;
>>>>> + clock-names = "ref_clk", "aper_clk";
>>>>> + reg = <0xe0008000 0x1000>;
>>>>> + interrupts = <0 28 4>;
>>>>> + interrupt-parent = <&intc>;
>>>>
>>>> Above xlnx,can-{rx,tx}-dpth is mentioned as required, but it's not in the
>>>> Zynq example.
>>>
>>> One of the Difference b/w the AXI CAN and zynq CAN is in AXI CAN the fifo depth(tx,rx)
>>> Is user configurable. But in case of ZYNQ CAN the fifo depth is fixed for tx and rx fifo's(64)
>>> Xlnx,can-{rx,tx}-dpth is required only for AXI CAN case it is not required for zynq CAN.
>>> That's why didn't putted that property in device tree.
>>
>> The device tree should be a hardware only description and should not
>> hold any user configurable data. Please split your patch into two
>> patches. The first one should add the driver with a fixed fifo size
>> (e.g. 0x40) for the AXI, too. The second patch should make the fifo
>> configurable via device tree.
>
> can-rx/tx-dpth is not user configurable data as you think.
> This is FPGA where you can configure this parameter in design tools.
> It means these 2 values just describe real hardware and user can't just change it
> for different software behaviour.
I see, thanks for the clarification. I had a short grep over the
arm/boot/dts folder and it seems that fifo-depth is a more or less
common property. I think it should be called {rx,tx}-fifo-depth. I'm
unsure whether we need the xlnx or not.
> Also I don't think it is worth to create 2 patches for the same driver
> where the first one is useless for axi can device. But if you think
> that it is worth to do we can create 2 patches as you suggested.
>
> Also what we can do is to define that this property is required also
> for zynq which is 0x40 and change code according too.
Good idea, I think this would make the driver more uniform.
>> If it's acceptable to describe the fifo usage by device tree, I'd like
>> to make it a generic CAN driver option. But we have to look around, e.g.
>> what the Ethernet driver use to configure their hardware.
>
> I think the real question is not if this is acceptable or not. It is just
> reality that we can setup hardware fifo depth and driver has to reflect this
> because without it driver just doesn't work for axi can.
>
> The only remaining question is if we should create generic DT binding
> for fifo depth. Arnd, Rob: Any opinion about it?
> Definitely will be worth to have one generic binding if this is generic feature.
> But if this is just specific feature for us then current properties should
> be fine.
>
> In general all these xlnx,XXX properties just reflect all configurable options
> which you can setup in design tool which means that provide full hw description
> with all variants and they are automatically generated from tools.
>
> Please let me know what you think.
I like:
rx-fifo-depth
tx-fifo-depth
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply
* [PATCH] of: Turn of_match_node into a static inline when CONFIG_OF isn't set
From: Laurent Pinchart @ 2014-02-11 12:36 UTC (permalink / raw)
To: linux-kernel; +Cc: devicetree, Grant Likely, Rob Herring
when CONFIG_OF is disabled of_match_node is defined as a macro that
evaluates to NULL. This breaks compilation of drivers that dereference
the function's return value directly. Fix it by turning the macro into a
static inline function that returns NULL.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/linux/of.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/linux/of.h b/include/linux/of.h
index 70c64ba..719e69f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -560,7 +560,13 @@ static inline const char *of_prop_next_string(struct property *prop,
}
#define of_match_ptr(_ptr) NULL
-#define of_match_node(_matches, _node) NULL
+
+static inline const struct of_device_id *of_match_node(
+ const struct of_device_id *matches, const struct device_node *node)
+{
+ return NULL;
+}
+
#endif /* CONFIG_OF */
#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
--
Regards,
Laurent Pinchart
^ permalink raw reply related
* Re: [PATCH v6 0/3] Introduce clocksource driver for Keystone platform
From: Daniel Lezcano @ 2014-02-11 12:50 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: Ivan Khoronzhuk, rob-VoJi6FS/r0vR7s880joybQ,
linux-lFZ/pmaqli7XmaaqVzeoHQ, galak-sgV2jX0FEOL9JmXXK+q4OQ,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
tglx-hfZtesqFncYOwBW4kG4KsQ, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
grygorii.strashko-l0cyMroinI0, joshc-sgV2jX0FEOL9JmXXK+q4OQ
In-Reply-To: <52F8F55A.2090903-l0cyMroinI0@public.gmane.org>
On 02/10/2014 04:50 PM, Santosh Shilimkar wrote:
> Daniel,
>
> On Monday 10 February 2014 05:10 AM, Ivan Khoronzhuk wrote:
>> Add a broadcast timer64 based clockevent driver for keystone arch.
>> This driver uses timer in 64-bit general purpose mode as clock event
>> device.
>>
>> Documentation:
>> http://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf
>>
>> Based on
>> git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
>> keystone/master
>>
>> v5..v6:
>> added function to encapsulate __iowmb().
>>
>> v4..v5:
>> used __iowmb() insted of wmb()
>>
>> v3..v4:
>> rebased on latest of linux-keystone.git keystone/master
>>
>> v2..v3:
>> - clocksource: timer-keystone: introduce clocksource driver for
>> changed "u64" type to "unsigned long" for hz_period as more appropriate
>> hz_period rounded up by DIV_ROUND_UP(rate, HZ)
>> corrected comments
>>
>> v1..v2:
>> - clocksource: timer-keystone: introduce clocksource driver for
>> renamed timer on "timer-keystone"
>> in keystone_timer_interrupt() evet pointer is passed via "dev_id"
>> used __relaxed variants of writel/readl and added explicit barriers
>> added "keystone_timer_disable()" for using in keystone_set_mode()
>> keystone_timer_config() is not used for disabling the timer any more
>> in case of an unsupported mode the keystone_timer_config() returns -1.
>> used request_irq() instead of setup_irq()
>> assigned irq for event_device in event_dev->irq
>> calculated timer.hz_period for CLOCK_EVT_MODE_PERIODIC at init
>> deleted spare call of keystone_timer_config() in keystone_timer_init()
>>
>> Ivan Khoronzhuk (3):
>> clocksource: timer-keystone: introduce clocksource driver for Keystone
>> clocksource: keystone: add bindings for keystone timer
>> arm: dts: keystone: add keystone timer entry
>>
> Can you queue the first two patches from the series ?
> I will queue the dts patch via my tree.
Sure.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" 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
* Re: [PATCH v6 1/3] clocksource: timer-keystone: introduce clocksource driver for Keystone
From: Daniel Lezcano @ 2014-02-11 12:58 UTC (permalink / raw)
To: Ivan Khoronzhuk, santosh.shilimkar, rob, linux, galak
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, tglx,
devicetree, linux-doc, linux-arm-kernel, linux-kernel,
grygorii.strashko, joshc
In-Reply-To: <1392027058-11680-2-git-send-email-ivan.khoronzhuk@ti.com>
On 02/10/2014 11:10 AM, Ivan Khoronzhuk wrote:
> Add broadcast clock-event device for the Keystone arch.
>
> The timer can be configured as a general-purpose 64-bit timer,
> dual general-purpose 32-bit timers. When configured as dual 32-bit
> timers, each half can operate in conjunction (chain mode) or
> independently (unchained mode) of each other.
>
> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
> Acked-by: Santosh shilimkar <santosh.shilimkar@ti.com>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
> ---
Applied to my tree for 3.15
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox