Skip to contentSkip to conversation

dm: arm: zynq: Convert serial driver to driver model

PATCH Superseded Simon Glass 2 participants 18 messages Oct 18, 2015 – Oct 30, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover dm: arm: zynq: Convert serial driver to driver model

This series updates the Zynq serial driver to use driver model. Along the way several problems are fixed:

- Support for /chosen/stdout-path using an alias
- Fix to fdtgrep which is currently breaking alias building
- Avoid building u-boot-spl-dtb.bin when it is not requested
- Deal with boards which have BSS in SDRAM

For zynq this series makes a few changes:
- Use the new SPL init procedure, which just involves a few tweaks for zynq
- Add debug UART support
- Move to using a separate device tree instead of embedded

Only zybo has been tested. Testing on other zynq boards is welcome. They are all set up roughly the same so I expect only minor problems.

This serial includes Michal's zynqmp device tree patch.

Changes in v2:
- Extend list of compatible strings with cadence compatible string.

Michal Simek (1):
ARM: zynqmp: Enable DM and OF binding

Simon Glass (13):
fdt: Add a function to look up a /chosen property
fdt: Correct handling of alias regions
fdtgrep: Simplify the alias generation code
dm: serial: Deal with stdout-path with an alias
dm: spl: Generate u-boot-spl-dtb.bin only when enabled
dm: spl: Support device tree when BSS is in a different section
arm: zynq: Use separate device tree instead of embedded
arm: zynq: Drop unnecessary code in SPL board_init_f()
arm: zynq: Support the debug UART
dm: arm: zynq: Enable device tree control in SPL
arm: zynq: dts: Add U-Boot device tree additions
arm: zynq: serial: Drop non-device-tree serial driver portions
arm: zynq: Move serial driver to driver model

 Kconfig                            |  10 +
 arch/arm/Kconfig                   |   7 +
 arch/arm/dts/Makefile              |   2 +-
 arch/arm/dts/zynq-7000.dtsi        |   1 +
 arch/arm/dts/zynq-microzed.dts     |   5 +
 arch/arm/dts/zynq-picozed.dts      |   5 +
 arch/arm/dts/zynq-zc702.dts        |   1 +
 arch/arm/dts/zynq-zc706.dts        |   1 +
 arch/arm/dts/zynq-zc770-xm010.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm011.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm012.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm013.dts  |   1 +
 arch/arm/dts/zynq-zed.dts          |   1 +
 arch/arm/dts/zynq-zybo.dts         |   1 +
 arch/arm/dts/zynqmp-ep108.dts      | 164 ++++++++++++++++
 arch/arm/dts/zynqmp.dtsi           | 385 +++++++++++++++++++++++++++++++++++++
 arch/arm/mach-zynq/spl.c           |  12 +-
 arch/arm/mach-zynq/u-boot-spl.lds  |  10 +-
 configs/xilinx_zynqmp_ep_defconfig |   3 +-
 configs/zynq_microzed_defconfig    |   2 +-
 configs/zynq_picozed_defconfig     |   2 +-
 configs/zynq_zc702_defconfig       |   2 +-
 configs/zynq_zc706_defconfig       |   2 +-
 configs/zynq_zc70x_defconfig       |   2 +-
 configs/zynq_zc770_xm010_defconfig |   2 +-
 configs/zynq_zc770_xm011_defconfig |   2 +-
 configs/zynq_zc770_xm012_defconfig |   2 +-
 configs/zynq_zc770_xm013_defconfig |   2 +-
 configs/zynq_zed_defconfig         |   2 +-
 configs/zynq_zybo_defconfig        |   6 +-
 drivers/serial/Kconfig             |   7 +
 drivers/serial/serial-uclass.c     |  30 ++-
 drivers/serial/serial_zynq.c       | 203 ++++++++++---------
 include/asm-generic/sections.h     |   1 +
 include/configs/xilinx_zynqmp.h    |   4 +-
 include/configs/xilinx_zynqmp_ep.h |   1 -
 include/configs/zynq-common.h      |   6 +-
 include/configs/zynq_microzed.h    |   1 -
 include/configs/zynq_picozed.h     |   1 -
 include/configs/zynq_zc70x.h       |   1 -
 include/configs/zynq_zc770.h       |   6 -
 include/configs/zynq_zed.h         |   1 -
 include/configs/zynq_zybo.h        |   1 -
 include/fdtdec.h                   |  11 +-
 lib/fdtdec.c                       |  22 ++-
 lib/libfdt/fdt_region.c            |   2 +-
 scripts/Makefile.spl               |   2 +
 tools/fdtgrep.c                    |  32 +--
 48 files changed, 796 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#1 lore raw

PATCH v2 1/14 fdt: Add a function to look up a /chosen property

It is sometimes useful to find a property in the chosen node. Add a function for this.

---

Changes in v2: None

 include/fdtdec.h | 11 ++++++++++-
 lib/fdtdec.c     | 15 ++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)
include/fdtdec.h +10 -1
index 2de6dda..9fcc7a1 100644
@@ -628,7 +628,16 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int node,
 			 int *seqp);
 
 /**
- * Get the offset of the given chosen node
+ * Get a property from the /chosen node
+ *
+ * @param blob		Device tree blob (if NULL, then NULL is returned)
+ * @param name		Property name to look up
+ * @return Value of property, or NULL if it does not exist
+ */
+const char *fdtdec_get_chosen_prop(const void *blob, const char *name);
+
+/**
+ * Get the offset of the given /chosen node
  *
  * This looks up a property in /chosen containing the path to another node,
  * then finds the offset of that node.
lib/fdtdec.c +10 -5
index 1a86369..1749468 100644
@@ -601,16 +601,21 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset,
 	return -ENOENT;
 }
 
-int fdtdec_get_chosen_node(const void *blob, const char *name)
+const char *fdtdec_get_chosen_prop(const void *blob, const char *name)
 {
-	const char *prop;
 	int chosen_node;
-	int len;
 
 	if (!blob)
-		return -FDT_ERR_NOTFOUND;
+		return NULL;
 	chosen_node = fdt_path_offset(blob, "/chosen");
-	prop = fdt_getprop(blob, chosen_node, name, &len);
+	return fdt_getprop(blob, chosen_node, name, NULL);
+}
+
+int fdtdec_get_chosen_node(const void *blob, const char *name)
+{
+	const char *prop;
+
+	prop = fdtdec_get_chosen_prop(blob, name);
 	if (!prop)
 		return -FDT_ERR_NOTFOUND;
 	return fdt_path_offset(blob, prop);
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#2 lore raw

PATCH v2 2/14 fdt: Correct handling of alias regions

In reply to Simon Glass

At present the last four bytes of the alias region are dropped in the case where the last alias is included. This results in a corrupted device tree. Fix this.

---

Changes in v2: None

 lib/libfdt/fdt_region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/libfdt/fdt_region.c +1 -1
index 9fea775..747d8bb 100644
@@ -101,7 +101,7 @@ int fdt_add_alias_regions(const void *fdt, struct fdt_region *region, int count,
 			continue;
 		next = fdt_next_property_offset(fdt, offset);
 		if (next < 0)
-			next = node_end - sizeof(fdt32_t);
+			next = node_end;
 
 		if (!did_alias_header) {
 			fdt_add_region(info, base + node, 12);
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#3 lore raw

PATCH v2 3/14 fdtgrep: Simplify the alias generation code

In reply to Simon Glass

We don't need to allocate a new region list when we run out of space. The outer function can take care of this for us.

---

Changes in v2: None

 tools/fdtgrep.c | 32 ++++++++++----------------------
 1 file changed, 10 insertions(+), 22 deletions(-)
tools/fdtgrep.c +10 -22
index caaf600..67aa41a 100644
@@ -667,28 +667,16 @@ static int fdtgrep_find_regions(const void *fdt,
 
 		new_count = fdt_add_alias_regions(fdt, region, count,
 						  max_regions, &state);
-		if (new_count > max_regions) {
-			region = malloc(new_count * sizeof(struct fdt_region));
-			if (!region) {
-				fprintf(stderr,
-					"Out of memory for %d regions\n",
-					count);
-				return -1;
-			}
-			memcpy(region, state.region,
-			       count * sizeof(struct fdt_region));
-			free(state.region);
-			new_count = fdt_add_alias_regions(fdt, region, count,
-							  max_regions, &state);
+		if (new_count <= max_regions) {
+			/*
+			* The alias regions will now be at the end of the list.
+			* Sort the regions by offset to get things into the
+			* right order
+			*/
+			count = new_count;
+			qsort(region, count, sizeof(struct fdt_region),
+			      h_cmp_region);
 		}
-
-		/*
-		 * The alias regions will now be@the end of the list. Sort
-		 * the regions by offset to get things into the right order
-		 */
-		qsort(region, new_count, sizeof(struct fdt_region),
-		      h_cmp_region);
-		count = new_count;
 	}
 
 	if (ret != -FDT_ERR_NOTFOUND)
@@ -805,7 +793,7 @@ static int do_fdtgrep(struct display_info *disp, const char *filename)
 	 * The first pass will count the regions, but if it is too many,
 	 * we do another pass to actually record them.
 	 */
-	for (i = 0; i < 2; i++) {
+	for (i = 0; i < 3; i++) {
 		region = malloc(count * sizeof(struct fdt_region));
 		if (!region) {
 			fprintf(stderr, "Out of memory for %d regions\n",
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#4 lore raw

PATCH v2 4/14 dm: serial: Deal with stdout-path with an alias

In reply to Simon Glass

Sometimes stdout-path contains a UART alias along with speed, etc. For example:

	stdout-path = "serial0:115200n8";

Add support for decoding this.

---

Changes in v2: None

 drivers/serial/serial-uclass.c | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)
drivers/serial/serial-uclass.c +25 -5
index 55011cc..842f78b 100644
@@ -29,14 +29,34 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 
 static void serial_find_console_or_panic(void)
 {
+	const void *blob = gd->fdt_blob;
 	struct udevice *dev;
 	int node;
 
-	if (CONFIG_IS_ENABLED(OF_CONTROL) && gd->fdt_blob) {
+	if (CONFIG_IS_ENABLED(OF_CONTROL) && blob) {
 		/* Check for a chosen console */
-		node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path");
+		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(gd->fdt_blob, "console");
+			node = fdt_path_offset(blob, "console");
 		if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node,
 						    &dev)) {
 			gd->cur_serial_dev = dev;
@@ -48,14 +68,14 @@ static void serial_find_console_or_panic(void)
 		* bind it anyway.
 		*/
 		if (node > 0 &&
-		    !lists_bind_fdt(gd->dm_root, gd->fdt_blob, node, &dev)) {
+		    !lists_bind_fdt(gd->dm_root, blob, node, &dev)) {
 			if (!device_probe(dev)) {
 				gd->cur_serial_dev = dev;
 				return;
 			}
 		}
 	}
-	if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !gd->fdt_blob) {
+	if (!SPL_BUILD || !CONFIG_IS_ENABLED(OF_CONTROL) || !blob) {
 		/*
 		* Try to use CONFIG_CONS_INDEX if available (it is numbered
 		* from 1!).
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#5 lore raw

PATCH v2 5/14 dm: spl: Generate u-boot-spl-dtb.bin only when enabled

In reply to Simon Glass

At present this file is generated even when device tree is not enabled in SPL. Avoid this, since this file serves no purpose in that case.

---

Changes in v2: None

 scripts/Makefile.spl | 2 ++
 1 file changed, 2 insertions(+)
scripts/Makefile.spl +2 -0
index 2df93c8..dd235b9 100644
@@ -129,7 +129,9 @@ boot.bin: $(obj)/u-boot-spl.bin
 
 ALL-y	+= $(obj)/$(SPL_BIN).bin $(obj)/$(SPL_BIN).cfg
 
+ifdef CONFIG_SPL_OF_CONTROL
 ALL-$(CONFIG_OF_SEPARATE) += $(obj)/$(SPL_BIN)-pad.bin $(obj)/$(SPL_BIN)-dtb.bin
+endif
 
 ifdef CONFIG_SAMSUNG
 ALL-y	+= $(obj)/$(BOARD)-spl.bin
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#6 lore raw

PATCH v2 6/14 dm: spl: Support device tree when BSS is in a different section

In reply to Simon Glass

At present in SPL we place the device tree immediately after BSS. This avoids needing to copy it out of the way before BSS can be used. However on some boards BSS is not placed with the image - e.g. it can be in RAM if available.

Add an option to tell U-Boot that the device tree should be placed at the end of the image binary (_image_binary_end) instead of at the end of BSS.

Note: A common reason to place BSS in RAM is to support the FAT filesystem. We should update the code so that it does not use so much BSS.

---

Changes in v2: None

 Kconfig                        | 10 ++++++++++
 include/asm-generic/sections.h |  1 +
 lib/fdtdec.c                   |  7 +++++--
 3 files changed, 16 insertions(+), 2 deletions(-)
Kconfig +10 -0
index f364a7a..01c6977 100644
@@ -132,6 +132,16 @@ config SPL_STACK_R_ADDR
 	  Specify the address in SDRAM for the SPL stack. This will be set up
 	  before board_init_r() is called.
 
+config SPL_SEPARATE_BSS
+	depends on SPL
+	bool "BSS section is in a different memory region from text"
+	help
+	  Some platforms need a large BSS region in SPL and can provide this
+	  because RAM is already set up. In this case BSS can be moved to RAM.
+	  This option should then be enabled so that the correct device tree
+	  location is used. Normally we put the device tree at the end of BSS
+	  but with this option enabled, it goes at _image_binary_end.
+
 config TPL
 	bool
 	depends on SPL && SUPPORT_TPL
include/asm-generic/sections.h +1 -0
index 458952f..328bc62 100644
@@ -71,6 +71,7 @@ extern char __bss_start[];
 extern char __bss_end[];
 extern char __image_copy_start[];
 extern char __image_copy_end[];
+extern char _image_binary_end[];
 extern char __rel_dyn_start[];
 extern char __rel_dyn_end[];
 
lib/fdtdec.c +5 -2
index 1749468..4684496 100644
@@ -1222,8 +1222,11 @@ int fdtdec_setup(void)
 	gd->fdt_blob = __dtb_dt_begin;
 # elif defined CONFIG_OF_SEPARATE
 #  ifdef CONFIG_SPL_BUILD
-	/* FDT is at end of BSS */
-	gd->fdt_blob = (ulong *)&__bss_end;
+	/* FDT is at end of BSS unless it is in a different memory region */
+	if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS))
+		gd->fdt_blob = (ulong *)&_image_binary_end;
+	else
+		gd->fdt_blob = (ulong *)&__bss_end;
 #  else
 	/* FDT is at end of image */
 	gd->fdt_blob = (ulong *)&_end;
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#7 lore raw

PATCH v2 7/14 arm: zynq: Use separate device tree instead of embedded

In reply to Simon Glass

Production boards should not use CONFIG_OF_EMBED. Fix this for the Zybo boards.

The image to use now becomes u-boot-dtb.bin.

For example, the .bif file should contain a line like:

[load = 0x04000000,startup=0x04000000]/path/to/u-boot-dtb.bin

instead of:

[load = 0x04000000,startup=0x04000000]/path/to/u-boot.bin

When device tree is enabled we need to load u-boot-dtb.img. Change the settings so that SPL does the right thing.

---

Changes in v2: None

 configs/zynq_microzed_defconfig    | 2 +-
 configs/zynq_picozed_defconfig     | 2 +-
 configs/zynq_zc702_defconfig       | 2 +-
 configs/zynq_zc706_defconfig       | 2 +-
 configs/zynq_zc70x_defconfig       | 2 +-
 configs/zynq_zc770_xm010_defconfig | 2 +-
 configs/zynq_zc770_xm011_defconfig | 2 +-
 configs/zynq_zc770_xm012_defconfig | 2 +-
 configs/zynq_zc770_xm013_defconfig | 2 +-
 configs/zynq_zed_defconfig         | 2 +-
 configs/zynq_zybo_defconfig        | 2 +-
 include/configs/zynq-common.h      | 6 +++++-
 12 files changed, 16 insertions(+), 12 deletions(-)
configs/zynq_microzed_defconfig +1 -1
index e9c3209..9d51540 100644
@@ -9,5 +9,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_picozed_defconfig +1 -1
index f2b71e9..3a42efb 100644
@@ -6,5 +6,5 @@ CONFIG_SPL=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc702_defconfig +1 -1
index 0abb7a8..6faf928 100644
@@ -8,5 +8,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc706_defconfig +1 -1
index d67f507..d6559b5 100644
@@ -9,5 +9,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc70x_defconfig +1 -1
index 37c249f..49c987a 100644
@@ -9,5 +9,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc770_xm010_defconfig +1 -1
index 0e826bb..4bfb9cc 100644
@@ -10,6 +10,6 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM010"
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPI_FLASH=y
configs/zynq_zc770_xm011_defconfig +1 -1
index 46d043b..2a61fe3 100644
@@ -10,5 +10,5 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM011"
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc770_xm012_defconfig +1 -1
index 34d479f..eb98a39 100644
@@ -8,5 +8,5 @@ CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_SIGNATURE=y
 CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM012"
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zc770_xm013_defconfig +1 -1
index c59599f..8d65c05 100644
@@ -10,5 +10,5 @@ CONFIG_SYS_EXTRA_OPTIONS="ZC770_XM013"
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zed_defconfig +1 -1
index 886b4a5..13bef36 100644
@@ -9,5 +9,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
configs/zynq_zybo_defconfig +1 -1
index 77b9409..fc251dc 100644
@@ -9,5 +9,5 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_OF_EMBED=y
+CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
include/configs/zynq-common.h +5 -1
index e7ab50a..aa4785f 100644
@@ -319,7 +319,11 @@
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_LIBDISK_SUPPORT
 #define CONFIG_SPL_FAT_SUPPORT
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME     "u-boot.img"
+#ifdef CONFIG_OF_CONTROL
+# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME     "u-boot-dtb.img"
+#else
+# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME     "u-boot.img"
+#endif
 #endif
 
 /* Disable dcache for SPL just for sure */
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#8 lore raw

PATCH v2 8/14 arm: zynq: Drop unnecessary code in SPL board_init_f()

In reply to Simon Glass

Move to the new way of starting up SPL. Clearing of BSS and calling board_init_r() is now handled by crt0.S.

Also tidy up the header include order.

---

Changes in v2: None

 arch/arm/mach-zynq/spl.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
arch/arm/mach-zynq/spl.c +1 -5
index 7bdac3b..1805455 100644
@@ -7,8 +7,8 @@
 #include <spl.h>
 
 #include <asm/io.h>
-#include <asm/arch/hardware.h>
 #include <asm/spl.h>
+#include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -17,11 +17,7 @@ void board_init_f(ulong dummy)
 {
 	ps7_init();
 
-	/* Clear the BSS. */
-	memset(__bss_start, 0, __bss_end - __bss_start);
-
 	arch_cpu_init();
-	board_init_r(NULL, 0);
 }
 
 #ifdef CONFIG_SPL_BOARD_INIT
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#9 lore raw

PATCH v2 9/14 arm: zynq: Support the debug UART

In reply to Simon Glass

Add support for the debug UART to assist with early debugging. Enable it for Zybo as an example.

---

Changes in v2: None

 arch/arm/mach-zynq/spl.c     |  6 ++++
 configs/zynq_zybo_defconfig  |  4 +++
 drivers/serial/Kconfig       |  7 ++++
 drivers/serial/serial_zynq.c | 77 +++++++++++++++++++++++++++++++++++---------
 4 files changed, 78 insertions(+), 16 deletions(-)
arch/arm/mach-zynq/spl.c +6 -0
index 1805455..723019d 100644
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 #include <common.h>
+#include <debug_uart.h>
 #include <spl.h>
 
 #include <asm/io.h>
@@ -18,6 +19,11 @@ void board_init_f(ulong dummy)
 	ps7_init();
 
 	arch_cpu_init();
+	/*
+	 * The debug UART can be used from this point:
+	 * debug_uart_init();
+	 * printch('x');
+	 */
 }
 
 #ifdef CONFIG_SPL_BOARD_INIT
configs/zynq_zybo_defconfig +4 -0
index fc251dc..b7531d6 100644
@@ -11,3 +11,7 @@ CONFIG_FIT_SIGNATURE=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_OF_SEPARATE=y
 CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DEBUG_UART=y
+CONFIG_DEBUG_UART_ZYNQ=y
+CONFIG_DEBUG_UART_BASE=0xe0001000
+CONFIG_DEBUG_UART_CLOCK=50000000
drivers/serial/Kconfig +7 -0
index ddb725d..6f2a1b1 100644
@@ -77,6 +77,13 @@ config DEBUG_UART_S5P
 	  will need to provide parameters to make this work. The driver will
 	  be available until the real driver-model serial is running.
 
+config DEBUG_UART_ZYNQ
+	bool "Xilinx Zynq"
+	help
+	  Select this to enable a debug UART using the serial_s5p driver. You
+	  will need to provide parameters to make this work. The driver will
+	  be available until the real driver-model serial is running.
+
 endchoice
 
 config DEBUG_UART_BASE
drivers/serial/serial_zynq.c +61 -16

126 lines not on this page · raw message

Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#10 lore raw

PATCH v2 10/14 dm: arm: zynq: Enable device tree control in SPL

In reply to Simon Glass

Move to using device tree control in SPL so that we can use the same driver code in both SPL and U-Boot proper.

---

Changes in v2: None

 arch/arm/Kconfig                  |  3 +++
 arch/arm/mach-zynq/u-boot-spl.lds | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)
arch/arm/Kconfig +3 -0
index 7981355..1d85240 100644
@@ -547,9 +547,12 @@ config ARCH_ZYNQ
 	select CPU_V7
 	select SUPPORT_SPL
 	select OF_CONTROL
+	select SPL_OF_CONTROL
 	select DM
+	select SPL_DM
 	select DM_SPI
 	select DM_SPI_FLASH
+	select SPL_SEPARATE_BSS
 
 config ARCH_ZYNQMP
 	bool "Support Xilinx ZynqMP Platform"
arch/arm/mach-zynq/u-boot-spl.lds +9 -1
index 0f2f756..ecdf6a0 100644
@@ -38,10 +38,18 @@ SECTIONS
 	} > .sram
 
 	. = ALIGN(4);
+#ifdef CONFIG_SPL_DM
+	.u_boot_list : {
+		KEEP(*(SORT(.u_boot_list_*_driver_*)));
+		KEEP(*(SORT(.u_boot_list_*_uclass_*)));
+	} > .sram
+
+	. = ALIGN(4);
+#endif
 
 	. = .;
 
-	__image_copy_end = .;
+	_image_binary_end = .;
 
 	_end = .;
 
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#11 lore raw

PATCH v2 11/14 arm: zynq: dts: Add U-Boot device tree additions

In reply to Simon Glass

We need to mark some device tree nodes so that they are available before relocation. This enables driver model to find these automatically. In the case of SPL it ensures that these nodes will be retained in SPL.

---

Changes in v2: None

 arch/arm/dts/zynq-7000.dtsi       | 1 +
 arch/arm/dts/zynq-microzed.dts    | 5 +++++
 arch/arm/dts/zynq-picozed.dts     | 5 +++++
 arch/arm/dts/zynq-zc702.dts       | 1 +
 arch/arm/dts/zynq-zc706.dts       | 1 +
 arch/arm/dts/zynq-zc770-xm010.dts | 1 +
 arch/arm/dts/zynq-zc770-xm011.dts | 1 +
 arch/arm/dts/zynq-zc770-xm012.dts | 1 +
 arch/arm/dts/zynq-zc770-xm013.dts | 1 +
 arch/arm/dts/zynq-zed.dts         | 1 +
 arch/arm/dts/zynq-zybo.dts        | 1 +
 11 files changed, 19 insertions(+)
arch/arm/dts/zynq-7000.dtsi +1 -0
index 0b62cb0..12614f2 100644
@@ -54,6 +54,7 @@
 	};
 
 	amba: amba {
+		u-boot,dm-pre-reloc;
 		compatible = "simple-bus";
 		#address-cells = <1>;
 		#size-cells = <1>;
arch/arm/dts/zynq-microzed.dts +5 -0
index c373a2c..5dff18e6 100644
@@ -21,3 +21,8 @@
 		reg = <0 0x40000000>;
 	};
 };
+
+&uart1 {
+	u-boot,dm-pre-reloc;
+	status = "okay";
+};
arch/arm/dts/zynq-picozed.dts +5 -0
index 686b98f..3408df8 100644
@@ -21,3 +21,8 @@
 		reg = <0 0x40000000>;
 	};
 };
+
+&uart1 {
+	u-boot,dm-pre-reloc;
+	status = "okay";
+};
arch/arm/dts/zynq-zc702.dts +1 -0
index 6691a8d..4fcef4b 100644
@@ -375,6 +375,7 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1_default>;
arch/arm/dts/zynq-zc706.dts +1 -0
index cf7bce4..8198917 100644
@@ -296,6 +296,7 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1_default>;
arch/arm/dts/zynq-zc770-xm010.dts +1 -0
index 680f24c..e2473d5 100644
@@ -83,6 +83,7 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
 
arch/arm/dts/zynq-zc770-xm011.dts +1 -0
index f73c0dd..77e3bb0 100644
@@ -55,6 +55,7 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
 
arch/arm/dts/zynq-zc770-xm012.dts +1 -0
index 4289e31..3e1769a 100644
@@ -62,5 +62,6 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
arch/arm/dts/zynq-zc770-xm013.dts +1 -0
index 5124cdc..288e248 100644
@@ -75,5 +75,6 @@
 };
 
 &uart0 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
arch/arm/dts/zynq-zed.dts +1 -0
index 5762576..81c64a6 100644
@@ -53,6 +53,7 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
 
arch/arm/dts/zynq-zybo.dts +1 -0
index 10f7815..dcfc00e 100644
@@ -49,5 +49,6 @@
 };
 
 &uart1 {
+	u-boot,dm-pre-reloc;
 	status = "okay";
 };
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#12 lore raw

PATCH v2 12/14 ARM: zynqmp: Enable DM and OF binding

In reply to Simon Glass

From: Michal Simek <[email protected]>

SPI requires DM and OF that's why enable DM for ZynqMP and start to use configuration based on embedded OF.

---

Changes in v2: None

 arch/arm/Kconfig                   |   3 +
 arch/arm/dts/Makefile              |   2 +-
 arch/arm/dts/zynqmp-ep108.dts      | 164 ++++++++++++++++
 arch/arm/dts/zynqmp.dtsi           | 385 +++++++++++++++++++++++++++++++++++++
 configs/xilinx_zynqmp_ep_defconfig |   3 +-
 5 files changed, 555 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi
arch/arm/Kconfig +3 -0
index 1d85240..eec56f1 100644
@@ -557,6 +557,9 @@ config ARCH_ZYNQ
 config ARCH_ZYNQMP
 	bool "Support Xilinx ZynqMP Platform"
 	select ARM64
+	select DM
+	select OF_CONTROL
+	select DM_SERIAL
 
 config TEGRA
 	bool "NVIDIA Tegra"
arch/arm/dts/Makefile +1 -1
index 65b4230..4fbac4f 100644
@@ -60,8 +60,8 @@ dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
 	zynq-zc770-xm011.dtb \
 	zynq-zc770-xm012.dtb \
 	zynq-zc770-xm013.dtb
+dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-ep108.dtb
 dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
-
 dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_cyclone5_mcvevk.dtb			\
arch/arm/dts/zynqmp-ep108.dts new file +164 -0

164 lines not on this page · raw message

arch/arm/dts/zynqmp.dtsi new file +385 -0

385 lines not on this page · raw message

configs/xilinx_zynqmp_ep_defconfig +2 -1
index 770c797..79304c1 100644
@@ -2,7 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_ZYNQMP=y
 CONFIG_ZYNQMP_USB=y
 CONFIG_SYS_TEXT_BASE=0x8000000
-CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep"
+CONFIG_DEFAULT_DEVICE_TREE="zynqmp-ep108"
 CONFIG_SYS_PROMPT="ZynqMP> "
 # CONFIG_CMD_CONSOLE is not set
 # CONFIG_CMD_IMLS is not set
@@ -20,5 +20,6 @@ CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_TIMER=y
+CONFIG_OF_EMBED=y
 CONFIG_NET_RANDOM_ETHADDR=y
 # CONFIG_REGEX is not set
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#13 lore raw

PATCH v2 13/14 arm: zynq: serial: Drop non-device-tree serial driver portions

In reply to Simon Glass

Since we use device tree in SPL also, we can drop this code.

---

Changes in v2: None

 drivers/serial/serial_zynq.c | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/serial/serial_zynq.c +0 -15
index c4304dd..c39c1a9 100644
@@ -195,7 +195,6 @@ DECLARE_PSSERIAL_FUNCTIONS(1);
 static struct serial_device uart_zynq_serial1_device =
 	INIT_PSSERIAL_STRUCTURE(1, "ttyPS1");
 
-#if CONFIG_IS_ENABLED(OF_CONTROL)
 __weak struct serial_device *default_serial_console(void)
 {
 	const void *blob = gd->fdt_blob;
@@ -218,20 +217,6 @@ __weak struct serial_device *default_serial_console(void)
 
 	return NULL;
 }
-#else
-__weak struct serial_device *default_serial_console(void)
-{
-#if defined(CONFIG_ZYNQ_SERIAL_UART0)
-	if (uart_zynq_ports[0])
-		return &uart_zynq_serial0_device;
-#endif
-#if defined(CONFIG_ZYNQ_SERIAL_UART1)
-	if (uart_zynq_ports[1])
-		return &uart_zynq_serial1_device;
-#endif
-	return NULL;
-}
-#endif
 
 void zynq_serial_initialize(void)
 {
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#14 lore raw

PATCH v2 14/14 arm: zynq: Move serial driver to driver model

In reply to Simon Glass

Update this driver to use driver model and change all users.

---

Changes in v2:
- Extend list of compatible strings with cadence compatible string.

 arch/arm/Kconfig                   |   1 +
 drivers/serial/serial_zynq.c       | 163 +++++++++++++++----------------------
 include/configs/xilinx_zynqmp.h    |   4 +-
 include/configs/xilinx_zynqmp_ep.h |   1 -
 include/configs/zynq_microzed.h    |   1 -
 include/configs/zynq_picozed.h     |   1 -
 include/configs/zynq_zc70x.h       |   1 -
 include/configs/zynq_zc770.h       |   6 --
 include/configs/zynq_zed.h         |   1 -
 include/configs/zynq_zybo.h        |   1 -
 10 files changed, 67 insertions(+), 113 deletions(-)
arch/arm/Kconfig +1 -0
index eec56f1..cfbcaa8 100644
@@ -551,6 +551,7 @@ config ARCH_ZYNQ
 	select DM
 	select SPL_DM
 	select DM_SPI
+	select DM_SERIAL
 	select DM_SPI_FLASH
 	select SPL_SEPARATE_BSS
 
drivers/serial/serial_zynq.c +65 -98

224 lines not on this page · raw message

include/configs/xilinx_zynqmp.h +1 -3
index da87188..7f90bab 100644
@@ -56,9 +56,7 @@
 # define CONFIG_ARM_DCC
 # define CONFIG_CPU_ARMV8
 #else
-# if defined(CONFIG_ZYNQ_SERIAL_UART0) || defined(CONFIG_ZYNQ_SERIAL_UART1)
-#  define CONFIG_ZYNQ_SERIAL
-# endif
+# define CONFIG_ZYNQ_SERIAL
 #endif
 
 #define CONFIG_CONS_INDEX		0
include/configs/xilinx_zynqmp_ep.h +0 -1
index e476eb1..ed6023a 100644
@@ -18,7 +18,6 @@
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	7
 
-#define CONFIG_ZYNQ_SERIAL_UART0
 #define CONFIG_ZYNQ_SDHCI0
 #define CONFIG_ZYNQ_I2C0
 #define CONFIG_SYS_I2C_ZYNQ
include/configs/zynq_microzed.h +0 -1
index 549a664..b5ffafb 100644
@@ -12,7 +12,6 @@
 
 #define CONFIG_SYS_SDRAM_SIZE		(1024 * 1024 * 1024)
 
-#define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	0
 
include/configs/zynq_picozed.h +0 -1
index d116e05..ffc73bd 100644
@@ -12,7 +12,6 @@
 
 #define CONFIG_SYS_SDRAM_SIZE		(1024 * 1024 * 1024)
 
-#define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	0
 
include/configs/zynq_zc70x.h +0 -1
index b659054..468a6bc 100644
@@ -12,7 +12,6 @@
 
 #define CONFIG_SYS_SDRAM_SIZE		(1024 * 1024 * 1024)
 
-#define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	7
 
include/configs/zynq_zc770.h +0 -6
index 7a1b872..63224dd 100644
@@ -15,26 +15,20 @@
 #define CONFIG_SYS_NO_FLASH
 
 #if defined(CONFIG_ZC770_XM010)
-# define CONFIG_ZYNQ_SERIAL_UART1
 # define CONFIG_ZYNQ_GEM0
 # define CONFIG_ZYNQ_GEM_PHY_ADDR0	7
 # define CONFIG_ZYNQ_SDHCI0
 # define CONFIG_ZYNQ_SPI
 
 #elif defined(CONFIG_ZC770_XM011)
-# define CONFIG_ZYNQ_SERIAL_UART1
 
 #elif defined(CONFIG_ZC770_XM012)
-# define CONFIG_ZYNQ_SERIAL_UART1
 # undef CONFIG_SYS_NO_FLASH
 
 #elif defined(CONFIG_ZC770_XM013)
-# define CONFIG_ZYNQ_SERIAL_UART0
 # define CONFIG_ZYNQ_GEM1
 # define CONFIG_ZYNQ_GEM_PHY_ADDR1	7
 
-#else
-# define CONFIG_ZYNQ_SERIAL_UART0
 #endif
 
 #include <configs/zynq-common.h>
include/configs/zynq_zed.h +0 -1
index 946de95..6ec6117 100644
@@ -12,7 +12,6 @@
 
 #define CONFIG_SYS_SDRAM_SIZE		(512 * 1024 * 1024)
 
-#define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	0
 
include/configs/zynq_zybo.h +0 -1
index 191f2a5..e2270cd 100644
@@ -13,7 +13,6 @@
 
 #define CONFIG_SYS_SDRAM_SIZE (512 * 1024 * 1024)
 
-#define CONFIG_ZYNQ_SERIAL_UART1
 #define CONFIG_ZYNQ_GEM0
 #define CONFIG_ZYNQ_GEM_PHY_ADDR0	0
 
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#15 lore raw

v2 cover dm: arm: zynq: Convert serial driver to driver model

In reply to Simon Glass

Hi Simon,

Quoted 82 lines · Simon Glass

This series updates the Zynq serial driver to use driver model. Along the way several problems are fixed:

- Support for /chosen/stdout-path using an alias
- Fix to fdtgrep which is currently breaking alias building
- Avoid building u-boot-spl-dtb.bin when it is not requested
- Deal with boards which have BSS in SDRAM

For zynq this series makes a few changes:
- Use the new SPL init procedure, which just involves a few tweaks for zynq
- Add debug UART support
- Move to using a separate device tree instead of embedded

Only zybo has been tested. Testing on other zynq boards is welcome. They are all set up roughly the same so I expect only minor problems.

This serial includes Michal's zynqmp device tree patch.

Changes in v2:
- Extend list of compatible strings with cadence compatible string.

Michal Simek (1):
ARM: zynqmp: Enable DM and OF binding

Simon Glass (13):
fdt: Add a function to look up a /chosen property
fdt: Correct handling of alias regions
fdtgrep: Simplify the alias generation code
dm: serial: Deal with stdout-path with an alias
dm: spl: Generate u-boot-spl-dtb.bin only when enabled
dm: spl: Support device tree when BSS is in a different section
arm: zynq: Use separate device tree instead of embedded
arm: zynq: Drop unnecessary code in SPL board_init_f()
arm: zynq: Support the debug UART
dm: arm: zynq: Enable device tree control in SPL
arm: zynq: dts: Add U-Boot device tree additions
arm: zynq: serial: Drop non-device-tree serial driver portions
arm: zynq: Move serial driver to driver model

 Kconfig                            |  10 +
 arch/arm/Kconfig                   |   7 +
 arch/arm/dts/Makefile              |   2 +-
 arch/arm/dts/zynq-7000.dtsi        |   1 +
 arch/arm/dts/zynq-microzed.dts     |   5 +
 arch/arm/dts/zynq-picozed.dts      |   5 +
 arch/arm/dts/zynq-zc702.dts        |   1 +
 arch/arm/dts/zynq-zc706.dts        |   1 +
 arch/arm/dts/zynq-zc770-xm010.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm011.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm012.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm013.dts  |   1 +
 arch/arm/dts/zynq-zed.dts          |   1 +
 arch/arm/dts/zynq-zybo.dts         |   1 +
 arch/arm/dts/zynqmp-ep108.dts      | 164 ++++++++++++++++
 arch/arm/dts/zynqmp.dtsi           | 385 +++++++++++++++++++++++++++++++++++++
 arch/arm/mach-zynq/spl.c           |  12 +-
 arch/arm/mach-zynq/u-boot-spl.lds  |  10 +-
 configs/xilinx_zynqmp_ep_defconfig |   3 +-
 configs/zynq_microzed_defconfig    |   2 +-
 configs/zynq_picozed_defconfig     |   2 +-
 configs/zynq_zc702_defconfig       |   2 +-
 configs/zynq_zc706_defconfig       |   2 +-
 configs/zynq_zc70x_defconfig       |   2 +-
 configs/zynq_zc770_xm010_defconfig |   2 +-
 configs/zynq_zc770_xm011_defconfig |   2 +-
 configs/zynq_zc770_xm012_defconfig |   2 +-
 configs/zynq_zc770_xm013_defconfig |   2 +-
 configs/zynq_zed_defconfig         |   2 +-
 configs/zynq_zybo_defconfig        |   6 +-
 drivers/serial/Kconfig             |   7 +
 drivers/serial/serial-uclass.c     |  30 ++-
 drivers/serial/serial_zynq.c       | 203 ++++++++++---------
 include/asm-generic/sections.h     |   1 +
 include/configs/xilinx_zynqmp.h    |   4 +-
 include/configs/xilinx_zynqmp_ep.h |   1 -
 include/configs/zynq-common.h      |   6 +-
 include/configs/zynq_microzed.h    |   1 -
 include/configs/zynq_picozed.h     |   1 -
 include/configs/zynq_zc70x.h       |   1 -
 include/configs/zynq_zc770.h       |   6 -
 include/configs/zynq_zed.h         |   1 -
 include/configs/zynq_zybo.h        |   1 -
Quoted 9 lines
 include/fdtdec.h                   |  11 +-
 lib/fdtdec.c                       |  22 ++-
 lib/libfdt/fdt_region.c            |   2 +-
 scripts/Makefile.spl               |   2 +
 tools/fdtgrep.c                    |  32 +--
 48 files changed, 796 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi

I am happy to take this series via zynq ARM tree.
Or do you want to take fdt part through your tree or all things via your tree?

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151027/18406379/attachment.sig>
#16 lore raw

v2 cover dm: arm: zynq: Convert serial driver to driver model

Hi Michal,

Quoted 5 lines · Michal Simek

Hi Simon,

Quoted 1 line · Simon Glass

This series updates the Zynq serial driver to use driver model. Along

the

Quoted 9 lines
Quoted 9 lines

way several problems are fixed:

- Support for /chosen/stdout-path using an alias
- Fix to fdtgrep which is currently breaking alias building
- Avoid building u-boot-spl-dtb.bin when it is not requested
- Deal with boards which have BSS in SDRAM

For zynq this series makes a few changes:
- Use the new SPL init procedure, which just involves a few tweaks for

zynq

Quoted 4 lines
Quoted 4 lines

- Add debug UART support
- Move to using a separate device tree instead of embedded

Only zybo has been tested. Testing on other zynq boards is welcome.

They are

Quoted 25 lines
Quoted 25 lines

all set up roughly the same so I expect only minor problems.

This serial includes Michal's zynqmp device tree patch.

Changes in v2:
- Extend list of compatible strings with cadence compatible string.

Michal Simek (1):
ARM: zynqmp: Enable DM and OF binding

Simon Glass (13):
fdt: Add a function to look up a /chosen property
fdt: Correct handling of alias regions
fdtgrep: Simplify the alias generation code
dm: serial: Deal with stdout-path with an alias
dm: spl: Generate u-boot-spl-dtb.bin only when enabled
dm: spl: Support device tree when BSS is in a different section
arm: zynq: Use separate device tree instead of embedded
arm: zynq: Drop unnecessary code in SPL board_init_f()
arm: zynq: Support the debug UART
dm: arm: zynq: Enable device tree control in SPL
arm: zynq: dts: Add U-Boot device tree additions
arm: zynq: serial: Drop non-device-tree serial driver portions
arm: zynq: Move serial driver to driver model

Quoted 16 lines
Quoted 8 lines
 Kconfig                            |  10 +
 arch/arm/Kconfig                   |   7 +
 arch/arm/dts/Makefile              |   2 +-
 arch/arm/dts/zynq-7000.dtsi        |   1 +
 arch/arm/dts/zynq-microzed.dts     |   5 +
 arch/arm/dts/zynq-picozed.dts      |   5 +
 arch/arm/dts/zynq-zc702.dts        |   1 +
 arch/arm/dts/zynq-zc706.dts        |   1 +
Quoted 8 lines
 arch/arm/dts/zynq-zc770-xm010.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm011.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm012.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm013.dts  |   1 +
 arch/arm/dts/zynq-zed.dts          |   1 +
 arch/arm/dts/zynq-zybo.dts         |   1 +
 arch/arm/dts/zynqmp-ep108.dts      | 164 ++++++++++++++++
 arch/arm/dts/zynqmp.dtsi           | 385

+++++++++++++++++++++++++++++++++++++

Quoted 37 lines
Quoted 27 lines
 arch/arm/mach-zynq/spl.c           |  12 +-
 arch/arm/mach-zynq/u-boot-spl.lds  |  10 +-
 configs/xilinx_zynqmp_ep_defconfig |   3 +-
 configs/zynq_microzed_defconfig    |   2 +-
 configs/zynq_picozed_defconfig     |   2 +-
 configs/zynq_zc702_defconfig       |   2 +-
 configs/zynq_zc706_defconfig       |   2 +-
 configs/zynq_zc70x_defconfig       |   2 +-
 configs/zynq_zc770_xm010_defconfig |   2 +-
 configs/zynq_zc770_xm011_defconfig |   2 +-
 configs/zynq_zc770_xm012_defconfig |   2 +-
 configs/zynq_zc770_xm013_defconfig |   2 +-
 configs/zynq_zed_defconfig         |   2 +-
 configs/zynq_zybo_defconfig        |   6 +-
 drivers/serial/Kconfig             |   7 +
 drivers/serial/serial-uclass.c     |  30 ++-
 drivers/serial/serial_zynq.c       | 203 ++++++++++---------
 include/asm-generic/sections.h     |   1 +
 include/configs/xilinx_zynqmp.h    |   4 +-
 include/configs/xilinx_zynqmp_ep.h |   1 -
 include/configs/zynq-common.h      |   6 +-
 include/configs/zynq_microzed.h    |   1 -
 include/configs/zynq_picozed.h     |   1 -
 include/configs/zynq_zc70x.h       |   1 -
 include/configs/zynq_zc770.h       |   6 -
 include/configs/zynq_zed.h         |   1 -
 include/configs/zynq_zybo.h        |   1 -
Quoted 9 lines
 include/fdtdec.h                   |  11 +-
 lib/fdtdec.c                       |  22 ++-
 lib/libfdt/fdt_region.c            |   2 +-
 scripts/Makefile.spl               |   2 +
 tools/fdtgrep.c                    |  32 +--
 48 files changed, 796 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi
Quoted 1 line

I am happy to take this series via zynq ARM tree.

Please go ahead.

Quoted 6 lines

Or do you want to take fdt part through your tree or all things via your tree?

Thanks,
Michal

Quoted 8 lines

--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform

Regards,
Simon

#17 lore raw

v2 cover dm: arm: zynq: Convert serial driver to driver model

In reply to Simon Glass
Quoted 82 lines · Simon Glass

This series updates the Zynq serial driver to use driver model. Along the way several problems are fixed:

- Support for /chosen/stdout-path using an alias
- Fix to fdtgrep which is currently breaking alias building
- Avoid building u-boot-spl-dtb.bin when it is not requested
- Deal with boards which have BSS in SDRAM

For zynq this series makes a few changes:
- Use the new SPL init procedure, which just involves a few tweaks for zynq
- Add debug UART support
- Move to using a separate device tree instead of embedded

Only zybo has been tested. Testing on other zynq boards is welcome. They are all set up roughly the same so I expect only minor problems.

This serial includes Michal's zynqmp device tree patch.

Changes in v2:
- Extend list of compatible strings with cadence compatible string.

Michal Simek (1):
ARM: zynqmp: Enable DM and OF binding

Simon Glass (13):
fdt: Add a function to look up a /chosen property
fdt: Correct handling of alias regions
fdtgrep: Simplify the alias generation code
dm: serial: Deal with stdout-path with an alias
dm: spl: Generate u-boot-spl-dtb.bin only when enabled
dm: spl: Support device tree when BSS is in a different section
arm: zynq: Use separate device tree instead of embedded
arm: zynq: Drop unnecessary code in SPL board_init_f()
arm: zynq: Support the debug UART
dm: arm: zynq: Enable device tree control in SPL
arm: zynq: dts: Add U-Boot device tree additions
arm: zynq: serial: Drop non-device-tree serial driver portions
arm: zynq: Move serial driver to driver model

 Kconfig                            |  10 +
 arch/arm/Kconfig                   |   7 +
 arch/arm/dts/Makefile              |   2 +-
 arch/arm/dts/zynq-7000.dtsi        |   1 +
 arch/arm/dts/zynq-microzed.dts     |   5 +
 arch/arm/dts/zynq-picozed.dts      |   5 +
 arch/arm/dts/zynq-zc702.dts        |   1 +
 arch/arm/dts/zynq-zc706.dts        |   1 +
 arch/arm/dts/zynq-zc770-xm010.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm011.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm012.dts  |   1 +
 arch/arm/dts/zynq-zc770-xm013.dts  |   1 +
 arch/arm/dts/zynq-zed.dts          |   1 +
 arch/arm/dts/zynq-zybo.dts         |   1 +
 arch/arm/dts/zynqmp-ep108.dts      | 164 ++++++++++++++++
 arch/arm/dts/zynqmp.dtsi           | 385 +++++++++++++++++++++++++++++++++++++
 arch/arm/mach-zynq/spl.c           |  12 +-
 arch/arm/mach-zynq/u-boot-spl.lds  |  10 +-
 configs/xilinx_zynqmp_ep_defconfig |   3 +-
 configs/zynq_microzed_defconfig    |   2 +-
 configs/zynq_picozed_defconfig     |   2 +-
 configs/zynq_zc702_defconfig       |   2 +-
 configs/zynq_zc706_defconfig       |   2 +-
 configs/zynq_zc70x_defconfig       |   2 +-
 configs/zynq_zc770_xm010_defconfig |   2 +-
 configs/zynq_zc770_xm011_defconfig |   2 +-
 configs/zynq_zc770_xm012_defconfig |   2 +-
 configs/zynq_zc770_xm013_defconfig |   2 +-
 configs/zynq_zed_defconfig         |   2 +-
 configs/zynq_zybo_defconfig        |   6 +-
 drivers/serial/Kconfig             |   7 +
 drivers/serial/serial-uclass.c     |  30 ++-
 drivers/serial/serial_zynq.c       | 203 ++++++++++---------
 include/asm-generic/sections.h     |   1 +
 include/configs/xilinx_zynqmp.h    |   4 +-
 include/configs/xilinx_zynqmp_ep.h |   1 -
 include/configs/zynq-common.h      |   6 +-
 include/configs/zynq_microzed.h    |   1 -
 include/configs/zynq_picozed.h     |   1 -
 include/configs/zynq_zc70x.h       |   1 -
 include/configs/zynq_zc770.h       |   6 -
 include/configs/zynq_zed.h         |   1 -
 include/configs/zynq_zybo.h        |   1 -
Quoted 9 lines
 include/fdtdec.h                   |  11 +-
 lib/fdtdec.c                       |  22 ++-
 lib/libfdt/fdt_region.c            |   2 +-
 scripts/Makefile.spl               |   2 +
 tools/fdtgrep.c                    |  32 +--
 48 files changed, 796 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/dts/zynqmp-ep108.dts
 create mode 100644 arch/arm/dts/zynqmp.dtsi

Applied all.

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151030/4bb2a2af/attachment.sig>