* [PATCH v6 01/20] fdt: Tidy up a few fdtdec problems
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 02/20] fdt: Add functions to access phandles, arrays and bools Simon Glass
` (9 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Tom Warren, Jerry Van Baren
This fixes five trivial issues in fdtdec.c:
1. fdtdec_get_is_enabled() doesn't really need a default value
2. The fdt must be word-aligned, since otherwise it will fail on ARM
3. The compat_names[] array is missing its first element. This is needed
only because the first fdt_compat_id is defined to be invalid.
4. Added a header prototype for fdtdec_next_compatible()
5. Change fdtdec_next_alias() to only increment its 'upto' parameter
on success, to make the display error messages in the caller easier.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
---
include/fdtdec.h | 23 +++++++++++++++++++----
lib/fdtdec.c | 22 ++++++++++++++++------
2 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 3a15f55..01badd4 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -82,6 +82,21 @@ int fdtdec_next_alias(const void *blob, const char *name,
enum fdt_compat_id id, int *upto);
/**
+ * Find the next compatible node for a peripheral.
+ *
+ * Do the first call with node = 0. This function will return a pointer to
+ * the next compatible node. Next time you call this function, pass the
+ * value returned, and the next node will be provided.
+ *
+ * @param blob FDT blob to use
+ * @param node Start node for search
+ * @param id Compatible ID to look for (enum fdt_compat_id)
+ * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
+ */
+int fdtdec_next_compatible(const void *blob, int node,
+ enum fdt_compat_id id);
+
+/**
* Look up an address property in a node and return it as an address.
* The property must hold either one address with no trailing data or
* one address with a length. This is only tested on 32-bit machines.
@@ -112,14 +127,14 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
* Checks whether a node is enabled.
* This looks for a 'status' property. If this exists, then returns 1 if
* the status is 'ok' and 0 otherwise. If there is no status property,
- * it returns the default value.
+ * it returns 1 on the assumption that anything mentioned should be enabled
+ * by default.
*
* @param blob FDT blob
* @param node node to examine
- * @param default_val default value to return if no 'status' property exists
- * @return integer value 0/1, if found, or default_val if not
+ * @return integer value 0 (not enabled) or 1 (enabled)
*/
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val);
+int fdtdec_get_is_enabled(const void *blob, int node);
/**
* Checks whether we have a valid fdt available to control U-Boot, and panic
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3852038..846ec3f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
*/
#define COMPAT(id, name) name
static const char * const compat_names[COMPAT_COUNT] = {
+ COMPAT(UNKNOWN, "<none>"),
};
const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -89,14 +90,21 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
return default_val;
}
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val)
+int fdtdec_get_is_enabled(const void *blob, int node)
{
const char *cell;
+ /*
+ * It should say "okay", so only allow that. Some fdts use "ok" but
+ * this is a bug. Please fix your device tree source file. See here
+ * for discussion:
+ *
+ * http://www.mail-archive.com/u-boot@lists.denx.de/msg71598.html
+ */
cell = fdt_getprop(blob, node, "status", NULL);
if (cell)
- return 0 == strcmp(cell, "ok");
- return default_val;
+ return 0 == strcmp(cell, "okay");
+ return 1;
}
enum fdt_compat_id fd_dec_lookup(const void *blob, int node)
@@ -127,14 +135,16 @@ int fdtdec_next_alias(const void *blob, const char *name,
/* snprintf() is not available */
assert(strlen(name) < MAX_STR_LEN);
sprintf(str, "%.*s%d", MAX_STR_LEN, name, *upto);
- (*upto)++;
node = find_alias_node(blob, str);
if (node < 0)
return node;
err = fdt_node_check_compatible(blob, node, compat_names[id]);
if (err < 0)
return err;
- return err ? -FDT_ERR_NOTFOUND : node;
+ if (err)
+ return -FDT_ERR_NOTFOUND;
+ (*upto)++;
+ return node;
}
/* TODO: Can we tighten this code up a little? */
@@ -254,7 +264,7 @@ int fdtdec_find_aliases_for_id(const void *blob, const char *name,
int fdtdec_check_fdt(void)
{
/* We must have an fdt */
- if (fdt_check_header(gd->fdt_blob))
+ if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob))
panic("No valid fdt found - please append one to U-Boot\n"
"binary or define CONFIG_OF_EMBED\n");
return 0;
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 02/20] fdt: Add functions to access phandles, arrays and bools
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
2012-02-27 20:52 ` [PATCH v6 01/20] fdt: Tidy up a few fdtdec problems Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 03/20] fdt: Add basic support for decoding GPIO definitions Simon Glass
` (8 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Tom Warren, Jerry Van Baren
Add a function to look up a property which is a phandle in a node, and
another to read a fixed-length integer array from an fdt property.
Also add a function to read boolean properties, although there is no
actual boolean type in U-Boot.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
---
include/fdtdec.h | 39 +++++++++++++++++++++++++++++++
lib/fdtdec.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 106 insertions(+), 0 deletions(-)
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 01badd4..047f603 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -188,3 +188,42 @@ int fdtdec_find_aliases_for_id(const void *blob, const char *name,
* @return compatible string for that id
*/
const char *fdtdec_get_compatible(enum fdt_compat_id id);
+
+/* Look up a phandle and follow it to its node. Then return the offset
+ * of that node.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @return node offset if found, -ve error code on error
+ */
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name);
+
+/**
+ * Look up a property in a node and return its contents in an integer
+ * array of given length. The property must have at least enough data for
+ * the array (4*count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @param array array to fill with data
+ * @param count number of array elements
+ * @return 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found,
+ * or -FDT_ERR_BADLAYOUT if not enough data
+ */
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+ u32 *array, int count);
+
+/**
+ * Look up a boolean property in a node and return it.
+ *
+ * A boolean properly is true if present in the device tree and false if not
+ * present, regardless of its value.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @return 1 if the properly is present; 0 if it isn't present
+ */
+int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 846ec3f..977528b 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -269,3 +269,70 @@ int fdtdec_check_fdt(void)
"binary or define CONFIG_OF_EMBED\n");
return 0;
}
+
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name)
+{
+ const u32 *phandle;
+ int lookup;
+
+ phandle = fdt_getprop(blob, node, prop_name, NULL);
+ if (!phandle)
+ return -FDT_ERR_NOTFOUND;
+
+ lookup = fdt_node_offset_by_phandle(blob, fdt32_to_cpu(*phandle));
+ return lookup;
+}
+
+/**
+ * Look up a property in a node and check that it has a minimum length.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_name name of property to find
+ * @param min_len minimum property length in bytes
+ * @param err 0 if ok, or -FDT_ERR_NOTFOUND if the property is not
+ found, or -FDT_ERR_BADLAYOUT if not enough data
+ * @return pointer to cell, which is only valid if err == 0
+ */
+static const void *get_prop_check_min_len(const void *blob, int node,
+ const char *prop_name, int min_len, int *err)
+{
+ const void *cell;
+ int len;
+
+ debug("%s: %s\n", __func__, prop_name);
+ cell = fdt_getprop(blob, node, prop_name, &len);
+ if (!cell)
+ *err = -FDT_ERR_NOTFOUND;
+ else if (len < min_len)
+ *err = -FDT_ERR_BADLAYOUT;
+ else
+ *err = 0;
+ return cell;
+}
+
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+ u32 *array, int count)
+{
+ const u32 *cell;
+ int i, err = 0;
+
+ debug("%s: %s\n", __func__, prop_name);
+ cell = get_prop_check_min_len(blob, node, prop_name,
+ sizeof(u32) * count, &err);
+ if (!err) {
+ for (i = 0; i < count; i++)
+ array[i] = fdt32_to_cpu(cell[i]);
+ }
+ return err;
+}
+
+int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
+{
+ const s32 *cell;
+ int len;
+
+ debug("%s: %s\n", __func__, prop_name);
+ cell = fdt_getprop(blob, node, prop_name, &len);
+ return cell != NULL;
+}
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 03/20] fdt: Add basic support for decoding GPIO definitions
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
2012-02-27 20:52 ` [PATCH v6 01/20] fdt: Tidy up a few fdtdec problems Simon Glass
2012-02-27 20:52 ` [PATCH v6 02/20] fdt: Add functions to access phandles, arrays and bools Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 04/20] arm: fdt: Add skeleton device tree file from kernel Simon Glass
` (7 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Tom Warren, Jerry Van Baren
This adds some support into fdtdec for reading GPIO definitions from
the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO
is of the form:
gpio-function-name = <phandle gpio_num flags>;
where:
phandle is a pointer to the GPIO node
gpio_num is the number of the GPIO (0 to 223)
flags is a flag, as follows:
bit meaning
0 0=polarity normal, 1=active low (inverted)
An example is:
enable-propounder-gpios = <&gpio 43 0>;
which means that GPIO 43 is used to enable the propounder (setting the
GPIO high), or that you can detect that the propounder is enabled by
checking if the GPIO is high (the fdt does not indicate input/output).
Two main functions are provided:
fdtdec_decode_gpio() reads a GPIO property from an fdt node and decodes it
into a structure.
fdtdec_setup_gpio() sets up the GPIO by calling gpio_request for you.
Both functions can cope with the property being missing, which is taken to
mean that that GPIO function is not available or is not needed.
[For reference, from Stephen Warren <swarren@nvidia.com>. It may be that
we add this extra complexity later if needed:
The correct way to parse such a GPIO property in general is:
* Read the first cell.
* Find the node referenced by the phandle (the controller).
* Ensure property gpio-controller is present in the controller node.
* Read property #gpio-cells from the controller node.
* Extract #gpio-cells from the original property.
* Keep processing more cells from the original property; there may be
multiple GPIOs listed.
According to the binding documentation in the Linux kernel, Samsung
Exynos4 doesn't use this format, and while all other chips do have a
flags cell, about 50% of the controllers indicate the cell is unused.
]
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v5:
- Fixed endian bug in fdtdec_decode_gpios()
- Make sure GPIO name is NULL if incorrectly decoded
include/fdtdec.h | 45 ++++++++++++++++++++++++++++++
lib/fdtdec.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 124 insertions(+), 0 deletions(-)
diff --git a/include/fdtdec.h b/include/fdtdec.h
index 047f603..6c0a2d1 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -61,6 +61,23 @@ enum fdt_compat_id {
COMPAT_COUNT,
};
+/* GPIOs are numbered from 0 */
+enum {
+ FDT_GPIO_NONE = -1U, /* an invalid GPIO used to end our list */
+
+ FDT_GPIO_ACTIVE_LOW = 1 << 0, /* input is active low (else high) */
+};
+
+/* This is the state of a GPIO pin as defined by the fdt */
+struct fdt_gpio_state {
+ const char *name; /* name of the fdt property defining this */
+ uint gpio; /* GPIO number, or FDT_GPIO_NONE if none */
+ u8 flags; /* FDT_GPIO_... flags */
+};
+
+/* This tells us whether a fdt_gpio_state record is valid or not */
+#define fdt_gpio_isvalid(x) ((x)->gpio != FDT_GPIO_NONE)
+
/**
* Find the next numbered alias for a peripheral. This is used to enumerate
* all the peripherals of a certain type.
@@ -227,3 +244,31 @@ int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
* @return 1 if the properly is present; 0 if it isn't present
*/
int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
+
+/**
+ * Decode a single GPIOs from an FDT.
+ *
+ * If the property is not found, then the GPIO structure will still be
+ * initialised, with gpio set to FDT_GPIO_NONE. This makes it easy to
+ * provide optional GPIOs.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_name Node property name
+ * @param gpio gpio elements to fill from FDT
+ * @return 0 if ok, -FDT_ERR_NOTFOUND if the property is missing.
+ */
+int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
+ struct fdt_gpio_state *gpio);
+
+/**
+ * Set up a GPIO pin according to the provided gpio information. At present this
+ * just requests the GPIO.
+ *
+ * If the gpio is FDT_GPIO_NONE, no action is taken. This makes it easy to
+ * deal with optional GPIOs.
+ *
+ * @param gpio GPIO info to use for set up
+ * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
+ */
+int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 977528b..c748cac 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -24,6 +24,9 @@
#include <libfdt.h>
#include <fdtdec.h>
+/* we need the generic GPIO interface here */
+#include <asm-generic/gpio.h>
+
DECLARE_GLOBAL_DATA_PTR;
/*
@@ -336,3 +339,79 @@ int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
cell = fdt_getprop(blob, node, prop_name, &len);
return cell != NULL;
}
+
+/**
+ * Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
+ * terminating item.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_name Node property name
+ * @param gpio Array of gpio elements to fill from FDT. This will be
+ * untouched if either 0 or an error is returned
+ * @param max_count Maximum number of elements allowed
+ * @return number of GPIOs read if ok, -FDT_ERR_BADLAYOUT if max_count would
+ * be exceeded, or -FDT_ERR_NOTFOUND if the property is missing.
+ */
+static int fdtdec_decode_gpios(const void *blob, int node,
+ const char *prop_name, struct fdt_gpio_state *gpio,
+ int max_count)
+{
+ const struct fdt_property *prop;
+ const u32 *cell;
+ const char *name;
+ int len, i;
+
+ debug("%s: %s\n", __func__, prop_name);
+ assert(max_count > 0);
+ prop = fdt_get_property(blob, node, prop_name, &len);
+ if (!prop) {
+ debug("FDT: %s: property '%s' missing\n", __func__, prop_name);
+ return -FDT_ERR_NOTFOUND;
+ }
+
+ /* We will use the name to tag the GPIO */
+ name = fdt_string(blob, fdt32_to_cpu(prop->nameoff));
+ cell = (u32 *)prop->data;
+ len /= sizeof(u32) * 3; /* 3 cells per GPIO record */
+ if (len > max_count) {
+ debug("FDT: %s: too many GPIOs / cells for "
+ "property '%s'\n", __func__, prop_name);
+ return -FDT_ERR_BADLAYOUT;
+ }
+
+ /* Read out the GPIO data from the cells */
+ for (i = 0; i < len; i++, cell += 3) {
+ gpio[i].gpio = fdt32_to_cpu(cell[1]);
+ gpio[i].flags = fdt32_to_cpu(cell[2]);
+ gpio[i].name = name;
+ }
+
+ return len;
+}
+
+int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
+ struct fdt_gpio_state *gpio)
+{
+ int err;
+
+ debug("%s: %s\n", __func__, prop_name);
+ gpio->gpio = FDT_GPIO_NONE;
+ gpio->name = NULL;
+ err = fdtdec_decode_gpios(blob, node, prop_name, gpio, 1);
+ return err == 1 ? 0 : err;
+}
+
+int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
+{
+ /*
+ * Return success if there is no GPIO defined. This is used for
+ * optional GPIOs)
+ */
+ if (!fdt_gpio_isvalid(gpio))
+ return 0;
+
+ if (gpio_request(gpio->gpio, gpio->name))
+ return -1;
+ return 0;
+}
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 04/20] arm: fdt: Add skeleton device tree file from kernel
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (2 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 03/20] fdt: Add basic support for decoding GPIO definitions Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 05/20] tegra: fdt: Add Tegra2x " Simon Glass
` (6 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/arm/dts/skeleton.dtsi | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/dts/skeleton.dtsi
diff --git a/arch/arm/dts/skeleton.dtsi b/arch/arm/dts/skeleton.dtsi
new file mode 100644
index 0000000..b41d241
--- /dev/null
+++ b/arch/arm/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value. The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ chosen { };
+ aliases { };
+ memory { device_type = "memory"; reg = <0 0>; };
+};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 05/20] tegra: fdt: Add Tegra2x device tree file from kernel
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (3 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 04/20] arm: fdt: Add skeleton device tree file from kernel Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
` (5 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren, linux-tegra
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git
config.mk is updated to provide this file to boards through the
built-in mechanism:
/include/ ARCH_CPU_DTS
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/arm/cpu/armv7/tegra2/config.mk | 2 +
arch/arm/dts/tegra20.dtsi | 168 +++++++++++++++++++++++++++++++++++
2 files changed, 170 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/dts/tegra20.dtsi
diff --git a/arch/arm/cpu/armv7/tegra2/config.mk b/arch/arm/cpu/armv7/tegra2/config.mk
index 2303dba..fe9ef5b 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -31,3 +31,5 @@ CFLAGS_arch/arm/lib/board.o += -march=armv4t
endif
USE_PRIVATE_LIBGCC = yes
+
+CONFIG_ARCH_DEVICE_TREE := tegra20
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
new file mode 100644
index 0000000..a9a98ea
--- /dev/null
+++ b/arch/arm/dts/tegra20.dtsi
@@ -0,0 +1,168 @@
+/include/ "skeleton.dtsi"
+
+/ {
+ compatible = "nvidia,tegra20";
+ interrupt-parent = <&intc>;
+
+ intc: interrupt-controller@50041000 {
+ compatible = "nvidia,tegra20-gic";
+ interrupt-controller;
+ #interrupt-cells = <1>;
+ reg = < 0x50041000 0x1000 >,
+ < 0x50040100 0x0100 >;
+ };
+
+ i2c@7000c000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2c";
+ reg = <0x7000C000 0x100>;
+ interrupts = < 70 >;
+ };
+
+ i2c@7000c400 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2c";
+ reg = <0x7000C400 0x100>;
+ interrupts = < 116 >;
+ };
+
+ i2c@7000c500 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2c";
+ reg = <0x7000C500 0x100>;
+ interrupts = < 124 >;
+ };
+
+ i2c@7000d000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2c";
+ reg = <0x7000D000 0x200>;
+ interrupts = < 85 >;
+ };
+
+ i2s@70002800 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2s";
+ reg = <0x70002800 0x200>;
+ interrupts = < 45 >;
+ dma-channel = < 2 >;
+ };
+
+ i2s@70002a00 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-i2s";
+ reg = <0x70002a00 0x200>;
+ interrupts = < 35 >;
+ dma-channel = < 1 >;
+ };
+
+ das@70000c00 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "nvidia,tegra20-das";
+ reg = <0x70000c00 0x80>;
+ };
+
+ gpio: gpio@6000d000 {
+ compatible = "nvidia,tegra20-gpio";
+ reg = < 0x6000d000 0x1000 >;
+ interrupts = < 64 65 66 67 87 119 121 >;
+ #gpio-cells = <2>;
+ gpio-controller;
+ };
+
+ pinmux: pinmux@70000000 {
+ compatible = "nvidia,tegra20-pinmux";
+ reg = < 0x70000014 0x10 /* Tri-state registers */
+ 0x70000080 0x20 /* Mux registers */
+ 0x700000a0 0x14 /* Pull-up/down registers */
+ 0x70000868 0xa8 >; /* Pad control registers */
+ };
+
+ serial@70006000 {
+ compatible = "nvidia,tegra20-uart";
+ reg = <0x70006000 0x40>;
+ reg-shift = <2>;
+ interrupts = < 68 >;
+ };
+
+ serial@70006040 {
+ compatible = "nvidia,tegra20-uart";
+ reg = <0x70006040 0x40>;
+ reg-shift = <2>;
+ interrupts = < 69 >;
+ };
+
+ serial@70006200 {
+ compatible = "nvidia,tegra20-uart";
+ reg = <0x70006200 0x100>;
+ reg-shift = <2>;
+ interrupts = < 78 >;
+ };
+
+ serial@70006300 {
+ compatible = "nvidia,tegra20-uart";
+ reg = <0x70006300 0x100>;
+ reg-shift = <2>;
+ interrupts = < 122 >;
+ };
+
+ serial@70006400 {
+ compatible = "nvidia,tegra20-uart";
+ reg = <0x70006400 0x100>;
+ reg-shift = <2>;
+ interrupts = < 123 >;
+ };
+
+ sdhci@c8000000 {
+ compatible = "nvidia,tegra20-sdhci";
+ reg = <0xc8000000 0x200>;
+ interrupts = < 46 >;
+ };
+
+ sdhci@c8000200 {
+ compatible = "nvidia,tegra20-sdhci";
+ reg = <0xc8000200 0x200>;
+ interrupts = < 47 >;
+ };
+
+ sdhci@c8000400 {
+ compatible = "nvidia,tegra20-sdhci";
+ reg = <0xc8000400 0x200>;
+ interrupts = < 51 >;
+ };
+
+ sdhci@c8000600 {
+ compatible = "nvidia,tegra20-sdhci";
+ reg = <0xc8000600 0x200>;
+ interrupts = < 63 >;
+ };
+
+ usb@c5000000 {
+ compatible = "nvidia,tegra20-ehci", "usb-ehci";
+ reg = <0xc5000000 0x4000>;
+ interrupts = < 52 >;
+ phy_type = "utmi";
+ };
+
+ usb@c5004000 {
+ compatible = "nvidia,tegra20-ehci", "usb-ehci";
+ reg = <0xc5004000 0x4000>;
+ interrupts = < 53 >;
+ phy_type = "ulpi";
+ };
+
+ usb@c5008000 {
+ compatible = "nvidia,tegra20-ehci", "usb-ehci";
+ reg = <0xc5008000 0x4000>;
+ interrupts = < 129 >;
+ phy_type = "utmi";
+ };
+
+};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 06/20] tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 09/20] tegra: fdt: Add additional USB binding Simon Glass
` (3 subsequent siblings)
4 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Warren, Stephen Warren, Simon Glass,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Jerry Van Baren,
Devicetree Discuss
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
board/nvidia/dts/tegra2-seaboard.dts | 36 ++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
create mode 100644 board/nvidia/dts/tegra2-seaboard.dts
diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
new file mode 100644
index 0000000..dde5d03
--- /dev/null
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+
+/memreserve/ 0x1c000000 0x04000000;
+/include/ ARCH_CPU_DTS
+
+/ {
+ model = "NVIDIA Seaboard";
+ compatible = "nvidia,seaboard", "nvidia,tegra20";
+
+ chosen {
+ bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait";
+ };
+
+ memory {
+ device_type = "memory";
+ reg = < 0x00000000 0x40000000 >;
+ };
+
+ serial@70006300 {
+ clock-frequency = < 216000000 >;
+ };
+
+ sdhci@c8000400 {
+ cd-gpios = <&gpio 69 0>; /* gpio PI5 */
+ wp-gpios = <&gpio 57 0>; /* gpio PH1 */
+ power-gpios = <&gpio 70 0>; /* gpio PI6 */
+ };
+
+ sdhci@c8000600 {
+ support-8bit;
+ };
+
+ usb@c5000000 {
+ nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+ };
+};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 07/20] fdt: Add staging area for device tree binding documentation
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (5 preceding siblings ...)
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 08/20] fdt: Add tegra-usb bindings file from linux Simon Glass
` (3 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Tom Warren, Jerry Van Baren
Add a directory to hold device tree binding files, to permit easy review
of this material in U-Boot patches.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v4:
- Add staging area for device tree bindings used in U-Boot
Changes in v5:
- Update README to indicate that we will commit fdt documentation to U-Boot
doc/device-tree-bindings/README | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
create mode 100644 doc/device-tree-bindings/README
diff --git a/doc/device-tree-bindings/README b/doc/device-tree-bindings/README
new file mode 100644
index 0000000..2ea3439
--- /dev/null
+++ b/doc/device-tree-bindings/README
@@ -0,0 +1,17 @@
+Device Tree Bindings Staging Area
+=================================
+
+This directory contains device tree bindings for U-Boot.
+
+These follow along with Linux kernel bindings, with a few additions. By
+adding the files here, U-Boot patches can clearly show thees additions.
+This makes it easier for device tree people to review these additions in
+patches sent to the U-Boot mailing list.
+
+The intent IS to commit these files to U-Boot. Hopefully at some point
+the files will be stored in another repo (shared with Linux) which is
+brought in as needed. Changes here are intended to mirror changes in the
+Linux Documentation/devicetree/bindings/ directory.
+
+sjg@chromium.org
+17-Jan-12
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 08/20] fdt: Add tegra-usb bindings file from linux
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (6 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 07/20] fdt: Add staging area for device tree binding documentation Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard Simon Glass
` (2 subsequent siblings)
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List; +Cc: Devicetree Discuss, Tom Warren, Jerry Van Baren
This file is taken from the Linux mailing list.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
doc/device-tree-bindings/usb/tegra-usb.txt | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
create mode 100644 doc/device-tree-bindings/usb/tegra-usb.txt
diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt b/doc/device-tree-bindings/usb/tegra-usb.txt
new file mode 100644
index 0000000..035d63d
--- /dev/null
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -0,0 +1,13 @@
+Tegra SOC USB controllers
+
+The device node for a USB controller that is part of a Tegra
+SOC is as described in the document "Open Firmware Recommended
+Practice : Universal Serial Bus" with the following modifications
+and additions :
+
+Required properties :
+ - compatible : Should be "nvidia,tegra20-ehci" for USB controllers
+ used in host mode.
+ - phy_type : Should be one of "ulpi" or "utmi".
+ - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
+ activated for the bus to be powered.
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 09/20] tegra: fdt: Add additional USB binding
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 06/20] tegra: fdt: Add device tree file for Tegra2 Seaboard " Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
[not found] ` <1330375973-10681-10-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 10/20] tegra: fdt: Add clock bindings Simon Glass
` (2 subsequent siblings)
4 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Warren, Stephen Warren, Simon Glass,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Jerry Van Baren,
Devicetree Discuss
This adds a property to indicate a port which can switch between host and device
mode.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes in v5:
- Add dr_mode property to control host/device/otg mode
- Add nvidia,has-legacy-mode property per review comments
doc/device-tree-bindings/usb/tegra-usb.txt | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt b/doc/device-tree-bindings/usb/tegra-usb.txt
index 035d63d..b7174a3 100644
--- a/doc/device-tree-bindings/usb/tegra-usb.txt
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -11,3 +11,15 @@ Required properties :
- phy_type : Should be one of "ulpi" or "utmi".
- nvidia,vbus-gpio : If present, specifies a gpio that needs to be
activated for the bus to be powered.
+
+Optional properties:
+ - dr_mode : dual role mode. Indicates the working mode for
+ nvidia,tegra20-ehci compatible controllers. Can be "host", "peripheral",
+ or "otg". Default to "host" if not defined for backward compatibility.
+ host means this is a host controller
+ peripheral means it is device controller
+ otg means it can operate as either ("on the go")
+ - nvidia,has-legacy-mode : boolean indicates whether this controller can
+ operate in legacy mode (as APX 2500 / 2600). In legacy mode some
+ registers are accessed through the APB_MISC base address instead of
+ the USB controller.
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 10/20] tegra: fdt: Add clock bindings
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 06/20] tegra: fdt: Add device tree file for Tegra2 Seaboard " Simon Glass
2012-02-27 20:52 ` [PATCH v6 09/20] tegra: fdt: Add additional USB binding Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard Simon Glass
2012-02-27 20:52 ` [PATCH v6 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports Simon Glass
4 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Warren, Stephen Warren, Simon Glass,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Jerry Van Baren,
Devicetree Discuss
This adds a basic binding for the oscillator and peripheral clocks. The
second cell is the clock number, defined as the bit number within the clock
enable register if the peripheral clock.
This uses the RFC clock bindings from Grant Likely so may change later:
https://lkml.org/lkml/2011/12/12/498
It is taken from Stephen Warren's patch here:
http://patchwork.ozlabs.org/patch/141359/
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes in v4:
- Add clock bindings for Tegra2x
Changes in v6:
- Add clock bindings from Stephen Warren's latest patch
arch/arm/dts/tegra20.dtsi | 16 ++
.../clock/nvidia,tegra20-car.txt | 207 ++++++++++++++++++++
2 files changed, 223 insertions(+), 0 deletions(-)
create mode 100644 doc/device-tree-bindings/clock/nvidia,tegra20-car.txt
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index a9a98ea..2c46e11 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -4,6 +4,22 @@
compatible = "nvidia,tegra20";
interrupt-parent = <&intc>;
+ tegra_car: clock@60006000 {
+ compatible = "nvidia,tegra20-car";
+ reg = <0x60006000 0x1000>;
+ #clock-cells = <1>;
+ };
+
+ clocks {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ osc: clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ };
+ };
+
intc: interrupt-controller@50041000 {
compatible = "nvidia,tegra20-gic";
interrupt-controller;
diff --git a/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt b/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt
new file mode 100644
index 0000000..5c07fca
--- /dev/null
+++ b/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt
@@ -0,0 +1,207 @@
+NVIDIA Tegra20 Clock And Reset Controller
+
+This binding uses the common clock binding:
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+The CAR (Clock And Reset) Controller on Tegra is the HW module responsible
+for muxing and gating Tegra's clocks, and setting their rates.
+
+Required properties :
+- compatible : Should be "nvidia,tegra20-car"
+- reg : Should contain CAR registers location and length
+- clocks : Should contain phandle and clock specifiers for two clocks:
+ the 32 KHz "32k_in", and the board-specific oscillator "osc".
+- #clock-cells : Should be 1.
+ In clock consumers, this cell represents the clock ID exposed by the CAR.
+
+ The first 96 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB
+ registers. These IDs often match those in the CAR's RST_DEVICES registers,
+ but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In
+ this case, those clocks are assigned IDs above 95 in order to highlight
+ this issue. Implementations that interpret these clock IDs as bit values
+ within the CLK_OUT_ENB or RST_DEVICES registers should be careful to
+ explicitly handle these special cases.
+
+ The balance of the clocks controlled by the CAR are assigned IDs of 96 and
+ above.
+
+ 0 cpu
+ 1 unassigned
+ 2 unassigned
+ 3 ac97
+ 4 rtc
+ 5 tmr
+ 6 uart1
+ 7 unassigned (register bit affects uart2 and vfir)
+ 8 gpio
+ 9 sdmmc2
+ 10 unassigned (register bit affects spdif_in and spdif_out)
+ 11 i2s1
+ 12 i2c1
+ 13 ndflash
+ 14 sdmmc1
+ 15 sdmmc4
+ 16 twc
+ 17 pwm
+ 18 i2s2
+ 19 epp
+ 20 unassigned (register bit affects vi and vi_sensor)
+ 21 2d
+ 22 usbd
+ 23 isp
+ 24 3d
+ 25 ide
+ 26 disp2
+ 27 disp1
+ 28 host1x
+ 29 vcp
+ 30 unassigned
+ 31 cache2
+
+ 32 mem
+ 33 ahbdma
+ 34 apbdma
+ 35 unassigned
+ 36 kbc
+ 37 stat_mon
+ 38 pmc
+ 39 fuse
+ 40 kfuse
+ 41 sbc1
+ 42 snor
+ 43 spi1
+ 44 sbc2
+ 45 xio
+ 46 sbc3
+ 47 dvc
+ 48 dsi
+ 49 unassigned (register bit affects tvo and cve)
+ 50 mipi
+ 51 hdmi
+ 52 csi
+ 53 tvdac
+ 54 i2c2
+ 55 uart3
+ 56 unassigned
+ 57 emc
+ 58 usb2
+ 59 usb3
+ 60 mpe
+ 61 vde
+ 62 bsea
+ 63 bsev
+
+ 64 speedo
+ 65 uart4
+ 66 uart5
+ 67 i2c3
+ 68 sbc4
+ 69 sdmmc3
+ 70 pcie
+ 71 owr
+ 72 afi
+ 73 csite
+ 74 unassigned
+ 75 avpucq
+ 76 la
+ 77 unassigned
+ 78 unassigned
+ 79 unassigned
+ 80 unassigned
+ 81 unassigned
+ 82 unassigned
+ 83 unassigned
+ 84 irama
+ 85 iramb
+ 86 iramc
+ 87 iramd
+ 88 cram2
+ 89 audio_2x a/k/a audio_2x_sync_clk
+ 90 clk_d
+ 91 unassigned
+ 92 sus
+ 93 cdev1
+ 94 cdev2
+ 95 unassigned
+
+ 96 uart2
+ 97 vfir
+ 98 spdif_in
+ 99 spdif_out
+ 100 vi
+ 101 vi_sensor
+ 102 tvo
+ 103 cve
+ 104 osc
+ 105 clk_32k a/k/a clk_s
+ 106 clk_m
+ 107 sclk
+ 108 cclk
+ 109 hclk
+ 110 pclk
+ 111 blink
+ 112 pll_a
+ 113 pll_a_out0
+ 114 pll_c
+ 115 pll_c_out1
+ 116 pll_d
+ 117 pll_d_out0
+ 118 pll_e
+ 119 pll_m
+ 120 pll_m_out1
+ 121 pll_p
+ 122 pll_p_out1
+ 123 pll_p_out2
+ 124 pll_p_out3
+ 125 pll_p_out4
+ 126 pll_s
+ 127 pll_u
+ 128 pll_x
+ 129 cop a/k/a avp
+ 130 audio a/k/a audio_sync_clk
+
+Example SoC include file:
+
+/ {
+ tegra_car: clock@60006000 {
+ compatible = "nvidia,tegra20-car";
+ reg = <0x60006000 0x1000>;
+ #clock-cells = <1>;
+ };
+
+ usb@c5004000 {
+ clocks = <&tegra_car 58>; /* usb2 */
+ };
+};
+
+Example board file:
+
+/ {
+ clocks {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ osc: clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <12000000>;
+ };
+ };
+
+ i2c@7000d000 {
+ pmic@34 {
+ compatible = "ti,tps6586x";
+ reg = <0x34>;
+
+ clk_32k: clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ };
+ };
+ };
+
+ &tegra_car {
+ clocks = <&clk_32k> <&osc>;
+ };
+};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
` (2 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 10/20] tegra: fdt: Add clock bindings Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
[not found] ` <1330375973-10681-12-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports Simon Glass
4 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Warren, Stephen Warren, Simon Glass,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Jerry Van Baren,
Devicetree Discuss
Add the definition of the oscillator clock frequency.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes in v6:
- Add new patch to bring in clock bindings to seaboard
board/nvidia/dts/tegra2-seaboard.dts | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
index dde5d03..87f58fb 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -16,6 +16,16 @@
reg = < 0x00000000 0x40000000 >;
};
+ clocks {
+ osc {
+ clock-frequency = <12000000>;
+ };
+ };
+
+ clock@60006000 {
+ clocks = <&osc>;
+ };
+
serial@70006300 {
clock-frequency = < 216000000 >;
};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
` (3 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
4 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Tom Warren, Stephen Warren, Simon Glass,
linux-tegra-u79uwXL29TY76Z2rM5mHXA, Remy Bohmer, Jerry Van Baren,
Devicetree Discuss
This adds clock references to the USB part of the device tree for U-Boot,
and marks USB1 as supporting legacy mode (which we disable in the driver).
The USB timing information may vary between boards sometimes, but for
now we hard-code it in C. This is because all current T2x boards use
the same values, we will deal with T3x later and we first need to agree
on the format for this timing information in the fdt and may in fact
decide that it has no place there.
Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes in v5:
- Add dr_mode property to control host/device/otg mode
- Add nvidia,has-legacy-mode property per review comments
- Change device tree comment style from // to /* */
Changes in v6:
- Remove dr_mode properties from SOC .dtsi file and move to boards
arch/arm/dts/tegra20.dtsi | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 2c46e11..d6bc9f1 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -165,6 +165,8 @@
reg = <0xc5000000 0x4000>;
interrupts = < 52 >;
phy_type = "utmi";
+ clocks = <&tegra_car 22>; /* PERIPH_ID_USBD */
+ nvidia,has-legacy-mode;
};
usb@c5004000 {
@@ -172,6 +174,7 @@
reg = <0xc5004000 0x4000>;
interrupts = < 53 >;
phy_type = "ulpi";
+ clocks = <&tegra_car 58>; /* PERIPH_ID_USB2 */
};
usb@c5008000 {
@@ -179,6 +182,7 @@
reg = <0xc5008000 0x4000>;
interrupts = < 129 >;
phy_type = "utmi";
+ clocks = <&tegra_car 59>; /* PERIPH_ID_USB3 */
};
};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (7 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 08/20] fdt: Add tegra-usb bindings file from linux Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID Simon Glass
2012-02-27 20:52 ` [PATCH v6 20/20] tegra: fdt: Enable FDT support for Seaboard Simon Glass
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Jerry Van Baren, Tom Warren, linux-tegra, Devicetree Discuss
We set up two USB ports, one of which can be host or device.
For some reason the kernel version does enable both ports.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v2:
- Remove 0x from fdt aliases
- Use "okay" instead of "ok" for fdt node status
Changes in v3:
- Disable USB2 which is not used on Seaboard
- Fix device tree indenting with tabs instead of spaces
- Remove "okay" from nodes since this is the default anyway
Changes in v5:
- Remove support-host-mode property
Changes in v6:
- Remove dr_mode properties from SOC .dtsi file and move to boards
board/nvidia/dts/tegra2-seaboard.dts | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
index 87f58fb..4fbb252 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -11,6 +11,12 @@
bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait";
};
+ aliases {
+ /* This defines the order of our USB ports */
+ usb0 = "/usb@c5008000";
+ usb1 = "/usb@c5000000";
+ };
+
memory {
device_type = "memory";
reg = < 0x00000000 0x40000000 >;
@@ -42,5 +48,10 @@
usb@c5000000 {
nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+ dr_mode = "otg";
+ };
+
+ usb@c5004000 {
+ status = "disabled";
};
};
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (8 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
[not found] ` <1330375973-10681-16-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 20/20] tegra: fdt: Enable FDT support for Seaboard Simon Glass
10 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren, linux-tegra
A common requirement is to find the clock ID for a peripheral. This is the
second cell of the 'clocks' property (the first being the phandle itself).
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v4:
- Add fdtdec function to return peripheral ID
Changes in v6:
- Move peripheral decode function into Tegra's clock.c
arch/arm/cpu/armv7/tegra2/clock.c | 19 +++++++++++++++++++
arch/arm/include/asm/arch-tegra2/clock.h | 13 +++++++++++++
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/arch/arm/cpu/armv7/tegra2/clock.c b/arch/arm/cpu/armv7/tegra2/clock.c
index 11d2346..ffbfc28 100644
--- a/arch/arm/cpu/armv7/tegra2/clock.c
+++ b/arch/arm/cpu/armv7/tegra2/clock.c
@@ -28,6 +28,7 @@
#include <asm/arch/tegra2.h>
#include <common.h>
#include <div64.h>
+#include <fdtdec.h>
/*
* This is our record of the current clock rate of each clock. We don't
@@ -918,6 +919,24 @@ void clock_ll_start_uart(enum periph_id periph_id)
reset_set_enable(periph_id, 0);
}
+
+int clock_decode_periph_id(const void *blob, int node)
+{
+ enum periph_id id;
+ int err, valid;
+ u32 cell[2];
+
+ err = fdtdec_get_int_array(blob, node, "clocks", cell,
+ ARRAY_SIZE(cell));
+ if (err)
+ return -1;
+ id = cell[1];
+
+ valid = clock_periph_id_isvalid(id);
+ assert(valid);
+ return valid ? id : PERIPH_ID_NONE;
+}
+
int clock_verify(void)
{
struct clk_pll *pll = get_pll(CLOCK_ID_PERIPH);
diff --git a/arch/arm/include/asm/arch-tegra2/clock.h b/arch/arm/include/asm/arch-tegra2/clock.h
index 080ef18..6b12c76 100644
--- a/arch/arm/include/asm/arch-tegra2/clock.h
+++ b/arch/arm/include/asm/arch-tegra2/clock.h
@@ -177,6 +177,7 @@ enum periph_id {
PERIPH_ID_CRAM2,
PERIPH_ID_COUNT,
+ PERIPH_ID_NONE = -1,
};
/* Converts a clock number to a clock register: 0=L, 1=H, 2=U */
@@ -355,6 +356,18 @@ unsigned clock_get_rate(enum clock_id clkid);
*/
void clock_ll_start_uart(enum periph_id periph_id);
+/**
+ * Decode a peripheral ID from a device tree node.
+ *
+ * This works by looking up the peripheral's 'clocks' node and reading out
+ * the second cell, which is the clock number / peripheral ID.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @return peripheral ID, or PERIPH_ID_NONE if none
+ */
+enum periph_id clock_decode_periph_id(const void *blob, int node);
+
/*
* Checks that clocks are valid and prints a warning if not
*
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* [PATCH v6 20/20] tegra: fdt: Enable FDT support for Seaboard
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
` (9 preceding siblings ...)
2012-02-27 20:52 ` [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID Simon Glass
@ 2012-02-27 20:52 ` Simon Glass
10 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-02-27 20:52 UTC (permalink / raw)
To: U-Boot Mailing List
Cc: Devicetree Discuss, Jerry Van Baren, Tom Warren, linux-tegra
This switches Seaboard over to use FDT for run-time config instead of
CONFIG options. USB is the only user at present.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3:
- Drop Tegra USB alignment patch as we will deal with this another way
Changes in v6:
- Drop fdt alignment patch as we will handle this after generic reloc
include/configs/seaboard.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index b6d9f7a..1dc775a 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -27,6 +27,11 @@
#include <asm/sizes.h>
#include "tegra2-common.h"
+/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE tegra2-seaboard
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
/* High-level configuration options */
#define TEGRA2_SYSMEM "mem=384M@0M nvmem=128M@384M mem=512M@512M"
#define V_PROMPT "Tegra2 (SeaBoard) # "
--
1.7.7.3
^ permalink raw reply related [flat|nested] 35+ messages in thread
* Re: [PATCH v6 09/20] tegra: fdt: Add additional USB binding
[not found] ` <1330375973-10681-10-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-02-27 23:27 ` Stephen Warren
0 siblings, 0 replies; 35+ messages in thread
From: Stephen Warren @ 2012-02-27 23:27 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
On 02/27/2012 01:52 PM, Simon Glass wrote:
> This adds a property to indicate a port which can switch between host and device
> mode.
...
> diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt b/doc/device-tree-bindings/usb/tegra-usb.txt
...
> +Optional properties:
> + - dr_mode : dual role mode. Indicates the working mode for
> + nvidia,tegra20-ehci compatible controllers. Can be "host", "peripheral",
> + or "otg". Default to "host" if not defined for backward compatibility.
Those last two lines need to be indented 1 extra space each so the text
lines up with "dr_mode". I assume that Tom can do this when applying the
change to save any respins etc.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <1330375973-10681-12-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-02-27 23:29 ` Stephen Warren
[not found] ` <4F4C11E9.1050907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-27 23:29 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
On 02/27/2012 01:52 PM, Simon Glass wrote:
> Add the definition of the oscillator clock frequency.
> diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
> + clock@60006000 {
> + clocks = <&osc>;
> + };
The CAR takes two clock inputs; one 32KHz clock (typically from the
PMU/PMIC) and one from the oscillator. The 32KHz one is missing here. I
guess this won't make any difference to U-Boot since it isn't using the
clock inputs in the CAR driver, but it'd be best if the .dts file
contained the correct content so it didn't act as an incorrect example.
See the example in the binding documentation for what should be there.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <1330375973-10681-16-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-02-27 23:41 ` Stephen Warren
[not found] ` <4F4C149E.3070505-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-27 23:41 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
On 02/27/2012 01:52 PM, Simon Glass wrote:
> A common requirement is to find the clock ID for a peripheral. This is the
> second cell of the 'clocks' property (the first being the phandle itself).
> +int clock_decode_periph_id(const void *blob, int node)
> + valid = clock_periph_id_isvalid(id);
clock_periph_id_isvalid() is not the correct function to use here; the
code should be checking for invalid IDs in the CAR binding, not invalid
IDs in the HW periph ID definition. They're different.
Just to be explicit, the function you need here would be:
int clkid_to_periphid(int clkid)
{
if (clk_id > 95)
return -1;
switch (clk_id) {
case 1:
case 2:
case 7:
case 10:
case 20:
case 30:
case 35:
case 49:
case 56:
case 74:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 91:
case 95:
return -1;
default:
return clkid;
}
}
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <4F4C11E9.1050907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-02-28 17:20 ` Simon Glass
[not found] ` <CAPnjgZ0_xzn0tvETt3C=pjyRX-MXNA-JXy4fuAs9L8OdHuvLhg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 17:20 UTC (permalink / raw)
To: Stephen Warren
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Hi Stephen,
On Mon, Feb 27, 2012 at 3:29 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> On 02/27/2012 01:52 PM, Simon Glass wrote:
>> Add the definition of the oscillator clock frequency.
>
>> diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
>
>> + clock@60006000 {
>> + clocks = <&osc>;
>> + };
>
> The CAR takes two clock inputs; one 32KHz clock (typically from the
> PMU/PMIC) and one from the oscillator. The 32KHz one is missing here. I
> guess this won't make any difference to U-Boot since it isn't using the
> clock inputs in the CAR driver, but it'd be best if the .dts file
> contained the correct content so it didn't act as an incorrect example.
> See the example in the binding documentation for what should be there.
Yes I saw that - but it adds an i2c binding which I don't yet have. I
add i2c in the next series.
I will add that one i2c node here.
Regards,
Simon
>
> --
> nvpublic
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 35+ messages in thread
* RE: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <CAPnjgZ0_xzn0tvETt3C=pjyRX-MXNA-JXy4fuAs9L8OdHuvLhg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-28 17:32 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1D6A-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-28 17:32 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 10:21 AM:
> On Mon, Feb 27, 2012 at 3:29 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> > On 02/27/2012 01:52 PM, Simon Glass wrote:
> >> Add the definition of the oscillator clock frequency.
> >
> >> diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
> >
> >> + clock@60006000 {
> >> + clocks = <&osc>;
> >> + };
> >
> > The CAR takes two clock inputs; one 32KHz clock (typically from the
> > PMU/PMIC) and one from the oscillator. The 32KHz one is missing here. I
> > guess this won't make any difference to U-Boot since it isn't using the
> > clock inputs in the CAR driver, but it'd be best if the .dts file
> > contained the correct content so it didn't act as an incorrect example.
> > See the example in the binding documentation for what should be there.
>
> Yes I saw that - but it adds an i2c binding which I don't yet have. I
> add i2c in the next series.
>
> I will add that one i2c node here.
The clock doesn't /have/ to be represented by its full I2C source; you
could represent it as another global fixed-clock source until the I2C
node is available to act as a clock source.
Note that in order to actually use the tps6586x node to provide the
clock source, you'll need to write or modify the tps6586x's bindings to
document which clock sources it provides. I haven't actually looked at
the tps6586x's bindings at all; it's possible that part of the example
is entirely incorrect. In my original email I quoted above, the part
of the example I was caring about was that the CAR itself needs two
entries in its clocks property; I don't really care where they come from
at present.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1D6A-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-02-28 17:37 ` Simon Glass
2012-02-28 18:31 ` Stephen Warren
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 17:37 UTC (permalink / raw)
To: Stephen Warren
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Hi Stephen,
On Tue, Feb 28, 2012 at 9:32 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 10:21 AM:
>> On Mon, Feb 27, 2012 at 3:29 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>> > On 02/27/2012 01:52 PM, Simon Glass wrote:
>> >> Add the definition of the oscillator clock frequency.
>> >
>> >> diff --git a/board/nvidia/dts/tegra2-seaboard.dts b/board/nvidia/dts/tegra2-seaboard.dts
>> >
>> >> + clock@60006000 {
>> >> + clocks = <&osc>;
>> >> + };
>> >
>> > The CAR takes two clock inputs; one 32KHz clock (typically from the
>> > PMU/PMIC) and one from the oscillator. The 32KHz one is missing here. I
>> > guess this won't make any difference to U-Boot since it isn't using the
>> > clock inputs in the CAR driver, but it'd be best if the .dts file
>> > contained the correct content so it didn't act as an incorrect example.
>> > See the example in the binding documentation for what should be there.
>>
>> Yes I saw that - but it adds an i2c binding which I don't yet have. I
>> add i2c in the next series.
>>
>> I will add that one i2c node here.
>
> The clock doesn't /have/ to be represented by its full I2C source; you
> could represent it as another global fixed-clock source until the I2C
> node is available to act as a clock source.
>
> Note that in order to actually use the tps6586x node to provide the
> clock source, you'll need to write or modify the tps6586x's bindings to
> document which clock sources it provides. I haven't actually looked at
> the tps6586x's bindings at all; it's possible that part of the example
> is entirely incorrect. In my original email I quoted above, the part
> of the example I was caring about was that the CAR itself needs two
> entries in its clocks property; I don't really care where they come from
> at present.
I don't have tps6586x bindings and don't have support for them in
U-Boot at present. U-Boot also doesn't look at the clocks property so
I think your request is entirely about keeping things in sync with
what we expect will go into the kernel in the future.
I am going to add your binding, less the #clock-cells which U-Boot
currently can't support because it conflicts with the C preprocessor
(at some point I may look at a patch to use sed or some other means of
avoiding this).
Regards,
Simon
>
> --
> nvpublic
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <4F4C149E.3070505-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2012-02-28 17:46 ` Simon Glass
[not found] ` <CAPnjgZ24vhy7NKj_Dt_dzn0qJ8=rj4nF04WSsY8u9MorAanzVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 17:46 UTC (permalink / raw)
To: Stephen Warren
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Hi Stephen,
On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> On 02/27/2012 01:52 PM, Simon Glass wrote:
>> A common requirement is to find the clock ID for a peripheral. This is the
>> second cell of the 'clocks' property (the first being the phandle itself).
>
>> +int clock_decode_periph_id(const void *blob, int node)
>
>> + valid = clock_periph_id_isvalid(id);
>
> clock_periph_id_isvalid() is not the correct function to use here; the
> code should be checking for invalid IDs in the CAR binding, not invalid
> IDs in the HW periph ID definition. They're different.
>
> Just to be explicit, the function you need here would be:
>
> int clkid_to_periphid(int clkid)
> {
> if (clk_id > 95)
> return -1;
> switch (clk_id) {
> case 1:
> case 2:
> case 7:
> case 10:
> case 20:
> case 30:
> case 35:
> case 49:
> case 56:
> case 74:
> case 77:
> case 78:
> case 79:
> case 80:
> case 81:
> case 82:
> case 83:
> case 91:
> case 95:
> return -1;
> default:
> return clkid;
> }
> }
Ick.
Why is 7 in there, and did you miss 76? Also U-Boot only goes up to 88
at present so should I change the first test to match?
Regards,
Simon
>
> --
> nvpublic
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-02-28 17:37 ` Simon Glass
@ 2012-02-28 18:31 ` Stephen Warren
2012-02-28 18:37 ` Simon Glass
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-28 18:31 UTC (permalink / raw)
To: Simon Glass
Cc: linux-tegra@vger.kernel.org, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
...
> I am going to add your binding, less the #clock-cells which U-Boot
> currently can't support because it conflicts with the C preprocessor
> (at some point I may look at a patch to use sed or some other means of
> avoiding this).
Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
build process running cpp on the .dts files or something? That's non-
standard, although perhaps it could be a useful standard...
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-02-28 18:31 ` Stephen Warren
@ 2012-02-28 18:37 ` Simon Glass
2012-02-28 18:41 ` Stephen Warren
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 18:37 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-tegra@vger.kernel.org, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, Devicetree Discuss
Hi Stephen,
On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
> ...
>> I am going to add your binding, less the #clock-cells which U-Boot
>> currently can't support because it conflicts with the C preprocessor
>> (at some point I may look at a patch to use sed or some other means of
>> avoiding this).
>
> Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
> build process running cpp on the .dts files or something? That's non-
> standard, although perhaps it could be a useful standard...
Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
Still hoping your symbolic stuff will go in though.
Regards,
Simon
>
> --
> nvpublic
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* RE: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <CAPnjgZ24vhy7NKj_Dt_dzn0qJ8=rj4nF04WSsY8u9MorAanzVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-28 18:37 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB4-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-28 18:37 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 10:46 AM:
> On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> > On 02/27/2012 01:52 PM, Simon Glass wrote:
> >> A common requirement is to find the clock ID for a peripheral. This is the
> >> second cell of the 'clocks' property (the first being the phandle itself).
> >
> >> +int clock_decode_periph_id(const void *blob, int node)
> >
> >> + valid = clock_periph_id_isvalid(id);
> >
> > clock_periph_id_isvalid() is not the correct function to use here; the
> > code should be checking for invalid IDs in the CAR binding, not invalid
> > IDs in the HW periph ID definition. They're different.
> >
> > Just to be explicit, the function you need here would be:
> >
> > int clkid_to_periphid(int clkid)
> > {
> > if (clk_id > 95)
> > return -1;
> > switch (clk_id) {
> > case 1:
> > case 2:
> > case 7:
> > case 10:
> > case 20:
> > case 30:
> > case 35:
> > case 49:
> > case 56:
> > case 74:
> > case 77:
> > case 78:
> > case 79:
> > case 80:
> > case 81:
> > case 82:
> > case 83:
> > case 91:
> > case 95:
> > return -1;
> > default:
> > return clkid;
> > }
> > }
>
> Ick.
>
> Why is 7 in there,
7 affects both the UART2 and VFIR clocks/blocks.
> and did you miss 76?
No, that's the undocumented "la" clock.
> Also U-Boot only goes up to 88
> at present so should I change the first test to match?
No, clocks 89, 90, 92, 93, and 94 are defined in the binding, which
matches the CLK_OUT_ENB registers in the Tegra CAR HW (albeit not the
CLK_RST registers, since there are some differences between the two).
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-02-28 18:37 ` Simon Glass
@ 2012-02-28 18:41 ` Stephen Warren
2012-02-28 18:46 ` Simon Glass
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
0 siblings, 2 replies; 35+ messages in thread
From: Stephen Warren @ 2012-02-28 18:41 UTC (permalink / raw)
To: Simon Glass
Cc: linux-tegra@vger.kernel.org, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
> On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren <swarren@nvidia.com> wrote:
> > Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
> > ...
> >> I am going to add your binding, less the #clock-cells which U-Boot
> >> currently can't support because it conflicts with the C preprocessor
> >> (at some point I may look at a patch to use sed or some other means of
> >> avoiding this).
> >
> > Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
> > build process running cpp on the .dts files or something? That's non-
> > standard, although perhaps it could be a useful standard...
>
> Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
Uggh. That's going to make the device tree files look different between
the kernel and U-Boot:-( With # disallowed in particular, it's going to
prevent U-Boot from /ever/ using the correct protocols for parsing the
device tree. This seems like an extremely bad idea.
> Still hoping your symbolic stuff will go in though.
That looks extremely unlikely in its current form. Ideally, I will get
time to take Jon's or David's patches and push one of them forward to
provide a more complete solution, but it's a very long way out either way.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB4-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-02-28 18:44 ` Simon Glass
2012-02-28 18:51 ` Stephen Warren
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 18:44 UTC (permalink / raw)
To: Stephen Warren
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Hi Stephen,
On Tue, Feb 28, 2012 at 10:37 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 10:46 AM:
>> On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>> > On 02/27/2012 01:52 PM, Simon Glass wrote:
>> >> A common requirement is to find the clock ID for a peripheral. This is the
>> >> second cell of the 'clocks' property (the first being the phandle itself).
>> >
>> >> +int clock_decode_periph_id(const void *blob, int node)
>> >
>> >> + valid = clock_periph_id_isvalid(id);
>> >
>> > clock_periph_id_isvalid() is not the correct function to use here; the
>> > code should be checking for invalid IDs in the CAR binding, not invalid
>> > IDs in the HW periph ID definition. They're different.
>> >
>> > Just to be explicit, the function you need here would be:
>> >
>> > int clkid_to_periphid(int clkid)
>> > {
>> > if (clk_id > 95)
>> > return -1;
>> > switch (clk_id) {
>> > case 1:
>> > case 2:
>> > case 7:
>> > case 10:
>> > case 20:
>> > case 30:
>> > case 35:
>> > case 49:
>> > case 56:
>> > case 74:
>> > case 77:
>> > case 78:
>> > case 79:
>> > case 80:
>> > case 81:
>> > case 82:
>> > case 83:
>> > case 91:
>> > case 95:
>> > return -1;
>> > default:
>> > return clkid;
>> > }
>> > }
>>
>> Ick.
>>
>> Why is 7 in there,
>
> 7 affects both the UART2 and VFIR clocks/blocks.
>
>> and did you miss 76?
>
> No, that's the undocumented "la" clock.
>
>> Also U-Boot only goes up to 88
>> at present so should I change the first test to match?
>
> No, clocks 89, 90, 92, 93, and 94 are defined in the binding, which
> matches the CLK_OUT_ENB registers in the Tegra CAR HW (albeit not the
> CLK_RST registers, since there are some differences between the two).
For both of your comments, since they aren't used in U-Boot, wouldn't
it be more correct to flag these as errors also? We would have to
update at least the clock.h header to support them.
Regards,
Simon
>
> --
> nvpublic
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-02-28 18:41 ` Stephen Warren
@ 2012-02-28 18:46 ` Simon Glass
[not found] ` <CAPnjgZ0VGRSgb92u2UbNf+_HFF-EXhLZzC4XdYUvAjVKtz1XtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
1 sibling, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 18:46 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-tegra@vger.kernel.org, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, Devicetree Discuss
Hi Stephen,
On Tue, Feb 28, 2012 at 10:41 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
>> On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren <swarren@nvidia.com> wrote:
>> > Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
>> > ...
>> >> I am going to add your binding, less the #clock-cells which U-Boot
>> >> currently can't support because it conflicts with the C preprocessor
>> >> (at some point I may look at a patch to use sed or some other means of
>> >> avoiding this).
>> >
>> > Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
>> > build process running cpp on the .dts files or something? That's non-
>> > standard, although perhaps it could be a useful standard...
>>
>> Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
>
> Uggh. That's going to make the device tree files look different between
> the kernel and U-Boot:-( With # disallowed in particular, it's going to
> prevent U-Boot from /ever/ using the correct protocols for parsing the
> device tree. This seems like an extremely bad idea.
Until we change it in U-Boot, you mean. We could move to sed or pre-
and post-process the file to remove and re-insert the #.
>
>> Still hoping your symbolic stuff will go in though.
>
> That looks extremely unlikely in its current form. Ideally, I will get
> time to take Jon's or David's patches and push one of them forward to
> provide a more complete solution, but it's a very long way out either way.
That's a shame.
Regards,
Simon
>
> --
> nvpublic
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
2012-02-28 18:44 ` Simon Glass
@ 2012-02-28 18:51 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DC8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Stephen Warren @ 2012-02-28 18:51 UTC (permalink / raw)
To: Simon Glass
Cc: linux-tegra@vger.kernel.org, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 11:44 AM:
> On Tue, Feb 28, 2012 at 10:37 AM, Stephen Warren <swarren@nvidia.com> wrote:
> > Simon Glass wrote at Tuesday, February 28, 2012 10:46 AM:
> >> On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren <swarren@nvidia.com> wrote:
> >> > On 02/27/2012 01:52 PM, Simon Glass wrote:
> >> >> A common requirement is to find the clock ID for a peripheral. This is the
> >> >> second cell of the 'clocks' property (the first being the phandle itself).
> >> >
> >> >> +int clock_decode_periph_id(const void *blob, int node)
> >> >
> >> >> + valid = clock_periph_id_isvalid(id);
> >> >
> >> > clock_periph_id_isvalid() is not the correct function to use here; the
> >> > code should be checking for invalid IDs in the CAR binding, not invalid
> >> > IDs in the HW periph ID definition. They're different.
> >> >
> >> > Just to be explicit, the function you need here would be:
> >> >
> >> > int clkid_to_periphid(int clkid)
> >> > {
> >> > if (clk_id > 95)
> >> > return -1;
> >> > switch (clk_id) {
> >> > case 1:
> >> > case 2:
> >> > case 7:
> >> > case 10:
> >> > case 20:
> >> > case 30:
> >> > case 35:
> >> > case 49:
> >> > case 56:
> >> > case 74:
> >> > case 77:
> >> > case 78:
> >> > case 79:
> >> > case 80:
> >> > case 81:
> >> > case 82:
> >> > case 83:
> >> > case 91:
> >> > case 95:
> >> > return -1;
> >> > default:
> >> > return clkid;
> >> > }
> >> > }
> >>
> >> Ick.
> >>
> >> Why is 7 in there,
> >
> > 7 affects both the UART2 and VFIR clocks/blocks.
> >
> >> and did you miss 76?
> >
> > No, that's the undocumented "la" clock.
> >
> >> Also U-Boot only goes up to 88
> >> at present so should I change the first test to match?
> >
> > No, clocks 89, 90, 92, 93, and 94 are defined in the binding, which
> > matches the CLK_OUT_ENB registers in the Tegra CAR HW (albeit not the
> > CLK_RST registers, since there are some differences between the two).
>
> For both of your comments, since they aren't used in U-Boot, wouldn't
> it be more correct to flag these as errors also? We would have to
> update at least the clock.h header to support them.
It's probably more correct to update the periph_id enum to define all
the valid values, but either way is fine.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [U-Boot] [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <CAPnjgZ0VGRSgb92u2UbNf+_HFF-EXhLZzC4XdYUvAjVKtz1XtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-28 22:16 ` Albert ARIBAUD
2012-03-03 16:26 ` Simon Glass
0 siblings, 1 reply; 35+ messages in thread
From: Albert ARIBAUD @ 2012-02-28 22:16 UTC (permalink / raw)
To: Simon Glass
Cc: Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
U-Boot Mailing List, Jerry Van Baren, Tom Warren,
Devicetree Discuss
Le 28/02/2012 19:46, Simon Glass a écrit :
> Hi Stephen,
>
> On Tue, Feb 28, 2012 at 10:41 AM, Stephen Warren<swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>> Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
>>> On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren<swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>>>> Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
>>>> ...
>>>>> I am going to add your binding, less the #clock-cells which U-Boot
>>>>> currently can't support because it conflicts with the C preprocessor
>>>>> (at some point I may look at a patch to use sed or some other means of
>>>>> avoiding this).
>>>>
>>>> Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
>>>> build process running cpp on the .dts files or something? That's non-
>>>> standard, although perhaps it could be a useful standard...
>>>
>>> Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
>>
>> Uggh. That's going to make the device tree files look different between
>> the kernel and U-Boot:-( With # disallowed in particular, it's going to
>> prevent U-Boot from /ever/ using the correct protocols for parsing the
>> device tree. This seems like an extremely bad idea.
>
> Until we change it in U-Boot, you mean. We could move to sed or pre-
> and post-process the file to remove and re-insert the #.
Rather, to convert # signs into something that the DTS cannot contain
and the compiler can withstand (and it should be printable ASCII, too).
is '##' a good candidate?
If so, a forward conversion would e.g. map '/include/' to '#include' and
any '#' to '##', and the reverse conversion would turn all '##' to '#'.
But something that simple is bound to be wrong in some way...
Amicalement,
--
Albert.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DC8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-02-28 23:50 ` Simon Glass
[not found] ` <CAPnjgZ2vwck_u1HVbpz=B4QjiCVoLeX6TcvwMi-o71Fqt_m3NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 35+ messages in thread
From: Simon Glass @ 2012-02-28 23:50 UTC (permalink / raw)
To: Stephen Warren
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Hi Stephen,
On Tue, Feb 28, 2012 at 10:51 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 11:44 AM:
>> On Tue, Feb 28, 2012 at 10:37 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
>> > Simon Glass wrote at Tuesday, February 28, 2012 10:46 AM:
>> >> On Mon, Feb 27, 2012 at 3:41 PM, Stephen Warren <swarren@nvidia.com> wrote:
>> >> > On 02/27/2012 01:52 PM, Simon Glass wrote:
>> >> >> A common requirement is to find the clock ID for a peripheral. This is the
>> >> >> second cell of the 'clocks' property (the first being the phandle itself).
>> >> >
>> >> >> +int clock_decode_periph_id(const void *blob, int node)
>> >> >
>> >> >> + valid = clock_periph_id_isvalid(id);
>> >> >
>> >> > clock_periph_id_isvalid() is not the correct function to use here; the
>> >> > code should be checking for invalid IDs in the CAR binding, not invalid
>> >> > IDs in the HW periph ID definition. They're different.
>> >> >
>> >> > Just to be explicit, the function you need here would be:
>> >> >
>> >> > int clkid_to_periphid(int clkid)
>> >> > {
>> >> > if (clk_id > 95)
>> >> > return -1;
>> >> > switch (clk_id) {
>> >> > case 1:
>> >> > case 2:
>> >> > case 7:
>> >> > case 10:
>> >> > case 20:
>> >> > case 30:
>> >> > case 35:
>> >> > case 49:
>> >> > case 56:
>> >> > case 74:
>> >> > case 77:
>> >> > case 78:
>> >> > case 79:
>> >> > case 80:
>> >> > case 81:
>> >> > case 82:
>> >> > case 83:
>> >> > case 91:
>> >> > case 95:
>> >> > return -1;
>> >> > default:
>> >> > return clkid;
>> >> > }
>> >> > }
>> >>
>> >> Ick.
>> >>
>> >> Why is 7 in there,
>> >
>> > 7 affects both the UART2 and VFIR clocks/blocks.
>> >
>> >> and did you miss 76?
>> >
>> > No, that's the undocumented "la" clock.
>> >
>> >> Also U-Boot only goes up to 88
>> >> at present so should I change the first test to match?
>> >
>> > No, clocks 89, 90, 92, 93, and 94 are defined in the binding, which
>> > matches the CLK_OUT_ENB registers in the Tegra CAR HW (albeit not the
>> > CLK_RST registers, since there are some differences between the two).
>>
>> For both of your comments, since they aren't used in U-Boot, wouldn't
>> it be more correct to flag these as errors also? We would have to
>> update at least the clock.h header to support them.
>
> It's probably more correct to update the periph_id enum to define all
> the valid values, but either way is fine.
OK - BTW what does 'LA' stand for?
Regards,
Simon
>
> --
> nvpublic
>
^ permalink raw reply [flat|nested] 35+ messages in thread
* RE: [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID
[not found] ` <CAPnjgZ2vwck_u1HVbpz=B4QjiCVoLeX6TcvwMi-o71Fqt_m3NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-02-29 17:08 ` Stephen Warren
0 siblings, 0 replies; 35+ messages in thread
From: Stephen Warren @ 2012-02-29 17:08 UTC (permalink / raw)
To: Simon Glass
Cc: U-Boot Mailing List, Tom Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jerry Van Baren, Devicetree Discuss
Simon Glass wrote at Tuesday, February 28, 2012 4:50 PM:
> On Tue, Feb 28, 2012 at 10:51 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> > Simon Glass wrote at Tuesday, February 28, 2012 11:44 AM:
> >> On Tue, Feb 28, 2012 at 10:37 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
...
> >> >> and did you miss 76?
> >> >
> >> > No, that's the undocumented "la" clock.
....
> OK - BTW what does 'LA' stand for?
Sorry, I don't know; it's not documented. I just confirmed it exists.
--
nvpublic
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-02-28 22:16 ` [U-Boot] " Albert ARIBAUD
@ 2012-03-03 16:26 ` Simon Glass
0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-03-03 16:26 UTC (permalink / raw)
To: Albert ARIBAUD
Cc: Devicetree Discuss, U-Boot Mailing List, Jerry Van Baren,
Tom Warren, linux-tegra@vger.kernel.org
Hi Albert,
On Tue, Feb 28, 2012 at 2:16 PM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Le 28/02/2012 19:46, Simon Glass a écrit :
>
>> Hi Stephen,
>>
>> On Tue, Feb 28, 2012 at 10:41 AM, Stephen Warren<swarren@nvidia.com>
>> wrote:
>>>
>>> Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
>>>>
>>>> On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren<swarren@nvidia.com>
>>>> wrote:
>>>>>
>>>>> Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
>>>>> ...
>>>>>>
>>>>>> I am going to add your binding, less the #clock-cells which U-Boot
>>>>>> currently can't support because it conflicts with the C preprocessor
>>>>>> (at some point I may look at a patch to use sed or some other means of
>>>>>> avoiding this).
>>>>>
>>>>>
>>>>> Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
>>>>> build process running cpp on the .dts files or something? That's non-
>>>>> standard, although perhaps it could be a useful standard...
>>>>
>>>>
>>>> Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
>>>
>>>
>>> Uggh. That's going to make the device tree files look different between
>>> the kernel and U-Boot:-( With # disallowed in particular, it's going to
>>> prevent U-Boot from /ever/ using the correct protocols for parsing the
>>> device tree. This seems like an extremely bad idea.
>>
>>
>> Until we change it in U-Boot, you mean. We could move to sed or pre-
>> and post-process the file to remove and re-insert the #.
>
>
> Rather, to convert # signs into something that the DTS cannot contain and
> the compiler can withstand (and it should be printable ASCII, too). is '##'
> a good candidate?
>
> If so, a forward conversion would e.g. map '/include/' to '#include' and any
> '#' to '##', and the reverse conversion would turn all '##' to '#'.
>
> But something that simple is bound to be wrong in some way...
It seems reasonable, although the /include/ is handled by the dtc
itself. If we bypath that then line number reporting won't work.
However I do have problems getting dtc to find its include files - I
wish it had a -I option.
I will take a look at this in a few weeks once this series in is and I
have looked at the include file problem in more detail.
Regards,
Simon
>
> Amicalement,
> --
> Albert.
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [U-Boot] [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
@ 2012-03-05 20:46 ` Tom Rini
2012-03-07 2:48 ` Simon Glass
0 siblings, 1 reply; 35+ messages in thread
From: Tom Rini @ 2012-03-05 20:46 UTC (permalink / raw)
To: Stephen Warren
Cc: Simon Glass, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
U-Boot Mailing List, Jerry Van Baren, Tom Warren,
Devicetree Discuss
On Tue, Feb 28, 2012 at 10:41:15AM -0800, Stephen Warren wrote:
> Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
> > On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> > > Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
> > > ...
> > >> I am going to add your binding, less the #clock-cells which U-Boot
> > >> currently can't support because it conflicts with the C preprocessor
> > >> (at some point I may look at a patch to use sed or some other means of
> > >> avoiding this).
> > >
> > > Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
> > > build process running cpp on the .dts files or something? That's non-
> > > standard, although perhaps it could be a useful standard...
> >
> > Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
>
> Uggh. That's going to make the device tree files look different between
> the kernel and U-Boot:-( With # disallowed in particular, it's going to
> prevent U-Boot from /ever/ using the correct protocols for parsing the
> device tree. This seems like an extremely bad idea.
Keeping my TI hat on, I think it'd be a bad idea to have dts stuff
divergent from the kernel. Have you raised the problem you're trying to
solve to the general DT gurus? My very high level hope is that someday
we can have them shared between kernel and u-boot (either directly or
something silly like a .dtss that spits out a kernel dts and a u-boot
dts). Going with a manual sync from kernel form to u-boot form seems
like adding a burden on ourselves we might not have to.
--
Tom
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [U-Boot] [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard
2012-03-05 20:46 ` [U-Boot] " Tom Rini
@ 2012-03-07 2:48 ` Simon Glass
0 siblings, 0 replies; 35+ messages in thread
From: Simon Glass @ 2012-03-07 2:48 UTC (permalink / raw)
To: Tom Rini
Cc: Stephen Warren,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
U-Boot Mailing List, Jerry Van Baren, Tom Warren,
Devicetree Discuss
Hi Tom,
On Mon, Mar 5, 2012 at 12:46 PM, Tom Rini <trini-l0cyMroinI0@public.gmane.org> wrote:
> On Tue, Feb 28, 2012 at 10:41:15AM -0800, Stephen Warren wrote:
>> Simon Glass wrote at Tuesday, February 28, 2012 11:37 AM:
>> > On Tue, Feb 28, 2012 at 10:31 AM, Stephen Warren <swarren@nvidia.com> wrote:
>> > > Simon Glass wrote at Tuesday, February 28, 2012 10:38 AM:
>> > > ...
>> > >> I am going to add your binding, less the #clock-cells which U-Boot
>> > >> currently can't support because it conflicts with the C preprocessor
>> > >> (at some point I may look at a patch to use sed or some other means of
>> > >> avoiding this).
>> > >
>> > > Out of curiosity, why does the C preprocessor come into it? Is U-Boot's
>> > > build process running cpp on the .dts files or something? That's non-
>> > > standard, although perhaps it could be a useful standard...
>> >
>> > Yes, but at the moment we only use it for '/include/ ARCH_CPU_DTS'.
>>
>> Uggh. That's going to make the device tree files look different between
>> the kernel and U-Boot:-( With # disallowed in particular, it's going to
>> prevent U-Boot from /ever/ using the correct protocols for parsing the
>> device tree. This seems like an extremely bad idea.
>
> Keeping my TI hat on, I think it'd be a bad idea to have dts stuff
> divergent from the kernel. Have you raised the problem you're trying to
> solve to the general DT gurus? My very high level hope is that someday
> we can have them shared between kernel and u-boot (either directly or
> something silly like a .dtss that spits out a kernel dts and a u-boot
> dts). Going with a manual sync from kernel form to u-boot form seems
> like adding a burden on ourselves we might not have to.
I agree, of course. I think the best solution may be to implement
search paths in dtc. I sent a patch today so let's see what people
think.
It is even worse when we copy the .dts and .dtsi files somewhere else
(e.g. losing the original directory tree relationship by copying all
into one directory).
Regards,
Simon
>
> --
> Tom
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2012-03-07 2:48 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1330375973-10681-1-git-send-email-sjg@chromium.org>
2012-02-27 20:52 ` [PATCH v6 01/20] fdt: Tidy up a few fdtdec problems Simon Glass
2012-02-27 20:52 ` [PATCH v6 02/20] fdt: Add functions to access phandles, arrays and bools Simon Glass
2012-02-27 20:52 ` [PATCH v6 03/20] fdt: Add basic support for decoding GPIO definitions Simon Glass
2012-02-27 20:52 ` [PATCH v6 04/20] arm: fdt: Add skeleton device tree file from kernel Simon Glass
2012-02-27 20:52 ` [PATCH v6 05/20] tegra: fdt: Add Tegra2x " Simon Glass
[not found] ` <1330375973-10681-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 20:52 ` [PATCH v6 06/20] tegra: fdt: Add device tree file for Tegra2 Seaboard " Simon Glass
2012-02-27 20:52 ` [PATCH v6 09/20] tegra: fdt: Add additional USB binding Simon Glass
[not found] ` <1330375973-10681-10-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 23:27 ` Stephen Warren
2012-02-27 20:52 ` [PATCH v6 10/20] tegra: fdt: Add clock bindings Simon Glass
2012-02-27 20:52 ` [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard Simon Glass
[not found] ` <1330375973-10681-12-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 23:29 ` Stephen Warren
[not found] ` <4F4C11E9.1050907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-28 17:20 ` Simon Glass
[not found] ` <CAPnjgZ0_xzn0tvETt3C=pjyRX-MXNA-JXy4fuAs9L8OdHuvLhg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-28 17:32 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1D6A-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-28 17:37 ` Simon Glass
2012-02-28 18:31 ` Stephen Warren
2012-02-28 18:37 ` Simon Glass
2012-02-28 18:41 ` Stephen Warren
2012-02-28 18:46 ` Simon Glass
[not found] ` <CAPnjgZ0VGRSgb92u2UbNf+_HFF-EXhLZzC4XdYUvAjVKtz1XtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-28 22:16 ` [U-Boot] " Albert ARIBAUD
2012-03-03 16:26 ` Simon Glass
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-03-05 20:46 ` [U-Boot] " Tom Rini
2012-03-07 2:48 ` Simon Glass
2012-02-27 20:52 ` [PATCH v6 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports Simon Glass
2012-02-27 20:52 ` [PATCH v6 07/20] fdt: Add staging area for device tree binding documentation Simon Glass
2012-02-27 20:52 ` [PATCH v6 08/20] fdt: Add tegra-usb bindings file from linux Simon Glass
2012-02-27 20:52 ` [PATCH v6 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard Simon Glass
2012-02-27 20:52 ` [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID Simon Glass
[not found] ` <1330375973-10681-16-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-02-27 23:41 ` Stephen Warren
[not found] ` <4F4C149E.3070505-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-02-28 17:46 ` Simon Glass
[not found] ` <CAPnjgZ24vhy7NKj_Dt_dzn0qJ8=rj4nF04WSsY8u9MorAanzVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-28 18:37 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DB4-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-28 18:44 ` Simon Glass
2012-02-28 18:51 ` Stephen Warren
[not found] ` <74CDBE0F657A3D45AFBB94109FB122FF17BDDF1DC8-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2012-02-28 23:50 ` Simon Glass
[not found] ` <CAPnjgZ2vwck_u1HVbpz=B4QjiCVoLeX6TcvwMi-o71Fqt_m3NQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-29 17:08 ` Stephen Warren
2012-02-27 20:52 ` [PATCH v6 20/20] tegra: fdt: Enable FDT support for Seaboard Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).