ffcdd29
From 38527d254b1d2c439c9e3ebbe2c82ecd7c729023 Mon Sep 17 00:00:00 2001
ffcdd29
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
Date: Wed, 13 Dec 2017 21:55:10 +0100
ffcdd29
Subject: [PATCH 09/15] db410c: configs: increase gunzip buffer size for the
ffcdd29
 kernel
ffcdd29
ffcdd29
the kernel fails to boot when it goes over the limit.
ffcdd29
ffcdd29
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
---
ffcdd29
 include/configs/dragonboard410c.h | 2 +-
ffcdd29
 1 file changed, 1 insertion(+), 1 deletion(-)
ffcdd29
ffcdd29
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
ffcdd29
index d2447b27d8..3c5bb8a678 100644
ffcdd29
--- a/include/configs/dragonboard410c.h
ffcdd29
+++ b/include/configs/dragonboard410c.h
ffcdd29
@@ -23,7 +23,7 @@
ffcdd29
 #define CONFIG_SYS_TEXT_BASE		0x80080000
ffcdd29
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x7fff0)
ffcdd29
 #define CONFIG_SYS_LOAD_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x80000)
ffcdd29
-#define CONFIG_SYS_BOOTM_LEN		0x1000000 /* 16MB max kernel size */
ffcdd29
+#define CONFIG_SYS_BOOTM_LEN		SZ_64M
ffcdd29
 
ffcdd29
 /* UART */
ffcdd29
 
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29
ffcdd29
From ddc4e0d38d32d6a8a65780cf00a337c639628ca1 Mon Sep 17 00:00:00 2001
ffcdd29
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
Date: Thu, 14 Dec 2017 11:12:12 +0100
ffcdd29
Subject: [PATCH 10/15] db410c: update wlan and bt mac addresses from firmware
ffcdd29
ffcdd29
The firmware that runs before u-boot modifies u-boot's device tree
ffcdd29
adding the local-mac-address and local-bd-address properties for the
ffcdd29
compatibles "qcom,wcnss-bt" and "qcom,wcnss-wlan".
ffcdd29
ffcdd29
This commit reads that firmware, retrieves the properties and fixups
ffcdd29
the device tree that is passed to the kernel before booting.
ffcdd29
ffcdd29
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
---
ffcdd29
 arch/arm/dts/dragonboard410c.dts                 | 10 +++++
ffcdd29
 board/qualcomm/dragonboard410c/Makefile          |  1 +
ffcdd29
 board/qualcomm/dragonboard410c/dragonboard410c.c | 49 +++++++++++++++++++++---
ffcdd29
 board/qualcomm/dragonboard410c/lowlevel_init.S   | 28 ++++++++++++++
ffcdd29
 configs/dragonboard410c_defconfig                |  3 ++
ffcdd29
 5 files changed, 85 insertions(+), 6 deletions(-)
ffcdd29
 create mode 100644 board/qualcomm/dragonboard410c/lowlevel_init.S
ffcdd29
ffcdd29
diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts
ffcdd29
index 7746622dda..25aeac46b1 100644
ffcdd29
--- a/arch/arm/dts/dragonboard410c.dts
ffcdd29
+++ b/arch/arm/dts/dragonboard410c.dts
ffcdd29
@@ -86,6 +86,16 @@
ffcdd29
 			clock-frequency = <200000000>;
ffcdd29
 		};
ffcdd29
 
ffcdd29
+		wcnss {
ffcdd29
+			bt {
ffcdd29
+				compatible="qcom,wcnss-bt";
ffcdd29
+			};
ffcdd29
+
ffcdd29
+			wifi {
ffcdd29
+				compatible="qcom,wcnss-wlan";
ffcdd29
+			};
ffcdd29
+		};
ffcdd29
+
ffcdd29
 		spmi@200f000 {
ffcdd29
 			compatible = "qcom,spmi-pmic-arb";
ffcdd29
 			reg = <0x200f800 0x200 0x2400000 0x400000 0x2c00000 0x400000>;
ffcdd29
diff --git a/board/qualcomm/dragonboard410c/Makefile b/board/qualcomm/dragonboard410c/Makefile
ffcdd29
index cd678088fa..5082383be4 100644
ffcdd29
--- a/board/qualcomm/dragonboard410c/Makefile
ffcdd29
+++ b/board/qualcomm/dragonboard410c/Makefile
ffcdd29
@@ -5,4 +5,5 @@
ffcdd29
 #
ffcdd29
 
ffcdd29
 obj-y	:= dragonboard410c.o
ffcdd29
+obj-y	+= lowlevel_init.o
ffcdd29
 extra-y += head.o
ffcdd29
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
index 848e27848b..9e5242170d 100644
ffcdd29
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
@@ -10,9 +10,16 @@
ffcdd29
 #include <dm.h>
ffcdd29
 #include <usb.h>
ffcdd29
 #include <asm/gpio.h>
ffcdd29
+#include <fdt_support.h>
ffcdd29
 
ffcdd29
 DECLARE_GLOBAL_DATA_PTR;
ffcdd29
 
ffcdd29
+/* pointer to the device tree ammended by the firmware */
ffcdd29
+extern const void *fw_dtb;
ffcdd29
+
ffcdd29
+static char wlan_mac[ARP_HLEN];
ffcdd29
+static char bt_mac[ARP_HLEN];
ffcdd29
+
ffcdd29
 int dram_init(void)
ffcdd29
 {
ffcdd29
 	gd->ram_size = PHYS_SDRAM_1_SIZE;
ffcdd29
@@ -27,7 +34,6 @@ int dram_init_banksize(void)
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
 
ffcdd29
-
ffcdd29
 int board_prepare_usb(enum usb_init_type type)
ffcdd29
 {
ffcdd29
 	static struct udevice *pmic_gpio;
ffcdd29
@@ -96,11 +102,6 @@ int board_prepare_usb(enum usb_init_type type)
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
 
ffcdd29
-int board_init(void)
ffcdd29
-{
ffcdd29
-	return 0;
ffcdd29
-}
ffcdd29
-
ffcdd29
 /* Check for vol- button - if pressed - stop autoboot */
ffcdd29
 int misc_init_r(void)
ffcdd29
 {
ffcdd29
@@ -134,3 +135,39 @@ int misc_init_r(void)
ffcdd29
 
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
+
ffcdd29
+int board_init(void)
ffcdd29
+{
ffcdd29
+	int offset, len;
ffcdd29
+	const char *mac;
ffcdd29
+
ffcdd29
+	/* take a copy of the firmware information (the user could unknownly
ffcdd29
+	   overwrite that DDR via tftp or other means)  */
ffcdd29
+
ffcdd29
+	offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-wlan");
ffcdd29
+	if (offset >= 0) {
ffcdd29
+		mac = fdt_getprop(fw_dtb, offset, "local-mac-address", &len;;
ffcdd29
+		if (mac)
ffcdd29
+			memcpy(wlan_mac, mac, ARP_HLEN);
ffcdd29
+	}
ffcdd29
+
ffcdd29
+	offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-bt");
ffcdd29
+	if (offset >= 0) {
ffcdd29
+		mac = fdt_getprop(fw_dtb, offset, "local-bd-address", &len;;
ffcdd29
+		if (mac)
ffcdd29
+			memcpy(bt_mac, mac, ARP_HLEN);
ffcdd29
+	}
ffcdd29
+
ffcdd29
+	return 0;
ffcdd29
+}
ffcdd29
+
ffcdd29
+int ft_board_setup(void *blob, bd_t *bd)
ffcdd29
+{
ffcdd29
+	do_fixup_by_compat(blob, "qcom,wcnss-wlan", "local-mac-address",
ffcdd29
+		wlan_mac, ARP_HLEN, 1);
ffcdd29
+
ffcdd29
+	do_fixup_by_compat(blob, "qcom,wcnss-bt", "local-bd-address",
ffcdd29
+		bt_mac, ARP_HLEN, 1);
ffcdd29
+
ffcdd29
+	return 0;
ffcdd29
+}
ffcdd29
diff --git a/board/qualcomm/dragonboard410c/lowlevel_init.S b/board/qualcomm/dragonboard410c/lowlevel_init.S
ffcdd29
new file mode 100644
ffcdd29
index 0000000000..15b2d0c7fd
ffcdd29
--- /dev/null
ffcdd29
+++ b/board/qualcomm/dragonboard410c/lowlevel_init.S
ffcdd29
@@ -0,0 +1,28 @@
ffcdd29
+/*
ffcdd29
+ * (C) Copyright 2016
ffcdd29
+ * C├ędric Schieli <cschieli@gmail.com>
ffcdd29
+ *
ffcdd29
+ * SPDX-License-Identifier:	GPL-2.0+
ffcdd29
+ */
ffcdd29
+
ffcdd29
+#include <config.h>
ffcdd29
+
ffcdd29
+.align 8
ffcdd29
+.global fw_dtb
ffcdd29
+fw_dtb:
ffcdd29
+	.dword 0x0
ffcdd29
+
ffcdd29
+/*
ffcdd29
+ * Routine: save_boot_params (called after reset from start.S)
ffcdd29
+ * Description: save ATAG/FDT address provided by the firmware at boot time
ffcdd29
+ */
ffcdd29
+
ffcdd29
+.global save_boot_params
ffcdd29
+save_boot_params:
ffcdd29
+
ffcdd29
+	/* The firmware provided ATAG/FDT address can be found in r2/x0 */
ffcdd29
+	adr	x8, fw_dtb
ffcdd29
+	str	x0, [x8]
ffcdd29
+
ffcdd29
+	/* Returns */
ffcdd29
+	b	save_boot_params_ret
ffcdd29
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
ffcdd29
index b71bff7592..cfe9be97f3 100644
ffcdd29
--- a/configs/dragonboard410c_defconfig
ffcdd29
+++ b/configs/dragonboard410c_defconfig
ffcdd29
@@ -44,3 +44,6 @@ CONFIG_USB_ETHER_ASIX88179=y
ffcdd29
 CONFIG_USB_ETHER_MCS7830=y
ffcdd29
 CONFIG_USB_ETHER_SMSC95XX=y
ffcdd29
 CONFIG_OF_LIBFDT_OVERLAY=y
ffcdd29
+CONFIG_OF_CONTROL=y
ffcdd29
+CONFIG_ENV_IS_IN_MMC=y
ffcdd29
+CONFIG_OF_BOARD_SETUP=y
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29
ffcdd29
From 5bdb47f83df86729d770601e294207dc42fb68be Mon Sep 17 00:00:00 2001
ffcdd29
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
Date: Thu, 21 Dec 2017 11:27:56 +0100
ffcdd29
Subject: [PATCH 11/15] db410c: replace reset driver with psci
ffcdd29
ffcdd29
this should be the norm for armv8 platforms.
ffcdd29
ffcdd29
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
---
ffcdd29
 arch/arm/dts/dragonboard410c.dts                 |  5 ---
ffcdd29
 board/qualcomm/dragonboard410c/dragonboard410c.c |  5 +++
ffcdd29
 configs/dragonboard410c_defconfig                |  2 +-
ffcdd29
 drivers/sysreset/Makefile                        |  2 --
ffcdd29
 drivers/sysreset/sysreset_snapdragon.c           | 40 ------------------------
ffcdd29
 5 files changed, 6 insertions(+), 48 deletions(-)
ffcdd29
 delete mode 100644 drivers/sysreset/sysreset_snapdragon.c
ffcdd29
ffcdd29
diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts
ffcdd29
index 25aeac46b1..b67e58882a 100644
ffcdd29
--- a/arch/arm/dts/dragonboard410c.dts
ffcdd29
+++ b/arch/arm/dts/dragonboard410c.dts
ffcdd29
@@ -48,11 +48,6 @@
ffcdd29
 			clock = <&clkc 4>;
ffcdd29
 		};
ffcdd29
 
ffcdd29
-		restart@4ab000 {
ffcdd29
-			compatible = "qcom,pshold";
ffcdd29
-			reg = <0x4ab000 0x4>;
ffcdd29
-		};
ffcdd29
-
ffcdd29
 		soc_gpios: pinctrl@1000000 {
ffcdd29
 			compatible = "qcom,apq8016-pinctrl";
ffcdd29
 			reg = <0x1000000 0x300000>;
ffcdd29
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
index 9e5242170d..1c5ab7b175 100644
ffcdd29
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
@@ -171,3 +171,8 @@ int ft_board_setup(void *blob, bd_t *bd)
ffcdd29
 
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
+
ffcdd29
+void reset_cpu(ulong addr)
ffcdd29
+{
ffcdd29
+	psci_system_reset();
ffcdd29
+}
ffcdd29
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
ffcdd29
index cfe9be97f3..de923adbc3 100644
ffcdd29
--- a/configs/dragonboard410c_defconfig
ffcdd29
+++ b/configs/dragonboard410c_defconfig
ffcdd29
@@ -30,7 +30,6 @@ CONFIG_DM_PMIC=y
ffcdd29
 CONFIG_PMIC_PM8916=y
ffcdd29
 CONFIG_MSM_SERIAL=y
ffcdd29
 CONFIG_SPMI_MSM=y
ffcdd29
-CONFIG_SYSRESET=y
ffcdd29
 CONFIG_USB=y
ffcdd29
 CONFIG_DM_USB=y
ffcdd29
 CONFIG_USB_EHCI_HCD=y
ffcdd29
@@ -47,3 +46,4 @@ CONFIG_OF_LIBFDT_OVERLAY=y
ffcdd29
 CONFIG_OF_CONTROL=y
ffcdd29
 CONFIG_ENV_IS_IN_MMC=y
ffcdd29
 CONFIG_OF_BOARD_SETUP=y
ffcdd29
+CONFIG_PSCI_RESET=y
ffcdd29
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
ffcdd29
index 2e9598e300..000c288eeb 100644
ffcdd29
--- a/drivers/sysreset/Makefile
ffcdd29
+++ b/drivers/sysreset/Makefile
ffcdd29
@@ -8,10 +8,8 @@ obj-$(CONFIG_SYSRESET) += sysreset-uclass.o
ffcdd29
 obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
ffcdd29
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
ffcdd29
 obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
ffcdd29
-
ffcdd29
 obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o
ffcdd29
 obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o
ffcdd29
-obj-$(CONFIG_ARCH_SNAPDRAGON) += sysreset_snapdragon.o
ffcdd29
 obj-$(CONFIG_ARCH_STI) += sysreset_sti.o
ffcdd29
 obj-$(CONFIG_TARGET_XTFPGA) += sysreset_xtfpga.o
ffcdd29
 obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o
ffcdd29
diff --git a/drivers/sysreset/sysreset_snapdragon.c b/drivers/sysreset/sysreset_snapdragon.c
ffcdd29
deleted file mode 100644
ffcdd29
index 9869813978..0000000000
ffcdd29
--- a/drivers/sysreset/sysreset_snapdragon.c
ffcdd29
+++ /dev/null
ffcdd29
@@ -1,40 +0,0 @@
ffcdd29
-/*
ffcdd29
- * Qualcomm APQ8016 reset controller driver
ffcdd29
- *
ffcdd29
- * (C) Copyright 2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
ffcdd29
- *
ffcdd29
- * SPDX-License-Identifier:	GPL-2.0+
ffcdd29
- */
ffcdd29
-
ffcdd29
-#include <common.h>
ffcdd29
-#include <dm.h>
ffcdd29
-#include <errno.h>
ffcdd29
-#include <sysreset.h>
ffcdd29
-#include <asm/io.h>
ffcdd29
-
ffcdd29
-DECLARE_GLOBAL_DATA_PTR;
ffcdd29
-
ffcdd29
-static int msm_sysreset_request(struct udevice *dev, enum sysreset_t type)
ffcdd29
-{
ffcdd29
-	phys_addr_t addr = devfdt_get_addr(dev);
ffcdd29
-	if (!addr)
ffcdd29
-		return -EINVAL;
ffcdd29
-	writel(0, addr);
ffcdd29
-	return -EINPROGRESS;
ffcdd29
-}
ffcdd29
-
ffcdd29
-static struct sysreset_ops msm_sysreset_ops = {
ffcdd29
-	.request	= msm_sysreset_request,
ffcdd29
-};
ffcdd29
-
ffcdd29
-static const struct udevice_id msm_sysreset_ids[] = {
ffcdd29
-	{ .compatible = "qcom,pshold" },
ffcdd29
-	{ }
ffcdd29
-};
ffcdd29
-
ffcdd29
-U_BOOT_DRIVER(msm_reset) = {
ffcdd29
-	.name		= "msm_sysreset",
ffcdd29
-	.id		= UCLASS_SYSRESET,
ffcdd29
-	.of_match	= msm_sysreset_ids,
ffcdd29
-	.ops		= &msm_sysreset_ops,
ffcdd29
-};
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29
ffcdd29
From 0d607c98eaead3b14b15da821128b920b2bb7b13 Mon Sep 17 00:00:00 2001
ffcdd29
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
Date: Thu, 4 Jan 2018 19:27:56 +0100
ffcdd29
Subject: [PATCH 13/15] db410c: use the device tree parsed by the lk loader.
ffcdd29
ffcdd29
We dont need to keep copies of the properties that we are going to
ffcdd29
fixup since we will be using the dtb provided by the firmware.
ffcdd29
ffcdd29
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
ffcdd29
---
ffcdd29
 board/qualcomm/dragonboard410c/dragonboard410c.c | 71 ++++++++++++++----------
ffcdd29
 configs/dragonboard410c_defconfig                |  1 +
ffcdd29
 2 files changed, 44 insertions(+), 28 deletions(-)
ffcdd29
ffcdd29
diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
index 1c5ab7b175..236160afd4 100644
ffcdd29
--- a/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
+++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
ffcdd29
@@ -15,14 +15,22 @@
ffcdd29
 DECLARE_GLOBAL_DATA_PTR;
ffcdd29
 
ffcdd29
 /* pointer to the device tree ammended by the firmware */
ffcdd29
-extern const void *fw_dtb;
ffcdd29
+extern void *fw_dtb;
ffcdd29
 
ffcdd29
-static char wlan_mac[ARP_HLEN];
ffcdd29
-static char bt_mac[ARP_HLEN];
ffcdd29
+void *board_fdt_blob_setup(void)
ffcdd29
+{
ffcdd29
+	if (fdt_magic(fw_dtb) != FDT_MAGIC) {
ffcdd29
+		printf("Firmware provided invalid dtb!\n");
ffcdd29
+		return NULL;
ffcdd29
+	}
ffcdd29
+
ffcdd29
+	return fw_dtb;
ffcdd29
+}
ffcdd29
 
ffcdd29
 int dram_init(void)
ffcdd29
 {
ffcdd29
 	gd->ram_size = PHYS_SDRAM_1_SIZE;
ffcdd29
+
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
 
ffcdd29
@@ -138,36 +146,43 @@ int misc_init_r(void)
ffcdd29
 
ffcdd29
 int board_init(void)
ffcdd29
 {
ffcdd29
-	int offset, len;
ffcdd29
-	const char *mac;
ffcdd29
-
ffcdd29
-	/* take a copy of the firmware information (the user could unknownly
ffcdd29
-	   overwrite that DDR via tftp or other means)  */
ffcdd29
-
ffcdd29
-	offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-wlan");
ffcdd29
-	if (offset >= 0) {
ffcdd29
-		mac = fdt_getprop(fw_dtb, offset, "local-mac-address", &len;;
ffcdd29
-		if (mac)
ffcdd29
-			memcpy(wlan_mac, mac, ARP_HLEN);
ffcdd29
-	}
ffcdd29
-
ffcdd29
-	offset = fdt_node_offset_by_compatible(fw_dtb, -1, "qcom,wcnss-bt");
ffcdd29
-	if (offset >= 0) {
ffcdd29
-		mac = fdt_getprop(fw_dtb, offset, "local-bd-address", &len;;
ffcdd29
-		if (mac)
ffcdd29
-			memcpy(bt_mac, mac, ARP_HLEN);
ffcdd29
-	}
ffcdd29
-
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
 
ffcdd29
 int ft_board_setup(void *blob, bd_t *bd)
ffcdd29
 {
ffcdd29
-	do_fixup_by_compat(blob, "qcom,wcnss-wlan", "local-mac-address",
ffcdd29
-		wlan_mac, ARP_HLEN, 1);
ffcdd29
-
ffcdd29
-	do_fixup_by_compat(blob, "qcom,wcnss-bt", "local-bd-address",
ffcdd29
-		bt_mac, ARP_HLEN, 1);
ffcdd29
+	int offset, len, i;
ffcdd29
+	const char *mac;
ffcdd29
+	struct {
ffcdd29
+		const char *compatible;
ffcdd29
+		const char *property;
ffcdd29
+	} fix[] = {
ffcdd29
+		[0] = {
ffcdd29
+			/* update the kernel's dtb with wlan mac */
ffcdd29
+			.compatible = "qcom,wcnss-wlan",
ffcdd29
+			.property = "local-mac-address",
ffcdd29
+		},
ffcdd29
+		[1] = {
ffcdd29
+			/* update the kernel's dtb with bt mac */
ffcdd29
+			.compatible = "qcom,wcnss-bt",
ffcdd29
+			.property = "local-bd-address",
ffcdd29
+		},
ffcdd29
+	};
ffcdd29
+
ffcdd29
+	for ( i = 0; i < sizeof(fix)/sizeof(fix[0]); i++) {
ffcdd29
+
ffcdd29
+		offset = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
ffcdd29
+							fix[i].compatible);
ffcdd29
+		if (offset < 0)
ffcdd29
+			continue;
ffcdd29
+
ffcdd29
+		mac = fdt_getprop(gd->fdt_blob, offset, fix[i].property, &len;;
ffcdd29
+		if (mac)
ffcdd29
+			do_fixup_by_compat(blob,
ffcdd29
+				fix[i].compatible,
ffcdd29
+				fix[i].property,
ffcdd29
+				mac, ARP_HLEN, 1);
ffcdd29
+	}
ffcdd29
 
ffcdd29
 	return 0;
ffcdd29
 }
ffcdd29
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
ffcdd29
index de923adbc3..4389f52b5c 100644
ffcdd29
--- a/configs/dragonboard410c_defconfig
ffcdd29
+++ b/configs/dragonboard410c_defconfig
ffcdd29
@@ -47,3 +47,4 @@ CONFIG_OF_CONTROL=y
ffcdd29
 CONFIG_ENV_IS_IN_MMC=y
ffcdd29
 CONFIG_OF_BOARD_SETUP=y
ffcdd29
 CONFIG_PSCI_RESET=y
ffcdd29
+CONFIG_OF_SEPARATE=y
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29
ffcdd29
From ff6b1225ccc02e5bb963bd72f68a5a36f96ca816 Mon Sep 17 00:00:00 2001
ffcdd29
From: Rob Clark <robdclark@gmail.com>
ffcdd29
Date: Wed, 19 Jul 2017 11:40:15 -0400
ffcdd29
Subject: [PATCH 14/15] db410c: add reserved-memory node to dts
ffcdd29
ffcdd29
If lk lights up display and populates simple-framebuffer node, it will
ffcdd29
also setup a reserved-memory node (needed by simplefb on linux).  But
ffcdd29
it isn't clever enough to cope when the reserved-memory node is not
ffcdd29
present.
ffcdd29
ffcdd29
Signed-off-by: Rob Clark <robdclark@gmail.com>
ffcdd29
---
ffcdd29
 arch/arm/dts/dragonboard410c.dts | 7 ++++++-
ffcdd29
 1 file changed, 6 insertions(+), 1 deletion(-)
ffcdd29
ffcdd29
diff --git a/arch/arm/dts/dragonboard410c.dts b/arch/arm/dts/dragonboard410c.dts
ffcdd29
index b67e58882a..5ccfe7f8c8 100644
ffcdd29
--- a/arch/arm/dts/dragonboard410c.dts
ffcdd29
+++ b/arch/arm/dts/dragonboard410c.dts
ffcdd29
@@ -23,11 +23,16 @@
ffcdd29
 		reg = <0 0x80000000 0 0x3da00000>;
ffcdd29
 	};
ffcdd29
 
ffcdd29
+	reserved-memory {
ffcdd29
+		#address-cells = <2>;
ffcdd29
+		#size-cells = <2>;
ffcdd29
+		ranges;
ffcdd29
+	};
ffcdd29
+
ffcdd29
 	chosen {
ffcdd29
 		stdout-path = "/soc/serial@78b0000";
ffcdd29
 	};
ffcdd29
 
ffcdd29
-
ffcdd29
 	soc {
ffcdd29
 		#address-cells = <0x1>;
ffcdd29
 		#size-cells = <0x1>;
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29
ffcdd29
From ab8c14f869c2cdfe09a36619c965785fd60b9a3c Mon Sep 17 00:00:00 2001
ffcdd29
From: Rob Clark <robdclark@gmail.com>
ffcdd29
Date: Mon, 26 Jun 2017 10:29:40 -0400
ffcdd29
Subject: [PATCH 15/15] db410c: on aarch64 the fdtfile is in per-vendor
ffcdd29
 subdirectory
ffcdd29
ffcdd29
Signed-off-by: Rob Clark <robdclark@gmail.com>
ffcdd29
---
ffcdd29
 include/configs/dragonboard410c.h | 2 +-
ffcdd29
 1 file changed, 1 insertion(+), 1 deletion(-)
ffcdd29
ffcdd29
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
ffcdd29
index 3c5bb8a678..530d667da8 100644
ffcdd29
--- a/include/configs/dragonboard410c.h
ffcdd29
+++ b/include/configs/dragonboard410c.h
ffcdd29
@@ -92,7 +92,7 @@ REFLASH(dragonboard/u-boot.img, 8)\
ffcdd29
 	"initrd_high=0xffffffffffffffff\0" \
ffcdd29
 	"linux_image=Image\0" \
ffcdd29
 	"kernel_addr_r=0x81000000\0"\
ffcdd29
-	"fdtfile=apq8016-sbc.dtb\0" \
ffcdd29
+	"fdtfile=qcom/apq8016-sbc.dtb\0" \
ffcdd29
 	"fdt_addr_r=0x83000000\0"\
ffcdd29
 	"ramdisk_addr_r=0x84000000\0"\
ffcdd29
 	"scriptaddr=0x90000000\0"\
ffcdd29
-- 
ffcdd29
2.14.3
ffcdd29