All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
@ 2017-06-12 12:21 Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count() Simon Glass
                   ` (35 more replies)
  0 siblings, 36 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This moves three entire boards to use a live device tree as an example of
the impact.

Nyan-big was chosen because I can easily and boot U-Boot without any
media swapping, etc. Beaver is enabled as well since it failed to boot
with serial v1 due to a disabled console node. Jetson-TK1 is chosen
because I found some USB problems in the v2 patches.

Total code size impact on this board is approximately 9KB on U-Boot and
64 bytes on SPL:

27: dm: tegra: nyan-big: Move to livetree
       arm: (for 1/1 boards) all +9264.0 bss -16.0 data +44.0 rodata +92.0
          spl/u-boot-spl:all +326.0 spl/u-boot-spl:rodata +262.0
          spl/u-boot-spl:text +64.0 text +9144.0

Tegra does not use Thumb2, which would likely reduce the code size by about
25%, indicating a code-size impact of perhaps 7KB.

Boot time is affected slightly. For nyan-big the times with flat tree are:

                 2,108  dm_r
                 7,924  dm_spl
               120,724  dm_f
               171,816  lcd

With the livetree:

                   721  dm_r
                 3,764  of_live
                 7,990  dm_spl
               120,736  dm_f
               168,215  lcd

As expected the spl and pre-relocation times are not affected. In the
post-relocation case, the live tree must be built, which here takes about
3.8ms. Driver-model device creation takes a bit of 1ms less time with the
livetree, so all up the cost is about 2.4ms. After DM init there appears
to be a slight reduction in the time taken to set up devices (from 327ms
to 319ms) so overall the live tree does not appear to be any slower. This
is because pre-parsing the device tree makes reading it later faster.

The use of livetree is controlled by a the CONFIG_OF_LIVE option. When
enabled, U-Boot builds a livetree immediately after relocation and uses
it from then on.

This series is available at u-boot-dm/livet-working

Changes in v3:
- Add new patch to add ofnode_read_string_count()
- Add new patch to add dev_read_resource()
- Add new patch to add dev_read_enabled()
- Add new patch with functions to obtain node's address/size cells
- Update commit message, enable for all tegra124 boards not just nyan-big
- Fix up the implementation which had node instead of subnode in one place
- Add new patch to convert tegra PCI to device tree
- Enable livetree for jetson-tk1 also

Changes in v2:
- Add new patch to enable bootstage for nyan-big
- Add new patch to ensure that the console UART is enabled
- Enable livetree for beaver also
- Add timing information

Simon Glass (35):
  dm: core: Add ofnode_read_string_count()
  dm: core: Add dev_read_resource() to read device resources
  dm: core: Add dev_read_enabled() to check if a device is enabled
  dm: core: Add functions to obtain node's address/size cells
  tegra: video: Time the LCD init
  tegra: nyan-big: Enable the debug UART
  dm: Fix error handling when unflattening the DT
  tegra: nyan-big: Enable bootstage
  dm: video: Sync display on backspace
  dm: video: Update pwm_backlight to support livetree
  video: simple-panel: Add a little more debugging
  tegra: Fix up include file ordering
  tegra: spl: Enable debug UART
  tegra: tegra124: Add a PMC syscon driver
  dm: tegra: Convert USB setup to livetree
  dm: tegra: Convert clock_decode_periph_id() to support livetree
  dm: video: tegra124: Convert to livetree
  tegra: dts: Move stdout-path to /chosen
  dm: tegra: gpio: Convert to support livetree
  dm: tegra: usb: Convert to livetree
  dm: tegra: spi: Convert to livetree
  dm: tegra: i2c: Convert to livetree
  dm: tegra: pwm: Convert to livetree
  dm: tegra: mmc: Convert to livetree
  dm: tegra: pci: Convert to livetree
  power: Add a regulator driver for the as3722 PMIC
  power: Add a GPIO driver for the as3722 PMIC
  dm: power: Convert as3722 to driver model
  dm: serial: ns16550: Convert to livetree
  dm: serial: Separate out the core serial-device finding code
  dm: serial: Add livetree support
  tegra: Show a debug message if the LCD PMIC fails to start
  fdtdec: Drop old compatible values
  tegra: fdt: Ensure that the console UART is enabled
  dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree

 arch/arm/dts/tegra114-dalmore.dts             |   4 +
 arch/arm/dts/tegra124-cei-tk1-som.dts         |   4 +
 arch/arm/dts/tegra124-jetson-tk1.dts          |   4 +
 arch/arm/dts/tegra124-nyan-big.dts            |   5 +-
 arch/arm/dts/tegra124-venice2.dts             |   4 +
 arch/arm/dts/tegra186-p2771-0000.dtsi         |   4 +
 arch/arm/dts/tegra20-colibri.dts              |   4 +
 arch/arm/dts/tegra20-harmony.dts              |   4 +
 arch/arm/dts/tegra20-trimslice.dts            |   4 +
 arch/arm/dts/tegra20-whistler.dts             |   4 +
 arch/arm/dts/tegra210-e2220-1170.dts          |   4 +
 arch/arm/dts/tegra210-p2371-0000.dts          |   4 +
 arch/arm/dts/tegra210-p2371-2180.dts          |   4 +
 arch/arm/dts/tegra210-p2571.dts               |   4 +
 arch/arm/dts/tegra30-apalis.dts               |   4 +
 arch/arm/dts/tegra30-beaver.dts               |   4 +
 arch/arm/dts/tegra30-cardhu.dts               |   4 +
 arch/arm/dts/tegra30-colibri.dts              |   4 +
 arch/arm/dts/tegra30-tec-ng.dts               |   4 +
 arch/arm/include/asm/arch-tegra/clock.h       |   2 +-
 arch/arm/include/asm/arch-tegra/tegra.h       |   5 +
 arch/arm/include/asm/arch-tegra/xusb-padctl.h |   2 +-
 arch/arm/mach-tegra/Kconfig                   |   2 +
 arch/arm/mach-tegra/board2.c                  |  34 ++-
 arch/arm/mach-tegra/clock.c                   |   9 +-
 arch/arm/mach-tegra/spl.c                     |   4 +
 arch/arm/mach-tegra/tegra124/Makefile         |   1 +
 arch/arm/mach-tegra/tegra124/pmc.c            |  19 ++
 arch/arm/mach-tegra/tegra124/xusb-padctl.c    |  36 +++-
 arch/arm/mach-tegra/tegra210/xusb-padctl.c    |  40 +++-
 arch/arm/mach-tegra/xusb-padctl-common.c      |  63 +++---
 arch/arm/mach-tegra/xusb-padctl-common.h      |  11 +-
 arch/arm/mach-tegra/xusb-padctl-dummy.c       |   2 +-
 board/cei/cei-tk1-som/cei-tk1-som.c           |   2 +
 board/nvidia/jetson-tk1/jetson-tk1.c          |   2 +
 board/nvidia/nyan-big/nyan-big.c              |  22 +-
 board/toradex/apalis-tk1/apalis-tk1.c         |   6 +
 configs/apalis-tk1_defconfig                  |   3 +
 configs/beaver_defconfig                      |   1 +
 configs/cei-tk1-som_defconfig                 |   3 +
 configs/jetson-tk1_defconfig                  |   4 +
 configs/nyan-big_defconfig                    |  11 +
 drivers/core/Makefile                         |   2 +-
 drivers/core/of_access.c                      |  24 +++
 drivers/core/ofnode.c                         |  28 ++-
 drivers/core/read.c                           |  21 ++
 drivers/core/read_extra.c                     |  37 ++++
 drivers/core/regmap.c                         |   4 +-
 drivers/gpio/tegra_gpio.c                     |  10 +-
 drivers/i2c/tegra_i2c.c                       |   6 +-
 drivers/mmc/tegra_mmc.c                       |  17 +-
 drivers/pci/pci-uclass.c                      |   6 +-
 drivers/pci/pci_tegra.c                       |  53 +++--
 drivers/power/pmic/Makefile                   |   2 +-
 drivers/power/pmic/as3722.c                   | 292 +++++++++-----------------
 drivers/power/pmic/as3722_gpio.c              | 120 +++++++++++
 drivers/power/regulator/Kconfig               |   9 +
 drivers/power/regulator/Makefile              |   1 +
 drivers/power/regulator/as3722_regulator.c    | 149 +++++++++++++
 drivers/pwm/tegra_pwm.c                       |   2 +-
 drivers/serial/ns16550.c                      |  15 +-
 drivers/serial/serial-uclass.c                |  92 ++++----
 drivers/spi/tegra114_spi.c                    |  15 +-
 drivers/spi/tegra20_sflash.c                  |   2 +-
 drivers/spi/tegra20_slink.c                   |   2 +-
 drivers/spi/tegra210_qspi.c                   |   2 +-
 drivers/usb/host/ehci-tegra.c                 |  36 ++--
 drivers/video/pwm_backlight.c                 |  22 +-
 drivers/video/simple_panel.c                  |   2 +
 drivers/video/tegra124/display.c              |  10 +-
 drivers/video/tegra124/dp.c                   |   3 +-
 drivers/video/tegra124/sor.c                  |  25 +--
 drivers/video/vidconsole-uclass.c             |   1 +
 include/dm/of_access.h                        |  38 ++++
 include/dm/ofnode.h                           |  32 ++-
 include/dm/read.h                             |  86 +++++++-
 include/fdtdec.h                              |   6 -
 include/power/as3722.h                        |  27 ++-
 lib/fdtdec.c                                  |   6 -
 lib/of_live.c                                 |   7 +-
 80 files changed, 1091 insertions(+), 482 deletions(-)
 create mode 100644 arch/arm/mach-tegra/tegra124/pmc.c
 create mode 100644 drivers/core/read_extra.c
 create mode 100644 drivers/power/pmic/as3722_gpio.c
 create mode 100644 drivers/power/regulator/as3722_regulator.c

-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count()
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources Simon Glass
                   ` (34 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This provides a way to find the number of strings in a string list. Add it
and also fix up the comment for ofnode_read_string_index().

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add ofnode_read_string_count()

Changes in v2: None

 drivers/core/ofnode.c  | 10 ++++++++++
 include/dm/of_access.h | 18 ++++++++++++++++++
 include/dm/ofnode.h    | 12 +++++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index ac312d6546..79c80df7f4 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -260,6 +260,16 @@ int ofnode_read_string_index(ofnode node, const char *property, int index,
 	}
 }
 
+int ofnode_read_string_count(ofnode node, const char *property)
+{
+	if (ofnode_is_np(node)) {
+		return of_property_count_strings(ofnode_to_np(node), property);
+	} else {
+		return fdt_stringlist_count(gd->fdt_blob,
+					    ofnode_to_offset(node), property);
+	}
+}
+
 static void ofnode_from_fdtdec_phandle_args(struct fdtdec_phandle_args *in,
 					    struct ofnode_phandle_args *out)
 {
diff --git a/include/dm/of_access.h b/include/dm/of_access.h
index 142f0f43c9..d2827001e2 100644
--- a/include/dm/of_access.h
+++ b/include/dm/of_access.h
@@ -260,6 +260,24 @@ static inline int of_property_read_string_index(const struct device_node *np,
 	return rc < 0 ? rc : 0;
 }
 
+/**
+ * of_property_count_strings() - Find and return the number of strings from a
+ * multiple strings property.
+ * @np:		device node from which the property value is to be read.
+ * @propname:	name of the property to be searched.
+ *
+ * Search for a property in a device tree node and retrieve the number of null
+ * terminated string contain in it. Returns the number of strings on
+ * success, -EINVAL if the property does not exist, -ENODATA if property
+ * does not have a value, and -EILSEQ if the string is not null-terminated
+ * within the length of the property data.
+ */
+static inline int of_property_count_strings(const struct device_node *np,
+					    const char *propname)
+{
+	return of_property_read_string_helper(np, propname, NULL, 0, 0);
+}
+
 /**
  * of_parse_phandle - Resolve a phandle property to a device_node pointer
  * @np: Pointer to device node holding phandle property
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 149622a0b2..d261a61e91 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -359,7 +359,7 @@ int ofnode_stringlist_search(ofnode node, const char *propname,
 			     const char *string);
 
 /**
- * fdt_stringlist_get() - obtain the string@a given index in a string list
+ * ofnode_read_string_index() - obtain an indexed string from a string list
  *
  * Note that this will successfully extract strings from properties with
  * non-NUL-terminated values. For example on small-valued cell properties
@@ -379,6 +379,16 @@ int ofnode_stringlist_search(ofnode node, const char *propname,
 int ofnode_read_string_index(ofnode node, const char *propname, int index,
 			     const char **outp);
 
+/**
+ * ofnode_read_string_count() - find the number of strings in a string list
+ *
+ * @node: node to check
+ * @propname: name of the property containing the string list
+ * @return:
+ *   number of strings in the list, or -ve error value if not found
+ */
+int ofnode_read_string_count(ofnode node, const char *property);
+
 /**
  * ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list
  *
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count() Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled Simon Glass
                   ` (33 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Add a function which reads resources from a device, such as the device
hardware address. This uses the "reg" property in the device.

Unlike other functions there is little sense in inlining this when
livetree is not being used because it has some logic in it and this would
just bloat the code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add dev_read_resource()

Changes in v2: None

 drivers/core/Makefile     |  2 +-
 drivers/core/read_extra.c | 37 +++++++++++++++++++++++++++++++++++++
 include/dm/read.h         | 12 ++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 drivers/core/read_extra.c

diff --git a/drivers/core/Makefile b/drivers/core/Makefile
index 435cf98ae1..fd2d4de0c8 100644
--- a/drivers/core/Makefile
+++ b/drivers/core/Makefile
@@ -15,4 +15,4 @@ obj-$(CONFIG_OF_LIVE) += of_access.o of_addr.o
 ifndef CONFIG_DM_DEV_READ_INLINE
 obj-$(CONFIG_OF_CONTROL) += read.o
 endif
-obj-$(CONFIG_OF_CONTROL) += of_extra.o ofnode.o
+obj-$(CONFIG_OF_CONTROL) += of_extra.o ofnode.o read_extra.o
diff --git a/drivers/core/read_extra.c b/drivers/core/read_extra.c
new file mode 100644
index 0000000000..a6d2f342d9
--- /dev/null
+++ b/drivers/core/read_extra.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/of_addr.h>
+#include <dm/read.h>
+#include <linux/ioport.h>
+
+int dev_read_resource(struct udevice *dev, uint index, struct resource *res)
+{
+	ofnode node = dev_ofnode(dev);
+
+#ifdef CONFIG_OF_LIVE
+	if (ofnode_is_np(node)) {
+		return of_address_to_resource(ofnode_to_np(node), index, res);
+	} else
+#endif
+		{
+		struct fdt_resource fres;
+		int ret;
+
+		ret = fdt_get_resource(gd->fdt_blob, ofnode_to_offset(node),
+				       "reg", index, &fres);
+		if (ret < 0)
+			return -EINVAL;
+		memset(res, '\0', sizeof(*res));
+		res->start = fres.start;
+		res->end = fres.end;
+
+		return 0;
+	}
+}
diff --git a/include/dm/read.h b/include/dm/read.h
index 8c9846eaf2..65d5d1f357 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -14,6 +14,8 @@
 #include <dm/ofnode.h>
 #include <dm/uclass.h>
 
+struct resource;
+
 #if CONFIG_IS_ENABLED(OF_LIVE)
 static inline const struct device_node *dev_np(struct udevice *dev)
 {
@@ -42,6 +44,16 @@ static inline bool dev_of_valid(struct udevice *dev)
 	return ofnode_valid(dev_ofnode(dev));
 }
 
+/**
+ * dev_read_resource() - obtain an indexed resource from a device.
+ *
+ * @dev: devuce to examine
+ * @index index of the resource to retrieve (0 = first)
+ * @res returns the resource
+ * @return 0 if ok, negative on error
+ */
+int dev_read_resource(struct udevice *dev, uint index, struct resource *res);
+
 #ifndef CONFIG_DM_DEV_READ_INLINE
 /**
  * dev_read_u32_default() - read a 32-bit integer from a device's DT property
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count() Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells Simon Glass
                   ` (32 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This function allows a device's status to be read. This indicates whether
the device should be enabled or disabled.

Note: In normal operation disabled devices will not be present in the
driver-model tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add dev_read_enabled()

Changes in v2: None

 drivers/core/read.c | 11 +++++++++++
 include/dm/read.h   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/drivers/core/read.c b/drivers/core/read.c
index 3131e5379c..1080767313 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -138,3 +138,14 @@ const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, const char *propname,
 {
 	return ofnode_read_u8_array_ptr(dev_ofnode(dev), propname, sz);
 }
+
+int dev_read_enabled(struct udevice *dev)
+{
+	ofnode node = dev_ofnode(dev);
+
+	if (ofnode_is_np(node))
+		return of_device_is_available(ofnode_to_np(node));
+	else
+		return fdtdec_get_is_enabled(gd->fdt_blob,
+					     ofnode_to_offset(node));
+}
diff --git a/include/dm/read.h b/include/dm/read.h
index 65d5d1f357..cea1c16a00 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -315,6 +315,19 @@ ofnode dev_read_next_subnode(ofnode node);
 const uint8_t *dev_read_u8_array_ptr(struct udevice *dev, const char *propname,
 				     size_t sz);
 
+/**
+ * dev_read_enabled() - check 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 1 on the assumption that anything mentioned should be enabled
+ * by default.
+ *
+ * @dev: device to examine
+ * @return integer value 0 (not enabled) or 1 (enabled)
+ */
+int dev_read_enabled(struct udevice *dev);
+
 #else /* CONFIG_DM_DEV_READ_INLINE is enabled */
 
 static inline int dev_read_u32_default(struct udevice *dev,
@@ -432,6 +445,11 @@ static inline const uint8_t *dev_read_u8_array_ptr(struct udevice *dev,
 	return ofnode_read_u8_array_ptr(dev_ofnode(dev), propname, sz);
 }
 
+static inline int dev_read_enabled(struct udevice *dev)
+{
+	return fdtdec_get_is_enabled(gd->fdt_blob, dev_of_offset(dev));
+}
+
 #endif /* CONFIG_DM_DEV_READ_INLINE */
 
 /**
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (2 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init Simon Glass
                   ` (31 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

The of_n_addr_cells() and of_n_size_cells() functions are useful for
getting the size of addresses in a node, but in a few places U-Boot needs
to obtain the actual property value for a node without walking up the
stack. Add functions for this and just the existing code to use it.

Add a comment the existing ofnode functions which do not do the right
thing with a flat tree.

This fixes a problem reading PCI addresses.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch with functions to obtain node's address/size cells

Changes in v2: None

 drivers/core/of_access.c | 24 +++++++++++++++++++++
 drivers/core/ofnode.c    | 18 +++++++++++++++-
 drivers/core/read.c      | 10 +++++++++
 drivers/core/regmap.c    |  4 ++--
 drivers/pci/pci-uclass.c |  6 +++---
 include/dm/of_access.h   | 20 +++++++++++++++++
 include/dm/ofnode.h      | 20 +++++++++++++++++
 include/dm/read.h        | 56 +++++++++++++++++++++++++++++++++++++++++++++++-
 8 files changed, 151 insertions(+), 7 deletions(-)

diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c
index 94ef3cc251..b1eaea924a 100644
--- a/drivers/core/of_access.c
+++ b/drivers/core/of_access.c
@@ -96,6 +96,30 @@ int of_n_size_cells(const struct device_node *np)
 	return OF_ROOT_NODE_SIZE_CELLS_DEFAULT;
 }
 
+int of_simple_addr_cells(const struct device_node *np)
+{
+	const __be32 *ip;
+
+	ip = of_get_property(np, "#address-cells", NULL);
+	if (ip)
+		return be32_to_cpup(ip);
+
+	/* Return a default of 2 to match fdt_address_cells()*/
+	return 2;
+}
+
+int of_simple_size_cells(const struct device_node *np)
+{
+	const __be32 *ip;
+
+	ip = of_get_property(np, "#size-cells", NULL);
+	if (ip)
+		return be32_to_cpup(ip);
+
+	/* Return a default of 2 to match fdt_size_cells()*/
+	return 2;
+}
+
 struct property *of_find_property(const struct device_node *np,
 				  const char *name, int *lenp)
 {
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 79c80df7f4..da7c477c81 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -552,7 +552,7 @@ int ofnode_read_addr_cells(ofnode node)
 {
 	if (ofnode_is_np(node))
 		return of_n_addr_cells(ofnode_to_np(node));
-	else
+	else  /* NOTE: this call should walk up the parent stack */
 		return fdt_address_cells(gd->fdt_blob, ofnode_to_offset(node));
 }
 
@@ -560,6 +560,22 @@ int ofnode_read_size_cells(ofnode node)
 {
 	if (ofnode_is_np(node))
 		return of_n_size_cells(ofnode_to_np(node));
+	else  /* NOTE: this call should walk up the parent stack */
+		return fdt_size_cells(gd->fdt_blob, ofnode_to_offset(node));
+}
+
+int ofnode_read_simple_addr_cells(ofnode node)
+{
+	if (ofnode_is_np(node))
+		return of_simple_addr_cells(ofnode_to_np(node));
+	else
+		return fdt_address_cells(gd->fdt_blob, ofnode_to_offset(node));
+}
+
+int ofnode_read_simple_size_cells(ofnode node)
+{
+	if (ofnode_is_np(node))
+		return of_simple_size_cells(ofnode_to_np(node));
 	else
 		return fdt_size_cells(gd->fdt_blob, ofnode_to_offset(node));
 }
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 1080767313..36293ba326 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -94,6 +94,16 @@ int dev_read_size_cells(struct udevice *dev)
 	return ofnode_read_size_cells(dev_ofnode(dev));
 }
 
+int dev_read_simple_addr_cells(struct udevice *dev)
+{
+	return ofnode_read_simple_addr_cells(dev_ofnode(dev));
+}
+
+int dev_read_simple_size_cells(struct udevice *dev)
+{
+	return ofnode_read_simple_size_cells(dev_ofnode(dev));
+}
+
 int dev_read_phandle(struct udevice *dev)
 {
 	ofnode node = dev_ofnode(dev);
diff --git a/drivers/core/regmap.c b/drivers/core/regmap.c
index 749d913372..d4e16a27ef 100644
--- a/drivers/core/regmap.c
+++ b/drivers/core/regmap.c
@@ -72,8 +72,8 @@ int regmap_init_mem(struct udevice *dev, struct regmap **mapp)
 	ofnode node = dev_ofnode(dev);
 	struct resource r;
 
-	addr_len = dev_read_addr_cells(dev->parent);
-	size_len = dev_read_size_cells(dev->parent);
+	addr_len = dev_read_simple_addr_cells(dev->parent);
+	size_len = dev_read_simple_size_cells(dev->parent);
 	both_len = addr_len + size_len;
 
 	len = dev_read_size(dev, "reg");
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index b36ef3338c..4223040541 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -766,9 +766,9 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node,
 	prop = ofnode_read_prop(node, "ranges", &len);
 	if (!prop)
 		return -EINVAL;
-	pci_addr_cells = ofnode_read_addr_cells(node);
-	addr_cells = ofnode_read_addr_cells(parent_node);
-	size_cells = ofnode_read_size_cells(node);
+	pci_addr_cells = ofnode_read_simple_addr_cells(node);
+	addr_cells = ofnode_read_simple_addr_cells(parent_node);
+	size_cells = ofnode_read_simple_size_cells(node);
 
 	/* PCI addresses are always 3-cells */
 	len /= sizeof(u32);
diff --git a/include/dm/of_access.h b/include/dm/of_access.h
index d2827001e2..c5ea391aec 100644
--- a/include/dm/of_access.h
+++ b/include/dm/of_access.h
@@ -60,6 +60,26 @@ int of_n_addr_cells(const struct device_node *np);
  */
 int of_n_size_cells(const struct device_node *np);
 
+/**
+ * of_simple_addr_cells() - Get the address cells property in a node
+ *
+ * This function matches fdt_address_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #address-cells property in this node, or 2 if none
+ */
+int of_simple_addr_cells(const struct device_node *np);
+
+/**
+ * of_simple_size_cells() - Get the size cells property in a node
+ *
+ * This function matches fdt_size_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #size-cells property in this node, or 2 if none
+ */
+int of_simple_size_cells(const struct device_node *np);
+
 /**
  * of_find_property() - find a property in a node
  *
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index d261a61e91..c3d8db5b16 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -561,6 +561,26 @@ int ofnode_read_addr_cells(ofnode node);
  */
 int ofnode_read_size_cells(ofnode node);
 
+/**
+ * ofnode_read_simple_addr_cells() - Get the address cells property in a node
+ *
+ * This function matches fdt_address_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #address-cells property in this node, or 2 if none
+ */
+int ofnode_read_simple_addr_cells(ofnode node);
+
+/**
+ * ofnode_read_simple_size_cells() - Get the size cells property in a node
+ *
+ * This function matches fdt_size_cells().
+ *
+ * @np: Node pointer to check
+ * @return value of #size-cells property in this node, or 2 if none
+ */
+int ofnode_read_simple_size_cells(ofnode node);
+
 /**
  * ofnode_pre_reloc() - check if a node should be bound before relocation
  *
diff --git a/include/dm/read.h b/include/dm/read.h
index cea1c16a00..e519c97327 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -230,6 +230,48 @@ int dev_read_addr_cells(struct udevice *dev);
  */
 int dev_read_size_cells(struct udevice *dev);
 
+/**
+ * dev_read_addr_cells() - Get the number of address cells for a device's node
+ *
+ * This walks back up the tree to find the closest #address-cells property
+ * which controls the given node.
+ *
+ * @dev: devioe to check
+ * @return number of address cells this node uses
+ */
+int dev_read_addr_cells(struct udevice *dev);
+
+/**
+ * dev_read_size_cells() - Get the number of size cells for a device's node
+ *
+ * This walks back up the tree to find the closest #size-cells property
+ * which controls the given node.
+ *
+ * @dev: devioe to check
+ * @return number of size cells this node uses
+ */
+int dev_read_size_cells(struct udevice *dev);
+
+/**
+ * dev_read_addr_cells() - Get the address cells property in a node
+ *
+ * This function matches fdt_address_cells().
+ *
+ * @dev: devioe to check
+ * @return number of address cells this node uses
+ */
+int dev_read_simple_addr_cells(struct udevice *dev);
+
+/**
+ * dev_read_size_cells() - Get the size cells property in a node
+ *
+ * This function matches fdt_size_cells().
+ *
+ * @dev: devioe to check
+ * @return number of size cells this node uses
+ */
+int dev_read_simple_size_cells(struct udevice *dev);
+
 /**
  * dev_read_phandle() - Get the phandle from a device
  *
@@ -398,17 +440,29 @@ static inline int dev_read_phandle_with_args(struct udevice *dev,
 
 static inline int dev_read_addr_cells(struct udevice *dev)
 {
+	/* NOTE: this call should walk up the parent stack */
 	return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev));
 }
 
 static inline int dev_read_size_cells(struct udevice *dev)
+{
+	/* NOTE: this call should walk up the parent stack */
+	return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev));
+}
+
+static inline int dev_read_simple_addr_cells(struct udevice *dev)
+{
+	return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev));
+}
+
+static inline int dev_read_simple_size_cells(struct udevice *dev)
 {
 	return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev));
 }
 
 static inline int dev_read_phandle(struct udevice *dev)
 {
-	return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev));
+	return fdt_size_cells(gd->fdt_blob, dev_of_offset(dev));
 }
 
 static inline const u32 *dev_read_prop(struct udevice *dev,
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (3 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART Simon Glass
                   ` (30 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Calculate the time taken to set up the LCD.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/video/tegra124/display.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index bbbca13bdc..47752b27f1 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -471,7 +471,9 @@ static int tegra124_lcd_probe(struct udevice *dev)
 	int ret;
 
 	start = get_timer(0);
+	bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "lcd");
 	ret = tegra124_lcd_init(dev, (void *)plat->base, VIDEO_BPP16);
+	bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
 	debug("LCD init took %lu ms\n", get_timer(start));
 	if (ret)
 		printf("%s: Error %d\n", __func__, ret);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (4 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT Simon Glass
                   ` (29 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Enable this to allow debugging when the serial UART driver is
misconfigured.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 configs/nyan-big_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index fb2e4791a5..8ecb56b38d 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -46,6 +46,10 @@ CONFIG_PMIC_AS3722=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_PWM_TEGRA=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_BASE=0x70006000
+CONFIG_DEBUG_UART_CLOCK=408000000
+CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_SYS_NS16550=y
 CONFIG_TEGRA114_SPI=y
 CONFIG_TPM_TIS_INFINEON=y
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (5 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage Simon Glass
                   ` (28 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

The error handling code does not current detect an error right away.
Adjust it to return immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 lib/of_live.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/of_live.c b/lib/of_live.c
index 51927f9e91..f351483387 100644
--- a/lib/of_live.c
+++ b/lib/of_live.c
@@ -216,9 +216,12 @@ static void *unflatten_dt_node(const void *blob, void *mem, int *poffset,
 	*poffset = fdt_next_node(blob, *poffset, &depth);
 	if (depth < 0)
 		depth = 0;
-	while (*poffset > 0 && depth > old_depth)
+	while (*poffset > 0 && depth > old_depth) {
 		mem = unflatten_dt_node(blob, mem, poffset, np, NULL,
 					fpsize, dryrun);
+		if (!mem)
+			return NULL;
+	}
 
 	if (*poffset < 0 && *poffset != -FDT_ERR_NOTFOUND) {
 		debug("unflatten: error %d processing FDT\n", *poffset);
@@ -286,6 +289,8 @@ static int unflatten_device_tree(const void *blob,
 	start = 0;
 	size = (unsigned long)unflatten_dt_node(blob, NULL, &start, NULL, NULL,
 						0, true);
+	if (!size)
+		return -EFAULT;
 	size = ALIGN(size, 4);
 
 	debug("  size is %lx, allocating...\n", size);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (6 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace Simon Glass
                   ` (27 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Enable full bootstage support so we can time SPL and U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2:
- Add new patch to enable bootstage for nyan-big

 configs/nyan-big_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 8ecb56b38d..cb3b0a85cf 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -6,6 +6,10 @@ CONFIG_DEFAULT_DEVICE_TREE="tegra124-nyan-big"
 CONFIG_FIT=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTSTAGE=y
+CONFIG_SPL_BOOTSTAGE=y
+CONFIG_BOOTSTAGE_STASH=y
+CONFIG_BOOTSTAGE_STASH_ADDR=0x83000000
 CONFIG_SYS_STDIO_DEREGISTER=y
 CONFIG_SYS_PROMPT="Tegra124 (Nyan-big) # "
 # CONFIG_CMD_IMI is not set
@@ -23,6 +27,7 @@ CONFIG_CMD_GPIO=y
 # CONFIG_CMD_SETEXPR is not set
 # CONFIG_CMD_NFS is not set
 CONFIG_CMD_BMP=y
+CONFIG_CMD_BOOTSTAGE=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (7 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree Simon Glass
                   ` (26 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

We should sync the display (e.g. flush cache) when backspace is pressed
to ensure that the character is erased correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/vidconsole-uclass.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index e9a90b1b9b..b5afd72227 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -77,6 +77,7 @@ static int vidconsole_back(struct udevice *dev)
 		if (priv->ycur < 0)
 			priv->ycur = 0;
 	}
+	video_sync(dev->parent);
 
 	return 0;
 }
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (8 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging Simon Glass
                   ` (25 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/pwm_backlight.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index 3697f4905c..fbd7bf7838 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -28,11 +28,13 @@ struct pwm_backlight_priv {
 static int pwm_backlight_enable(struct udevice *dev)
 {
 	struct pwm_backlight_priv *priv = dev_get_priv(dev);
+	struct dm_regulator_uclass_platdata *plat;
 	uint duty_cycle;
 	int ret;
 
-	debug("%s: Enable '%s', regulator '%s'\n", __func__, dev->name,
-	      priv->reg->name);
+	plat = dev_get_uclass_platdata(priv->reg);
+	debug("%s: Enable '%s', regulator '%s'/'%s'\n", __func__, dev->name,
+	      priv->reg->name, plat->name);
 	ret = regulator_set_enable(priv->reg, true);
 	if (ret) {
 		debug("%s: Cannot enable regulator for PWM '%s'\n", __func__,
@@ -59,12 +61,11 @@ static int pwm_backlight_enable(struct udevice *dev)
 static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
 {
 	struct pwm_backlight_priv *priv = dev_get_priv(dev);
-	struct fdtdec_phandle_args args;
-	const void *blob = gd->fdt_blob;
-	int node = dev_of_offset(dev);
+	struct ofnode_phandle_args args;
 	int index, ret, count, len;
 	const u32 *cell;
 
+	debug("%s: start\n", __func__);
 	ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,
 					   "power-supply", &priv->reg);
 	if (ret) {
@@ -79,14 +80,14 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
 		if (ret != -ENOENT)
 			return ret;
 	}
-	ret = fdtdec_parse_phandle_with_args(blob, node, "pwms", "#pwm-cells",
-					     0, 0, &args);
+	ret = dev_read_phandle_with_args(dev, "pwms", "#pwm-cells", 0, 0,
+					 &args);
 	if (ret) {
 		debug("%s: Cannot get PWM phandle: ret=%d\n", __func__, ret);
 		return ret;
 	}
 
-	ret = uclass_get_device_by_of_offset(UCLASS_PWM, args.node, &priv->pwm);
+	ret = uclass_get_device_by_ofnode(UCLASS_PWM, args.node, &priv->pwm);
 	if (ret) {
 		debug("%s: Cannot get PWM: ret=%d\n", __func__, ret);
 		return ret;
@@ -94,8 +95,8 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
 	priv->channel = args.args[0];
 	priv->period_ns = args.args[1];
 
-	index = fdtdec_get_int(blob, node, "default-brightness-level", 255);
-	cell = fdt_getprop(blob, node, "brightness-levels", &len);
+	index = dev_read_u32_default(dev, "default-brightness-level", 255);
+	cell = dev_read_prop(dev, "brightness-levels", &len);
 	count = len / sizeof(u32);
 	if (cell && count > index) {
 		priv->default_level = fdt32_to_cpu(cell[index]);
@@ -104,6 +105,7 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
 		priv->default_level = index;
 		priv->max_level = 255;
 	}
+	debug("%s: done\n", __func__);
 
 
 	return 0;
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (9 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering Simon Glass
                   ` (24 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Add some debugging to show when the backlight is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/simple_panel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c
index baa95f6a12..c0ce199c6a 100644
--- a/drivers/video/simple_panel.c
+++ b/drivers/video/simple_panel.c
@@ -25,8 +25,10 @@ static int simple_panel_enable_backlight(struct udevice *dev)
 	struct simple_panel_priv *priv = dev_get_priv(dev);
 	int ret;
 
+	debug("%s: start, backlight = '%s'\n", __func__, priv->backlight->name);
 	dm_gpio_set_value(&priv->enable, 1);
 	ret = backlight_enable(priv->backlight);
+	debug("%s: done, ret = %d\n", __func__, ret);
 	if (ret)
 		return ret;
 
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (10 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART Simon Glass
                   ` (23 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update these two files so include files in the right order.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/board2.c | 22 ++++++++--------------
 arch/arm/mach-tegra/clock.c  |  4 ++--
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 1e627ba603..99057201d4 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -9,14 +9,8 @@
 #include <dm.h>
 #include <errno.h>
 #include <ns16550.h>
-#include <linux/compiler.h>
-#include <linux/sizes.h>
+#include <usb.h>
 #include <asm/io.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/funcmux.h>
-#include <asm/arch/pinmux.h>
-#include <asm/arch/pmu.h>
-#include <asm/arch/tegra.h>
 #include <asm/arch-tegra/ap.h>
 #include <asm/arch-tegra/board.h>
 #include <asm/arch-tegra/clk_rst.h>
@@ -25,17 +19,17 @@
 #include <asm/arch-tegra/uart.h>
 #include <asm/arch-tegra/warmboot.h>
 #include <asm/arch-tegra/gpu.h>
+#include <asm/arch-tegra/usb.h>
+#include <asm/arch-tegra/xusb-padctl.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/funcmux.h>
+#include <asm/arch/pinmux.h>
+#include <asm/arch/pmu.h>
+#include <asm/arch/tegra.h>
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
-#include <asm/arch-tegra/usb.h>
-#ifdef CONFIG_USB_EHCI_TEGRA
-#include <usb.h>
-#endif
-#include <asm/arch-tegra/xusb-padctl.h>
 #include <power/as3722.h>
-#include <i2c.h>
-#include <spi.h>
 #include "emc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index bac42119cd..668bbd20c1 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -7,6 +7,8 @@
 /* Tegra SoC common clock control functions */
 
 #include <common.h>
+#include <div64.h>
+#include <dm.h>
 #include <errno.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
@@ -15,8 +17,6 @@
 #include <asm/arch-tegra/clk_rst.h>
 #include <asm/arch-tegra/pmc.h>
 #include <asm/arch-tegra/timer.h>
-#include <div64.h>
-#include <fdtdec.h>
 
 /*
  * This is our record of the current clock rate of each clock. We don't
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (11 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver Simon Glass
                   ` (22 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Enable the debug UART in SPL to allow early serial output even if the
standard UART does not work (e.g. due to driver model problem).

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/spl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-tegra/spl.c b/arch/arm/mach-tegra/spl.c
index 41c88cb2b4..189b3da026 100644
--- a/arch/arm/mach-tegra/spl.c
+++ b/arch/arm/mach-tegra/spl.c
@@ -7,6 +7,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 #include <common.h>
+#include <debug_uart.h>
 #include <spl.h>
 
 #include <asm/io.h>
@@ -32,6 +33,9 @@ void spl_board_init(void)
 	gpio_early_init_uart();
 
 	clock_early_init();
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#endif
 	preloader_console_init();
 }
 
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (12 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree Simon Glass
                   ` (21 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

The PMC can be modelled as a syscon peripheral. Add a driver for this
so that it can be accessed by drivers when needed. Enable it for tegra124
boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Update commit message, enable for all tegra124 boards not just nyan-big

Changes in v2: None

 arch/arm/include/asm/arch-tegra/tegra.h |  5 +++++
 arch/arm/mach-tegra/Kconfig             |  2 ++
 arch/arm/mach-tegra/tegra124/Makefile   |  1 +
 arch/arm/mach-tegra/tegra124/pmc.c      | 19 +++++++++++++++++++
 4 files changed, 27 insertions(+)
 create mode 100644 arch/arm/mach-tegra/tegra124/pmc.c

diff --git a/arch/arm/include/asm/arch-tegra/tegra.h b/arch/arm/include/asm/arch-tegra/tegra.h
index 3add1b3c09..3b9711d28e 100644
--- a/arch/arm/include/asm/arch-tegra/tegra.h
+++ b/arch/arm/include/asm/arch-tegra/tegra.h
@@ -97,6 +97,11 @@ enum {
 	TEGRA_SOC_UNKNOWN	= -1,
 };
 
+/* Tegra system controller (SYSCON) devices */
+enum {
+	TEGRA_SYSCON_PMC,
+};
+
 #else  /* __ASSEMBLY__ */
 #define PRM_RSTCTRL		NV_PA_PMC_BASE
 #endif
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 89d2a499e4..51e50907d2 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -85,6 +85,8 @@ config TEGRA114
 config TEGRA124
 	bool "Tegra124 family"
 	select TEGRA_ARMV7_COMMON
+	imply REGMAP
+	imply SYSCON
 
 config TEGRA210
 	bool "Tegra210 family"
diff --git a/arch/arm/mach-tegra/tegra124/Makefile b/arch/arm/mach-tegra/tegra124/Makefile
index c00de6151e..d275dafdc4 100644
--- a/arch/arm/mach-tegra/tegra124/Makefile
+++ b/arch/arm/mach-tegra/tegra124/Makefile
@@ -10,6 +10,7 @@ obj-$(CONFIG_SPL_BUILD) += cpu.o
 obj-y	+= clock.o
 obj-y	+= funcmux.o
 obj-y	+= pinmux.o
+obj-y	+= pmc.o
 obj-y	+= xusb-padctl.o
 obj-y	+= ../xusb-padctl-common.o
 
diff --git a/arch/arm/mach-tegra/tegra124/pmc.c b/arch/arm/mach-tegra/tegra124/pmc.c
new file mode 100644
index 0000000000..be82acf11e
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra124/pmc.c
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Google, Inc
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <syscon.h>
+
+static const struct udevice_id tegra124_syscon_ids[] = {
+	{ .compatible = "nvidia,tegra124-pmc", .data = TEGRA_SYSCON_PMC },
+};
+
+U_BOOT_DRIVER(syscon_tegra124) = {
+	.name = "tegra124_syscon",
+	.id = UCLASS_SYSCON,
+	.of_match = tegra124_syscon_ids,
+};
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (13 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree Simon Glass
                   ` (20 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Adjust this code to support a live device tree. This should be implemented
as a PHY driver but that is left as an exercise for the maintainer.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Fix up the implementation which had node instead of subnode in one place

Changes in v2: None

 arch/arm/include/asm/arch-tegra/xusb-padctl.h |  2 +-
 arch/arm/mach-tegra/board2.c                  |  2 +-
 arch/arm/mach-tegra/tegra124/xusb-padctl.c    | 36 ++++++++++++---
 arch/arm/mach-tegra/tegra210/xusb-padctl.c    | 40 ++++++++++++-----
 arch/arm/mach-tegra/xusb-padctl-common.c      | 63 ++++++++++++++++-----------
 arch/arm/mach-tegra/xusb-padctl-common.h      | 11 ++---
 arch/arm/mach-tegra/xusb-padctl-dummy.c       |  2 +-
 7 files changed, 104 insertions(+), 52 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/xusb-padctl.h b/arch/arm/include/asm/arch-tegra/xusb-padctl.h
index b4b4c8ba4d..deccdf455d 100644
--- a/arch/arm/include/asm/arch-tegra/xusb-padctl.h
+++ b/arch/arm/include/asm/arch-tegra/xusb-padctl.h
@@ -15,7 +15,7 @@ struct tegra_xusb_phy;
  */
 struct tegra_xusb_phy *tegra_xusb_phy_get(unsigned int type);
 
-void tegra_xusb_padctl_init(const void *fdt);
+void tegra_xusb_padctl_init(void);
 int tegra_xusb_phy_prepare(struct tegra_xusb_phy *phy);
 int tegra_xusb_phy_enable(struct tegra_xusb_phy *phy);
 int tegra_xusb_phy_disable(struct tegra_xusb_phy *phy);
diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 99057201d4..85e19f3a9c 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -164,7 +164,7 @@ int board_init(void)
 	pin_mux_nand();
 #endif
 
-	tegra_xusb_padctl_init(gd->fdt_blob);
+	tegra_xusb_padctl_init();
 
 #ifdef CONFIG_TEGRA_LP0
 	/* save Sdram params to PMC 2, 4, and 24 for WB0 */
diff --git a/arch/arm/mach-tegra/tegra124/xusb-padctl.c b/arch/arm/mach-tegra/tegra124/xusb-padctl.c
index 76af924b94..d326a6ae57 100644
--- a/arch/arm/mach-tegra/tegra124/xusb-padctl.c
+++ b/arch/arm/mach-tegra/tegra124/xusb-padctl.c
@@ -8,6 +8,8 @@
 
 #include <common.h>
 #include <errno.h>
+#include <dm/of_access.h>
+#include <dm/ofnode.h>
 
 #include "../xusb-padctl-common.h"
 
@@ -317,13 +319,33 @@ static const struct tegra_xusb_padctl_soc tegra124_socdata = {
 	.num_phys = ARRAY_SIZE(tegra124_phys),
 };
 
-void tegra_xusb_padctl_init(const void *fdt)
+void tegra_xusb_padctl_init(void)
 {
-	int count, nodes[1];
+	ofnode nodes[1];
+	int count = 0;
+	int ret;
+
+	debug("%s: start\n", __func__);
+	if (of_live_active()) {
+		struct device_node *np = of_find_compatible_node(NULL, NULL,
+						"nvidia,tegra124-xusb-padctl");
+
+		debug("np=%p\n", np);
+		if (np) {
+			nodes[0] = np_to_ofnode(np);
+			count = 1;
+		}
+	} else {
+		int node_offsets[1];
+		int i;
+
+		count = fdtdec_find_aliases_for_id(gd->fdt_blob, "padctl",
+				COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL,
+				node_offsets, ARRAY_SIZE(node_offsets));
+		for (i = 0; i < count; i++)
+			nodes[i] = offset_to_ofnode(node_offsets[i]);
+	}
 
-	count = fdtdec_find_aliases_for_id(fdt, "padctl",
-					   COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL,
-					   nodes, ARRAY_SIZE(nodes));
-	if (tegra_xusb_process_nodes(fdt, nodes, count, &tegra124_socdata))
-		return;
+	ret = tegra_xusb_process_nodes(nodes, count, &tegra124_socdata);
+	debug("%s: done, ret=%d\n", __func__, ret);
 }
diff --git a/arch/arm/mach-tegra/tegra210/xusb-padctl.c b/arch/arm/mach-tegra/tegra210/xusb-padctl.c
index 9ec93e7c4c..fde76dda01 100644
--- a/arch/arm/mach-tegra/tegra210/xusb-padctl.c
+++ b/arch/arm/mach-tegra/tegra210/xusb-padctl.c
@@ -8,6 +8,8 @@
 
 #include <common.h>
 #include <errno.h>
+#include <dm/of_access.h>
+#include <dm/ofnode.h>
 
 #include "../xusb-padctl-common.h"
 
@@ -421,17 +423,33 @@ static const struct tegra_xusb_padctl_soc tegra210_socdata = {
 	.num_phys = ARRAY_SIZE(tegra210_phys),
 };
 
-void tegra_xusb_padctl_init(const void *fdt)
+void tegra_xusb_padctl_init(void)
 {
-	int count, nodes[1];
-
-	debug("> %s(fdt=%p)\n", __func__, fdt);
-
-	count = fdtdec_find_aliases_for_id(fdt, "padctl",
-					   COMPAT_NVIDIA_TEGRA210_XUSB_PADCTL,
-					   nodes, ARRAY_SIZE(nodes));
-	if (tegra_xusb_process_nodes(fdt, nodes, count, &tegra210_socdata))
-		return;
+	ofnode nodes[1];
+	int count = 0;
+	int ret;
+
+	debug("%s: start\n", __func__);
+	if (of_live_active()) {
+		struct device_node *np = of_find_compatible_node(NULL, NULL,
+						"nvidia,tegra210-xusb-padctl");
+
+		debug("np=%p\n", np);
+		if (np) {
+			nodes[0] = np_to_ofnode(np);
+			count = 1;
+		}
+	} else {
+		int node_offsets[1];
+		int i;
+
+		count = fdtdec_find_aliases_for_id(gd->fdt_blob, "padctl",
+				COMPAT_NVIDIA_TEGRA210_XUSB_PADCTL,
+				node_offsets, ARRAY_SIZE(node_offsets));
+		for (i = 0; i < count; i++)
+			nodes[i] = offset_to_ofnode(node_offsets[i]);
+	}
 
-	debug("< %s()\n", __func__);
+	ret = tegra_xusb_process_nodes(nodes, count, &tegra210_socdata);
+	debug("%s: done, ret=%d\n", __func__, ret);
 }
diff --git a/arch/arm/mach-tegra/xusb-padctl-common.c b/arch/arm/mach-tegra/xusb-padctl-common.c
index 43f5bb7da6..ef540852ca 100644
--- a/arch/arm/mach-tegra/xusb-padctl-common.c
+++ b/arch/arm/mach-tegra/xusb-padctl-common.c
@@ -75,14 +75,14 @@ tegra_xusb_padctl_find_lane(struct tegra_xusb_padctl *padctl, const char *name)
 static int
 tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
 				 struct tegra_xusb_padctl_group *group,
-				 const void *fdt, int node)
+				 ofnode node)
 {
 	unsigned int i;
-	int len;
+	int len, ret;
 
-	group->name = fdt_get_name(fdt, node, &len);
+	group->name = ofnode_get_name(node);
 
-	len = fdt_stringlist_count(fdt, node, "nvidia,lanes");
+	len = ofnode_read_string_count(node, "nvidia,lanes");
 	if (len < 0) {
 		error("failed to parse \"nvidia,lanes\" property");
 		return -EINVAL;
@@ -91,9 +91,9 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
 	group->num_pins = len;
 
 	for (i = 0; i < group->num_pins; i++) {
-		group->pins[i] = fdt_stringlist_get(fdt, node, "nvidia,lanes",
-						    i, NULL);
-		if (!group->pins[i]) {
+		ret = ofnode_read_string_index(node, "nvidia,lanes", i,
+					       &group->pins[i]);
+		if (ret) {
 			error("failed to read string from \"nvidia,lanes\" property");
 			return -EINVAL;
 		}
@@ -101,13 +101,14 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
 
 	group->num_pins = len;
 
-	group->func = fdt_stringlist_get(fdt, node, "nvidia,function", 0, NULL);
-	if (!group->func) {
+	ret = ofnode_read_string_index(node, "nvidia,function", 0,
+				       &group->func);
+	if (ret) {
 		error("failed to parse \"nvidia,func\" property");
 		return -EINVAL;
 	}
 
-	group->iddq = fdtdec_get_int(fdt, node, "nvidia,iddq", -1);
+	group->iddq = ofnode_read_u32_default(node, "nvidia,iddq", -1);
 
 	return 0;
 }
@@ -217,20 +218,21 @@ tegra_xusb_padctl_config_apply(struct tegra_xusb_padctl *padctl,
 static int
 tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl,
 				  struct tegra_xusb_padctl_config *config,
-				  const void *fdt, int node)
+				  ofnode node)
 {
-	int subnode;
+	ofnode subnode;
 
-	config->name = fdt_get_name(fdt, node, NULL);
+	config->name = ofnode_get_name(node);
 
-	fdt_for_each_subnode(subnode, fdt, node) {
+	for (subnode = ofnode_first_subnode(node);
+	     ofnode_valid(subnode);
+	     subnode = ofnode_next_subnode(subnode)) {
 		struct tegra_xusb_padctl_group *group;
 		int err;
 
 		group = &config->groups[config->num_groups];
 
-		err = tegra_xusb_padctl_group_parse_dt(padctl, group, fdt,
-						       subnode);
+		err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode);
 		if (err < 0) {
 			error("failed to parse group %s", group->name);
 			return err;
@@ -243,20 +245,25 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl,
 }
 
 static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
-				      const void *fdt, int node)
+				      ofnode node)
 {
-	int subnode, err;
+	ofnode subnode;
+	int err;
 
-	err = fdt_get_resource(fdt, node, "reg", 0, &padctl->regs);
-	if (err < 0) {
+	debug("%s: start %s\n", __func__, ofnode_get_name(node));
+	padctl->regs = ofnode_get_addr(node);
+	if (padctl->regs == FDT_ADDR_T_NONE) {
 		error("registers not found");
 		return err;
 	}
 
-	fdt_for_each_subnode(subnode, fdt, node) {
+	for (subnode = ofnode_first_subnode(node);
+	     ofnode_valid(subnode);
+	     subnode = ofnode_next_subnode(subnode)) {
 		struct tegra_xusb_padctl_config *config = &padctl->config;
 
-		err = tegra_xusb_padctl_config_parse_dt(padctl, config, fdt,
+		debug("%s: subnode=%s\n", __func__, ofnode_get_name(subnode));
+		err = tegra_xusb_padctl_config_parse_dt(padctl, config,
 							subnode);
 		if (err < 0) {
 			error("failed to parse entry %s: %d",
@@ -264,25 +271,28 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
 			continue;
 		}
 	}
+	debug("%s: done\n", __func__);
 
 	return 0;
 }
 
 struct tegra_xusb_padctl padctl;
 
-int tegra_xusb_process_nodes(const void *fdt, int nodes[], unsigned int count,
-	const struct tegra_xusb_padctl_soc *socdata)
+int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
+			     const struct tegra_xusb_padctl_soc *socdata)
 {
 	unsigned int i;
 	int err;
 
+	debug("%s: count=%d\n", __func__, count);
 	for (i = 0; i < count; i++) {
-		if (!fdtdec_get_is_enabled(fdt, nodes[i]))
+		debug("%s: i=%d, node=%p\n", __func__, i, nodes[i].np);
+		if (!ofnode_is_available(nodes[i]))
 			continue;
 
 		padctl.socdata = socdata;
 
-		err = tegra_xusb_padctl_parse_dt(&padctl, fdt, nodes[i]);
+		err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]);
 		if (err < 0) {
 			error("failed to parse DT: %d", err);
 			continue;
@@ -300,6 +310,7 @@ int tegra_xusb_process_nodes(const void *fdt, int nodes[], unsigned int count,
 		/* only a single instance is supported */
 		break;
 	}
+	debug("%s: done\n", __func__);
 
 	return 0;
 }
diff --git a/arch/arm/mach-tegra/xusb-padctl-common.h b/arch/arm/mach-tegra/xusb-padctl-common.h
index f44790a650..afb62a9adc 100644
--- a/arch/arm/mach-tegra/xusb-padctl-common.h
+++ b/arch/arm/mach-tegra/xusb-padctl-common.h
@@ -9,6 +9,7 @@
 
 #include <common.h>
 #include <fdtdec.h>
+#include <dm/ofnode.h>
 
 #include <asm/io.h>
 #include <asm/arch-tegra/xusb-padctl.h>
@@ -77,7 +78,7 @@ struct tegra_xusb_padctl_config {
 struct tegra_xusb_padctl {
 	const struct tegra_xusb_padctl_soc *socdata;
 	struct tegra_xusb_padctl_config config;
-	struct fdt_resource regs;
+	ulong regs;
 	unsigned int enable;
 
 };
@@ -86,16 +87,16 @@ extern struct tegra_xusb_padctl padctl;
 static inline u32 padctl_readl(struct tegra_xusb_padctl *padctl,
 			       unsigned long offset)
 {
-	return readl(padctl->regs.start + offset);
+	return readl(padctl->regs + offset);
 }
 
 static inline void padctl_writel(struct tegra_xusb_padctl *padctl,
 				 u32 value, unsigned long offset)
 {
-	writel(value, padctl->regs.start + offset);
+	writel(value, padctl->regs + offset);
 }
 
-int tegra_xusb_process_nodes(const void *fdt, int nodes[], unsigned int count,
-	const struct tegra_xusb_padctl_soc *socdata);
+int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
+			     const struct tegra_xusb_padctl_soc *socdata);
 
 #endif
diff --git a/arch/arm/mach-tegra/xusb-padctl-dummy.c b/arch/arm/mach-tegra/xusb-padctl-dummy.c
index 65f8d2ea96..856d712512 100644
--- a/arch/arm/mach-tegra/xusb-padctl-dummy.c
+++ b/arch/arm/mach-tegra/xusb-padctl-dummy.c
@@ -34,6 +34,6 @@ int __weak tegra_xusb_phy_unprepare(struct tegra_xusb_phy *phy)
 	return -ENOSYS;
 }
 
-void __weak tegra_xusb_padctl_init(const void *fdt)
+void __weak tegra_xusb_padctl_init(void)
 {
 }
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (14 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree Simon Glass
                   ` (19 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Adjust this to take a device as a parameter instead of a node.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/include/asm/arch-tegra/clock.h | 2 +-
 arch/arm/mach-tegra/clock.c             | 5 ++---
 drivers/spi/tegra114_spi.c              | 2 +-
 drivers/spi/tegra20_sflash.c            | 2 +-
 drivers/spi/tegra20_slink.c             | 2 +-
 drivers/spi/tegra210_qspi.c             | 2 +-
 drivers/usb/host/ehci-tegra.c           | 2 +-
 7 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm/include/asm/arch-tegra/clock.h b/arch/arm/include/asm/arch-tegra/clock.h
index f62b2a4378..92180db321 100644
--- a/arch/arm/include/asm/arch-tegra/clock.h
+++ b/arch/arm/include/asm/arch-tegra/clock.h
@@ -266,7 +266,7 @@ void clock_ll_start_uart(enum periph_id periph_id);
  * @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);
+int clock_decode_periph_id(struct udevice *dev);
 
 /**
  * Checks if the oscillator bypass is enabled (XOBP bit)
diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
index 668bbd20c1..dc58b3027d 100644
--- a/arch/arm/mach-tegra/clock.c
+++ b/arch/arm/mach-tegra/clock.c
@@ -655,14 +655,13 @@ void clock_ll_start_uart(enum periph_id periph_id)
 }
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
-int clock_decode_periph_id(const void *blob, int node)
+int clock_decode_periph_id(struct udevice *dev)
 {
 	enum periph_id id;
 	u32 cell[2];
 	int err;
 
-	err = fdtdec_get_int_array(blob, node, "clocks", cell,
-				   ARRAY_SIZE(cell));
+	err = dev_read_u32_array(dev, "clocks", cell, ARRAY_SIZE(cell));
 	if (err)
 		return -1;
 	id = clk_id_to_periph_id(cell[1]);
diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 91659349a3..6478352c31 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -104,7 +104,7 @@ static int tegra114_spi_ofdata_to_platdata(struct udevice *bus)
 	int node = dev_of_offset(bus);
 
 	plat->base = devfdt_get_addr(bus);
-	plat->periph_id = clock_decode_periph_id(blob, node);
+	plat->periph_id = clock_decode_periph_id(bus);
 
 	if (plat->periph_id == PERIPH_ID_NONE) {
 		debug("%s: could not decode periph id %d\n", __func__,
diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c
index 299e1b44fa..e70210d7ab 100644
--- a/drivers/spi/tegra20_sflash.c
+++ b/drivers/spi/tegra20_sflash.c
@@ -91,7 +91,7 @@ static int tegra20_sflash_ofdata_to_platdata(struct udevice *bus)
 	int node = dev_of_offset(bus);
 
 	plat->base = devfdt_get_addr(bus);
-	plat->periph_id = clock_decode_periph_id(blob, node);
+	plat->periph_id = clock_decode_periph_id(bus);
 
 	if (plat->periph_id == PERIPH_ID_NONE) {
 		debug("%s: could not decode periph id %d\n", __func__,
diff --git a/drivers/spi/tegra20_slink.c b/drivers/spi/tegra20_slink.c
index 4cbde7b22f..f242574760 100644
--- a/drivers/spi/tegra20_slink.c
+++ b/drivers/spi/tegra20_slink.c
@@ -97,7 +97,7 @@ static int tegra30_spi_ofdata_to_platdata(struct udevice *bus)
 	int node = dev_of_offset(bus);
 
 	plat->base = devfdt_get_addr(bus);
-	plat->periph_id = clock_decode_periph_id(blob, node);
+	plat->periph_id = clock_decode_periph_id(bus);
 
 	if (plat->periph_id == PERIPH_ID_NONE) {
 		debug("%s: could not decode periph id %d\n", __func__,
diff --git a/drivers/spi/tegra210_qspi.c b/drivers/spi/tegra210_qspi.c
index 6d0b5da261..2a35a583f5 100644
--- a/drivers/spi/tegra210_qspi.c
+++ b/drivers/spi/tegra210_qspi.c
@@ -100,7 +100,7 @@ static int tegra210_qspi_ofdata_to_platdata(struct udevice *bus)
 	int node = dev_of_offset(bus);
 
 	plat->base = devfdt_get_addr(bus);
-	plat->periph_id = clock_decode_periph_id(blob, node);
+	plat->periph_id = clock_decode_periph_id(bus);
 
 	if (plat->periph_id == PERIPH_ID_NONE) {
 		debug("%s: could not decode periph id %d\n", __func__,
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 7dc37f045d..873bf8ecfd 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -723,7 +723,7 @@ static int fdt_decode_usb(struct udevice *dev, struct fdt_usb *config)
 	config->enabled = fdtdec_get_is_enabled(blob, node);
 	config->has_legacy_mode = fdtdec_get_bool(blob, node,
 						  "nvidia,has-legacy-mode");
-	config->periph_id = clock_decode_periph_id(blob, node);
+	config->periph_id = clock_decode_periph_id(dev);
 	if (config->periph_id == PERIPH_ID_NONE) {
 		debug("%s: Missing/invalid peripheral ID\n", __func__);
 		return -EINVAL;
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (15 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen Simon Glass
                   ` (18 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update these drives to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/tegra124/display.c |  8 +++-----
 drivers/video/tegra124/dp.c      |  3 +--
 drivers/video/tegra124/sor.c     | 25 +++++++------------------
 3 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index 47752b27f1..4164fa1bd9 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -12,7 +12,6 @@
 #include <errno.h>
 #include <display.h>
 #include <edid.h>
-#include <fdtdec.h>
 #include <lcd.h>
 #include <video.h>
 #include <asm/gpio.h>
@@ -334,7 +333,6 @@ static int display_init(struct udevice *dev, void *lcdbase,
 {
 	struct display_plat *disp_uc_plat;
 	struct dc_ctlr *dc_ctlr;
-	const void *blob = gd->fdt_blob;
 	struct udevice *dp_dev;
 	const int href_to_sync = 1, vref_to_sync = 1;
 	int panel_bpp = 18;	/* default 18 bits per pixel */
@@ -363,9 +361,8 @@ static int display_init(struct udevice *dev, void *lcdbase,
 		return ret;
 	}
 
-	dc_ctlr = (struct dc_ctlr *)fdtdec_get_addr(blob, dev_of_offset(dev),
-						    "reg");
-	if (fdtdec_decode_display_timing(blob, dev_of_offset(dev), 0, timing)) {
+	dc_ctlr = (struct dc_ctlr *)dev_read_addr(dev);
+	if (ofnode_decode_display_timing(dev_ofnode(dev), 0, timing)) {
 		debug("%s: Failed to decode display timing\n", __func__);
 		return -EINVAL;
 	}
@@ -416,6 +413,7 @@ static int display_init(struct udevice *dev, void *lcdbase,
 		debug("dc: failed to update window\n");
 		return ret;
 	}
+	debug("%s: ready\n", __func__);
 
 	return 0;
 }
diff --git a/drivers/video/tegra124/dp.c b/drivers/video/tegra124/dp.c
index c38b3e5335..95d743d0f4 100644
--- a/drivers/video/tegra124/dp.c
+++ b/drivers/video/tegra124/dp.c
@@ -10,7 +10,6 @@
 #include <dm.h>
 #include <div64.h>
 #include <errno.h>
-#include <fdtdec.h>
 #include <video_bridge.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/dc.h>
@@ -1572,7 +1571,7 @@ static int tegra_dp_ofdata_to_platdata(struct udevice *dev)
 {
 	struct tegra_dp_plat *plat = dev_get_platdata(dev);
 
-	plat->base = devfdt_get_addr(dev);
+	plat->base = dev_read_addr(dev);
 
 	return 0;
 }
diff --git a/drivers/video/tegra124/sor.c b/drivers/video/tegra124/sor.c
index 4324071cdc..700ab25d46 100644
--- a/drivers/video/tegra124/sor.c
+++ b/drivers/video/tegra124/sor.c
@@ -7,9 +7,9 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
 #include <malloc.h>
 #include <panel.h>
+#include <syscon.h>
 #include <video_bridge.h>
 #include <asm/io.h>
 #include <asm/arch/clock.h>
@@ -759,15 +759,12 @@ int tegra_dc_sor_attach(struct udevice *dc_dev, struct udevice *dev,
 			const struct display_timing *timing)
 {
 	struct tegra_dc_sor_data *sor = dev_get_priv(dev);
-	const void *blob = gd->fdt_blob;
 	struct dc_ctlr *disp_ctrl;
 	u32 reg_val;
-	int node;
 
 	/* Use the first display controller */
 	debug("%s\n", __func__);
-	node = dev_of_offset(dc_dev);
-	disp_ctrl = (struct dc_ctlr *)fdtdec_get_addr(blob, node, "reg");
+	disp_ctrl = (struct dc_ctlr *)dev_read_addr(dc_dev);
 
 	tegra_dc_sor_enable_dc(disp_ctrl);
 	tegra_dc_sor_config_panel(sor, 0, link_cfg, timing);
@@ -974,16 +971,13 @@ int tegra_dc_sor_detach(struct udevice *dc_dev, struct udevice *dev)
 {
 	struct tegra_dc_sor_data *sor = dev_get_priv(dev);
 	int dc_reg_ctx[DC_REG_SAVE_SPACE];
-	const void *blob = gd->fdt_blob;
 	struct dc_ctlr *disp_ctrl;
 	unsigned long dc_int_mask;
-	int node;
 	int ret;
 
 	debug("%s\n", __func__);
 	/* Use the first display controller */
-	node = dev_of_offset(dc_dev);
-	disp_ctrl = (struct dc_ctlr *)fdtdec_get_addr(blob, node, "reg");
+	disp_ctrl = (struct dc_ctlr *)dev_read_addr(dev);
 
 	/* Sleep mode */
 	tegra_sor_writel(sor, SUPER_STATE1, SUPER_STATE1_ASY_HEAD_OP_SLEEP |
@@ -1050,18 +1044,13 @@ static int tegra_sor_set_backlight(struct udevice *dev, int percent)
 static int tegra_sor_ofdata_to_platdata(struct udevice *dev)
 {
 	struct tegra_dc_sor_data *priv = dev_get_priv(dev);
-	const void *blob = gd->fdt_blob;
-	int node;
 	int ret;
 
-	priv->base = (void *)fdtdec_get_addr(blob, dev_of_offset(dev), "reg");
+	priv->base = (void *)dev_read_addr(dev);
 
-	node = fdtdec_next_compatible(blob, 0, COMPAT_NVIDIA_TEGRA124_PMC);
-	if (node < 0) {
-		debug("%s: Cannot find PMC\n", __func__);
-		return -ENOENT;
-	}
-	priv->pmc_base = (void *)fdtdec_get_addr(blob, node, "reg");
+	priv->pmc_base = (void *)syscon_get_first_range(TEGRA_SYSCON_PMC);
+	if (IS_ERR(priv->pmc_base))
+		return PTR_ERR(priv->pmc_base);
 
 	ret = uclass_get_device_by_phandle(UCLASS_PANEL, dev, "nvidia,panel",
 					   &priv->panel);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (16 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree Simon Glass
                   ` (17 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This property should be in the /chosen node, not /aliases.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/dts/tegra124-nyan-big.dts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/tegra124-nyan-big.dts b/arch/arm/dts/tegra124-nyan-big.dts
index 62f89d0f1a..f1c97052a8 100644
--- a/arch/arm/dts/tegra124-nyan-big.dts
+++ b/arch/arm/dts/tegra124-nyan-big.dts
@@ -8,7 +8,6 @@
 
 	aliases {
 		console = &uarta;
-		stdout-path = &uarta;
 		i2c0 = "/i2c at 7000d000";
 		i2c1 = "/i2c at 7000c000";
 		i2c2 = "/i2c at 7000c400";
@@ -26,6 +25,10 @@
 		usb2 = "/usb at 7d004000";
 	};
 
+	chosen {
+		stdout-path = &uarta;
+	};
+
 	host1x at 50000000 {
 		dc at 54200000 {
 			display-timings {
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (17 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree Simon Glass
                   ` (16 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the GPIO driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/gpio/tegra_gpio.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpio/tegra_gpio.c b/drivers/gpio/tegra_gpio.c
index 687cd74fee..4965583158 100644
--- a/drivers/gpio/tegra_gpio.c
+++ b/drivers/gpio/tegra_gpio.c
@@ -337,11 +337,13 @@ static int gpio_tegra_bind(struct udevice *parent)
 	 * This driver does not make use of interrupts, other than to figure
 	 * out the number of GPIO banks
 	 */
-	if (!fdt_getprop(gd->fdt_blob, dev_of_offset(parent), "interrupts",
-			 &len))
-		return -EINVAL;
+	len = dev_read_size(parent, "interrupts");
+	if (len < 0)
+		return len;
 	bank_count = len / 3 / sizeof(u32);
-	ctlr = (struct gpio_ctlr *)devfdt_get_addr(parent);
+	ctlr = (struct gpio_ctlr *)dev_read_addr(parent);
+	if ((ulong)ctlr == FDT_ADDR_T_NONE)
+		return -EINVAL;
 	}
 #endif
 	for (bank = 0; bank < bank_count; bank++) {
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (18 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 21/35] dm: tegra: spi: " Simon Glass
                   ` (15 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the Tegra EHCI driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/usb/host/ehci-tegra.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 873bf8ecfd..1c72330b0c 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -17,7 +17,6 @@
 #include <usb.h>
 #include <usb/ulpi.h>
 #include <libfdt.h>
-#include <fdtdec.h>
 
 #include "ehci.h"
 
@@ -695,12 +694,11 @@ static void config_clock(const u32 timing[])
 
 static int fdt_decode_usb(struct udevice *dev, struct fdt_usb *config)
 {
-	const void *blob = gd->fdt_blob;
-	int node = dev_of_offset(dev);
 	const char *phy, *mode;
 
-	config->reg = (struct usb_ctlr *)devfdt_get_addr(dev);
-	mode = fdt_getprop(blob, node, "dr_mode", NULL);
+	config->reg = (struct usb_ctlr *)dev_read_addr(dev);
+	debug("reg=%p\n", config->reg);
+	mode = dev_read_string(dev, "dr_mode");
 	if (mode) {
 		if (0 == strcmp(mode, "host"))
 			config->dr_mode = DR_MODE_HOST;
@@ -717,28 +715,24 @@ static int fdt_decode_usb(struct udevice *dev, struct fdt_usb *config)
 		config->dr_mode = DR_MODE_HOST;
 	}
 
-	phy = fdt_getprop(blob, node, "phy_type", NULL);
+	phy = dev_read_string(dev, "phy_type");
 	config->utmi = phy && 0 == strcmp("utmi", phy);
 	config->ulpi = phy && 0 == strcmp("ulpi", phy);
-	config->enabled = fdtdec_get_is_enabled(blob, node);
-	config->has_legacy_mode = fdtdec_get_bool(blob, node,
-						  "nvidia,has-legacy-mode");
+	config->has_legacy_mode = dev_read_bool(dev, "nvidia,has-legacy-mode");
 	config->periph_id = clock_decode_periph_id(dev);
 	if (config->periph_id == PERIPH_ID_NONE) {
 		debug("%s: Missing/invalid peripheral ID\n", __func__);
 		return -EINVAL;
 	}
-	gpio_request_by_name_nodev(offset_to_ofnode(node), "nvidia,vbus-gpio",
-				   0, &config->vbus_gpio, GPIOD_IS_OUT);
-	gpio_request_by_name_nodev(offset_to_ofnode(node),
-				   "nvidia,phy-reset-gpio", 0,
-				   &config->phy_reset_gpio, GPIOD_IS_OUT);
-	debug("enabled=%d, legacy_mode=%d, utmi=%d, ulpi=%d, periph_id=%d, "
-		"vbus=%d, phy_reset=%d, dr_mode=%d\n",
-		config->enabled, config->has_legacy_mode, config->utmi,
-		config->ulpi, config->periph_id,
-		gpio_get_number(&config->vbus_gpio),
-		gpio_get_number(&config->phy_reset_gpio), config->dr_mode);
+	gpio_request_by_name(dev, "nvidia,vbus-gpio", 0, &config->vbus_gpio,
+			     GPIOD_IS_OUT);
+	gpio_request_by_name(dev, "nvidia,phy-reset-gpio", 0,
+			     &config->phy_reset_gpio, GPIOD_IS_OUT);
+	debug("legacy_mode=%d, utmi=%d, ulpi=%d, periph_id=%d, vbus=%d, phy_reset=%d, dr_mode=%d, reg=%p\n",
+	      config->has_legacy_mode, config->utmi, config->ulpi,
+	      config->periph_id, gpio_get_number(&config->vbus_gpio),
+	      gpio_get_number(&config->phy_reset_gpio), config->dr_mode,
+	      config->reg);
 
 	return 0;
 }
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 21/35] dm: tegra: spi: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (19 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: " Simon Glass
                   ` (14 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the tegra114 spi driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/spi/tegra114_spi.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/tegra114_spi.c b/drivers/spi/tegra114_spi.c
index 6478352c31..04b4fce061 100644
--- a/drivers/spi/tegra114_spi.c
+++ b/drivers/spi/tegra114_spi.c
@@ -12,7 +12,6 @@
 #include <asm/arch/clock.h>
 #include <asm/arch-tegra/clk_rst.h>
 #include <spi.h>
-#include <fdtdec.h>
 #include "tegra_spi.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -100,10 +99,8 @@ struct tegra114_spi_priv {
 static int tegra114_spi_ofdata_to_platdata(struct udevice *bus)
 {
 	struct tegra_spi_platdata *plat = bus->platdata;
-	const void *blob = gd->fdt_blob;
-	int node = dev_of_offset(bus);
 
-	plat->base = devfdt_get_addr(bus);
+	plat->base = dev_read_addr(bus);
 	plat->periph_id = clock_decode_periph_id(bus);
 
 	if (plat->periph_id == PERIPH_ID_NONE) {
@@ -113,10 +110,10 @@ static int tegra114_spi_ofdata_to_platdata(struct udevice *bus)
 	}
 
 	/* Use 500KHz as a suitable default */
-	plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency",
-					500000);
-	plat->deactivate_delay_us = fdtdec_get_int(blob, node,
-					"spi-deactivate-delay", 0);
+	plat->frequency = dev_read_u32_default(bus, "spi-max-frequency",
+					       500000);
+	plat->deactivate_delay_us = dev_read_u32_default(bus,
+						"spi-deactivate-delay", 0);
 	debug("%s: base=%#08lx, periph_id=%d, max-frequency=%d, deactivate_delay=%d\n",
 	      __func__, plat->base, plat->periph_id, plat->frequency,
 	      plat->deactivate_delay_us);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (20 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 21/35] dm: tegra: spi: " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: " Simon Glass
                   ` (13 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the tegra i2c driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/i2c/tegra_i2c.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/tegra_i2c.c b/drivers/i2c/tegra_i2c.c
index 055f48153a..4163d798d5 100644
--- a/drivers/i2c/tegra_i2c.c
+++ b/drivers/i2c/tegra_i2c.c
@@ -365,7 +365,11 @@ static int tegra_i2c_probe(struct udevice *dev)
 
 	i2c_bus->id = dev->seq;
 	i2c_bus->type = dev_get_driver_data(dev);
-	i2c_bus->regs = (struct i2c_ctlr *)devfdt_get_addr(dev);
+	i2c_bus->regs = (struct i2c_ctlr *)dev_read_addr(dev);
+	if ((ulong)i2c_bus->regs == FDT_ADDR_T_NONE) {
+		debug("%s: Cannot get regs address\n", __func__);
+		return -EINVAL;
+	}
 
 	ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl);
 	if (ret) {
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (21 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: " Simon Glass
                   ` (12 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the tegra pwm driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/pwm/tegra_pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/tegra_pwm.c b/drivers/pwm/tegra_pwm.c
index d93ac28c31..b8acc1583f 100644
--- a/drivers/pwm/tegra_pwm.c
+++ b/drivers/pwm/tegra_pwm.c
@@ -59,7 +59,7 @@ static int tegra_pwm_ofdata_to_platdata(struct udevice *dev)
 {
 	struct tegra_pwm_priv *priv = dev_get_priv(dev);
 
-	priv->regs = (struct pwm_ctlr *)devfdt_get_addr(dev);
+	priv->regs = (struct pwm_ctlr *)dev_read_addr(dev);
 
 	return 0;
 }
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (22 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 25/35] dm: tegra: pci: " Simon Glass
                   ` (11 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the tegra mmc driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/mmc/tegra_mmc.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/tegra_mmc.c b/drivers/mmc/tegra_mmc.c
index 338e42b528..9f7e7195f1 100644
--- a/drivers/mmc/tegra_mmc.c
+++ b/drivers/mmc/tegra_mmc.c
@@ -11,10 +11,10 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
+#include <mmc.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch-tegra/tegra_mmc.h>
-#include <mmc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -599,8 +599,7 @@ static int tegra_mmc_probe(struct udevice *dev)
 
 	cfg->name = dev->name;
 
-	bus_width = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-				   "bus-width", 1);
+	bus_width = dev_read_u32_default(dev, "bus-width", 1);
 
 	cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
 	cfg->host_caps = 0;
@@ -621,7 +620,7 @@ static int tegra_mmc_probe(struct udevice *dev)
 
 	cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
 
-	priv->reg = (void *)devfdt_get_addr(dev);
+	priv->reg = (void *)dev_read_addr(dev);
 
 	ret = reset_get_by_name(dev, "sdhci", &priv->reset_ctl);
 	if (ret) {
@@ -648,12 +647,10 @@ static int tegra_mmc_probe(struct udevice *dev)
 		return ret;
 
 	/* These GPIOs are optional */
-	gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
-			     GPIOD_IS_IN);
-	gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio,
-			     GPIOD_IS_IN);
-	gpio_request_by_name(dev, "power-gpios", 0,
-			     &priv->pwr_gpio, GPIOD_IS_OUT);
+	gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
+	gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
+	gpio_request_by_name(dev, "power-gpios", 0, &priv->pwr_gpio,
+			     GPIOD_IS_OUT);
 	if (dm_gpio_is_valid(&priv->pwr_gpio))
 		dm_gpio_set_value(&priv->pwr_gpio, 1);
 
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (23 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 26/35] power: Add a regulator driver for the as3722 PMIC Simon Glass
                   ` (10 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update the tegra pci driver to support a live device tree. Fix the check
for nvidia,num-lanes so that an error will actually be detected.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to convert tegra PCI to device tree

Changes in v2: None

 drivers/pci/pci_tegra.c | 53 ++++++++++++++++++++++---------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/drivers/pci/pci_tegra.c b/drivers/pci/pci_tegra.c
index 7d9c63b06f..c969954182 100644
--- a/drivers/pci/pci_tegra.c
+++ b/drivers/pci/pci_tegra.c
@@ -16,7 +16,6 @@
 #include <clk.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
 #include <malloc.h>
 #include <pci.h>
 #include <power-domain.h>
@@ -25,6 +24,7 @@
 #include <asm/io.h>
 #include <asm/gpio.h>
 
+#include <linux/ioport.h>
 #include <linux/list.h>
 
 #ifndef CONFIG_TEGRA186
@@ -220,9 +220,9 @@ struct tegra_pcie_soc {
 struct tegra_pcie {
 	struct pci_controller hose;
 
-	struct fdt_resource pads;
-	struct fdt_resource afi;
-	struct fdt_resource cs;
+	struct resource pads;
+	struct resource afi;
+	struct resource cs;
 
 	struct list_head ports;
 	unsigned long xbar;
@@ -364,13 +364,12 @@ static int pci_tegra_write_config(struct udevice *bus, pci_dev_t bdf,
 	return 0;
 }
 
-static int tegra_pcie_port_parse_dt(const void *fdt, int node,
-				    struct tegra_pcie_port *port)
+static int tegra_pcie_port_parse_dt(ofnode node, struct tegra_pcie_port *port)
 {
 	const u32 *addr;
 	int len;
 
-	addr = fdt_getprop(fdt, node, "assigned-addresses", &len);
+	addr = ofnode_read_prop(node, "assigned-addresses", &len);
 	if (!addr) {
 		error("property \"assigned-addresses\" not found");
 		return -FDT_ERR_NOTFOUND;
@@ -382,7 +381,7 @@ static int tegra_pcie_port_parse_dt(const void *fdt, int node,
 	return 0;
 }
 
-static int tegra_pcie_get_xbar_config(const void *fdt, int node, u32 lanes,
+static int tegra_pcie_get_xbar_config(ofnode node, u32 lanes,
 				      enum tegra_pci_id id, unsigned long *xbar)
 {
 	switch (id) {
@@ -456,14 +455,12 @@ static int tegra_pcie_get_xbar_config(const void *fdt, int node, u32 lanes,
 	return -FDT_ERR_NOTFOUND;
 }
 
-static int tegra_pcie_parse_port_info(const void *fdt, int node,
-				      unsigned int *index,
-				      unsigned int *lanes)
+static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes)
 {
 	struct fdt_pci_addr addr;
 	int err;
 
-	err = fdtdec_get_int(fdt, node, "nvidia,num-lanes", 0);
+	err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1);
 	if (err < 0) {
 		error("failed to parse \"nvidia,num-lanes\" property");
 		return err;
@@ -471,7 +468,7 @@ static int tegra_pcie_parse_port_info(const void *fdt, int node,
 
 	*lanes = err;
 
-	err = fdtdec_get_pci_addr(fdt, node, 0, "reg", &addr);
+	err = ofnode_read_pci_addr(node, 0, "reg", &addr);
 	if (err < 0) {
 		error("failed to parse \"reg\" property");
 		return err;
@@ -487,28 +484,26 @@ int __weak tegra_pcie_board_init(void)
 	return 0;
 }
 
-static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id,
+static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
 			       struct tegra_pcie *pcie)
 {
-	int err, subnode;
+	ofnode subnode;
 	u32 lanes = 0;
+	int err;
 
-	err = fdt_get_named_resource(fdt, node, "reg", "reg-names", "pads",
-				     &pcie->pads);
+	err = dev_read_resource(dev, 0, &pcie->pads);
 	if (err < 0) {
 		error("resource \"pads\" not found");
 		return err;
 	}
 
-	err = fdt_get_named_resource(fdt, node, "reg", "reg-names", "afi",
-				     &pcie->afi);
+	err = dev_read_resource(dev, 1, &pcie->afi);
 	if (err < 0) {
 		error("resource \"afi\" not found");
 		return err;
 	}
 
-	err = fdt_get_named_resource(fdt, node, "reg", "reg-names", "cs",
-				     &pcie->cs);
+	err = dev_read_resource(dev, 2, &pcie->cs);
 	if (err < 0) {
 		error("resource \"cs\" not found");
 		return err;
@@ -531,12 +526,11 @@ static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id,
 	}
 #endif
 
-	fdt_for_each_subnode(subnode, fdt, node) {
+	dev_for_each_subnode(subnode, dev) {
 		unsigned int index = 0, num_lanes = 0;
 		struct tegra_pcie_port *port;
 
-		err = tegra_pcie_parse_port_info(fdt, subnode, &index,
-						 &num_lanes);
+		err = tegra_pcie_parse_port_info(subnode, &index, &num_lanes);
 		if (err < 0) {
 			error("failed to obtain root port info");
 			continue;
@@ -544,7 +538,7 @@ static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id,
 
 		lanes |= num_lanes << (index << 3);
 
-		if (!fdtdec_get_is_enabled(fdt, subnode))
+		if (!ofnode_is_available(subnode))
 			continue;
 
 		port = malloc(sizeof(*port));
@@ -555,7 +549,7 @@ static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id,
 		port->num_lanes = num_lanes;
 		port->index = index;
 
-		err = tegra_pcie_port_parse_dt(fdt, subnode, port);
+		err = tegra_pcie_port_parse_dt(subnode, port);
 		if (err < 0) {
 			free(port);
 			continue;
@@ -565,7 +559,8 @@ static int tegra_pcie_parse_dt(const void *fdt, int node, enum tegra_pci_id id,
 		port->pcie = pcie;
 	}
 
-	err = tegra_pcie_get_xbar_config(fdt, node, lanes, id, &pcie->xbar);
+	err = tegra_pcie_get_xbar_config(dev_ofnode(dev), lanes, id,
+					 &pcie->xbar);
 	if (err < 0) {
 		error("invalid lane configuration");
 		return err;
@@ -815,7 +810,7 @@ static int tegra_pcie_setup_translations(struct udevice *bus)
 
 	/* BAR 0: type 1 extended configuration space */
 	fpci = 0xfe100000;
-	size = fdt_resource_size(&pcie->cs);
+	size = resource_size(&pcie->cs);
 	axi = pcie->cs.start;
 
 	afi_writel(pcie, axi, AFI_AXI_BAR0_START);
@@ -1099,7 +1094,7 @@ static int pci_tegra_ofdata_to_platdata(struct udevice *dev)
 
 	INIT_LIST_HEAD(&pcie->ports);
 
-	if (tegra_pcie_parse_dt(gd->fdt_blob, dev_of_offset(dev), id, pcie))
+	if (tegra_pcie_parse_dt(dev, id, pcie))
 		return -EINVAL;
 
 	return 0;
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 26/35] power: Add a regulator driver for the as3722 PMIC
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (24 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 25/35] dm: tegra: pci: " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 27/35] power: Add a GPIO " Simon Glass
                   ` (9 subsequent siblings)
  35 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This pmic includes regulators which should have their own driver. Add
a driver to support these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/power/regulator/Kconfig            |   9 ++
 drivers/power/regulator/Makefile           |   1 +
 drivers/power/regulator/as3722_regulator.c | 149 +++++++++++++++++++++++++++++
 include/power/as3722.h                     |   8 ++
 4 files changed, 167 insertions(+)
 create mode 100644 drivers/power/regulator/as3722_regulator.c

diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index f2134874c2..c82a936e8a 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -34,6 +34,15 @@ config REGULATOR_ACT8846
 	by the PMIC device. This driver is controlled by a device tree node
 	which includes voltage limits.
 
+config REGULATOR_AS3722
+	bool "Enable driver for AS7322 regulator"
+	depends on DM_REGULATOR && PMIC_AS3722
+	help
+	  Enable support for the regulator functions of the AS3722. The
+	  driver implements enable/disable for step-down bucks and LDOs,
+	  but does not yet support change voltages. Currently this must be
+	  done using direct register writes to the PMIC.
+
 config DM_REGULATOR_PFUZE100
 	bool "Enable Driver Model for REGULATOR PFUZE100"
 	depends on DM_REGULATOR && DM_PMIC_PFUZE100
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index ce14d08fd4..18fb870e43 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_$(SPL_)DM_REGULATOR) += regulator-uclass.o
 obj-$(CONFIG_REGULATOR_ACT8846) += act8846.o
+obj-$(CONFIG_REGULATOR_AS3722)	+= as3722_regulator.o
 obj-$(CONFIG_DM_REGULATOR_MAX77686) += max77686.o
 obj-$(CONFIG_DM_REGULATOR_PFUZE100) += pfuze100.o
 obj-$(CONFIG_REGULATOR_PWM) += pwm_regulator.o
diff --git a/drivers/power/regulator/as3722_regulator.c b/drivers/power/regulator/as3722_regulator.c
new file mode 100644
index 0000000000..0122e1e389
--- /dev/null
+++ b/drivers/power/regulator/as3722_regulator.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2017 Google, Inc
+ * Written by Simon Glass <sjg@chromium.org>
+ *
+ * Placeholder regulator driver for as3722.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <power/as3722.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+
+static int stepdown_get_value(struct udevice *dev)
+{
+	return -ENOSYS;
+}
+
+static int stepdown_set_value(struct udevice *dev, int uvolt)
+{
+	return -ENOSYS;
+}
+
+static int stepdown_set_enable(struct udevice *dev, bool enable)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	int sd = dev->driver_data;
+	int ret;
+
+	ret = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
+	if (ret < 0) {
+		debug("%s: failed to write SD control register: %d", __func__,
+		      ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static bool stepdown_get_enable(struct udevice *dev)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	int sd = dev->driver_data;
+	int ret;
+
+	ret = pmic_reg_read(pmic, AS3722_SD_CONTROL);
+	if (ret < 0) {
+		debug("%s: failed to read SD control register: %d", __func__,
+		      ret);
+		return false;
+	}
+
+	return ret & (1 << sd) ? true : false;
+}
+
+static int ldo_get_value(struct udevice *dev)
+{
+	return -ENOSYS;
+}
+
+static int ldo_set_value(struct udevice *dev, int uvolt)
+{
+	return -ENOSYS;
+}
+
+static int ldo_set_enable(struct udevice *dev, bool enable)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	int ldo = dev->driver_data;
+	int ret;
+
+	ret = pmic_clrsetbits(pmic, AS3722_LDO_CONTROL, 0, 1 << ldo);
+	if (ret < 0) {
+		debug("%s: failed to write LDO control register: %d", __func__,
+		      ret);
+		return ret;
+	}
+
+	return 0;
+}
+
+static bool ldo_get_enable(struct udevice *dev)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	int ldo = dev->driver_data;
+	int ret;
+
+	ret = pmic_reg_read(pmic, AS3722_LDO_CONTROL);
+	if (ret < 0) {
+		debug("%s: failed to read SD control register: %d", __func__,
+		      ret);
+		return false;
+	}
+
+	return ret & (1 << ldo) ? true : false;
+}
+
+static int as3722_stepdown_probe(struct udevice *dev)
+{
+	struct dm_regulator_uclass_platdata *uc_pdata;
+
+	uc_pdata = dev_get_uclass_platdata(dev);
+
+	uc_pdata->type = REGULATOR_TYPE_BUCK;
+
+	return 0;
+}
+
+static int as3722_ldo_probe(struct udevice *dev)
+{
+	struct dm_regulator_uclass_platdata *uc_pdata;
+
+	uc_pdata = dev_get_uclass_platdata(dev);
+
+	uc_pdata->type = REGULATOR_TYPE_LDO;
+
+	return 0;
+}
+
+static const struct dm_regulator_ops as3722_stepdown_ops = {
+	.get_value  = stepdown_get_value,
+	.set_value  = stepdown_set_value,
+	.get_enable = stepdown_get_enable,
+	.set_enable = stepdown_set_enable,
+};
+
+static const struct dm_regulator_ops as3722_ldo_ops = {
+	.get_value  = ldo_get_value,
+	.set_value  = ldo_set_value,
+	.get_enable = ldo_get_enable,
+	.set_enable = ldo_set_enable,
+};
+
+U_BOOT_DRIVER(as3722_stepdown) = {
+	.name = "as3722_stepdown",
+	.id = UCLASS_REGULATOR,
+	.ops = &as3722_stepdown_ops,
+	.probe = as3722_stepdown_probe,
+};
+
+U_BOOT_DRIVER(as3722_ldo) = {
+	.name = "as3722_ldo",
+	.id = UCLASS_REGULATOR,
+	.ops = &as3722_ldo_ops,
+	.probe = as3722_ldo_probe,
+};
diff --git a/include/power/as3722.h b/include/power/as3722.h
index 0f22482ff7..14afa0c81a 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -12,6 +12,14 @@
 #define AS3722_GPIO_OUTPUT_VDDH (1 << 0)
 #define AS3722_GPIO_INVERT (1 << 1)
 
+#define AS3722_DEVICE_ID 0x0c
+#define AS3722_SD_VOLTAGE(n) (0x00 + (n))
+#define AS3722_LDO_VOLTAGE(n) (0x10 + (n))
+#define AS3722_SD_CONTROL 0x4d
+#define AS3722_LDO_CONTROL 0x4e
+#define AS3722_ASIC_ID1 0x90
+#define AS3722_ASIC_ID2 0x91
+
 struct udevice;
 
 int as3722_init(struct udevice **devp);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 27/35] power: Add a GPIO driver for the as3722 PMIC
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (25 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 26/35] power: Add a regulator driver for the as3722 PMIC Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 28/35] dm: power: Convert as3722 to driver model Simon Glass
                   ` (8 subsequent siblings)
  35 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This pmic includes GPIOs which should have their own driver. Add
a driver to support these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/power/pmic/as3722_gpio.c | 120 +++++++++++++++++++++++++++++++++++++++
 include/power/as3722.h           |   5 ++
 2 files changed, 125 insertions(+)
 create mode 100644 drivers/power/pmic/as3722_gpio.c

diff --git a/drivers/power/pmic/as3722_gpio.c b/drivers/power/pmic/as3722_gpio.c
new file mode 100644
index 0000000000..d0b681ca4a
--- /dev/null
+++ b/drivers/power/pmic/as3722_gpio.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (C) 2014 NVIDIA Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <asm/gpio.h>
+#include <power/as3722.h>
+#include <power/pmic.h>
+
+#define NUM_GPIOS	8
+
+int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
+			  unsigned long flags)
+{
+	u8 value = 0;
+	int err;
+
+	if (flags & AS3722_GPIO_OUTPUT_VDDH)
+		value |= AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH;
+
+	if (flags & AS3722_GPIO_INVERT)
+		value |= AS3722_GPIO_CONTROL_INVERT;
+
+	err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
+	if (err) {
+		error("failed to configure GPIO#%u: %d", gpio, err);
+		return err;
+	}
+
+	return 0;
+}
+
+static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio,
+				 int level)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	const char *l;
+	u8 value;
+	int err;
+
+	if (gpio >= NUM_GPIOS)
+		return -EINVAL;
+
+	err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT);
+	if (err < 0) {
+		error("failed to read GPIO signal out register: %d", err);
+		return err;
+	}
+	value = err;
+
+	if (level == 0) {
+		value &= ~(1 << gpio);
+		l = "low";
+	} else {
+		value |= 1 << gpio;
+		l = "high";
+	}
+
+	err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value);
+	if (err) {
+		error("failed to set GPIO#%u %s: %d", gpio, l, err);
+		return err;
+	}
+
+	return 0;
+}
+
+int as3722_gpio_direction_output(struct udevice *dev, unsigned int gpio,
+				 int value)
+{
+	struct udevice *pmic = dev_get_parent(dev);
+	int err;
+
+	if (gpio > 7)
+		return -EINVAL;
+
+	if (value == 0)
+		value = AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL;
+	else
+		value = AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH;
+
+	err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
+	if (err) {
+		error("failed to configure GPIO#%u as output: %d", gpio, err);
+		return err;
+	}
+
+	err = as3722_gpio_set_value(pmic, gpio, value);
+	if (err < 0) {
+		error("failed to set GPIO#%u high: %d", gpio, err);
+		return err;
+	}
+
+	return 0;
+}
+
+static int as3722_gpio_probe(struct udevice *dev)
+{
+	struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+
+	uc_priv->gpio_count = NUM_GPIOS;
+	uc_priv->bank_name = "as3722_";
+
+	return 0;
+}
+
+static const struct dm_gpio_ops gpio_as3722_ops = {
+	.direction_output	= as3722_gpio_direction_output,
+	.set_value		= as3722_gpio_set_value,
+};
+
+U_BOOT_DRIVER(gpio_as3722) = {
+	.name	= "gpio_as3722",
+	.id	= UCLASS_GPIO,
+	.ops	= &gpio_as3722_ops,
+	.probe	= as3722_gpio_probe,
+};
diff --git a/include/power/as3722.h b/include/power/as3722.h
index 14afa0c81a..713e79840f 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -20,6 +20,11 @@
 #define AS3722_ASIC_ID1 0x90
 #define AS3722_ASIC_ID2 0x91
 
+#define AS3722_GPIO_CONTROL(n) (0x08 + (n))
+#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
+#define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL (7 << 0)
+#define AS3722_GPIO_CONTROL_INVERT (1 << 7)
+
 struct udevice;
 
 int as3722_init(struct udevice **devp);
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 28/35] dm: power: Convert as3722 to driver model
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (26 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 27/35] power: Add a GPIO " Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree Simon Glass
                   ` (7 subsequent siblings)
  35 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Convert this PMIC driver to driver model and fix up other users. The
regulator and GPIO functions are now handled by separate drivers.

Update nyan-big to work correct. Three boards will need to be updated by
the maintainers: apalis-tk1, jetson-tk1, cei-tk1-som

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/board2.c          |   6 -
 board/cei/cei-tk1-som/cei-tk1-som.c   |   2 +
 board/nvidia/jetson-tk1/jetson-tk1.c  |   2 +
 board/nvidia/nyan-big/nyan-big.c      |  22 +--
 board/toradex/apalis-tk1/apalis-tk1.c |   6 +
 configs/apalis-tk1_defconfig          |   3 +
 configs/cei-tk1-som_defconfig         |   3 +
 configs/jetson-tk1_defconfig          |   3 +
 configs/nyan-big_defconfig            |   1 +
 drivers/power/pmic/Makefile           |   2 +-
 drivers/power/pmic/as3722.c           | 292 ++++++++++++----------------------
 include/power/as3722.h                |  18 +--
 12 files changed, 133 insertions(+), 227 deletions(-)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index 85e19f3a9c..fb416fb94e 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -29,7 +29,6 @@
 #ifdef CONFIG_TEGRA_CLOCK_SCALING
 #include <asm/arch/emc.h>
 #endif
-#include <power/as3722.h>
 #include "emc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -142,11 +141,6 @@ int board_init(void)
 		debug("Memory controller init failed: %d\n", err);
 #  endif
 # endif /* CONFIG_TEGRA_PMU */
-#ifdef CONFIG_PMIC_AS3722
-	err = as3722_init(NULL);
-	if (err && err != -ENODEV)
-		return err;
-#endif
 #endif /* CONFIG_SYS_I2C_TEGRA */
 
 #ifdef CONFIG_USB_EHCI_TEGRA
diff --git a/board/cei/cei-tk1-som/cei-tk1-som.c b/board/cei/cei-tk1-som/cei-tk1-som.c
index 9ba7490c38..7c87bd1eb1 100644
--- a/board/cei/cei-tk1-som/cei-tk1-som.c
+++ b/board/cei/cei-tk1-som/cei-tk1-som.c
@@ -39,6 +39,7 @@ void pinmux_init(void)
 #ifdef CONFIG_PCI_TEGRA
 int tegra_pcie_board_init(void)
 {
+/* TODO: Convert to driver model
 	struct udevice *pmic;
 	int err;
 
@@ -59,6 +60,7 @@ int tegra_pcie_board_init(void)
 		error("failed to set SD4 voltage: %d\n", err);
 		return err;
 	}
+*/
 
 	return 0;
 }
diff --git a/board/nvidia/jetson-tk1/jetson-tk1.c b/board/nvidia/jetson-tk1/jetson-tk1.c
index a66b710cdd..48272d086c 100644
--- a/board/nvidia/jetson-tk1/jetson-tk1.c
+++ b/board/nvidia/jetson-tk1/jetson-tk1.c
@@ -39,6 +39,7 @@ void pinmux_init(void)
 #ifdef CONFIG_PCI_TEGRA
 int tegra_pcie_board_init(void)
 {
+/* TODO: Convert to driver model
 	struct udevice *pmic;
 	int err;
 
@@ -59,6 +60,7 @@ int tegra_pcie_board_init(void)
 		error("failed to set SD4 voltage: %d\n", err);
 		return err;
 	}
+*/
 
 	return 0;
 }
diff --git a/board/nvidia/nyan-big/nyan-big.c b/board/nvidia/nyan-big/nyan-big.c
index 8f68ae9fbe..54acf5418d 100644
--- a/board/nvidia/nyan-big/nyan-big.c
+++ b/board/nvidia/nyan-big/nyan-big.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <dm.h>
 #include <errno.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
@@ -46,20 +47,23 @@ int tegra_board_id(void)
 
 int tegra_lcd_pmic_init(int board_id)
 {
-	struct udevice *pmic;
+	struct udevice *dev;
 	int ret;
 
-	ret = as3722_get(&pmic);
-	if (ret)
-		return -ENOENT;
+	ret = uclass_get_device_by_driver(UCLASS_PMIC,
+					  DM_GET_DRIVER(pmic_as3722), &dev);
+	if (ret) {
+		debug("%s: Failed to find PMIC\n", __func__);
+		return ret;
+	}
 
 	if (board_id == 0)
-		as3722_write(pmic, 0x00, 0x3c);
+		pmic_reg_write(dev, 0x00, 0x3c);
 	else
-		as3722_write(pmic, 0x00, 0x50);
-	as3722_write(pmic, 0x12, 0x10);
-	as3722_write(pmic, 0x0c, 0x07);
-	as3722_write(pmic, 0x20, 0x10);
+		pmic_reg_write(dev, 0x00, 0x50);
+	pmic_reg_write(dev, 0x12, 0x10);
+	pmic_reg_write(dev, 0x0c, 0x07);
+	pmic_reg_write(dev, 0x20, 0x10);
 
 	return 0;
 }
diff --git a/board/toradex/apalis-tk1/apalis-tk1.c b/board/toradex/apalis-tk1/apalis-tk1.c
index c7e519c19b..5de61e7c2b 100644
--- a/board/toradex/apalis-tk1/apalis-tk1.c
+++ b/board/toradex/apalis-tk1/apalis-tk1.c
@@ -61,6 +61,7 @@ void pinmux_init(void)
 #ifdef CONFIG_PCI_TEGRA
 int tegra_pcie_board_init(void)
 {
+	/* TODO: Convert to driver model
 	struct udevice *pmic;
 	int err;
 
@@ -94,6 +95,7 @@ int tegra_pcie_board_init(void)
 		error("failed to set GPIO#2 high: %d\n", err);
 		return err;
 	}
+	*/
 
 	/* Reset I210 Gigabit Ethernet Controller */
 	gpio_request(LAN_RESET_N, "LAN_RESET_N");
@@ -110,6 +112,7 @@ int tegra_pcie_board_init(void)
 	gpio_direction_output(TEGRA_GPIO(O, 6), 0);
 
 	/* Make sure LDO9 and LDO10 are initially enabled @ 0V */
+	/* TODO: Convert to driver model
 	err = as3722_ldo_enable(pmic, 9);
 	if (err < 0) {
 		error("failed to enable LDO9: %d\n", err);
@@ -130,6 +133,7 @@ int tegra_pcie_board_init(void)
 		error("failed to set LDO10 voltage: %d\n", err);
 		return err;
 	}
+	*/
 
 	mdelay(100);
 
@@ -137,6 +141,7 @@ int tegra_pcie_board_init(void)
 	gpio_set_value(TEGRA_GPIO(O, 6), 1);
 
 	/* Enable LDO9 and LDO10 for +V3.3_ETH on patched prototypes */
+	/* TODO: Convert to driver model
 	err = as3722_ldo_set_voltage(pmic, 9, 0xff);
 	if (err < 0) {
 		error("failed to set LDO9 voltage: %d\n", err);
@@ -147,6 +152,7 @@ int tegra_pcie_board_init(void)
 		error("failed to set LDO10 voltage: %d\n", err);
 		return err;
 	}
+	*/
 
 	mdelay(100);
 	gpio_set_value(LAN_RESET_N, 1);
diff --git a/configs/apalis-tk1_defconfig b/configs/apalis-tk1_defconfig
index 9179aaf92f..ccff112392 100644
--- a/configs/apalis-tk1_defconfig
+++ b/configs/apalis-tk1_defconfig
@@ -32,7 +32,10 @@ CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_TEGRA=y
+CONFIG_DM_PMIC=y
 CONFIG_PMIC_AS3722=y
+CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AS3722=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_DM_USB=y
diff --git a/configs/cei-tk1-som_defconfig b/configs/cei-tk1-som_defconfig
index 1a5e47dba5..5623bbfbc6 100644
--- a/configs/cei-tk1-som_defconfig
+++ b/configs/cei-tk1-som_defconfig
@@ -36,7 +36,10 @@ CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_TEGRA=y
+CONFIG_DM_PMIC=y
 CONFIG_PMIC_AS3722=y
+CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AS3722=y
 CONFIG_SYS_NS16550=y
 CONFIG_TEGRA114_SPI=y
 CONFIG_USB=y
diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig
index 65a5832e44..d086951299 100644
--- a/configs/jetson-tk1_defconfig
+++ b/configs/jetson-tk1_defconfig
@@ -36,7 +36,10 @@ CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_TEGRA=y
+CONFIG_DM_PMIC=y
 CONFIG_PMIC_AS3722=y
+CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AS3722=y
 CONFIG_SYS_NS16550=y
 CONFIG_TEGRA114_SPI=y
 CONFIG_USB=y
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index cb3b0a85cf..8e11c2f15c 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -49,6 +49,7 @@ CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_PMIC=y
 CONFIG_PMIC_AS3722=y
 CONFIG_DM_REGULATOR=y
+CONFIG_REGULATOR_AS3722=y
 CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_PWM_TEGRA=y
 CONFIG_DEBUG_UART=y
diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
index f488799a92..f7bdfa5609 100644
--- a/drivers/power/pmic/Makefile
+++ b/drivers/power/pmic/Makefile
@@ -12,7 +12,7 @@ obj-$(CONFIG_DM_PMIC_PFUZE100) += pfuze100.o
 obj-$(CONFIG_PMIC_S2MPS11) += s2mps11.o
 obj-$(CONFIG_DM_PMIC_SANDBOX) += sandbox.o i2c_pmic_emul.o
 obj-$(CONFIG_PMIC_ACT8846) += act8846.o
-obj-$(CONFIG_PMIC_AS3722) += as3722.o
+obj-$(CONFIG_PMIC_AS3722) += as3722.o as3722_gpio.o
 obj-$(CONFIG_PMIC_MAX8997) += max8997.o
 obj-$(CONFIG_PMIC_PM8916) += pm8916.o
 obj-$(CONFIG_PMIC_RK8XX) += rk8xx.o
diff --git a/drivers/power/pmic/as3722.c b/drivers/power/pmic/as3722.c
index c09e1de06f..4efe8ee183 100644
--- a/drivers/power/pmic/as3722.c
+++ b/drivers/power/pmic/as3722.c
@@ -11,264 +11,168 @@
 #include <errno.h>
 #include <fdtdec.h>
 #include <i2c.h>
-
+#include <dm/lists.h>
 #include <power/as3722.h>
+#include <power/pmic.h>
 
-#define AS3722_SD_VOLTAGE(n) (0x00 + (n))
-#define AS3722_GPIO_CONTROL(n) (0x08 + (n))
-#define  AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
-#define  AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL (7 << 0)
-#define  AS3722_GPIO_CONTROL_INVERT (1 << 7)
-#define AS3722_LDO_VOLTAGE(n) (0x10 + (n))
-#define AS3722_GPIO_SIGNAL_OUT 0x20
-#define AS3722_SD_CONTROL 0x4d
-#define AS3722_LDO_CONTROL 0x4e
-#define AS3722_ASIC_ID1 0x90
-#define  AS3722_DEVICE_ID 0x0c
-#define AS3722_ASIC_ID2 0x91
-
-int as3722_read(struct udevice *pmic, u8 reg, u8 *value)
-{
-	int err;
-
-	err = dm_i2c_read(pmic, reg, value, 1);
-	if (err < 0)
-		return err;
-
-	return 0;
-}
+#define AS3722_NUM_OF_REGS	0x92
 
-int as3722_write(struct udevice *pmic, u8 reg, u8 value)
+static int as3722_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
 {
-	int err;
+	int ret;
 
-	err = dm_i2c_write(pmic, reg, &value, 1);
-	if (err < 0)
-		return err;
+	ret = dm_i2c_read(dev, reg, buff, len);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
 
-static int as3722_read_id(struct udevice *pmic, u8 *id, u8 *revision)
+static int as3722_write(struct udevice *dev, uint reg, const uint8_t *buff,
+			int len)
 {
-	int err;
+	int ret;
 
-	err = as3722_read(pmic, AS3722_ASIC_ID1, id);
-	if (err) {
-		error("failed to read ID1 register: %d", err);
-		return err;
-	}
-
-	err = as3722_read(pmic, AS3722_ASIC_ID2, revision);
-	if (err) {
-		error("failed to read ID2 register: %d", err);
-		return err;
-	}
+	ret = dm_i2c_write(dev, reg, buff, len);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
 
-int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
+static int as3722_read_id(struct udevice *dev, uint *idp, uint *revisionp)
 {
-	u8 value;
-	int err;
-
-	if (sd > 6)
-		return -EINVAL;
+	int ret;
 
-	err = as3722_read(pmic, AS3722_SD_CONTROL, &value);
-	if (err) {
-		error("failed to read SD control register: %d", err);
-		return err;
+	ret = pmic_reg_read(dev, AS3722_ASIC_ID1);
+	if (ret < 0) {
+		error("failed to read ID1 register: %d", ret);
+		return ret;
 	}
+	*idp = ret;
 
-	value |= 1 << sd;
-
-	err = as3722_write(pmic, AS3722_SD_CONTROL, value);
-	if (err < 0) {
-		error("failed to write SD control register: %d", err);
-		return err;
+	ret = pmic_reg_read(dev, AS3722_ASIC_ID2);
+	if (ret < 0) {
+		error("failed to read ID2 register: %d", ret);
+		return ret;
 	}
+	*revisionp = ret;
 
 	return 0;
 }
 
-int as3722_sd_set_voltage(struct udevice *pmic, unsigned int sd, u8 value)
+/* TODO(treding@nvidia.com): Add proper regulator support to avoid this */
+int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value)
 {
-	int err;
+	int ret;
 
 	if (sd > 6)
 		return -EINVAL;
 
-	err = as3722_write(pmic, AS3722_SD_VOLTAGE(sd), value);
-	if (err < 0) {
-		error("failed to write SD%u voltage register: %d", sd, err);
-		return err;
+	ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value);
+	if (ret < 0) {
+		error("failed to write SD%u voltage register: %d", sd, ret);
+		return ret;
 	}
 
 	return 0;
 }
 
-int as3722_ldo_enable(struct udevice *pmic, unsigned int ldo)
+int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value)
 {
-	u8 value;
-	int err;
+	int ret;
 
 	if (ldo > 11)
 		return -EINVAL;
 
-	err = as3722_read(pmic, AS3722_LDO_CONTROL, &value);
-	if (err) {
-		error("failed to read LDO control register: %d", err);
-		return err;
-	}
-
-	value |= 1 << ldo;
-
-	err = as3722_write(pmic, AS3722_LDO_CONTROL, value);
-	if (err < 0) {
-		error("failed to write LDO control register: %d", err);
-		return err;
-	}
-
-	return 0;
-}
-
-int as3722_ldo_set_voltage(struct udevice *pmic, unsigned int ldo, u8 value)
-{
-	int err;
-
-	if (ldo > 11)
-		return -EINVAL;
-
-	err = as3722_write(pmic, AS3722_LDO_VOLTAGE(ldo), value);
-	if (err < 0) {
+	ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value);
+	if (ret < 0) {
 		error("failed to write LDO%u voltage register: %d", ldo,
-		      err);
-		return err;
+		      ret);
+		return ret;
 	}
 
 	return 0;
 }
 
-int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
-			  unsigned long flags)
+static int as3722_probe(struct udevice *dev)
 {
-	u8 value = 0;
-	int err;
+	uint id, revision;
+	int ret;
 
-	if (flags & AS3722_GPIO_OUTPUT_VDDH)
-		value |= AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH;
-
-	if (flags & AS3722_GPIO_INVERT)
-		value |= AS3722_GPIO_CONTROL_INVERT;
-
-	err = as3722_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
-	if (err) {
-		error("failed to configure GPIO#%u: %d", gpio, err);
-		return err;
+	ret = as3722_read_id(dev, &id, &revision);
+	if (ret < 0) {
+		error("failed to read ID: %d", ret);
+		return ret;
 	}
 
-	return 0;
-}
-
-static int as3722_gpio_set(struct udevice *pmic, unsigned int gpio,
-			   unsigned int level)
-{
-	const char *l;
-	u8 value;
-	int err;
-
-	if (gpio > 7)
-		return -EINVAL;
-
-	err = as3722_read(pmic, AS3722_GPIO_SIGNAL_OUT, &value);
-	if (err < 0) {
-		error("failed to read GPIO signal out register: %d", err);
-		return err;
-	}
-
-	if (level == 0) {
-		value &= ~(1 << gpio);
-		l = "low";
-	} else {
-		value |= 1 << gpio;
-		l = "high";
+	if (id != AS3722_DEVICE_ID) {
+		error("unknown device");
+		return -ENOENT;
 	}
 
-	err = as3722_write(pmic, AS3722_GPIO_SIGNAL_OUT, value);
-	if (err) {
-		error("failed to set GPIO#%u %s: %d", gpio, l, err);
-		return err;
-	}
+	debug("AS3722 revision %#x found on I2C bus %s\n", revision, dev->name);
 
 	return 0;
 }
 
-int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio,
-				 unsigned int level)
-{
-	u8 value;
-	int err;
-
-	if (gpio > 7)
-		return -EINVAL;
+#if CONFIG_IS_ENABLED(PMIC_CHILDREN)
+static const struct pmic_child_info pmic_children_info[] = {
+	{ .prefix = "sd", .driver = "as3722_stepdown"},
+	{ .prefix = "ldo", .driver = "as3722_ldo"},
+	{ },
+};
 
-	if (level == 0)
-		value = AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL;
-	else
-		value = AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH;
+static int as3722_bind(struct udevice *dev)
+{
+	struct udevice *gpio_dev;
+	ofnode regulators_node;
+	int children;
+	int ret;
 
-	err = as3722_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
-	if (err) {
-		error("failed to configure GPIO#%u as output: %d", gpio, err);
-		return err;
+	regulators_node = dev_read_subnode(dev, "regulators");
+	if (!ofnode_valid(regulators_node)) {
+		debug("%s: %s regulators subnode not found\n", __func__,
+		      dev->name);
+		return -ENXIO;
 	}
 
-	err = as3722_gpio_set(pmic, gpio, level);
-	if (err < 0) {
-		error("failed to set GPIO#%u high: %d", gpio, err);
-		return err;
+	children = pmic_bind_children(dev, regulators_node, pmic_children_info);
+	if (!children)
+		debug("%s: %s - no child found\n", __func__, dev->name);
+	ret = device_bind_driver(dev, "gpio_as3722", "gpio_as3722", &gpio_dev);
+	if (ret) {
+		debug("%s: Cannot bind GPIOs (ret=%d)\n", __func__, ret);
+		return ret;
 	}
 
 	return 0;
 }
+#endif
 
-/* Temporary function until we get the pmic framework */
-int as3722_get(struct udevice **devp)
+static int as3722_reg_count(struct udevice *dev)
 {
-	int bus = 0;
-	int address = 0x40;
-
-	return i2c_get_chip_for_busnum(bus, address, 1, devp);
+	return AS3722_NUM_OF_REGS;
 }
 
-int as3722_init(struct udevice **devp)
-{
-	struct udevice *pmic;
-	u8 id, revision;
-	const unsigned int bus = 0;
-	const unsigned int address = 0x40;
-	int err;
-
-	err = i2c_get_chip_for_busnum(bus, address, 1, &pmic);
-	if (err)
-		return err;
-	err = as3722_read_id(pmic, &id, &revision);
-	if (err < 0) {
-		error("failed to read ID: %d", err);
-		return err;
-	}
-
-	if (id != AS3722_DEVICE_ID) {
-		error("unknown device");
-		return -ENOENT;
-	}
-
-	debug("AS3722 revision %#x found on I2C bus %u, address %#x\n",
-	      revision, bus, address);
-	if (devp)
-		*devp = pmic;
-
-	return 0;
-}
+static struct dm_pmic_ops as3722_ops = {
+	.reg_count = as3722_reg_count,
+	.read = as3722_read,
+	.write = as3722_write,
+};
+
+static const struct udevice_id as3722_ids[] = {
+	{ .compatible = "ams,as3722" },
+	{ }
+};
+
+U_BOOT_DRIVER(pmic_as3722) = {
+	.name = "as3722_pmic",
+	.id = UCLASS_PMIC,
+	.of_match = as3722_ids,
+#if CONFIG_IS_ENABLED(PMIC_CHILDREN)
+	.bind = as3722_bind,
+#endif
+	.probe = as3722_probe,
+	.ops = &as3722_ops,
+};
diff --git a/include/power/as3722.h b/include/power/as3722.h
index 713e79840f..491f1b7ea7 100644
--- a/include/power/as3722.h
+++ b/include/power/as3722.h
@@ -7,8 +7,6 @@
 #ifndef __POWER_AS3722_H__
 #define __POWER_AS3722_H__
 
-#include <asm/types.h>
-
 #define AS3722_GPIO_OUTPUT_VDDH (1 << 0)
 #define AS3722_GPIO_INVERT (1 << 1)
 
@@ -21,23 +19,9 @@
 #define AS3722_ASIC_ID2 0x91
 
 #define AS3722_GPIO_CONTROL(n) (0x08 + (n))
+#define AS3722_GPIO_SIGNAL_OUT 0x20
 #define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDH (1 << 0)
 #define AS3722_GPIO_CONTROL_MODE_OUTPUT_VDDL (7 << 0)
 #define AS3722_GPIO_CONTROL_INVERT (1 << 7)
 
-struct udevice;
-
-int as3722_init(struct udevice **devp);
-int as3722_sd_enable(struct udevice *pmic, unsigned int sd);
-int as3722_sd_set_voltage(struct udevice *pmic, unsigned int sd, u8 value);
-int as3722_ldo_enable(struct udevice *pmic, unsigned int ldo);
-int as3722_ldo_set_voltage(struct udevice *pmic, unsigned int ldo, u8 value);
-int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
-			  unsigned long flags);
-int as3722_gpio_direction_output(struct udevice *pmic, unsigned int gpio,
-				 unsigned int level);
-int as3722_read(struct udevice *pmic, u8 reg, u8 *value);
-int as3722_write(struct udevice *pmic, u8 reg, u8 value);
-int as3722_get(struct udevice **devp);
-
 #endif /* __POWER_AS3722_H__ */
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (27 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 28/35] dm: power: Convert as3722 to driver model Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code Simon Glass
                   ` (6 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/ns16550.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 52c52c1ad1..330c5e186a 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -8,7 +8,6 @@
 #include <clk.h>
 #include <dm.h>
 #include <errno.h>
-#include <fdtdec.h>
 #include <ns16550.h>
 #include <serial.h>
 #include <watchdog.h>
@@ -395,7 +394,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 	int err;
 
 	/* try Processor Local Bus device first */
-	addr = devfdt_get_addr(dev);
+	addr = dev_read_addr(dev);
 #if defined(CONFIG_PCI) && defined(CONFIG_DM_PCI)
 	if (addr == FDT_ADDR_T_NONE) {
 		/* then try pci device */
@@ -434,11 +433,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 	plat->base = (unsigned long)map_physmem(addr, 0, MAP_NOCACHE);
 #endif
 
-	plat->reg_offset = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-				     "reg-offset", 0);
-	plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					 "reg-shift", 0);
-
+	plat->reg_offset = dev_read_u32_default(dev, "reg-offset", 0);
+	plat->reg_shift = dev_read_u32_default(dev, "reg-shift", 0);
 	err = clk_get_by_index(dev, 0, &clk);
 	if (!err) {
 		err = clk_get_rate(&clk);
@@ -450,9 +446,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
 	}
 
 	if (!plat->clock)
-		plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-					     "clock-frequency",
-					     CONFIG_SYS_NS16550_CLK);
+		plat->clock = dev_read_u32_default(dev, "clock-frequency",
+						   CONFIG_SYS_NS16550_CLK);
 	if (!plat->clock) {
 		debug("ns16550 clock not defined\n");
 		return -EINVAL;
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (28 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support Simon Glass
                   ` (5 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This function is quite long. Move the core code into a separate function
in preparation for adding livetree support.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/serial-uclass.c | 84 ++++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 40 deletions(-)

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index a9c4f89e1a..ede5c2c0be 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -8,7 +8,6 @@
 #include <dm.h>
 #include <environment.h>
 #include <errno.h>
-#include <fdtdec.h>
 #include <os.h>
 #include <serial.h>
 #include <stdio_dev.h>
@@ -27,11 +26,53 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #error "Serial is required before relocation - define CONFIG_SYS_MALLOC_F_LEN to make this work"
 #endif
 
+static int serial_check_stdout(const void *blob, struct udevice **devp)
+{
+	int node;
+
+	/* Check for a chosen console */
+	node = fdtdec_get_chosen_node(blob, "stdout-path");
+	if (node < 0) {
+		const char *str, *p, *name;
+
+		/*
+		 * Deal with things like
+		 *	stdout-path = "serial0:115200n8";
+		 *
+		 * We need to look up the alias and then follow it to the
+		 * correct node.
+		 */
+		str = fdtdec_get_chosen_prop(blob, "stdout-path");
+		if (str) {
+			p = strchr(str, ':');
+			name = fdt_get_alias_namelen(blob, str,
+					p ? p - str : strlen(str));
+			if (name)
+				node = fdt_path_offset(blob, name);
+		}
+	}
+	if (node < 0)
+		node = fdt_path_offset(blob, "console");
+	if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, devp))
+		return 0;
+
+	/*
+	 * If the console is not marked to be bound before relocation, bind it
+	 * anyway.
+	 */
+	if (node > 0 && !lists_bind_fdt(gd->dm_root, offset_to_ofnode(node),
+					devp)) {
+		if (!device_probe(*devp))
+			return 0;
+	}
+
+	return -ENODEV;
+}
+
 static void serial_find_console_or_panic(void)
 {
 	const void *blob = gd->fdt_blob;
 	struct udevice *dev;
-	int node;
 
 	if (CONFIG_IS_ENABLED(OF_PLATDATA)) {
 		uclass_first_device(UCLASS_SERIAL, &dev);
@@ -40,47 +81,10 @@ static void serial_find_console_or_panic(void)
 			return;
 		}
 	} else if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) {
-		/* Check for a chosen console */
-		node = fdtdec_get_chosen_node(blob, "stdout-path");
-		if (node < 0) {
-			const char *str, *p, *name;
-
-			/*
-			 * Deal with things like
-			 *	stdout-path = "serial0:115200n8";
-			 *
-			 * We need to look up the alias and then follow it to
-			 * the correct node.
-			 */
-			str = fdtdec_get_chosen_prop(blob, "stdout-path");
-			if (str) {
-				p = strchr(str, ':');
-				name = fdt_get_alias_namelen(blob, str,
-						p ? p - str : strlen(str));
-				if (name)
-					node = fdt_path_offset(blob, name);
-			}
-		}
-		if (node < 0)
-			node = fdt_path_offset(blob, "console");
-		if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node,
-						    &dev)) {
+		if (!serial_check_stdout(blob, &dev)) {
 			gd->cur_serial_dev = dev;
 			return;
 		}
-
-		/*
-		 * If the console is not marked to be bound before relocation,
-		 * bind it anyway.
-		 */
-		if (node > 0 &&
-		    !lists_bind_fdt(gd->dm_root, offset_to_ofnode(node),
-				    &dev)) {
-			if (!device_probe(dev)) {
-				gd->cur_serial_dev = dev;
-				return;
-			}
-		}
 	}
 	if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
 		/*
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (29 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start Simon Glass
                   ` (4 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

Add support for a live device tree to the core serial uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/serial-uclass.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index ede5c2c0be..976b99ce7c 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -14,6 +14,7 @@
 #include <watchdog.h>
 #include <dm/lists.h>
 #include <dm/device-internal.h>
+#include <dm/of_access.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -81,9 +82,20 @@ static void serial_find_console_or_panic(void)
 			return;
 		}
 	} else if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) {
-		if (!serial_check_stdout(blob, &dev)) {
-			gd->cur_serial_dev = dev;
-			return;
+		/* Live tree has support for stdout */
+		if (of_live_active()) {
+			struct device_node *np = of_get_stdout();
+
+			if (np && !uclass_get_device_by_ofnode(UCLASS_SERIAL,
+					np_to_ofnode(np), &dev)) {
+				gd->cur_serial_dev = dev;
+				return;
+			}
+		} else {
+			if (!serial_check_stdout(blob, &dev)) {
+				gd->cur_serial_dev = dev;
+				return;
+			}
 		}
 	}
 	if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (30 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support Simon Glass
@ 2017-06-12 12:21 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values Simon Glass
                   ` (3 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:21 UTC (permalink / raw)
  To: u-boot

This error condition should have a debug() message. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/board2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
index fb416fb94e..bd137969f0 100644
--- a/arch/arm/mach-tegra/board2.c
+++ b/arch/arm/mach-tegra/board2.c
@@ -150,8 +150,10 @@ int board_init(void)
 #if defined(CONFIG_DM_VIDEO)
 	board_id = tegra_board_id();
 	err = tegra_lcd_pmic_init(board_id);
-	if (err)
+	if (err) {
+		debug("Failed to set up LCD PMIC\n");
 		return err;
+	}
 #endif
 
 #ifdef CONFIG_TEGRA_NAND
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (31 preceding siblings ...)
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start Simon Glass
@ 2017-06-12 12:22 ` Simon Glass
  2017-07-06 17:36   ` sjg at google.com
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 34/35] tegra: fdt: Ensure that the console UART is enabled Simon Glass
                   ` (2 subsequent siblings)
  35 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:22 UTC (permalink / raw)
  To: u-boot

These are not needed now since the drivers now use driver model. Drop
them.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 include/fdtdec.h | 6 ------
 lib/fdtdec.c     | 6 ------
 2 files changed, 12 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index eda2ffaf66..4a0947c626 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -119,12 +119,6 @@ enum fdt_compat_id {
 	COMPAT_NVIDIA_TEGRA20_EMC,	/* Tegra20 memory controller */
 	COMPAT_NVIDIA_TEGRA20_EMC_TABLE, /* Tegra20 memory timing table */
 	COMPAT_NVIDIA_TEGRA20_NAND,	/* Tegra2 NAND controller */
-	COMPAT_NVIDIA_TEGRA124_PMC,	/* Tegra 124 power mgmt controller */
-	COMPAT_NVIDIA_TEGRA186_SDMMC,	/* Tegra186 SDMMC controller */
-	COMPAT_NVIDIA_TEGRA210_SDMMC,	/* Tegra210 SDMMC controller */
-	COMPAT_NVIDIA_TEGRA124_SDMMC,	/* Tegra124 SDMMC controller */
-	COMPAT_NVIDIA_TEGRA30_SDMMC,	/* Tegra30 SDMMC controller */
-	COMPAT_NVIDIA_TEGRA20_SDMMC,	/* Tegra20 SDMMC controller */
 	COMPAT_NVIDIA_TEGRA124_XUSB_PADCTL,
 					/* Tegra124 XUSB pad controller */
 	COMPAT_NVIDIA_TEGRA210_XUSB_PADCTL,
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 91503b8cb9..9818f78c51 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -33,12 +33,6 @@ static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(NVIDIA_TEGRA20_EMC, "nvidia,tegra20-emc"),
 	COMPAT(NVIDIA_TEGRA20_EMC_TABLE, "nvidia,tegra20-emc-table"),
 	COMPAT(NVIDIA_TEGRA20_NAND, "nvidia,tegra20-nand"),
-	COMPAT(NVIDIA_TEGRA124_PMC, "nvidia,tegra124-pmc"),
-	COMPAT(NVIDIA_TEGRA186_SDMMC, "nvidia,tegra186-sdhci"),
-	COMPAT(NVIDIA_TEGRA210_SDMMC, "nvidia,tegra210-sdhci"),
-	COMPAT(NVIDIA_TEGRA124_SDMMC, "nvidia,tegra124-sdhci"),
-	COMPAT(NVIDIA_TEGRA30_SDMMC, "nvidia,tegra30-sdhci"),
-	COMPAT(NVIDIA_TEGRA20_SDMMC, "nvidia,tegra20-sdhci"),
 	COMPAT(NVIDIA_TEGRA124_XUSB_PADCTL, "nvidia,tegra124-xusb-padctl"),
 	COMPAT(NVIDIA_TEGRA210_XUSB_PADCTL, "nvidia,tegra210-xusb-padctl"),
 	COMPAT(SMSC_LAN9215, "smsc,lan9215"),
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 34/35] tegra: fdt: Ensure that the console UART is enabled
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (32 preceding siblings ...)
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values Simon Glass
@ 2017-06-12 12:22 ` Simon Glass
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 35/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
  2017-06-12 19:52 ` [U-Boot] [PATCH v3 00/35] " Stephen Warren
  35 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:22 UTC (permalink / raw)
  To: u-boot

Many tegra boards have the console UART node disabled. With livetree this
prevents serial from working since it does not 'force' the console to be
bound. Updates the affected boards to fix this error.

The boards were checked with:

for b in $(grep  tegra boards.cfg  |grep -v integrator | \
		awk '{print $7}' | sort); do
	echo $b;
	fdtgrep -c nvidia,tegra20-uart b/$b/u-boot.dtb |grep okay;
done

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2:
- Add new patch to ensure that the console UART is enabled

 arch/arm/dts/tegra114-dalmore.dts     | 4 ++++
 arch/arm/dts/tegra124-cei-tk1-som.dts | 4 ++++
 arch/arm/dts/tegra124-jetson-tk1.dts  | 4 ++++
 arch/arm/dts/tegra124-venice2.dts     | 4 ++++
 arch/arm/dts/tegra186-p2771-0000.dtsi | 4 ++++
 arch/arm/dts/tegra20-colibri.dts      | 4 ++++
 arch/arm/dts/tegra20-harmony.dts      | 4 ++++
 arch/arm/dts/tegra20-trimslice.dts    | 4 ++++
 arch/arm/dts/tegra20-whistler.dts     | 4 ++++
 arch/arm/dts/tegra210-e2220-1170.dts  | 4 ++++
 arch/arm/dts/tegra210-p2371-0000.dts  | 4 ++++
 arch/arm/dts/tegra210-p2371-2180.dts  | 4 ++++
 arch/arm/dts/tegra210-p2571.dts       | 4 ++++
 arch/arm/dts/tegra30-apalis.dts       | 4 ++++
 arch/arm/dts/tegra30-beaver.dts       | 4 ++++
 arch/arm/dts/tegra30-cardhu.dts       | 4 ++++
 arch/arm/dts/tegra30-colibri.dts      | 4 ++++
 arch/arm/dts/tegra30-tec-ng.dts       | 4 ++++
 18 files changed, 72 insertions(+)

diff --git a/arch/arm/dts/tegra114-dalmore.dts b/arch/arm/dts/tegra114-dalmore.dts
index 5f4df88f84..18bcb75faf 100644
--- a/arch/arm/dts/tegra114-dalmore.dts
+++ b/arch/arm/dts/tegra114-dalmore.dts
@@ -93,3 +93,7 @@
 		};
 	};
 };
+
+&uartd {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra124-cei-tk1-som.dts b/arch/arm/dts/tegra124-cei-tk1-som.dts
index c4d4f9d89f..b1dd4181ac 100644
--- a/arch/arm/dts/tegra124-cei-tk1-som.dts
+++ b/arch/arm/dts/tegra124-cei-tk1-som.dts
@@ -475,3 +475,7 @@
 		};
 	};
 };
+
+&uartd {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra124-jetson-tk1.dts b/arch/arm/dts/tegra124-jetson-tk1.dts
index f1db952355..d6420436cd 100644
--- a/arch/arm/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/dts/tegra124-jetson-tk1.dts
@@ -480,3 +480,7 @@
 		};
 	};
 };
+
+&uartd {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra124-venice2.dts b/arch/arm/dts/tegra124-venice2.dts
index add9244e68..7e9c6aa183 100644
--- a/arch/arm/dts/tegra124-venice2.dts
+++ b/arch/arm/dts/tegra124-venice2.dts
@@ -109,3 +109,7 @@
 	};
 
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra186-p2771-0000.dtsi b/arch/arm/dts/tegra186-p2771-0000.dtsi
index 54b2539ff4..a1319dc493 100644
--- a/arch/arm/dts/tegra186-p2771-0000.dtsi
+++ b/arch/arm/dts/tegra186-p2771-0000.dtsi
@@ -76,3 +76,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra20-colibri.dts b/arch/arm/dts/tegra20-colibri.dts
index 3c10dd6630..9171319d98 100644
--- a/arch/arm/dts/tegra20-colibri.dts
+++ b/arch/arm/dts/tegra20-colibri.dts
@@ -162,3 +162,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-harmony.dts
index dcbde7c2ed..0c907054db 100644
--- a/arch/arm/dts/tegra20-harmony.dts
+++ b/arch/arm/dts/tegra20-harmony.dts
@@ -812,3 +812,7 @@
 		clock-names = "pll_a", "pll_a_out0", "mclk";
 	};
 };
+
+&uartd {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra20-trimslice.dts b/arch/arm/dts/tegra20-trimslice.dts
index 7fb7dd0b58..31f509ab12 100644
--- a/arch/arm/dts/tegra20-trimslice.dts
+++ b/arch/arm/dts/tegra20-trimslice.dts
@@ -129,3 +129,7 @@
 	};
 
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra20-whistler.dts b/arch/arm/dts/tegra20-whistler.dts
index 447874674d..074d377ca1 100644
--- a/arch/arm/dts/tegra20-whistler.dts
+++ b/arch/arm/dts/tegra20-whistler.dts
@@ -75,3 +75,7 @@
 	};
 
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra210-e2220-1170.dts b/arch/arm/dts/tegra210-e2220-1170.dts
index 70cd72b561..e6b06862d8 100644
--- a/arch/arm/dts/tegra210-e2220-1170.dts
+++ b/arch/arm/dts/tegra210-e2220-1170.dts
@@ -57,3 +57,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra210-p2371-0000.dts b/arch/arm/dts/tegra210-p2371-0000.dts
index d9612962bd..539e7cef93 100644
--- a/arch/arm/dts/tegra210-p2371-0000.dts
+++ b/arch/arm/dts/tegra210-p2371-0000.dts
@@ -58,3 +58,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra210-p2371-2180.dts b/arch/arm/dts/tegra210-p2371-2180.dts
index 0dc06a4721..da4349bd03 100644
--- a/arch/arm/dts/tegra210-p2371-2180.dts
+++ b/arch/arm/dts/tegra210-p2371-2180.dts
@@ -109,3 +109,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra210-p2571.dts b/arch/arm/dts/tegra210-p2571.dts
index 2afcde5ca2..16370c596e 100644
--- a/arch/arm/dts/tegra210-p2571.dts
+++ b/arch/arm/dts/tegra210-p2571.dts
@@ -105,3 +105,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra30-apalis.dts b/arch/arm/dts/tegra30-apalis.dts
index 9e4ab8c26f..e739c595ab 100644
--- a/arch/arm/dts/tegra30-apalis.dts
+++ b/arch/arm/dts/tegra30-apalis.dts
@@ -332,3 +332,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra30-beaver.dts b/arch/arm/dts/tegra30-beaver.dts
index 4a32fcf44a..c1a15bb4b3 100644
--- a/arch/arm/dts/tegra30-beaver.dts
+++ b/arch/arm/dts/tegra30-beaver.dts
@@ -346,3 +346,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra30-cardhu.dts b/arch/arm/dts/tegra30-cardhu.dts
index 70fd916f1a..5b9798c5a8 100644
--- a/arch/arm/dts/tegra30-cardhu.dts
+++ b/arch/arm/dts/tegra30-cardhu.dts
@@ -451,3 +451,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra30-colibri.dts b/arch/arm/dts/tegra30-colibri.dts
index 3cff2f62e6..49ebe91fb2 100644
--- a/arch/arm/dts/tegra30-colibri.dts
+++ b/arch/arm/dts/tegra30-colibri.dts
@@ -106,3 +106,7 @@
 		};
 	};
 };
+
+&uarta {
+	status = "okay";
+};
diff --git a/arch/arm/dts/tegra30-tec-ng.dts b/arch/arm/dts/tegra30-tec-ng.dts
index e924acc35c..f2a49b8cbe 100644
--- a/arch/arm/dts/tegra30-tec-ng.dts
+++ b/arch/arm/dts/tegra30-tec-ng.dts
@@ -20,3 +20,7 @@
 		status = "okay";
 	};
 };
+
+&uartd {
+	status = "okay";
+};
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 35/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (33 preceding siblings ...)
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 34/35] tegra: fdt: Ensure that the console UART is enabled Simon Glass
@ 2017-06-12 12:22 ` Simon Glass
  2017-06-12 19:52 ` [U-Boot] [PATCH v3 00/35] " Stephen Warren
  35 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-06-12 12:22 UTC (permalink / raw)
  To: u-boot

Change these board to use a live device tree after relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Enable livetree for jetson-tk1 also

Changes in v2:
- Enable livetree for beaver also
- Add timing information

 configs/beaver_defconfig     | 1 +
 configs/jetson-tk1_defconfig | 1 +
 configs/nyan-big_defconfig   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/configs/beaver_defconfig b/configs/beaver_defconfig
index 71d6cd52c1..10fd50d925 100644
--- a/configs/beaver_defconfig
+++ b/configs/beaver_defconfig
@@ -25,6 +25,7 @@ CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_LIVE=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig
index d086951299..a533c6402f 100644
--- a/configs/jetson-tk1_defconfig
+++ b/configs/jetson-tk1_defconfig
@@ -25,6 +25,7 @@ CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_LIVE=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 8e11c2f15c..f62ebac04d 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -37,6 +37,7 @@ CONFIG_CMD_EXT4_WRITE=y
 # CONFIG_SPL_DOS_PARTITION is not set
 # CONFIG_SPL_ISO_PARTITION is not set
 # CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_LIVE=y
 CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
-- 
2.13.1.508.gb3defc5cc-goog

^ permalink raw reply related	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
                   ` (34 preceding siblings ...)
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 35/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
@ 2017-06-12 19:52 ` Stephen Warren
  2017-06-12 20:09   ` Simon Glass
  35 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-06-12 19:52 UTC (permalink / raw)
  To: u-boot

On 06/12/2017 06:21 AM, Simon Glass wrote:
> This moves three entire boards to use a live device tree as an example of
> the impact.

This series appears to cause problems on a couple of boards:

On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:

ERROR: tegra-pcie: failed to power on PHY: -110

at .../pci_tegra.c:774/tegra_pcie_enable_controller()
ERROR: tegra-pcie: failed to enable controller
at .../pci_tegra.c:1154/pci_tegra_probe()

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 19:52 ` [U-Boot] [PATCH v3 00/35] " Stephen Warren
@ 2017-06-12 20:09   ` Simon Glass
  2017-06-12 21:02     ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 20:09 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>
>> This moves three entire boards to use a live device tree as an example of
>> the impact.
>
>
> This series appears to cause problems on a couple of boards:
>
> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>
> ERROR: tegra-pcie: failed to power on PHY: -110
>
> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
> ERROR: tegra-pcie: failed to enable controller
> at .../pci_tegra.c:1154/pci_tegra_probe()

I seem to get this error always (before these patches) on TK1. I
thought it was because I corrupted my PMIC. Do it happen on vanilla
mainline for you?

I did get a TX1 but unfortunately I am temporarily misplaced it. Too
many boards :-(

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 20:09   ` Simon Glass
@ 2017-06-12 21:02     ` Stephen Warren
  2017-06-12 21:15       ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-06-12 21:02 UTC (permalink / raw)
  To: u-boot

On 06/12/2017 02:09 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>>
>>> This moves three entire boards to use a live device tree as an example of
>>> the impact.
>>
>>
>> This series appears to cause problems on a couple of boards:
>>
>> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>>
>> ERROR: tegra-pcie: failed to power on PHY: -110
>>
>> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
>> ERROR: tegra-pcie: failed to enable controller
>> at .../pci_tegra.c:1154/pci_tegra_probe()
> 
> I seem to get this error always (before these patches) on TK1. I
> thought it was because I corrupted my PMIC. Do it happen on vanilla
> mainline for you?

No, this error doesn't occur in mainline AFAIK; git hash 8cb3ce64f936 
from mainline ran through testing a couple of days ago without any issue.

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 21:02     ` Stephen Warren
@ 2017-06-12 21:15       ` Simon Glass
  2017-06-12 21:39         ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 21:15 UTC (permalink / raw)
  To: u-boot

[trimming the cc list a bit]

Hi Stephen,

On 12 June 2017 at 15:02, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 06/12/2017 02:09 PM, Simon Glass wrote:
>>
>> Hi Stephen,
>>
>> On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>>>
>>>>
>>>> This moves three entire boards to use a live device tree as an example
>>>> of
>>>> the impact.
>>>
>>>
>>>
>>> This series appears to cause problems on a couple of boards:
>>>
>>> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>>>
>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>
>>> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
>>> ERROR: tegra-pcie: failed to enable controller
>>> at .../pci_tegra.c:1154/pci_tegra_probe()
>>
>>
>> I seem to get this error always (before these patches) on TK1. I
>> thought it was because I corrupted my PMIC. Do it happen on vanilla
>> mainline for you?
>
>
> No, this error doesn't occur in mainline AFAIK; git hash 8cb3ce64f936 from
> mainline ran through testing a couple of days ago without any issue.

That does make me think my board is broken as mentioned. Here's what I
get with that commit which looks very similar to you:

U-Boot SPL 2017.07-rc1-00163-g8cb3ce6 (Jun 12 2017 - 15:12:24)
Trying to boot from RAM


U-Boot 2017.07-rc1-00163-g8cb3ce6 (Jun 12 2017 - 15:12:24 -0600)

TEGRA124
Model: NVIDIA Jetson TK1
Board: NVIDIA Jetson TK1
DRAM:  2 GiB
MMC:   sdhci at 700b0400: 1, sdhci at 700b0600: 0
** First descriptor is NOT a primary desc on 0:1 **
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Tegra124 (Jetson TK1) # boot
MMC: no card present
mmc_init: -123, time 0
tegra_mmc_send_cmd_bounced: MMC Timeout
    Interrupt status        0x00000001
    Interrupt status enable 0xffff003b
    Interrupt signal enable 0xffff0002
    Present status          0x01fb02f6
mmc_init: -1, time 8042
starting USB...
USB0:   USB EHCI 1.10
USB1:   USB EHCI 1.10
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

USB device 0: unknown device
ERROR: tegra-pcie: failed to power on PHY: -110

at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
ERROR: tegra-pcie: failed to enable controller
at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
No ethernet found.
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-tegra124
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
No ethernet found.
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
No ethernet found.
Config file not found
ERROR: tegra-pcie: failed to power on PHY: -110

at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
ERROR: tegra-pcie: failed to enable controller
at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
No ethernet found.
No ethernet found.
Tegra124 (Jetson TK1) #


Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 21:15       ` Simon Glass
@ 2017-06-12 21:39         ` Stephen Warren
  2017-06-12 23:15           ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-06-12 21:39 UTC (permalink / raw)
  To: u-boot

On 06/12/2017 03:15 PM, Simon Glass wrote:
> [trimming the cc list a bit]
> 
> Hi Stephen,
> 
> On 12 June 2017 at 15:02, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 06/12/2017 02:09 PM, Simon Glass wrote:
>>>
>>> Hi Stephen,
>>>
>>> On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>
>>>> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>>>>
>>>>>
>>>>> This moves three entire boards to use a live device tree as an example of
>>>>> the impact.
>>>>
>>>> This series appears to cause problems on a couple of boards:
>>>>
>>>> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>>>>
>>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>>
>>>> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
>>>> ERROR: tegra-pcie: failed to enable controller
>>>> at .../pci_tegra.c:1154/pci_tegra_probe()
>>>
>>> I seem to get this error always (before these patches) on TK1. I
>>> thought it was because I corrupted my PMIC. Do it happen on vanilla
>>> mainline for you?
>>
>> No, this error doesn't occur in mainline AFAIK; git hash 8cb3ce64f936 from
>> mainline ran through testing a couple of days ago without any issue.
> 
> That does make me think my board is broken as mentioned. Here's what I
> get with that commit which looks very similar to you:
> 

> U-Boot 2017.07-rc1-00163-g8cb3ce6 (Jun 12 2017 - 15:12:24 -0600)

OK, that's the same commit that ran OK on my test system.

> Tegra124 (Jetson TK1) # boot
> MMC: no card present
> mmc_init: -123, time 0
> tegra_mmc_send_cmd_bounced: MMC Timeout
>      Interrupt status        0x00000001
>      Interrupt status enable 0xffff003b
>      Interrupt signal enable 0xffff0002
>      Present status          0x01fb02f6
> mmc_init: -1, time 8042

I haven't seen that error occur in any commit/branch; perhaps something 
is wrong with your system.

...
> USB device 0: unknown device
> ERROR: tegra-pcie: failed to power on PHY: -110
> 
> at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
> ERROR: tegra-pcie: failed to enable controller
> at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()

That's the issue I saw in your branch though, even though your build is 
for an upstream commit.

...
> ERROR: tegra-pcie: failed to power on PHY: -110
> 
> at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
> ERROR: tegra-pcie: failed to enable controller
> at /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
> No ethernet found.
> No ethernet found.

Same there.

It seems coincidental that your broken board would give the exact same 
error message as my test system sees with your branch. I wonder if you 
have an incremental build issue; have you tried deleting all the build 
results and trying again?

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 21:39         ` Stephen Warren
@ 2017-06-12 23:15           ` Simon Glass
  2017-06-14 11:30             ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-12 23:15 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 12 June 2017 at 15:39, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 06/12/2017 03:15 PM, Simon Glass wrote:
>>
>> [trimming the cc list a bit]
>>
>> Hi Stephen,
>>
>> On 12 June 2017 at 15:02, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>> On 06/12/2017 02:09 PM, Simon Glass wrote:
>>>>
>>>>
>>>> Hi Stephen,
>>>>
>>>> On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>>
>>>>>
>>>>> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> This moves three entire boards to use a live device tree as an example
>>>>>> of
>>>>>> the impact.
>>>>>
>>>>>
>>>>> This series appears to cause problems on a couple of boards:
>>>>>
>>>>> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>>>>>
>>>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>>>
>>>>> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
>>>>> ERROR: tegra-pcie: failed to enable controller
>>>>> at .../pci_tegra.c:1154/pci_tegra_probe()
>>>>
>>>>
>>>> I seem to get this error always (before these patches) on TK1. I
>>>> thought it was because I corrupted my PMIC. Do it happen on vanilla
>>>> mainline for you?
>>>
>>>
>>> No, this error doesn't occur in mainline AFAIK; git hash 8cb3ce64f936
>>> from
>>> mainline ran through testing a couple of days ago without any issue.
>>
>>
>> That does make me think my board is broken as mentioned. Here's what I
>> get with that commit which looks very similar to you:
>>
>
>> U-Boot 2017.07-rc1-00163-g8cb3ce6 (Jun 12 2017 - 15:12:24 -0600)
>
>
> OK, that's the same commit that ran OK on my test system.
>
>> Tegra124 (Jetson TK1) # boot
>> MMC: no card present
>> mmc_init: -123, time 0
>> tegra_mmc_send_cmd_bounced: MMC Timeout
>>      Interrupt status        0x00000001
>>      Interrupt status enable 0xffff003b
>>      Interrupt signal enable 0xffff0002
>>      Present status          0x01fb02f6
>> mmc_init: -1, time 8042
>
>
> I haven't seen that error occur in any commit/branch; perhaps something is
> wrong with your system.

This is fixed by this patch:

http://patchwork.ozlabs.org/patch/772771/

I'm unsure how your board could work without that patch.

>
> ...
>>
>> USB device 0: unknown device
>> ERROR: tegra-pcie: failed to power on PHY: -110
>>
>> at
>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
>> ERROR: tegra-pcie: failed to enable controller
>> at
>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
>
>
> That's the issue I saw in your branch though, even though your build is for
> an upstream commit.
>
> ...
>>
>> ERROR: tegra-pcie: failed to power on PHY: -110
>>
>> at
>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
>> ERROR: tegra-pcie: failed to enable controller
>> at
>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
>> No ethernet found.
>> No ethernet found.
>
>
> Same there.
>
> It seems coincidental that your broken board would give the exact same error
> message as my test system sees with your branch. I wonder if you have an
> incremental build issue; have you tried deleting all the build results and
> trying again?

Yes, but same result. It works OK on beaver though. Can you try it on beaver?

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-12 23:15           ` Simon Glass
@ 2017-06-14 11:30             ` Simon Glass
  2017-06-14 16:32               ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-14 11:30 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 12 June 2017 at 17:15, Simon Glass <sjg@chromium.org> wrote:
> Hi Stephen,
>
> On 12 June 2017 at 15:39, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 06/12/2017 03:15 PM, Simon Glass wrote:
>>>
>>> [trimming the cc list a bit]
>>>
>>> Hi Stephen,
>>>
>>> On 12 June 2017 at 15:02, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>
>>>> On 06/12/2017 02:09 PM, Simon Glass wrote:
>>>>>
>>>>>
>>>>> Hi Stephen,
>>>>>
>>>>> On 12 June 2017 at 13:52, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>>>>
>>>>>>
>>>>>> On 06/12/2017 06:21 AM, Simon Glass wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This moves three entire boards to use a live device tree as an example
>>>>>>> of
>>>>>>> the impact.
>>>>>>
>>>>>>
>>>>>> This series appears to cause problems on a couple of boards:
>>>>>>
>>>>>> On both Jetson TK1 and Jetson TX1 (p2372-180), "pci enum" fails with:
>>>>>>
>>>>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>>>>
>>>>>> at .../pci_tegra.c:774/tegra_pcie_enable_controller()
>>>>>> ERROR: tegra-pcie: failed to enable controller
>>>>>> at .../pci_tegra.c:1154/pci_tegra_probe()
>>>>>
>>>>>
>>>>> I seem to get this error always (before these patches) on TK1. I
>>>>> thought it was because I corrupted my PMIC. Do it happen on vanilla
>>>>> mainline for you?
>>>>
>>>>
>>>> No, this error doesn't occur in mainline AFAIK; git hash 8cb3ce64f936
>>>> from
>>>> mainline ran through testing a couple of days ago without any issue.
>>>
>>>
>>> That does make me think my board is broken as mentioned. Here's what I
>>> get with that commit which looks very similar to you:
>>>
>>
>>> U-Boot 2017.07-rc1-00163-g8cb3ce6 (Jun 12 2017 - 15:12:24 -0600)
>>
>>
>> OK, that's the same commit that ran OK on my test system.
>>
>>> Tegra124 (Jetson TK1) # boot
>>> MMC: no card present
>>> mmc_init: -123, time 0
>>> tegra_mmc_send_cmd_bounced: MMC Timeout
>>>      Interrupt status        0x00000001
>>>      Interrupt status enable 0xffff003b
>>>      Interrupt signal enable 0xffff0002
>>>      Present status          0x01fb02f6
>>> mmc_init: -1, time 8042
>>
>>
>> I haven't seen that error occur in any commit/branch; perhaps something is
>> wrong with your system.
>
> This is fixed by this patch:
>
> http://patchwork.ozlabs.org/patch/772771/
>
> I'm unsure how your board could work without that patch.
>
>>
>> ...
>>>
>>> USB device 0: unknown device
>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>
>>> at
>>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
>>> ERROR: tegra-pcie: failed to enable controller
>>> at
>>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
>>
>>
>> That's the issue I saw in your branch though, even though your build is for
>> an upstream commit.
>>
>> ...
>>>
>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>>
>>> at
>>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:779/tegra_pcie_enable_controller()
>>> ERROR: tegra-pcie: failed to enable controller
>>> at
>>> /scratch/sglass/cosarm/src/third_party/u-boot/files/drivers/pci/pci_tegra.c:1159/pci_tegra_probe()
>>> No ethernet found.
>>> No ethernet found.
>>
>>
>> Same there.
>>
>> It seems coincidental that your broken board would give the exact same error
>> message as my test system sees with your branch. I wonder if you have an
>> incremental build issue; have you tried deleting all the build results and
>> trying again?
>
> Yes, but same result. It works OK on beaver though. Can you try it on beaver?
>
> Regards,
> Simon

At this point I'm thinking of applying the patches except for the one
that actually enables livetree. Once we figure out what is happening
with jetson-tk1, or you can confirm that it works on beaver, we can
look at the final patch.

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-14 11:30             ` Simon Glass
@ 2017-06-14 16:32               ` Stephen Warren
  2017-06-14 16:48                 ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-06-14 16:32 UTC (permalink / raw)
  To: u-boot

On 06/14/2017 05:30 AM, Simon Glass wrote:
...
> At this point I'm thinking of applying the patches except for the one
> that actually enables livetree. Once we figure out what is happening
> with jetson-tk1, or you can confirm that it works on beaver, we can
> look at the final patch.

Beaver PCIe works OK with or without this series. Note that while my 
automated test system contains a Beaver, it actually uses a USB Ethernet 
adapter for network tests rather than the built-in PCIe Ethernet, since 
the tests co-exist with another kernel testing system that only supports 
USB Ethernet on this board.

This series (I didn't check which patch) breaks PCIe on both p2371-2180 
(Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without this 
series on both these boards, and is tested by my automated system.

Note that I didn't see the boot-time MMC timeout errors (that were 
mentioned elsewhere) on any of these 3 boards with or without this 
series, with the baseline commit being 8cb3ce64f936 Merge 
git://git.denx.de/u-boot-dm.

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-14 16:32               ` Stephen Warren
@ 2017-06-14 16:48                 ` Stephen Warren
  2017-06-14 16:57                   ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-06-14 16:48 UTC (permalink / raw)
  To: u-boot

On 06/14/2017 10:32 AM, Stephen Warren wrote:
> On 06/14/2017 05:30 AM, Simon Glass wrote:
> ...
>> At this point I'm thinking of applying the patches except for the one
>> that actually enables livetree. Once we figure out what is happening
>> with jetson-tk1, or you can confirm that it works on beaver, we can
>> look at the final patch.
> 
> Beaver PCIe works OK with or without this series. Note that while my 
> automated test system contains a Beaver, it actually uses a USB Ethernet 
> adapter for network tests rather than the built-in PCIe Ethernet, since 
> the tests co-exist with another kernel testing system that only supports 
> USB Ethernet on this board.
> 
> This series (I didn't check which patch) breaks PCIe on both p2371-2180 
> (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without this 
> series on both these boards, and is tested by my automated system.
> 
> Note that I didn't see the boot-time MMC timeout errors (that were 
> mentioned elsewhere) on any of these 3 boards with or without this 
> series, with the baseline commit being 8cb3ce64f936 Merge 
> git://git.denx.de/u-boot-dm.

I should also mention that I'm not convinced that applying this series, 
even with the new feature only enabled on Beaver, is a good idea.

If we were confident that there was some purely logic bug that only 
affects Jetson TK1/TX1, then applying the series only for Beaver would 
be fine. However, we haven't root-caused the issue yet. If the problem 
is in fact some kind of memory corruption, stack overflow, or 
uninitialized data issue, then it's just a complete fluke that we happen 
not to see the issue on Beaver. If that's the case, then the issue could 
randomly appear on Beaver later due to unrelated code/data layout 
changes. I'd prefer to avoid that possibility. Let's root-cause the bug 
first and fix it, then apply the changes. Also, as I mentioned I don't 
test Beaver PCIe in my automated system, so any problems there run the 
risk of being undetected for longer.

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-14 16:48                 ` Stephen Warren
@ 2017-06-14 16:57                   ` Simon Glass
  2017-07-06 17:35                     ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-06-14 16:57 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 14 June 2017 at 10:48, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 06/14/2017 10:32 AM, Stephen Warren wrote:
>>
>> On 06/14/2017 05:30 AM, Simon Glass wrote:
>> ...
>>>
>>> At this point I'm thinking of applying the patches except for the one
>>> that actually enables livetree. Once we figure out what is happening
>>> with jetson-tk1, or you can confirm that it works on beaver, we can
>>> look at the final patch.
>>
>>
>> Beaver PCIe works OK with or without this series. Note that while my
>> automated test system contains a Beaver, it actually uses a USB Ethernet
>> adapter for network tests rather than the built-in PCIe Ethernet, since the
>> tests co-exist with another kernel testing system that only supports USB
>> Ethernet on this board.
>>
>> This series (I didn't check which patch) breaks PCIe on both p2371-2180
>> (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without this series on
>> both these boards, and is tested by my automated system.
>>
>> Note that I didn't see the boot-time MMC timeout errors (that were
>> mentioned elsewhere) on any of these 3 boards with or without this series,
>> with the baseline commit being 8cb3ce64f936 Merge
>> git://git.denx.de/u-boot-dm.
>
>
> I should also mention that I'm not convinced that applying this series, even
> with the new feature only enabled on Beaver, is a good idea.
>
> If we were confident that there was some purely logic bug that only affects
> Jetson TK1/TX1, then applying the series only for Beaver would be fine.
> However, we haven't root-caused the issue yet. If the problem is in fact
> some kind of memory corruption, stack overflow, or uninitialized data issue,
> then it's just a complete fluke that we happen not to see the issue on
> Beaver. If that's the case, then the issue could randomly appear on Beaver
> later due to unrelated code/data layout changes. I'd prefer to avoid that
> possibility. Let's root-cause the bug first and fix it, then apply the
> changes. Also, as I mentioned I don't test Beaver PCIe in my automated
> system, so any problems there run the risk of being undetected for longer.

Thanks for testing. I suspect the bisect would just point you to the
last patch which enables things.

Unfortunately my Jetson-TK1 does not work with PCI before or after
this series as I mentioned before. I have a TX1 somewhere but cannot
find it at present. Is there anyone there that can take a look at what
is different on Jetson-TK1? Or can I send my board somewhere to be
re-imaged (to fix the PMIC)?

Since you don't test beaver, one fallback would be apply it just for
nyan-big, as per my original series. The problem is likely in the
device-tree decoding for PCI, and without a working board I doubt it
is possible to resolve it.

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-06-14 16:57                   ` Simon Glass
@ 2017-07-06 17:35                     ` Simon Glass
  2017-07-11 15:33                       ` Marcel Ziswiler
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-07-06 17:35 UTC (permalink / raw)
  To: u-boot

Hi,

On 14 June 2017 at 10:57, Simon Glass <sjg@chromium.org> wrote:
> Hi Stephen,
>
> On 14 June 2017 at 10:48, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> On 06/14/2017 10:32 AM, Stephen Warren wrote:
>>>
>>> On 06/14/2017 05:30 AM, Simon Glass wrote:
>>> ...
>>>>
>>>> At this point I'm thinking of applying the patches except for the one
>>>> that actually enables livetree. Once we figure out what is happening
>>>> with jetson-tk1, or you can confirm that it works on beaver, we can
>>>> look at the final patch.
>>>
>>>
>>> Beaver PCIe works OK with or without this series. Note that while my
>>> automated test system contains a Beaver, it actually uses a USB Ethernet
>>> adapter for network tests rather than the built-in PCIe Ethernet, since the
>>> tests co-exist with another kernel testing system that only supports USB
>>> Ethernet on this board.
>>>
>>> This series (I didn't check which patch) breaks PCIe on both p2371-2180
>>> (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without this series on
>>> both these boards, and is tested by my automated system.
>>>
>>> Note that I didn't see the boot-time MMC timeout errors (that were
>>> mentioned elsewhere) on any of these 3 boards with or without this series,
>>> with the baseline commit being 8cb3ce64f936 Merge
>>> git://git.denx.de/u-boot-dm.
>>
>>
>> I should also mention that I'm not convinced that applying this series, even
>> with the new feature only enabled on Beaver, is a good idea.
>>
>> If we were confident that there was some purely logic bug that only affects
>> Jetson TK1/TX1, then applying the series only for Beaver would be fine.
>> However, we haven't root-caused the issue yet. If the problem is in fact
>> some kind of memory corruption, stack overflow, or uninitialized data issue,
>> then it's just a complete fluke that we happen not to see the issue on
>> Beaver. If that's the case, then the issue could randomly appear on Beaver
>> later due to unrelated code/data layout changes. I'd prefer to avoid that
>> possibility. Let's root-cause the bug first and fix it, then apply the
>> changes. Also, as I mentioned I don't test Beaver PCIe in my automated
>> system, so any problems there run the risk of being undetected for longer.
>
> Thanks for testing. I suspect the bisect would just point you to the
> last patch which enables things.
>
> Unfortunately my Jetson-TK1 does not work with PCI before or after
> this series as I mentioned before. I have a TX1 somewhere but cannot
> find it at present. Is there anyone there that can take a look at what
> is different on Jetson-TK1? Or can I send my board somewhere to be
> re-imaged (to fix the PMIC)?
>
> Since you don't test beaver, one fallback would be apply it just for
> nyan-big, as per my original series. The problem is likely in the
> device-tree decoding for PCI, and without a working board I doubt it
> is possible to resolve it.

This is still in my queue. I think the best option is just to leave
out the last patch. If someone is able to test with beaver (which
works for me) or I can get my TK1 going with PCI, or find my TX1, then
I can move forward with actually enabling it.

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values
  2017-06-12 12:22 ` [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

These are not needed now since the drivers now use driver model. Drop
them.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 include/fdtdec.h | 6 ------
 lib/fdtdec.c     | 6 ------
 2 files changed, 12 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Add support for a live device tree to the core serial uclass.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/serial-uclass.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

This error condition should have a debug() message. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/board2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

This function is quite long. Move the core code into a separate function
in preparation for adding livetree support.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/serial-uclass.c | 84 ++++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 40 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/serial/ns16550.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 25/35] dm: tegra: pci: " Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  2017-07-06 18:55     ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the tegra pci driver to support a live device tree. Fix the check
for nvidia,num-lanes so that an error will actually be detected.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to convert tegra PCI to device tree

Changes in v2: None

 drivers/pci/pci_tegra.c | 53 ++++++++++++++++++++++---------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: " Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the tegra mmc driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/mmc/tegra_mmc.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: " Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the tegra pwm driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/pwm/tegra_pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: " Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the tegra i2c driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/i2c/tegra_i2c.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 21/35] dm: tegra: spi: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 21/35] dm: tegra: spi: " Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the tegra114 spi driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/spi/tegra114_spi.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the Tegra EHCI driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/usb/host/ehci-tegra.c | 34 ++++++++++++++--------------------
 1 file changed, 14 insertions(+), 20 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update the GPIO driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/gpio/tegra_gpio.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

This property should be in the /chosen node, not /aliases.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/dts/tegra124-nyan-big.dts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update these drives to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/tegra124/display.c |  8 +++-----
 drivers/video/tegra124/dp.c      |  3 +--
 drivers/video/tegra124/sor.c     | 25 +++++++------------------
 3 files changed, 11 insertions(+), 25 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Adjust this code to support a live device tree. This should be implemented
as a PHY driver but that is left as an exercise for the maintainer.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Fix up the implementation which had node instead of subnode in one place

Changes in v2: None

 arch/arm/include/asm/arch-tegra/xusb-padctl.h |  2 +-
 arch/arm/mach-tegra/board2.c                  |  2 +-
 arch/arm/mach-tegra/tegra124/xusb-padctl.c    | 36 ++++++++++++---
 arch/arm/mach-tegra/tegra210/xusb-padctl.c    | 40 ++++++++++++-----
 arch/arm/mach-tegra/xusb-padctl-common.c      | 63 ++++++++++++++++-----------
 arch/arm/mach-tegra/xusb-padctl-common.h      | 11 ++---
 arch/arm/mach-tegra/xusb-padctl-dummy.c       |  2 +-
 7 files changed, 104 insertions(+), 52 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Adjust this to take a device as a parameter instead of a node.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/include/asm/arch-tegra/clock.h | 2 +-
 arch/arm/mach-tegra/clock.c             | 5 ++---
 drivers/spi/tegra114_spi.c              | 2 +-
 drivers/spi/tegra20_sflash.c            | 2 +-
 drivers/spi/tegra20_slink.c             | 2 +-
 drivers/spi/tegra210_qspi.c             | 2 +-
 drivers/usb/host/ehci-tegra.c           | 2 +-
 7 files changed, 8 insertions(+), 9 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

The PMC can be modelled as a syscon peripheral. Add a driver for this
so that it can be accessed by drivers when needed. Enable it for tegra124
boards.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Update commit message, enable for all tegra124 boards not just nyan-big

Changes in v2: None

 arch/arm/include/asm/arch-tegra/tegra.h |  5 +++++
 arch/arm/mach-tegra/Kconfig             |  2 ++
 arch/arm/mach-tegra/tegra124/Makefile   |  1 +
 arch/arm/mach-tegra/tegra124/pmc.c      | 19 +++++++++++++++++++
 4 files changed, 27 insertions(+)
 create mode 100644 arch/arm/mach-tegra/tegra124/pmc.c

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update these two files so include files in the right order.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/board2.c | 22 ++++++++--------------
 arch/arm/mach-tegra/clock.c  |  4 ++--
 2 files changed, 10 insertions(+), 16 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Enable the debug UART in SPL to allow early serial output even if the
standard UART does not work (e.g. due to driver model problem).

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-tegra/spl.c | 4 ++++
 1 file changed, 4 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Add some debugging to show when the backlight is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/simple_panel.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Update this driver to support a live device tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/pwm_backlight.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

We should sync the display (e.g. flush cache) when backspace is pressed
to ensure that the character is erased correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v3: None
Changes in v2: None

 drivers/video/vidconsole-uclass.c | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

The error handling code does not current detect an error right away.
Adjust it to return immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 lib/of_live.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Enable full bootstage support so we can time SPL and U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2:
- Add new patch to enable bootstage for nyan-big

 configs/nyan-big_defconfig | 5 +++++
 1 file changed, 5 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Enable this to allow debugging when the serial UART driver is
misconfigured.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 configs/nyan-big_defconfig | 4 ++++
 1 file changed, 4 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Calculate the time taken to set up the LCD.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 drivers/video/tegra124/display.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

This function allows a device's status to be read. This indicates whether
the device should be enabled or disabled.

Note: In normal operation disabled devices will not be present in the
driver-model tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add dev_read_enabled()

Changes in v2: None

 drivers/core/read.c | 11 +++++++++++
 include/dm/read.h   | 18 ++++++++++++++++++
 2 files changed, 29 insertions(+)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

The of_n_addr_cells() and of_n_size_cells() functions are useful for
getting the size of addresses in a node, but in a few places U-Boot needs
to obtain the actual property value for a node without walking up the
stack. Add functions for this and just the existing code to use it.

Add a comment the existing ofnode functions which do not do the right
thing with a flat tree.

This fixes a problem reading PCI addresses.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch with functions to obtain node's address/size cells

Changes in v2: None

 drivers/core/of_access.c | 24 +++++++++++++++++++++
 drivers/core/ofnode.c    | 18 +++++++++++++++-
 drivers/core/read.c      | 10 +++++++++
 drivers/core/regmap.c    |  4 ++--
 drivers/pci/pci-uclass.c |  6 +++---
 include/dm/of_access.h   | 20 +++++++++++++++++
 include/dm/ofnode.h      | 20 +++++++++++++++++
 include/dm/read.h        | 56 +++++++++++++++++++++++++++++++++++++++++++++++-
 8 files changed, 151 insertions(+), 7 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

Add a function which reads resources from a device, such as the device
hardware address. This uses the "reg" property in the device.

Unlike other functions there is little sense in inlining this when
livetree is not being used because it has some logic in it and this would
just bloat the code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add dev_read_resource()

Changes in v2: None

 drivers/core/Makefile     |  2 +-
 drivers/core/read_extra.c | 37 +++++++++++++++++++++++++++++++++++++
 include/dm/read.h         | 12 ++++++++++++
 3 files changed, 50 insertions(+), 1 deletion(-)
 create mode 100644 drivers/core/read_extra.c

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count()
  2017-06-12 12:21 ` [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count() Simon Glass
@ 2017-07-06 17:36   ` sjg at google.com
  0 siblings, 0 replies; 85+ messages in thread
From: sjg at google.com @ 2017-07-06 17:36 UTC (permalink / raw)
  To: u-boot

This provides a way to find the number of strings in a string list. Add it
and also fix up the comment for ofnode_read_string_index().

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3:
- Add new patch to add ofnode_read_string_count()

Changes in v2: None

 drivers/core/ofnode.c  | 10 ++++++++++
 include/dm/of_access.h | 18 ++++++++++++++++++
 include/dm/ofnode.h    | 12 +++++++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-07-06 17:36   ` sjg at google.com
@ 2017-07-06 18:55     ` Stephen Warren
  2017-07-07  3:57       ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Stephen Warren @ 2017-07-06 18:55 UTC (permalink / raw)
  To: u-boot

On 07/06/2017 11:36 AM, sjg at google.com wrote:
> Update the tegra pci driver to support a live device tree. Fix the check
> for nvidia,num-lanes so that an error will actually be detected.

Simon,

Something in the latest u-boot-dm/master branch breaks PCI or Ethernet 
on Jeton TK1 and TX1. I don't know which patch it is. test/py's ping 
test simply fails due to lack of any Ethernet adapter. I don't see any 
errors during either boot or the network test setup scripts, which 
include "pci enum":

TK1 (built-in RTL8169 PCI Ethernet):
Tegra124 (Jetson TK1) # ping $serverip
No ethernet found.
ping failed; host 192.168.100.1 is not alive
Tegra124 (Jetson TK1) #

TX1 (add-on RTL8169 PCI Ethernet):
Tegra210 (P2371-2180) # pci enum
ERROR: tegra-pcie: failed to power on PHY: -110
at 
/var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:774/tegra_pcie_enable_controller()
ERROR: tegra-pcie: failed to enable controller
at 
/var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:1154/pci_tegra_probe()
Tegra210 (P2371-2180) # setenv autoload no
Tegra210 (P2371-2180) # dhcp
No ethernet found.
Tegra210 (P2371-2180) #

I also retested u-boot/master to make sure there's no test system 
infrastructure issue (that branch passes), and re-ran the failing test 3 
times on TK1 with identical results. Other Tegra boards that I test all 
seem fine, at least as far as passing test/py.

P.S. I'll be away next week and the week after. Tom Warren may be able 
to monitor the test system emails, but I don't think I've set him up 
with access to e.g. retrigger tests etc.; perhaps I should look into that...

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-07-06 18:55     ` Stephen Warren
@ 2017-07-07  3:57       ` Simon Glass
  2017-07-07 15:50         ` Stephen Warren
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-07-07  3:57 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 6 July 2017 at 12:55, Stephen Warren <swarren@wwwdotorg.org> wrote:
>
> On 07/06/2017 11:36 AM, sjg at google.com wrote:
>>
>> Update the tegra pci driver to support a live device tree. Fix the check
>> for nvidia,num-lanes so that an error will actually be detected.
>
>
> Simon,
>
> Something in the latest u-boot-dm/master branch breaks PCI or Ethernet on Jeton TK1 and TX1. I don't know which patch it is. test/py's ping test simply fails due to lack of any Ethernet adapter. I don't see any errors during either boot or the network test setup scripts, which include "pci enum":
>
> TK1 (built-in RTL8169 PCI Ethernet):
> Tegra124 (Jetson TK1) # ping $serverip
> No ethernet found.
> ping failed; host 192.168.100.1 is not alive
> Tegra124 (Jetson TK1) #
>
> TX1 (add-on RTL8169 PCI Ethernet):
> Tegra210 (P2371-2180) # pci enum
> ERROR: tegra-pcie: failed to power on PHY: -110
> at /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:774/tegra_pcie_enable_controller()
> ERROR: tegra-pcie: failed to enable controller
> at /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:1154/pci_tegra_probe()
> Tegra210 (P2371-2180) # setenv autoload no
> Tegra210 (P2371-2180) # dhcp
> No ethernet found.
> Tegra210 (P2371-2180) #
>
> I also retested u-boot/master to make sure there's no test system infrastructure issue (that branch passes), and re-ran the failing test 3 times on TK1 with identical results. Other Tegra boards that I test all seem fine, at least as far as passing test/py.
>
> P.S. I'll be away next week and the week after. Tom Warren may be able to monitor the test system emails, but I don't think I've set him up with access to e.g. retrigger tests etc.; perhaps I should look into that...

As mentioned elsewhere that error (failing to power on PHY) happens
for me always on my TK1 (and has for about a year) because it seems to
have a broken PMIC. I do have a TX1 somewhere but cannot find it
despite much searching.

Obviously I chose Tegra for the livetree work based on Nyan which I
have and which is quick to develop on. I am beginning to regret this
because:

- No one at Nvidia appears to be maintaining the code at present -
e.g. DM enablement, Kconfig versions
- The test report you provides is a signal, but it is not actionable for me
- As above due to broken/lost boards I am not able to test as well as
I originally thought

Is there any way someone at Nvidia could jump into this and work on
bringing mainline up to scratch?

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-07-07  3:57       ` Simon Glass
@ 2017-07-07 15:50         ` Stephen Warren
  2017-07-07 16:03           ` Simon Glass
  2017-07-07 22:09           ` Peter Robinson
  0 siblings, 2 replies; 85+ messages in thread
From: Stephen Warren @ 2017-07-07 15:50 UTC (permalink / raw)
  To: u-boot

On 07/06/2017 09:57 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On 6 July 2017 at 12:55, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>
>> On 07/06/2017 11:36 AM, sjg at google.com wrote:
>>>
>>> Update the tegra pci driver to support a live device tree. Fix the check
>>> for nvidia,num-lanes so that an error will actually be detected.
>>
>>
>> Simon,
>>
>> Something in the latest u-boot-dm/master branch breaks PCI or Ethernet on Jeton TK1 and TX1. I don't know which patch it is. test/py's ping test simply fails due to lack of any Ethernet adapter. I don't see any errors during either boot or the network test setup scripts, which include "pci enum":
>>
>> TK1 (built-in RTL8169 PCI Ethernet):
>> Tegra124 (Jetson TK1) # ping $serverip
>> No ethernet found.
>> ping failed; host 192.168.100.1 is not alive
>> Tegra124 (Jetson TK1) #
>>
>> TX1 (add-on RTL8169 PCI Ethernet):
>> Tegra210 (P2371-2180) # pci enum
>> ERROR: tegra-pcie: failed to power on PHY: -110
>> at /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:774/tegra_pcie_enable_controller()
>> ERROR: tegra-pcie: failed to enable controller
>> at /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:1154/pci_tegra_probe()
>> Tegra210 (P2371-2180) # setenv autoload no
>> Tegra210 (P2371-2180) # dhcp
>> No ethernet found.
>> Tegra210 (P2371-2180) #
>>
>> I also retested u-boot/master to make sure there's no test system infrastructure issue (that branch passes), and re-ran the failing test 3 times on TK1 with identical results. Other Tegra boards that I test all seem fine, at least as far as passing test/py.
>>
>> P.S. I'll be away next week and the week after. Tom Warren may be able to monitor the test system emails, but I don't think I've set him up with access to e.g. retrigger tests etc.; perhaps I should look into that...
> 
> As mentioned elsewhere that error (failing to power on PHY) happens
> for me always on my TK1 (and has for about a year) because it seems to
> have a broken PMIC. I do have a TX1 somewhere but cannot find it
> despite much searching.

I'm very puzzled that you claim your TK1 always has this issue; this 
issue is clearly not present in mainline U-Boot (unless it's very 
intermittent and my test system has got lucky, but it's very 
reproducible so I don't think so), and I don't believe there's anything 
in the the PMIC that can be altered permanently; the boot configuration 
is in OTP (One Time Programmable) memory (fuses?) and can't be changed. 
Are you absolutely 100% sure that you cleanly replaced your development 
version of U-Boot correctly and tested with a 100% unmodified mainline 
U-Boot? Also, please try (a) flashing unmodified mainline U-Boot (b) 
disconnecting EVERY cable from the TK1 and leaving it that way for 10 
minutes to drain any capacitors (or perhaps even overnight) (c) powering 
up to see if any problems still exist.

> Obviously I chose Tegra for the livetree work based on Nyan which I
> have and which is quick to develop on. I am beginning to regret this
> because:
> 
> - No one at Nvidia appears to be maintaining the code at present -
> e.g. DM enablement, Kconfig versions

Well, the existing code works perfectly. There's no need to change it. 
If you want to change it, that's fine, but you must take on the job of 
validating your changes and fixing any issues they introduce. It's not 
reasonable to introduce changes that break things and then try and push 
forward with them even in the face of known breakage caused by those 
changes. It's not reasonable to create patches that introduce problems 
and then expect others to do the work of debugging and fixing them.

> - The test report you provides is a signal, but it is not actionable for me

Why is it not actionable? You possess hardware that will reproduce the 
change (your TX1 board even if not the TK1 system). The test system 
source is checked into the U-Boot source tree and available to you, 
although I believe that simply running "pci enum; dhcp Image" should 
reproduce the problem so it's even simpler than running test/py.

> - As above due to broken/lost boards I am not able to test as well as
> I originally thought

Perhaps you should only modify the boards you can test? You mentioned 
that Nyan works for you. If so, limit the modifications to the 
boards/drivers/features you have available.

> Is there any way someone at Nvidia could jump into this and work on
> bringing mainline up to scratch?

If anyone can, it'd be Tom Warren.

P.S. I'm on vacation for the next 2 weeks, so won't be able to respond 
further for a while.

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-07-07 15:50         ` Stephen Warren
@ 2017-07-07 16:03           ` Simon Glass
  2017-07-07 22:09           ` Peter Robinson
  1 sibling, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-07-07 16:03 UTC (permalink / raw)
  To: u-boot

Hi Stephen,

On 7 July 2017 at 09:50, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 07/06/2017 09:57 PM, Simon Glass wrote:
>>
>> Hi Stephen,
>>
>> On 6 July 2017 at 12:55, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>>
>>> On 07/06/2017 11:36 AM, sjg at google.com wrote:
>>>>
>>>>
>>>> Update the tegra pci driver to support a live device tree. Fix the check
>>>> for nvidia,num-lanes so that an error will actually be detected.
>>>
>>>
>>>
>>> Simon,
>>>
>>> Something in the latest u-boot-dm/master branch breaks PCI or Ethernet on
>>> Jeton TK1 and TX1. I don't know which patch it is. test/py's ping test
>>> simply fails due to lack of any Ethernet adapter. I don't see any errors
>>> during either boot or the network test setup scripts, which include "pci
>>> enum":
>>>
>>> TK1 (built-in RTL8169 PCI Ethernet):
>>> Tegra124 (Jetson TK1) # ping $serverip
>>> No ethernet found.
>>> ping failed; host 192.168.100.1 is not alive
>>> Tegra124 (Jetson TK1) #
>>>
>>> TX1 (add-on RTL8169 PCI Ethernet):
>>> Tegra210 (P2371-2180) # pci enum
>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>> at
>>> /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:774/tegra_pcie_enable_controller()
>>> ERROR: tegra-pcie: failed to enable controller
>>> at
>>> /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:1154/pci_tegra_probe()
>>> Tegra210 (P2371-2180) # setenv autoload no
>>> Tegra210 (P2371-2180) # dhcp
>>> No ethernet found.
>>> Tegra210 (P2371-2180) #
>>>
>>> I also retested u-boot/master to make sure there's no test system
>>> infrastructure issue (that branch passes), and re-ran the failing test 3
>>> times on TK1 with identical results. Other Tegra boards that I test all seem
>>> fine, at least as far as passing test/py.
>>>
>>> P.S. I'll be away next week and the week after. Tom Warren may be able to
>>> monitor the test system emails, but I don't think I've set him up with
>>> access to e.g. retrigger tests etc.; perhaps I should look into that...
>>
>>
>> As mentioned elsewhere that error (failing to power on PHY) happens
>> for me always on my TK1 (and has for about a year) because it seems to
>> have a broken PMIC. I do have a TX1 somewhere but cannot find it
>> despite much searching.
>
>
> I'm very puzzled that you claim your TK1 always has this issue; this issue
> is clearly not present in mainline U-Boot (unless it's very intermittent and
> my test system has got lucky, but it's very reproducible so I don't think
> so), and I don't believe there's anything in the the PMIC that can be
> altered permanently; the boot configuration is in OTP (One Time
> Programmable) memory (fuses?) and can't be changed. Are you absolutely 100%
> sure that you cleanly replaced your development version of U-Boot correctly
> and tested with a 100% unmodified mainline U-Boot? Also, please try (a)
> flashing unmodified mainline U-Boot (b) disconnecting EVERY cable from the
> TK1 and leaving it that way for 10 minutes to drain any capacitors (or
> perhaps even overnight) (c) powering up to see if any problems still exist.

I have tried to explain this quite a few times.

My TK1 has some sort of power problem. I think it is due to my
overwriting the PMIC registers with invalid values during some I2C
testing a while back.

I'll try what you suggest, although I do generally leave it powered
off between use.

>
>> Obviously I chose Tegra for the livetree work based on Nyan which I
>> have and which is quick to develop on. I am beginning to regret this
>> because:
>>
>> - No one at Nvidia appears to be maintaining the code at present -
>> e.g. DM enablement, Kconfig versions
>
>
> Well, the existing code works perfectly. There's no need to change it. If
> you want to change it, that's fine, but you must take on the job of
> validating your changes and fixing any issues they introduce. It's not
> reasonable to introduce changes that break things and then try and push
> forward with them even in the face of known breakage caused by those
> changes. It's not reasonable to create patches that introduce problems and
> then expect others to do the work of debugging and fixing them.

That's a different point. Please see the point I made above. Kconfig
conversion needs to be completed by the end of this year [1] and DM
conversion needs to be done at some point (no specific deadline).

>
>> - The test report you provides is a signal, but it is not actionable for
>> me
>
>
> Why is it not actionable? You possess hardware that will reproduce the
> change (your TX1 board even if not the TK1 system). The test system source
> is checked into the U-Boot source tree and available to you, although I
> believe that simply running "pci enum; dhcp Image" should reproduce the
> problem so it's even simpler than running test/py.

I have this morning found the TX1 board so hopefully can figure this out!

>
>> - As above due to broken/lost boards I am not able to test as well as
>> I originally thought
>
>
> Perhaps you should only modify the boards you can test? You mentioned that
> Nyan works for you. If so, limit the modifications to the
> boards/drivers/features you have available.

Yes that was my original series, but Nyan does not have PCI.

>
>> Is there any way someone at Nvidia could jump into this and work on
>> bringing mainline up to scratch?
>
>
> If anyone can, it'd be Tom Warren.
>
> P.S. I'm on vacation for the next 2 weeks, so won't be able to respond
> further for a while.

Have a nice break.

Regards,
Simon

[1] https://lists.denx.de/pipermail/u-boot/2017-January/277605.html

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 25/35] dm: tegra: pci: Convert to livetree
  2017-07-07 15:50         ` Stephen Warren
  2017-07-07 16:03           ` Simon Glass
@ 2017-07-07 22:09           ` Peter Robinson
  1 sibling, 0 replies; 85+ messages in thread
From: Peter Robinson @ 2017-07-07 22:09 UTC (permalink / raw)
  To: u-boot

On Fri, Jul 7, 2017 at 4:50 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 07/06/2017 09:57 PM, Simon Glass wrote:
>>
>> Hi Stephen,
>>
>> On 6 July 2017 at 12:55, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>>
>>>
>>> On 07/06/2017 11:36 AM, sjg at google.com wrote:
>>>>
>>>>
>>>> Update the tegra pci driver to support a live device tree. Fix the check
>>>> for nvidia,num-lanes so that an error will actually be detected.
>>>
>>>
>>>
>>> Simon,
>>>
>>> Something in the latest u-boot-dm/master branch breaks PCI or Ethernet on
>>> Jeton TK1 and TX1. I don't know which patch it is. test/py's ping test
>>> simply fails due to lack of any Ethernet adapter. I don't see any errors
>>> during either boot or the network test setup scripts, which include "pci
>>> enum":
>>>
>>> TK1 (built-in RTL8169 PCI Ethernet):
>>> Tegra124 (Jetson TK1) # ping $serverip
>>> No ethernet found.
>>> ping failed; host 192.168.100.1 is not alive
>>> Tegra124 (Jetson TK1) #
>>>
>>> TX1 (add-on RTL8169 PCI Ethernet):
>>> Tegra210 (P2371-2180) # pci enum
>>> ERROR: tegra-pcie: failed to power on PHY: -110
>>> at
>>> /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:774/tegra_pcie_enable_controller()
>>> ERROR: tegra-pcie: failed to enable controller
>>> at
>>> /var/lib/jenkins/workspace/u-boot-denx_uboot_dm-master-build/src/u-boot/drivers/pci/pci_tegra.c:1154/pci_tegra_probe()
>>> Tegra210 (P2371-2180) # setenv autoload no
>>> Tegra210 (P2371-2180) # dhcp
>>> No ethernet found.
>>> Tegra210 (P2371-2180) #
>>>
>>> I also retested u-boot/master to make sure there's no test system
>>> infrastructure issue (that branch passes), and re-ran the failing test 3
>>> times on TK1 with identical results. Other Tegra boards that I test all seem
>>> fine, at least as far as passing test/py.
>>>
>>> P.S. I'll be away next week and the week after. Tom Warren may be able to
>>> monitor the test system emails, but I don't think I've set him up with
>>> access to e.g. retrigger tests etc.; perhaps I should look into that...
>>
>>
>> As mentioned elsewhere that error (failing to power on PHY) happens
>> for me always on my TK1 (and has for about a year) because it seems to
>> have a broken PMIC. I do have a TX1 somewhere but cannot find it
>> despite much searching.
>
>
> I'm very puzzled that you claim your TK1 always has this issue; this issue
> is clearly not present in mainline U-Boot (unless it's very intermittent and
> my test system has got lucky, but it's very reproducible so I don't think
> so), and I don't believe there's anything in the the PMIC that can be
> altered permanently; the boot configuration is in OTP (One Time
> Programmable) memory (fuses?) and can't be changed. Are you absolutely 100%
> sure that you cleanly replaced your development version of U-Boot correctly
> and tested with a 100% unmodified mainline U-Boot? Also, please try (a)
> flashing unmodified mainline U-Boot (b) disconnecting EVERY cable from the
> TK1 and leaving it that way for 10 minutes to drain any capacitors (or
> perhaps even overnight) (c) powering up to see if any problems still exist.

I've never seen this on my device, but one of the Fedora QA devices
has similar issues with vanilla upstream u-boot, I wondered whether it
was a slightly different HW rev.

Peter

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-07-06 17:35                     ` Simon Glass
@ 2017-07-11 15:33                       ` Marcel Ziswiler
  2017-07-11 16:10                         ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Marcel Ziswiler @ 2017-07-11 15:33 UTC (permalink / raw)
  To: u-boot

On Thu, 2017-07-06 at 11:35 -0600, Simon Glass wrote:
> Hi,
> 
> On 14 June 2017 at 10:57, Simon Glass <sjg@chromium.org> wrote:
> > Hi Stephen,
> > 
> > On 14 June 2017 at 10:48, Stephen Warren <swarren@wwwdotorg.org>
> > wrote:
> > > On 06/14/2017 10:32 AM, Stephen Warren wrote:
> > > > 
> > > > On 06/14/2017 05:30 AM, Simon Glass wrote:
> > > > ...
> > > > > 
> > > > > At this point I'm thinking of applying the patches except for
> > > > > the one
> > > > > that actually enables livetree. Once we figure out what is
> > > > > happening
> > > > > with jetson-tk1, or you can confirm that it works on beaver,
> > > > > we can
> > > > > look at the final patch.
> > > > 
> > > > 
> > > > Beaver PCIe works OK with or without this series. Note that
> > > > while my
> > > > automated test system contains a Beaver, it actually uses a USB
> > > > Ethernet
> > > > adapter for network tests rather than the built-in PCIe
> > > > Ethernet, since the
> > > > tests co-exist with another kernel testing system that only
> > > > supports USB
> > > > Ethernet on this board.
> > > > 
> > > > This series (I didn't check which patch) breaks PCIe on both
> > > > p2371-2180
> > > > (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without
> > > > this series on
> > > > both these boards, and is tested by my automated system.
> > > > 
> > > > Note that I didn't see the boot-time MMC timeout errors (that
> > > > were
> > > > mentioned elsewhere) on any of these 3 boards with or without
> > > > this series,
> > > > with the baseline commit being 8cb3ce64f936 Merge
> > > > git://git.denx.de/u-boot-dm.
> > > 
> > > 
> > > I should also mention that I'm not convinced that applying this
> > > series, even
> > > with the new feature only enabled on Beaver, is a good idea.
> > > 
> > > If we were confident that there was some purely logic bug that
> > > only affects
> > > Jetson TK1/TX1, then applying the series only for Beaver would be
> > > fine.
> > > However, we haven't root-caused the issue yet. If the problem is
> > > in fact
> > > some kind of memory corruption, stack overflow, or uninitialized
> > > data issue,
> > > then it's just a complete fluke that we happen not to see the
> > > issue on
> > > Beaver. If that's the case, then the issue could randomly appear
> > > on Beaver
> > > later due to unrelated code/data layout changes. I'd prefer to
> > > avoid that
> > > possibility. Let's root-cause the bug first and fix it, then
> > > apply the
> > > changes. Also, as I mentioned I don't test Beaver PCIe in my
> > > automated
> > > system, so any problems there run the risk of being undetected
> > > for longer.
> > 
> > Thanks for testing. I suspect the bisect would just point you to
> > the
> > last patch which enables things.
> > 
> > Unfortunately my Jetson-TK1 does not work with PCI before or after
> > this series as I mentioned before. I have a TX1 somewhere but
> > cannot
> > find it at present. Is there anyone there that can take a look at
> > what
> > is different on Jetson-TK1? Or can I send my board somewhere to be
> > re-imaged (to fix the PMIC)?
> > 
> > Since you don't test beaver, one fallback would be apply it just
> > for
> > nyan-big, as per my original series. The problem is likely in the
> > device-tree decoding for PCI, and without a working board I doubt
> > it
> > is possible to resolve it.
> 
> This is still in my queue. I think the best option is just to leave
> out the last patch. If someone is able to test with beaver (which
> works for me) or I can get my TK1 going with PCI, or find my TX1,
> then
> I can move forward with actually enabling it.

The whole series

Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Beaver, Jetson-TK1

> Regards,
> Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-07-11 15:33                       ` Marcel Ziswiler
@ 2017-07-11 16:10                         ` Simon Glass
  2017-07-12  3:29                           ` Simon Glass
  0 siblings, 1 reply; 85+ messages in thread
From: Simon Glass @ 2017-07-11 16:10 UTC (permalink / raw)
  To: u-boot

Hi Marcel,

On 11 July 2017 at 09:33, Marcel Ziswiler <marcel.ziswiler@toradex.com> wrote:
>
> On Thu, 2017-07-06 at 11:35 -0600, Simon Glass wrote:
> > Hi,
> >
> > On 14 June 2017 at 10:57, Simon Glass <sjg@chromium.org> wrote:
> > > Hi Stephen,
> > >
> > > On 14 June 2017 at 10:48, Stephen Warren <swarren@wwwdotorg.org>
> > > wrote:
> > > > On 06/14/2017 10:32 AM, Stephen Warren wrote:
> > > > >
> > > > > On 06/14/2017 05:30 AM, Simon Glass wrote:
> > > > > ...
> > > > > >
> > > > > > At this point I'm thinking of applying the patches except for
> > > > > > the one
> > > > > > that actually enables livetree. Once we figure out what is
> > > > > > happening
> > > > > > with jetson-tk1, or you can confirm that it works on beaver,
> > > > > > we can
> > > > > > look at the final patch.
> > > > >
> > > > >
> > > > > Beaver PCIe works OK with or without this series. Note that
> > > > > while my
> > > > > automated test system contains a Beaver, it actually uses a USB
> > > > > Ethernet
> > > > > adapter for network tests rather than the built-in PCIe
> > > > > Ethernet, since the
> > > > > tests co-exist with another kernel testing system that only
> > > > > supports USB
> > > > > Ethernet on this board.
> > > > >
> > > > > This series (I didn't check which patch) breaks PCIe on both
> > > > > p2371-2180
> > > > > (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without
> > > > > this series on
> > > > > both these boards, and is tested by my automated system.
> > > > >
> > > > > Note that I didn't see the boot-time MMC timeout errors (that
> > > > > were
> > > > > mentioned elsewhere) on any of these 3 boards with or without
> > > > > this series,
> > > > > with the baseline commit being 8cb3ce64f936 Merge
> > > > > git://git.denx.de/u-boot-dm.
> > > >
> > > >
> > > > I should also mention that I'm not convinced that applying this
> > > > series, even
> > > > with the new feature only enabled on Beaver, is a good idea.
> > > >
> > > > If we were confident that there was some purely logic bug that
> > > > only affects
> > > > Jetson TK1/TX1, then applying the series only for Beaver would be
> > > > fine.
> > > > However, we haven't root-caused the issue yet. If the problem is
> > > > in fact
> > > > some kind of memory corruption, stack overflow, or uninitialized
> > > > data issue,
> > > > then it's just a complete fluke that we happen not to see the
> > > > issue on
> > > > Beaver. If that's the case, then the issue could randomly appear
> > > > on Beaver
> > > > later due to unrelated code/data layout changes. I'd prefer to
> > > > avoid that
> > > > possibility. Let's root-cause the bug first and fix it, then
> > > > apply the
> > > > changes. Also, as I mentioned I don't test Beaver PCIe in my
> > > > automated
> > > > system, so any problems there run the risk of being undetected
> > > > for longer.
> > >
> > > Thanks for testing. I suspect the bisect would just point you to
> > > the
> > > last patch which enables things.
> > >
> > > Unfortunately my Jetson-TK1 does not work with PCI before or after
> > > this series as I mentioned before. I have a TX1 somewhere but
> > > cannot
> > > find it at present. Is there anyone there that can take a look at
> > > what
> > > is different on Jetson-TK1? Or can I send my board somewhere to be
> > > re-imaged (to fix the PMIC)?
> > >
> > > Since you don't test beaver, one fallback would be apply it just
> > > for
> > > nyan-big, as per my original series. The problem is likely in the
> > > device-tree decoding for PCI, and without a working board I doubt
> > > it
> > > is possible to resolve it.
> >
> > This is still in my queue. I think the best option is just to leave
> > out the last patch. If someone is able to test with beaver (which
> > works for me) or I can get my TK1 going with PCI, or find my TX1,
> > then
> > I can move forward with actually enabling it.
>
> The whole series
>
> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Tested-on: Beaver, Jetson-TK1

Thanks for that. I am not sure what is going on with Jetson-TK1. For
now I am going to drop some most of the tegra-specific patches as
Stephen reports problems and my board appears to be faulty. I did
manage to get a TX1 running but it seems to need to reflash the whole
board just to try out U-Boot.

I'll send a pull request in the next day or so.

Regards,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

* [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree
  2017-07-11 16:10                         ` Simon Glass
@ 2017-07-12  3:29                           ` Simon Glass
  0 siblings, 0 replies; 85+ messages in thread
From: Simon Glass @ 2017-07-12  3:29 UTC (permalink / raw)
  To: u-boot

Hi Marcel,

On 11 July 2017 at 10:10, Simon Glass <sjg@chromium.org> wrote:
> Hi Marcel,
>
> On 11 July 2017 at 09:33, Marcel Ziswiler <marcel.ziswiler@toradex.com> wrote:
>>
>> On Thu, 2017-07-06 at 11:35 -0600, Simon Glass wrote:
>> > Hi,
>> >
>> > On 14 June 2017 at 10:57, Simon Glass <sjg@chromium.org> wrote:
>> > > Hi Stephen,
>> > >
>> > > On 14 June 2017 at 10:48, Stephen Warren <swarren@wwwdotorg.org>
>> > > wrote:
>> > > > On 06/14/2017 10:32 AM, Stephen Warren wrote:
>> > > > >
>> > > > > On 06/14/2017 05:30 AM, Simon Glass wrote:
>> > > > > ...
>> > > > > >
>> > > > > > At this point I'm thinking of applying the patches except for
>> > > > > > the one
>> > > > > > that actually enables livetree. Once we figure out what is
>> > > > > > happening
>> > > > > > with jetson-tk1, or you can confirm that it works on beaver,
>> > > > > > we can
>> > > > > > look at the final patch.
>> > > > >
>> > > > >
>> > > > > Beaver PCIe works OK with or without this series. Note that
>> > > > > while my
>> > > > > automated test system contains a Beaver, it actually uses a USB
>> > > > > Ethernet
>> > > > > adapter for network tests rather than the built-in PCIe
>> > > > > Ethernet, since the
>> > > > > tests co-exist with another kernel testing system that only
>> > > > > supports USB
>> > > > > Ethernet on this board.
>> > > > >
>> > > > > This series (I didn't check which patch) breaks PCIe on both
>> > > > > p2371-2180
>> > > > > (Jetson TX1) and Jetson TK1. PCIe Ethernet works fine without
>> > > > > this series on
>> > > > > both these boards, and is tested by my automated system.
>> > > > >
>> > > > > Note that I didn't see the boot-time MMC timeout errors (that
>> > > > > were
>> > > > > mentioned elsewhere) on any of these 3 boards with or without
>> > > > > this series,
>> > > > > with the baseline commit being 8cb3ce64f936 Merge
>> > > > > git://git.denx.de/u-boot-dm.
>> > > >
>> > > >
>> > > > I should also mention that I'm not convinced that applying this
>> > > > series, even
>> > > > with the new feature only enabled on Beaver, is a good idea.
>> > > >
>> > > > If we were confident that there was some purely logic bug that
>> > > > only affects
>> > > > Jetson TK1/TX1, then applying the series only for Beaver would be
>> > > > fine.
>> > > > However, we haven't root-caused the issue yet. If the problem is
>> > > > in fact
>> > > > some kind of memory corruption, stack overflow, or uninitialized
>> > > > data issue,
>> > > > then it's just a complete fluke that we happen not to see the
>> > > > issue on
>> > > > Beaver. If that's the case, then the issue could randomly appear
>> > > > on Beaver
>> > > > later due to unrelated code/data layout changes. I'd prefer to
>> > > > avoid that
>> > > > possibility. Let's root-cause the bug first and fix it, then
>> > > > apply the
>> > > > changes. Also, as I mentioned I don't test Beaver PCIe in my
>> > > > automated
>> > > > system, so any problems there run the risk of being undetected
>> > > > for longer.
>> > >
>> > > Thanks for testing. I suspect the bisect would just point you to
>> > > the
>> > > last patch which enables things.
>> > >
>> > > Unfortunately my Jetson-TK1 does not work with PCI before or after
>> > > this series as I mentioned before. I have a TX1 somewhere but
>> > > cannot
>> > > find it at present. Is there anyone there that can take a look at
>> > > what
>> > > is different on Jetson-TK1? Or can I send my board somewhere to be
>> > > re-imaged (to fix the PMIC)?
>> > >
>> > > Since you don't test beaver, one fallback would be apply it just
>> > > for
>> > > nyan-big, as per my original series. The problem is likely in the
>> > > device-tree decoding for PCI, and without a working board I doubt
>> > > it
>> > > is possible to resolve it.
>> >
>> > This is still in my queue. I think the best option is just to leave
>> > out the last patch. If someone is able to test with beaver (which
>> > works for me) or I can get my TK1 going with PCI, or find my TX1,
>> > then
>> > I can move forward with actually enabling it.
>>
>> The whole series
>>
>> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
>> Tested-on: Beaver, Jetson-TK1
>
> Thanks for that. I am not sure what is going on with Jetson-TK1. For
> now I am going to drop some most of the tegra-specific patches as
> Stephen reports problems and my board appears to be faulty. I did
> manage to get a TX1 running but it seems to need to reflash the whole
> board just to try out U-Boot.
>
> I'll send a pull request in the next day or so.

I've now rebased the remaining patches against master (since the pull
request has been applied).

After much wailing and gnashing of teeth I managed to repeat the
problem on my TX1 and found two things:

- The USB setup was incorrect and seemed to mess up the pad init
- The I2C peripheral register address was not being read correctly

I've fixed these two things and pushed to u-boot-dm/livet-working if
you have time to test. I've tried it on beaver but my Jetson-TK1 is
still broken.

The key thing to test is that 'pci enum' works without errors and
makes the network available (e.g. 'bootp' works).

I'll send patches soon.

Thanks,
Simon

^ permalink raw reply	[flat|nested] 85+ messages in thread

end of thread, other threads:[~2017-07-12  3:29 UTC | newest]

Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-12 12:21 [U-Boot] [PATCH v3 00/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
2017-06-12 12:21 ` [U-Boot] [PATCH v3 01/35] dm: core: Add ofnode_read_string_count() Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 02/35] dm: core: Add dev_read_resource() to read device resources Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 03/35] dm: core: Add dev_read_enabled() to check if a device is enabled Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 04/35] dm: core: Add functions to obtain node's address/size cells Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 05/35] tegra: video: Time the LCD init Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 06/35] tegra: nyan-big: Enable the debug UART Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 07/35] dm: Fix error handling when unflattening the DT Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 08/35] tegra: nyan-big: Enable bootstage Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 09/35] dm: video: Sync display on backspace Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 10/35] dm: video: Update pwm_backlight to support livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 11/35] video: simple-panel: Add a little more debugging Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 12/35] tegra: Fix up include file ordering Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 13/35] tegra: spl: Enable debug UART Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 14/35] tegra: tegra124: Add a PMC syscon driver Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 15/35] dm: tegra: Convert USB setup to livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 16/35] dm: tegra: Convert clock_decode_periph_id() to support livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 17/35] dm: video: tegra124: Convert to livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 18/35] tegra: dts: Move stdout-path to /chosen Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 19/35] dm: tegra: gpio: Convert to support livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 20/35] dm: tegra: usb: Convert to livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 21/35] dm: tegra: spi: " Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 22/35] dm: tegra: i2c: " Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 23/35] dm: tegra: pwm: " Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 24/35] dm: tegra: mmc: " Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 25/35] dm: tegra: pci: " Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-07-06 18:55     ` Stephen Warren
2017-07-07  3:57       ` Simon Glass
2017-07-07 15:50         ` Stephen Warren
2017-07-07 16:03           ` Simon Glass
2017-07-07 22:09           ` Peter Robinson
2017-06-12 12:21 ` [U-Boot] [PATCH v3 26/35] power: Add a regulator driver for the as3722 PMIC Simon Glass
2017-06-12 12:21 ` [U-Boot] [PATCH v3 27/35] power: Add a GPIO " Simon Glass
2017-06-12 12:21 ` [U-Boot] [PATCH v3 28/35] dm: power: Convert as3722 to driver model Simon Glass
2017-06-12 12:21 ` [U-Boot] [PATCH v3 29/35] dm: serial: ns16550: Convert to livetree Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 30/35] dm: serial: Separate out the core serial-device finding code Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 31/35] dm: serial: Add livetree support Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:21 ` [U-Boot] [PATCH v3 32/35] tegra: Show a debug message if the LCD PMIC fails to start Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:22 ` [U-Boot] [PATCH v3 33/35] fdtdec: Drop old compatible values Simon Glass
2017-07-06 17:36   ` sjg at google.com
2017-06-12 12:22 ` [U-Boot] [PATCH v3 34/35] tegra: fdt: Ensure that the console UART is enabled Simon Glass
2017-06-12 12:22 ` [U-Boot] [PATCH v3 35/35] dm: tegra: Move nyan-big, jetson-tk1, beaver to livetree Simon Glass
2017-06-12 19:52 ` [U-Boot] [PATCH v3 00/35] " Stephen Warren
2017-06-12 20:09   ` Simon Glass
2017-06-12 21:02     ` Stephen Warren
2017-06-12 21:15       ` Simon Glass
2017-06-12 21:39         ` Stephen Warren
2017-06-12 23:15           ` Simon Glass
2017-06-14 11:30             ` Simon Glass
2017-06-14 16:32               ` Stephen Warren
2017-06-14 16:48                 ` Stephen Warren
2017-06-14 16:57                   ` Simon Glass
2017-07-06 17:35                     ` Simon Glass
2017-07-11 15:33                       ` Marcel Ziswiler
2017-07-11 16:10                         ` Simon Glass
2017-07-12  3:29                           ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.