From patchwork Tue Jan 14 06:13:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239582 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:08 +0100 Subject: [RFC WIP PATCH v1 1/7] wandboard: Import the dts files for the other revd1 variants In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-2-hs@denx.de> From: Fabio Estevam Import the imx6dl-wandboard-revd1.dts and imx6q-wandboard-revd1.dts from kernel 5.4.8 so that these variants can also be supported. Signed-off-by: Fabio Estevam Signed-off-by: Heiko Schocher --- arch/arm/dts/Makefile | 2 ++ arch/arm/dts/imx6dl-wandboard-revd1.dts | 19 +++++++++++++++++++ arch/arm/dts/imx6q-wandboard-revd1.dts | 23 +++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 arch/arm/dts/imx6dl-wandboard-revd1.dts create mode 100644 arch/arm/dts/imx6q-wandboard-revd1.dts diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 983e235f442..a60e23242fe 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -609,6 +609,7 @@ dtb-y += \ imx6dl-sabreauto.dtb \ imx6dl-sabresd.dtb \ imx6dl-wandboard-revb1.dtb \ + imx6dl-wandboard-revd1.dtb \ endif @@ -641,6 +642,7 @@ dtb-y += \ imx6q-sabresd.dtb \ imx6q-tbs2910.dtb \ imx6q-wandboard-revb1.dtb \ + imx6q-wandboard-revd1.dtb \ imx6qp-sabreauto.dtb \ imx6qp-sabresd.dtb \ imx6qp-wandboard-revd1.dtb \ diff --git a/arch/arm/dts/imx6dl-wandboard-revd1.dts b/arch/arm/dts/imx6dl-wandboard-revd1.dts new file mode 100644 index 00000000000..6d1d863c2e3 --- /dev/null +++ b/arch/arm/dts/imx6dl-wandboard-revd1.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * Author: Fabio Estevam + */ +/dts-v1/; +#include "imx6dl.dtsi" +#include "imx6qdl-wandboard-revd1.dtsi" + +/ { + model = "Wandboard i.MX6 Dual Lite Board revD1"; + compatible = "wand,imx6dl-wandboard", "fsl,imx6dl"; + + memory at 10000000 { + device_type = "memory"; + reg = <0x10000000 0x40000000>; + }; +}; diff --git a/arch/arm/dts/imx6q-wandboard-revd1.dts b/arch/arm/dts/imx6q-wandboard-revd1.dts new file mode 100644 index 00000000000..55331021d80 --- /dev/null +++ b/arch/arm/dts/imx6q-wandboard-revd1.dts @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright 2013 Freescale Semiconductor, Inc. + * + * Author: Fabio Estevam + */ +/dts-v1/; +#include "imx6q.dtsi" +#include "imx6qdl-wandboard-revd1.dtsi" + +/ { + model = "Wandboard i.MX6 Quad Board revD1"; + compatible = "wand,imx6q-wandboard", "fsl,imx6q"; + + memory at 10000000 { + device_type = "memory"; + reg = <0x10000000 0x80000000>; + }; +}; + +&sata { + status = "okay"; +}; From patchwork Tue Jan 14 06:13:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239583 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:09 +0100 Subject: [RFC WIP PATCH v1 2/7] wandboard: Handle the imx6dl and imx6q revd1 boards In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-3-hs@denx.de> From: Fabio Estevam Currently the only supported revd1 variant is imx6qp. Add logic for supporting imx6dl and imx6q revd1 boards as well. Reported-by: Heiko Schocher Signed-off-by: Fabio Estevam Signed-off-by: Heiko Schocher --- board/wandboard/wandboard.c | 16 +++++++++++++--- configs/wandboard_defconfig | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index f4534dd3dc6..05f36b7f5d5 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -483,12 +483,22 @@ int checkboard(void) #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { + /* imx6qp wandboard only comes in revd1 flavor */ + if (is_mx6dqp()) { + if (!strcmp(name, "imx6qp-wandboard-revd1")) + return 0; + } + + if (is_mx6dq() && is_revd1()) { + if (!strcmp(name, "imx6q-wandboard-revd1")) + return 0; + } else if ((is_mx6dl() || is_mx6solo()) && is_revd1()) { + if (!strcmp(name, "imx6dl-wandboard-revd1")) + return 0; + } if (is_mx6dq()) { if (!strcmp(name, "imx6q-wandboard-revb1")) return 0; - } else if (is_mx6dqp()) { - if (!strcmp(name, "imx6qp-wandboard-revd1")) - return 0; } else if (is_mx6dl() || is_mx6solo()) { if (!strcmp(name, "imx6dl-wandboard-revb1")) return 0; diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index ca564c59b80..d6bde4bf28b 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revb1" -CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1" +CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1 imx6q-wandboard-revd1 imx6dl-wandboard-revd1" CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y From patchwork Tue Jan 14 06:13:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239584 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:10 +0100 Subject: [RFC WIP PATCH v1 3/7] wandboard: reorder board_fit_config_name_match In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-4-hs@denx.de> handle different board revisions in one if path. Without this change if "imx6dl-wandboard-revb1" is passed before "imx6dl-wandboard-revd1" to this function, "imx6dl-wandboard-revb1" is detected as the correct version, on revd1 boards, as "imx6dl-wandboard-revb1" is not dependend on is_revd1(). Signed-off-by: Heiko Schocher --- board/wandboard/wandboard.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index 05f36b7f5d5..4cb9bf6f8c2 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -489,19 +489,22 @@ int board_fit_config_name_match(const char *name) return 0; } - if (is_mx6dq() && is_revd1()) { - if (!strcmp(name, "imx6q-wandboard-revd1")) - return 0; - } else if ((is_mx6dl() || is_mx6solo()) && is_revd1()) { - if (!strcmp(name, "imx6dl-wandboard-revd1")) - return 0; - } - if (is_mx6dq()) { - if (!strcmp(name, "imx6q-wandboard-revb1")) - return 0; - } else if (is_mx6dl() || is_mx6solo()) { - if (!strcmp(name, "imx6dl-wandboard-revb1")) - return 0; + if (is_revd1()) { + if (is_mx6dq()) { + if (!strcmp(name, "imx6q-wandboard-revd1")) + return 0; + } else if (is_mx6dl() || is_mx6solo()) { + if (!strcmp(name, "imx6dl-wandboard-revd1")) + return 0; + } + } else { + if (is_mx6dq()) { + if (!strcmp(name, "imx6q-wandboard-revb1")) + return 0; + } else if (is_mx6dl() || is_mx6solo()) { + if (!strcmp(name, "imx6dl-wandboard-revb1")) + return 0; + } } return -EINVAL; From patchwork Tue Jan 14 06:13:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239585 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:11 +0100 Subject: [RFC WIP PATCH v1 4/7] wandboard: enable CONFIG_DTB_RESELECT In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-5-hs@denx.de> we have to reselect the DTB, as we need to start with DTB for revision D1 boards, as there is a PMIC which is not on other board revisions. If we do not find the PMIC, we are not on D1 revision board. Signed-off-by: Heiko Schocher --- board/wandboard/wandboard.c | 21 +++++++++++++++++++++ configs/wandboard_defconfig | 1 + 2 files changed, 22 insertions(+) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index 4cb9bf6f8c2..ae4ad765a83 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -510,3 +510,24 @@ int board_fit_config_name_match(const char *name) return -EINVAL; } #endif + +#if !defined(CONFIG_SPL_BUILD) +#ifdef CONFIG_DTB_RESELECT +/* + * we have to reselect the DTB, as we need to start + * with DTB for revision D1 boards, as there is + * a PMIC which is not on other board revisions. + * If we do not find the PMIC, we are not on D1 + * revision board. + */ +int embedded_dtb_select(void) +{ + int rescan; + + power_init_board(); + fdtdec_resetup(&rescan); + + return 0; +} +#endif +#endif diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index d6bde4bf28b..b8ed143ee99 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -44,6 +44,7 @@ CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revb1" CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1 imx6q-wandboard-revd1 imx6dl-wandboard-revd1" +CONFIG_DTB_RESELECT=y CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_IS_IN_MMC=y CONFIG_SYS_RELOC_GD_ENV_ADDR=y From patchwork Tue Jan 14 06:13:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239586 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:12 +0100 Subject: [RFC WIP PATCH v1 5/7] wandboard: use imx6dl-wandboard-revd1 as default DTB In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-6-hs@denx.de> we detect revision D1 board by searching for pmic, as revision D1 only has a pmic on board. For this we need to have pmic in DTB, so use imx6dl-wandboard-revd1 as default device tree, not imx6dl-wandboard-revb1 Signed-off-by: Heiko Schocher --- configs/wandboard_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/wandboard_defconfig b/configs/wandboard_defconfig index b8ed143ee99..6f3d413f66a 100644 --- a/configs/wandboard_defconfig +++ b/configs/wandboard_defconfig @@ -42,7 +42,7 @@ CONFIG_CMD_BMP=y CONFIG_CMD_CACHE=y CONFIG_CMD_EXT4_WRITE=y CONFIG_OF_CONTROL=y -CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revb1" +CONFIG_DEFAULT_DEVICE_TREE="imx6dl-wandboard-revd1" CONFIG_OF_LIST="imx6q-wandboard-revb1 imx6qp-wandboard-revd1 imx6dl-wandboard-revb1 imx6q-wandboard-revd1 imx6dl-wandboard-revd1" CONFIG_DTB_RESELECT=y CONFIG_MULTI_DTB_FIT=y From patchwork Tue Jan 14 06:13:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239587 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:13 +0100 Subject: [RFC WIP PATCH v1 6/7] wandboard: add u-boot specific *wandboard-revd1-u-boot.dtsi In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-7-hs@denx.de> we want to access PMIC before relocation, so we need to add u-boot specific "u-boot,dm-pre-reloc" properties. Signed-off-by: Heiko Schocher --- arch/arm/dts/imx6dl-wandboard-revd1-u-boot.dtsi | 11 +++++++++++ arch/arm/dts/imx6q-wandboard-revd1-u-boot.dtsi | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 arch/arm/dts/imx6dl-wandboard-revd1-u-boot.dtsi create mode 100644 arch/arm/dts/imx6q-wandboard-revd1-u-boot.dtsi diff --git a/arch/arm/dts/imx6dl-wandboard-revd1-u-boot.dtsi b/arch/arm/dts/imx6dl-wandboard-revd1-u-boot.dtsi new file mode 100644 index 00000000000..93e88fa1148 --- /dev/null +++ b/arch/arm/dts/imx6dl-wandboard-revd1-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (C) 2020 Heiko Schocher + +&i2c3 { + u-boot,dm-pre-reloc; +}; + +&pmic { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/dts/imx6q-wandboard-revd1-u-boot.dtsi b/arch/arm/dts/imx6q-wandboard-revd1-u-boot.dtsi new file mode 100644 index 00000000000..93e88fa1148 --- /dev/null +++ b/arch/arm/dts/imx6q-wandboard-revd1-u-boot.dtsi @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// Copyright (C) 2020 Heiko Schocher + +&i2c3 { + u-boot,dm-pre-reloc; +}; + +&pmic { + u-boot,dm-pre-reloc; +}; From patchwork Tue Jan 14 06:13:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 239588 List-Id: U-Boot discussion From: hs at denx.de (Heiko Schocher) Date: Tue, 14 Jan 2020 07:13:14 +0100 Subject: [RFC WIP PATCH v1 7/7] wandboard: in SPL use only D1 DTB In-Reply-To: <20200114061314.148491-1-hs@denx.de> References: <20200114061314.148491-1-hs@denx.de> Message-ID: <20200114061314.148491-8-hs@denx.de> Signed-off-by: Heiko Schocher --- board/wandboard/wandboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c index ae4ad765a83..6b7210c0992 100644 --- a/board/wandboard/wandboard.c +++ b/board/wandboard/wandboard.c @@ -489,7 +489,12 @@ int board_fit_config_name_match(const char *name) return 0; } +#if defined(CONFIG_SPL_BUILD) + /* in SPL we use only revision D1 DTB */ + if (1) { +#else if (is_revd1()) { +#endif if (is_mx6dq()) { if (!strcmp(name, "imx6q-wandboard-revd1")) return 0;