From patchwork Mon Apr 27 01:24:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 238560 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 26 Apr 2020 19:24:32 -0600 Subject: [PATCH v5 1/4] omap: mmc: Avoid using libfdt with of-platdata In-Reply-To: <20200427012435.254270-1-sjg@chromium.org> References: <20200427012435.254270-1-sjg@chromium.org> Message-ID: <20200427012435.254270-2-sjg@chromium.org> At present this driver is enabled in SPL on omapl138_lcdk, which uses of-platdata. The driver needs to be ported to use of-platdata properly. For now, avoid a build error by returning an error. Signed-off-by: Simon Glass Acked-by: Peng Fan --- Changes in v5: None Changes in v4: None Changes in v3: None drivers/mmc/davinci_mmc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/davinci_mmc.c b/drivers/mmc/davinci_mmc.c index ef5cd4e723..44903354ab 100644 --- a/drivers/mmc/davinci_mmc.c +++ b/drivers/mmc/davinci_mmc.c @@ -498,6 +498,12 @@ static int davinci_mmc_probe(struct udevice *dev) cfg->b_max = DAVINCI_MAX_BLOCKS; cfg->name = "da830-mmc"; + /* FIXME: Cannot read from device tree with of-platdata */ + if (CONFIG_IS_ENABLED(OF_PLATDATA)) { + printf("Please fix this driver to use of-platdata"); + return -ENOSYS; + } + priv->reg_base = (struct davinci_mmc_regs *)dev_read_addr(dev); priv->input_clk = clk_get(DAVINCI_MMCSD_CLKID); From patchwork Mon Apr 27 01:24:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 238562 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 26 Apr 2020 19:24:33 -0600 Subject: [PATCH v5 2/4] rockchip: pinctrl: Disable full pinctrl for SPL In-Reply-To: <20200427012435.254270-1-sjg@chromium.org> References: <20200427012435.254270-1-sjg@chromium.org> Message-ID: <20200427012435.254270-3-sjg@chromium.org> We don't need full pinctrl for SPL on these chrombook devices. Disable it so that of-platdata can be used without calling libfdt routines. Signed-off-by: Simon Glass Reviewed-by: Kever Yang --- Changes in v5: None Changes in v4: None Changes in v3: None configs/chromebit_mickey_defconfig | 1 + configs/chromebook_jerry_defconfig | 1 + configs/chromebook_minnie_defconfig | 1 + configs/chromebook_speedy_defconfig | 1 + 4 files changed, 4 insertions(+) diff --git a/configs/chromebit_mickey_defconfig b/configs/chromebit_mickey_defconfig index a0b1c8d87e..7a1a5d6fcb 100644 --- a/configs/chromebit_mickey_defconfig +++ b/configs/chromebit_mickey_defconfig @@ -72,6 +72,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set # CONFIG_SPL_PINMUX is not set CONFIG_SPL_PINCONF=y CONFIG_DM_PMIC=y diff --git a/configs/chromebook_jerry_defconfig b/configs/chromebook_jerry_defconfig index 7ba0c9566a..0e7381ca72 100644 --- a/configs/chromebook_jerry_defconfig +++ b/configs/chromebook_jerry_defconfig @@ -75,6 +75,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set # CONFIG_SPL_PINMUX is not set CONFIG_SPL_PINCONF=y CONFIG_DM_PMIC=y diff --git a/configs/chromebook_minnie_defconfig b/configs/chromebook_minnie_defconfig index 46e1c183a2..bacfafb539 100644 --- a/configs/chromebook_minnie_defconfig +++ b/configs/chromebook_minnie_defconfig @@ -74,6 +74,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set # CONFIG_SPL_PINMUX is not set CONFIG_SPL_PINCONF=y CONFIG_DM_PMIC=y diff --git a/configs/chromebook_speedy_defconfig b/configs/chromebook_speedy_defconfig index 34cf727abc..370a40df3e 100644 --- a/configs/chromebook_speedy_defconfig +++ b/configs/chromebook_speedy_defconfig @@ -74,6 +74,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y From patchwork Mon Apr 27 01:24:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 238564 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 26 Apr 2020 19:24:34 -0600 Subject: [PATCH v5 3/4] spl: Allow SPL/TPL to use of-platdata without libfdt In-Reply-To: <20200427012435.254270-1-sjg@chromium.org> References: <20200427012435.254270-1-sjg@chromium.org> Message-ID: <20200427012435.254270-4-sjg@chromium.org> At present libfdt is included in SPL/TPL if SPL/TPL_OF_CONTROL is enabled. But if of-platdata is in use this is not required. Update the condition to avoid building this extra code. This ensures that if a libfdt function is used it will produce a link error rather than silently increasing the build size. Signed-off-by: Simon Glass --- Changes in v5: - Drop rockchip patches as those boards have been fixed Changes in v4: - Add new patch for rockchip build errors - Add new patch for omap MMC build errors - Add new patch for rockchip chromebook build errors - Pull out patches into a new series - Add new patches to handle build failures Changes in v3: None lib/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Kconfig b/lib/Kconfig index 144a54da28..854f0990c5 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -501,7 +501,7 @@ config OF_LIBFDT_OVERLAY config SPL_OF_LIBFDT bool "Enable the FDT library for SPL" - default y if SPL_OF_CONTROL + default y if SPL_OF_CONTROL && !SPL_OF_PLATDATA help This enables the FDT library (libfdt). It provides functions for accessing binary device tree images in memory, such as adding and @@ -522,7 +522,7 @@ config SPL_OF_LIBFDT_ASSUME_MASK config TPL_OF_LIBFDT bool "Enable the FDT library for TPL" - default y if TPL_OF_CONTROL + default y if TPL_OF_CONTROL && !TPL_OF_PLATDATA help This enables the FDT library (libfdt). It provides functions for accessing binary device tree images in memory, such as adding and From patchwork Mon Apr 27 01:24:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 238563 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 26 Apr 2020 19:24:35 -0600 Subject: [PATCH v5 4/4] dm: core: Don't include ofnode functions with of-platdata In-Reply-To: <20200427012435.254270-1-sjg@chromium.org> References: <20200427012435.254270-1-sjg@chromium.org> Message-ID: <20200427012435.254270-5-sjg@chromium.org> These functions cannot work with of-platdata since libfdt is not available. At present when dev_read_...() functions are used it produces error messages about ofnode which is confusing. Adjust the Makefile and header to produce an error message for the actual dev_read...() function which is called. This makes it easier to see what code needs to be converted for use with of-platdata. Signed-off-by: Simon Glass --- Changes in v5: None Changes in v4: None Changes in v3: - Fix eth_dev_get_mac_address() call dev_read...() only when available drivers/core/Makefile | 4 +++- include/dm/read.h | 3 +-- net/eth-uclass.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/core/Makefile b/drivers/core/Makefile index c707026a3a..0fd09abc40 100644 --- a/drivers/core/Makefile +++ b/drivers/core/Makefile @@ -14,6 +14,8 @@ 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 read_extra.o +ifdef CONFIG_$(SPL_TPL_)OF_LIBFDT +obj-$(CONFIG_$(SPL_TPL_)OF_CONTROL) += of_extra.o ofnode.o read_extra.o +endif ccflags-$(CONFIG_DM_DEBUG) += -DDEBUG diff --git a/include/dm/read.h b/include/dm/read.h index 03c15b8550..79a2a4ec8c 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -43,8 +43,7 @@ static inline bool dev_of_valid(const struct udevice *dev) return ofnode_valid(dev_ofnode(dev)); } -#ifndef CONFIG_DM_DEV_READ_INLINE - +#if !defined(CONFIG_DM_DEV_READ_INLINE) || CONFIG_IS_ENABLED(OF_PLATDATA) /** * dev_read_u32() - read a 32-bit integer from a device's DT property * diff --git a/net/eth-uclass.c b/net/eth-uclass.c index 8bf2eabe90..abefda0b0c 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -467,7 +467,7 @@ static int eth_pre_unbind(struct udevice *dev) static bool eth_dev_get_mac_address(struct udevice *dev, u8 mac[ARP_HLEN]) { -#if IS_ENABLED(CONFIG_OF_CONTROL) +#if CONFIG_IS_ENABLED(OF_CONTROL) const uint8_t *p; p = dev_read_u8_array_ptr(dev, "mac-address", ARP_HLEN);