lib: Allow crc32 to be disabled.
Subsystems (20)
PATCH 1/30 lib: Allow crc32 to be disabled.
Unfortunately this table seems to appear in TPL with gcc 7.3 even if it is not used. Fix it by creating a Kconfig that can be used to disable this routine.
It is enabled by default, since most boards use it.
---
lib/Kconfig | 29 +++++++++++++++++++++++++++++ lib/Makefile | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-)
lib/Kconfig +29 -0
@@ -353,6 +353,35 @@ config SHA_PROG_HW_ACCEL config MD5 bool +config CRC32 + bool "Enable crc32 routine" + default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine. It is + typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + +config SPL_CRC32 + bool "Enable crc32 routine in SPL" + depends on SPL + default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It + is typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + +config TPL_CRC32 + bool "Enable crc32 routine in SPL" + depends on TPL + default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It + is typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + config CRC32C bool
lib/Makefile +1 -1
@@ -84,7 +84,7 @@ obj-y += errno.o obj-y += display_options.o CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"') obj-$(CONFIG_BCH) += bch.o -obj-y += crc32.o +obj-$(CONFIG_$(SPL_TPL_)CRC32) += crc32.o obj-$(CONFIG_CRC32C) += crc32c.o obj-y += ctype.o obj-y += div64.o
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 2/30 spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
In some cases SPL needs to be able to erase but TPL just needs to read. Allow these to have separate settings for SPI_FLASH_TINY.
---
common/spl/Kconfig | 10 ++++++++++ drivers/mtd/spi/Makefile | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-)
common/spl/Kconfig +10 -0
@@ -1423,6 +1423,16 @@ config TPL_SPI_FLASH_SUPPORT Enable support for using SPI flash in TPL. See SPL_SPI_FLASH_SUPPORT for details. +config TPL_SPI_FLASH_TINY + bool "Enable low footprint TPL SPI Flash support" + depends on TPL_SPI_FLASH_SUPPORT && !SPI_FLASH_BAR + default y if SPI_FLASH + help + Enable lightweight TPL SPI Flash support that supports just reading + data/images from flash. No support to write/erase flash. Enable + this if you have TPL size limitations and don't need full-fledged + SPI flash support. + config TPL_SPI_LOAD bool "Support loading from SPI flash" depends on TPL_SPI_FLASH_SUPPORT
drivers/mtd/spi/Makefile +1 -1
@@ -8,7 +8,7 @@ spi-nor-y := sf_probe.o spi-nor-ids.o ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_SPI_BOOT) += fsl_espi_spl.o -ifeq ($(CONFIG_SPL_SPI_FLASH_TINY),y) +ifeq ($(CONFIG_$(SPL_TPL_)SPI_FLASH_TINY),y) spi-nor-y += spi-nor-tiny.o else spi-nor-y += spi-nor-core.o
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 3/30 mtd: spi-nor: Tidy up error handling / debug code
In reply to Simon GlassThe -ENODEV error value in spi_nor_read_id() is incorrect since there clearly is a device - it just cannot be supported. Use -ENOMEDIUM instead which has the virtue of being less common.
Fix the return value in spi_nor_scan().
Also there are a few printf() statements which should be debug() since they bloat the code with unused strings at present. Fix those while here.
---
drivers/mtd/spi/sf_probe.c | 2 +- drivers/mtd/spi/spi-nor-core.c | 2 +- drivers/mtd/spi/spi-nor-tiny.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/mtd/spi/sf_probe.c +1 -1
@@ -119,7 +119,7 @@ static int spi_flash_std_erase(struct udevice *dev, u32 offset, size_t len)struct erase_info instr;if (offset % mtd->erasesize || len % mtd->erasesize) { -printf ("SF: Erase offset/length not multiple of erase size\n" ); +debug ("SF: Erase offset/length not multiple of erase size\n" );return -EINVAL ; }
drivers/mtd/spi/spi-nor-core.c +1 -1
@@ -2399,7 +2399,7 @@ static int spi_nor_init(struct spi_nor *nor)* designer) that this is bad. */ if (nor->flags &SNOR_F_BROKEN_RESET ) -printf ("enabling reset hack; may not recover from unexpected reboots\n" ); +debug ("enabling reset hack; may not recover from unexpected reboots\n" );set_4byte (nor, nor->info,1 ); }
drivers/mtd/spi/spi-nor-tiny.c +2 -2
@@ -375,7 +375,7 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor) }dev_dbg (nor->dev,"unrecognized JEDEC id bytes: %02x, %02x, %02x\n" , id[0 ], id[1 ], id[2 ]); -return ERR_PTR (-ENODEV ); +return ERR_PTR (-EMEDIUMTYPE ); } static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
@@ -731,7 +731,7 @@ int spi_nor_scan(struct spi_nor *nor) info =spi_nor_read_id (nor);if (IS_ERR_OR_NULL (info)) -return -ENOENT ; +return PTR_ERR (info);/* Parse the Serial Flash Discoverable Parameters table. */ ret =spi_nor_init_params (nor, info, ¶ms);if (ret)
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 4/30 mtd: spi: Export spi_flash_std_probe()
In reply to Simon GlassWith of-platdata we need to create drivers for particular chips, or at least drivers that are separate from the standard code, since C structures are created by dtoc which are private to that driver.
To avoid duplicating the probing code, export this probe function for use by these drivers.
---
drivers/mtd/spi/sf_probe.c | 2 +- include/spi_flash.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/mtd/spi/sf_probe.c +1 -1
@@ -137,7 +137,7 @@ static int spi_flash_std_get_sw_write_prot(struct udevice *dev)return spi_flash_cmd_get_sw_write_prot (flash); } -static int spi_flash_std_probe (struct udevice *dev) +int spi_flash_std_probe (struct udevice *dev) {struct spi_slave *slave =dev_get_parent_priv (dev);struct dm_spi_slave_platdata *plat =dev_get_parent_platdata (dev);
include/spi_flash.h +12 -0
@@ -102,6 +102,18 @@ int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len);*/ int spl_flash_get_sw_write_prot (struct udevice *dev); +/** +* spi_flash_std_probe() - Probe a SPI flash device +* +* This is the standard internal method for probing a SPI flash device to +* determine its type. It can be used in chip-specific drivers which need to +* do this, typically with of-platdata +* +* @dev: SPI-flash device to probe +* @return 0 if OK, -ve on error +*/ +int spi_flash_std_probe (struct udevice *dev); +int spi_flash_probe_bus_cs (unsigned int busnum,unsigned int cs,unsigned int max_hz,unsigned int spi_mode,struct udevice **devp);
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 5/30 wdt: Move code out of the header
In reply to Simon GlassWe should not have C code in a header file. Move it into a shared C file so it can be used by U-Boot and SPL.
---
common/init/Makefile | 1 + common/init/wdt.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ include/init.h | 7 +++++++ include/wdt.h | 38 ------------------------------------ 4 files changed, 54 insertions(+), 38 deletions(-) create mode 100644 common/init/wdt.c
common/init/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-y += board_init.o obj-$(CONFIG_$(SPL_TPL_)HANDOFF) += handoff.o +obj-$(CONFIG_$(SPL_TPL_)WDT) += wdt.o
common/init/wdt.c new file +46 -0
46 lines not on this page · raw message
include/init.h +7 -0
@@ -181,6 +181,13 @@ int init_func_vid(void);int checkboard (void );int show_board_info (void ); +/** +* initr_watchdog() - Init the watchdog +* +* @return 0 if OK, -ve on error +*/ +int initr_watchdog (void ); +#endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */
include/wdt.h +0 -38
@@ -106,42 +106,4 @@ struct wdt_ops { int (*expire_now)(struct udevice *dev, ulong flags); }; -#if CONFIG_IS_ENABLED (WDT ) -#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS -#define CONFIG_WATCHDOG_TIMEOUT_MSECS (60 * 1000) -#endif -#define WATCHDOG_TIMEOUT_SECS (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000) - -static inline int initr_watchdog (void ) -{ -u32 timeout =WATCHDOG_TIMEOUT_SECS ; - -/* -* Init watchdog: This will call the probe function of the -* watchdog driver, enabling the use of the device -*/ -if (uclass_get_device_by_seq (UCLASS_WDT ,0 , - (struct udevice **)&gd->watchdog_dev)) { -debug ("WDT: Not found by seq!\n" ); -if (uclass_get_device (UCLASS_WDT ,0 , - (struct udevice **)&gd->watchdog_dev)) { -printf ("WDT: Not found!\n" ); -return 0 ; - } - } - -if (CONFIG_IS_ENABLED (OF_CONTROL )) { - timeout =dev_read_u32_default (gd->watchdog_dev,"timeout-sec" , -WATCHDOG_TIMEOUT_SECS ); - } - -wdt_start (gd->watchdog_dev, timeout *1000 ,0 ); - gd->flags |=GD_FLG_WDT_READY ; -printf ("WDT: Started with%s servicing (%ds timeout)\n" , -IS_ENABLED (CONFIG_WATCHDOG ) ?"" :"out" , timeout); - -return 0 ; -} -#endif -#endif /* _WDT_H_ */
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 5/30 wdt: Move code out of the header
Quoted 4 lines · Simon Glass
We should not have C code in a header file. Move it into a shared C file so it can be used by U-Boot and SPL.
Signed-off-by Simon Glass <[email protected]>
Thanks,
Stefan
Quoted 126 lines
---
common/init/Makefile | 1 + common/init/wdt.c | 46 ++++++++++++++++++++++++++++++++++++++++++++ include/init.h | 7 +++++++ include/wdt.h | 38 ------------------------------------ 4 files changed, 54 insertions(+), 38 deletions(-)create mode 100644
common/init/wdt.ccommon/init/Makefile +1
-0@@ -6,3 +6,4 @@ obj-y += board_init.o obj-$(CONFIG_$(SPL_TPL_)HANDOFF) += handoff.o +obj-$(CONFIG_$(SPL_TPL_)WDT) += wdt.ocommon/init/wdt.c new file +46
-0@@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright 2017 Google, Inc +*/ + +#include <common.h> +#include <dm.h> +#include <wdt.h> + +DECLARE_GLOBAL_DATA_PTR ; + +#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS +#define CONFIG_WATCHDOG_TIMEOUT_MSECS (60 * 1000) +#endif +#define WATCHDOG_TIMEOUT_SECS (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000) + +int initr_watchdog (void ) +{ +u32 timeout =WATCHDOG_TIMEOUT_SECS ; + +/* +* Init watchdog: This will call the probe function of the +* watchdog driver, enabling the use of the device +*/ +if (uclass_get_device_by_seq (UCLASS_WDT ,0 , + (struct udevice **)&gd->watchdog_dev)) { +debug ("WDT: Not found by seq!\n" ); +if (uclass_get_device (UCLASS_WDT ,0 , + (struct udevice **)&gd->watchdog_dev)) { +printf ("WDT: Not found!\n" ); +return 0 ; + } + } + +if (CONFIG_IS_ENABLED (OF_CONTROL )) { + timeout =dev_read_u32_default (gd->watchdog_dev,"timeout-sec" , +WATCHDOG_TIMEOUT_SECS ); + } + +wdt_start (gd->watchdog_dev, timeout *1000 ,0 ); + gd->flags |=GD_FLG_WDT_READY ; +printf ("WDT: Started with%s servicing (%ds timeout)\n" , +IS_ENABLED (CONFIG_WATCHDOG ) ?"" :"out" , timeout); + +return 0 ; +}include/init.h +7
-0@@ -181,6 +181,13 @@ int init_func_vid(void);int checkboard (void );int show_board_info (void ); +/** +* initr_watchdog() - Init the watchdog +* +* @return 0 if OK, -ve on error +*/ +int initr_watchdog (void ); +#endif /* __ASSEMBLY__ */ /* Put only stuff here that the assembler can digest */ include/wdt.h +0
-29@@ -106,42 +106,4 @@ struct wdt_ops {int (*expire_now)(struct udevice *dev,ulong flags); }; -#if CONFIG_IS_ENABLED (WDT ) -#ifndef CONFIG_WATCHDOG_TIMEOUT_MSECS -#define CONFIG_WATCHDOG_TIMEOUT_MSECS (60 * 1000) -#endif -#define WATCHDOG_TIMEOUT_SECS (CONFIG_WATCHDOG_TIMEOUT_MSECS / 1000) - -static inline int initr_watchdog (void ) -{ -u32 timeout =WATCHDOG_TIMEOUT_SECS ; - -/* -* Init watchdog: This will call the probe function of the -* watchdog driver, enabling the use of the device -*/ -if (uclass_get_device_by_seq (UCLASS_WDT ,0 , - (struct udevice **)&gd->watchdog_dev)) { -debug ("WDT: Not found by seq!\n" ); -if (uclass_get_device (UCLASS_WDT ,0 , - (struct udevice **)&gd->watchdog_dev)) { -printf ("WDT: Not found!\n" ); -return 0 ; - } - } - -if (CONFIG_IS_ENABLED (OF_CONTROL )) { - timeout =dev_read_u32_default (gd->watchdog_dev,"timeout-sec" , -WATCHDOG_TIMEOUT_SECS ); - } -
include/wdt.h struct wdt_ops { · line 109
Quoted 10 lines
include/wdt.h +0
-9-wdt_start (gd->watchdog_dev, timeout *1000 ,0 ); - gd->flags |=GD_FLG_WDT_READY ; -printf ("WDT: Started with%s servicing (%ds timeout)\n" , -IS_ENABLED (CONFIG_WATCHDOG ) ?"" :"out" , timeout); - -return 0 ; -} -#endif -#endif /* _WDT_H_ */
Viele Grüße,
Stefan
Signature · 3 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
PATCH 6/30 wdt: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
include/wdt.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/wdt.h +1 -2
@@ -6,8 +6,7 @@#ifndef _WDT_H_#define _WDT_H_ -#include <dm.h> -#include <dm/read.h> +struct udevice ;/* * Implement a simple watchdog uclass. Watchdog is basically a timer that
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 6/30 wdt: Drop dm.h header file
Quoted 14 lines · Simon Glass
This header file should not be included in other header files. Remove it and use a forward declaration instead.
Signed-off-by Simon Glass <[email protected]>---
include/wdt.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)include/wdt.h +0
-0
include/wdt.h line 9
Quoted 6 lines
include/wdt.h +1
-2@@ -6,8 +6,7 @@#ifndef _WDT_H_#define _WDT_H_ -#include <dm.h> -#include <dm/read.h> +struct udevice ;
I'm not a big fan of forward declarations. But if this helps with overall cleanup and compile speed:
Thanks,
Stefan
PATCH 7/30 mtd: spi-mem: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
drivers/spi/spi-mem-nodm.c | 1 + drivers/spi/spi-mem.c | 5 +++++ drivers/spi/stm32_qspi.c | 2 ++ include/spi-mem.h | 5 +---- 4 files changed, 9 insertions(+), 4 deletions(-)
drivers/spi/spi-mem-nodm.c +1 -0
@@ -3,6 +3,7 @@* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ */ +#include <malloc.h> #include <spi.h> #include <spi-mem.h>
drivers/spi/spi-mem.c +5 -0
@@ -11,6 +11,11 @@#include <linux/pm_runtime.h> #include "internals.h" #else +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <malloc.h> +#include <spi.h> #include <spi.h> #include <spi-mem.h> #endif
drivers/spi/stm32_qspi.c +2 -0
@@ -9,7 +9,9 @@#include <common.h> #include <clk.h> +#include <dm.h> #include <reset.h> +#include <spi.h> #include <spi-mem.h> #include <linux/iopoll.h> #include <linux/ioport.h>
include/spi-mem.h +1 -4
@@ -11,10 +11,7 @@#ifndef __UBOOT_SPI_MEM_H#define __UBOOT_SPI_MEM_H -#include <common.h> -#include <dm.h> -#include <errno.h> -#include <spi.h> +struct udevice ;#define SPI_MEM_OP_CMD (__opcode, __buswidth) \ { \
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 8/30 mtd: spi: Drop SPI_XFER_MMAP*
In reply to Simon GlassThese two defines are no-longer supported. Drop them.
---
include/spi.h | 2 -- 1 file changed, 2 deletions(-)
include/spi.h +0 -2
@@ -113,8 +113,6 @@ struct spi_slave {#define SPI_XFER_BEGIN BIT(0)/* Assert CS before transfer */ #define SPI_XFER_END BIT(1)/* Deassert CS after transfer */ #define SPI_XFER_ONCE (SPI_XFER_BEGIN | SPI_XFER_END) -#define SPI_XFER_MMAP BIT(2)/* Memory Mapped start */ -#define SPI_XFER_MMAP_END BIT(3)/* Memory Mapped End */ };/**
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 9/30 dm: core: Drop dm.h header file from dm-demo.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and add it to the cmd file instead.
---
cmd/demo.c | 1 + include/dm-demo.h | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-)
cmd/demo.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <dm.h> #include <dm-demo.h> #include <mapmem.h> #include <asm/io.h>
include/dm-demo.h +0 -2
@@ -6,8 +6,6 @@#ifndef __DM_DEMO_H#define __DM_DEMO_H -#include <dm.h> -/** * struct dm_demo_pdata - configuration data for demo instance *
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 10/30 dm: core: Drop header files from dm/test.h
In reply to Simon GlassThese header file should not be included in other header files. Remove them and add to each individual file.
---
include/dm/test.h | 3 --- test/dm/adc.c | 1 + test/dm/audio.c | 1 + test/dm/axi.c | 3 ++- test/dm/blk.c | 1 + test/dm/board.c | 1 + test/dm/bootcount.c | 1 + test/dm/bus.c | 1 + test/dm/clk.c | 1 + test/dm/clk_ccf.c | 1 + test/dm/core.c | 1 + test/dm/cpu.c | 1 + test/dm/dma.c | 1 + test/dm/dsi_host.c | 1 + test/dm/eth.c | 3 ++- test/dm/firmware.c | 1 + test/dm/gpio.c | 3 ++- test/dm/hwspinlock.c | 1 + test/dm/i2c.c | 1 + test/dm/i2s.c | 3 ++- test/dm/led.c | 1 + test/dm/mailbox.c | 1 + test/dm/mdio.c | 5 +++-- test/dm/mdio_mux.c | 5 +++-- test/dm/misc.c | 1 + test/dm/mmc.c | 1 + test/dm/nop.c | 1 + test/dm/ofnode.c | 1 + test/dm/osd.c | 5 +++-- test/dm/panel.c | 3 ++- test/dm/pch.c | 1 + test/dm/pci.c | 1 + test/dm/pci_ep.c | 5 +++-- test/dm/phy.c | 1 + test/dm/pmic.c | 5 +++-- test/dm/power-domain.c | 1 + test/dm/pwm.c | 1 + test/dm/ram.c | 1 + test/dm/regmap.c | 1 + test/dm/regulator.c | 1 + test/dm/remoteproc.c | 2 ++ test/dm/reset.c | 1 + test/dm/rtc.c | 1 + test/dm/serial.c | 1 + test/dm/sf.c | 1 + test/dm/smem.c | 1 + test/dm/sound.c | 1 + test/dm/spi.c | 1 + test/dm/spmi.c | 1 + test/dm/syscon.c | 1 + test/dm/sysreset.c | 1 + test/dm/tee.c | 1 + test/dm/test-driver.c | 3 ++- test/dm/test-fdt.c | 1 + test/dm/test-main.c | 2 ++ test/dm/test-uclass.c | 1 + test/dm/timer.c | 1 + test/dm/usb.c | 1 + test/dm/video.c | 1 + test/dm/virtio.c | 3 ++- test/dm/wdt.c | 1 + test/lib/lmb.c | 2 ++ 62 files changed, 81 insertions(+), 20 deletions(-)
include/dm/test.h +0 -3
@@ -6,9 +6,6 @@#ifndef __DM_TEST_H#define __DM_TEST_H -#include <dm.h> -#include <test/test.h> -/** * struct dm_test_cdata - configuration data for test instance *
test/dm/adc.c +1 -0
@@ -17,6 +17,7 @@#include <power/regulator.h> #include <power/sandbox_pmic.h> #include <sandbox-adc.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_adc_bind (struct unit_test_state *uts)
test/dm/audio.c +1 -0
@@ -8,6 +8,7 @@#include <audio_codec.h> #include <dm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> #include <asm/test.h>
test/dm/axi.c +2 -1
@@ -7,9 +7,10 @@#include <common.h> #include <axi.h> #include <dm.h> +#include <asm/axi.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/axi.h> /* Test that sandbox AXI works correctly */ static int dm_test_axi_base (struct unit_test_state *uts)
test/dm/blk.c +1 -0
@@ -8,6 +8,7 @@#include <usb.h> #include <asm/state.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/board.c +1 -0
@@ -8,6 +8,7 @@#include <dm.h> #include <dm/test.h> #include <board.h> +#include <test/test.h> #include <test/ut.h> #include "../../drivers/board/sandbox.h"
test/dm/bootcount.c +1 -0
@@ -8,6 +8,7 @@#include <bootcount.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_bootcount (struct unit_test_state *uts)
test/dm/bus.c +1 -0
@@ -13,6 +13,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/clk.c +1 -0
@@ -9,6 +9,7 @@#include <asm/clk.h> #include <dm/test.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the clk uclass */
test/dm/clk_ccf.c +1 -0
@@ -11,6 +11,7 @@#include <dm/test.h> #include <dm/uclass.h> #include <linux/err.h> +#include <test/test.h> #include <test/ut.h> #include <sandbox-clk.h>
test/dm/core.c +1 -0
@@ -15,6 +15,7 @@#include <dm/util.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/cpu.c +1 -0
@@ -9,6 +9,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <cpu.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_cpu (struct unit_test_state *uts)
test/dm/dma.c +1 -0
@@ -10,6 +10,7 @@#include <dm.h> #include <dm/test.h> #include <dma.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_dma_m2m (struct unit_test_state *uts)
test/dm/dsi_host.c +1 -0
@@ -10,6 +10,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_dsi_host_phy_init (void *priv_data)
test/dm/eth.c +2 -1
@@ -12,10 +12,11 @@#include <fdtdec.h> #include <malloc.h> #include <net.h> +#include <asm/eth.h> #include <dm/test.h> #include <dm/device-internal.h> #include <dm/uclass-internal.h> -#include <asm/eth.h> +#include <test/test.h> #include <test/ut.h> #define DM_TEST_ETH_NUM 4
test/dm/firmware.c +1 -0
@@ -8,6 +8,7 @@#include <syscon.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of firmware probe */
test/dm/gpio.c +2 -1
@@ -6,10 +6,11 @@#include <common.h> #include <fdtdec.h> #include <dm.h> +#include <asm/gpio.h> #include <dm/root.h> #include <dm/test.h> #include <dm/util.h> -#include <asm/gpio.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox GPIOs work correctly */
test/dm/hwspinlock.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that hwspinlock driver functions are called */
test/dm/i2c.c +1 -0
@@ -15,6 +15,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> static const int busnum;
test/dm/i2s.c +2 -1
@@ -7,9 +7,10 @@#include <common.h> #include <dm.h> #include <i2s.h> +#include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/test.h> /* Basic test of the i2s codec uclass */ static int dm_test_i2s (struct unit_test_state *uts)
test/dm/led.c +1 -0
@@ -8,6 +8,7 @@#include <led.h> #include <asm/gpio.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the led uclass */
test/dm/mailbox.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <dm/test.h> #include <asm/mbox.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_mailbox (struct unit_test_state *uts)
test/dm/mdio.c +3 -2
@@ -6,10 +6,11 @@#include <common.h> #include <dm.h> -#include <dm/test.h> +#include <miiphy.h> #include <misc.h> +#include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <miiphy.h> /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5
test/dm/mdio_mux.c +3 -2
@@ -6,10 +6,11 @@#include <common.h> #include <dm.h> -#include <dm/test.h> +#include <miiphy.h> #include <misc.h> +#include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <miiphy.h> /* macros copied over from mdio_sandbox.c */ #define SANDBOX_PHY_ADDR 5
test/dm/misc.c +1 -0
@@ -8,6 +8,7 @@#include <dm.h> #include <dm/test.h> #include <misc.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_misc (struct unit_test_state *uts)
test/dm/mmc.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <mmc.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/nop.c +1 -0
@@ -13,6 +13,7 @@#include <dm/device.h> #include <dm/test.h> #include <misc.h> +#include <test/test.h> #include <test/ut.h> static int noptest_bind (struct udevice *parent)
test/dm/ofnode.c +1 -0
@@ -4,6 +4,7 @@#include <dm.h> #include <dm/of_extra.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_ofnode_compatible (struct unit_test_state *uts)
test/dm/osd.c +3 -2
@@ -7,10 +7,11 @@#include <common.h> #include <display_options.h> #include <dm.h> -#include <dm/test.h> -#include <test/ut.h> #include <video_osd.h> #include <asm/test.h> +#include <dm/test.h> +#include <test/test.h> +#include <test/ut.h> #include "../../drivers/video/sandbox_osd.h"
test/dm/panel.c +2 -1
@@ -14,8 +14,9 @@#include <asm/gpio.h> #include <asm/test.h> #include <dm/test.h> -#include <test/ut.h> #include <power/regulator.h> +#include <test/test.h> +#include <test/ut.h> /* Basic test of the panel uclass */ static int dm_test_panel (struct unit_test_state *uts)
test/dm/pch.c +1 -0
@@ -8,6 +8,7 @@#include <pch.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox PCH works correctly */
test/dm/pci.c +1 -0
@@ -8,6 +8,7 @@#include <asm/io.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox PCI works correctly */
test/dm/pci_ep.c +3 -2
@@ -5,12 +5,13 @@#include <common.h> #include <dm.h> +#include <hexdump.h> +#include <pci_ep.h> #include <asm/io.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <hexdump.h> -#include <pci_ep.h> /* Test that sandbox PCI EP works correctly */ static int dm_test_pci_ep_base (struct unit_test_state *uts)
test/dm/phy.c +1 -0
@@ -8,6 +8,7 @@#include <dm.h> #include <generic-phy.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of the phy uclass */
test/dm/pmic.c +3 -2
@@ -10,16 +10,17 @@#include <errno.h> #include <dm.h> #include <fdtdec.h> +#include <fsl_pmic.h> #include <malloc.h> #include <dm/device-internal.h> #include <dm/root.h> -#include <dm/util.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <dm/util.h> #include <power/pmic.h> #include <power/sandbox_pmic.h> +#include <test/test.h> #include <test/ut.h> -#include <fsl_pmic.h> /* Test PMIC get method */
test/dm/power-domain.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <dm/test.h> #include <asm/power-domain.h> +#include <test/test.h> #include <test/ut.h> /* This must match the specifier for power-domains in the DT node */
test/dm/pwm.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <pwm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the pwm uclass */
test/dm/ram.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <ram.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/regmap.c +1 -0
@@ -10,6 +10,7 @@#include <syscon.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of register maps */
test/dm/regulator.c +1 -0
@@ -19,6 +19,7 @@#include <power/pmic.h> #include <power/regulator.h> #include <power/sandbox_pmic.h> +#include <test/test.h> #include <test/ut.h> enum {
test/dm/remoteproc.c +2 -0
@@ -10,7 +10,9 @@#include <remoteproc.h> #include <asm/io.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> +/** * dm_test_remoteproc_base() - test the operations after initializations * @uts: unit test state
test/dm/reset.c +1 -0
@@ -8,6 +8,7 @@#include <reset.h> #include <dm/test.h> #include <asm/reset.h> +#include <test/test.h> #include <test/ut.h> /* This must match the specifier for mbox-names="test" in the DT node */
test/dm/rtc.c +1 -0
@@ -11,6 +11,7 @@#include <asm/io.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Simple RTC sanity check */
test/dm/serial.c +1 -0
@@ -7,6 +7,7 @@#include <serial.h> #include <dm.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int dm_test_serial (struct unit_test_state *uts)
test/dm/sf.c +1 -0
@@ -14,6 +14,7 @@#include <asm/test.h> #include <dm/test.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> /* Simple test of sandbox SPI flash */
test/dm/smem.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <smem.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the smem uclass */
test/dm/sound.c +1 -0
@@ -9,6 +9,7 @@#include <sound.h> #include <dm/test.h> #include <test/ut.h> +#include <test/test.h> #include <asm/test.h> /* Basic test of the sound codec uclass */
test/dm/spi.c +1 -0
@@ -13,6 +13,7 @@#include <dm/test.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <test/test.h> #include <test/ut.h> /* Test that we can find buses and chip-selects */
test/dm/spmi.c +1 -0
@@ -13,6 +13,7 @@#include <power/pmic.h> #include <spmi/spmi.h> #include <asm/gpio.h> +#include <test/test.h> #include <test/ut.h> /* Test if bus childs got probed propperly*/
test/dm/syscon.c +1 -0
@@ -9,6 +9,7 @@#include <regmap.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Base test of system controllers */
test/dm/sysreset.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that we can use particular sysreset devices */
test/dm/tee.c +1 -0
@@ -8,6 +8,7 @@#include <dm/test.h> #include <sandboxtee.h> #include <tee.h> +#include <test/test.h> #include <test/ut.h> #include <tee/optee_ta_avb.h>
test/dm/test-driver.c +2 -1
@@ -10,9 +10,10 @@#include <dm.h> #include <errno.h> #include <malloc.h> +#include <asm/io.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> -#include <asm/io.h> int dm_testdrv_op_count[DM_TEST_OP_COUNT ];static struct unit_test_state *uts = &global_dm_test_state;
test/dm/test-fdt.c +1 -0
@@ -16,6 +16,7 @@#include <dm/util.h> #include <dm/lists.h> #include <dm/of_access.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/test-main.c +2 -0
@@ -13,6 +13,8 @@#include <dm/test.h> #include <dm/root.h> #include <dm/uclass-internal.h> +#include <test/test.h> +#include <test/test.h> #include <test/ut.h> DECLARE_GLOBAL_DATA_PTR ;
test/dm/test-uclass.c +1 -0
@@ -13,6 +13,7 @@#include <asm/io.h> #include <dm/test.h> #include <linux/list.h> +#include <test/test.h> #include <test/ut.h> static struct unit_test_state *uts = &global_dm_test_state;
test/dm/timer.c +1 -0
@@ -7,6 +7,7 @@#include <dm.h> #include <timer.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/usb.c +1 -0
@@ -13,6 +13,7 @@#include <dm/device-internal.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> /* Test that sandbox USB works correctly */
test/dm/video.c +1 -0
@@ -13,6 +13,7 @@#include <video_console.h> #include <dm/test.h> #include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> /*
test/dm/virtio.c +2 -1
@@ -9,9 +9,10 @@#include <virtio.h> #include <virtio_ring.h> #include <dm/device-internal.h> -#include <dm/uclass-internal.h> #include <dm/root.h> #include <dm/test.h> +#include <dm/uclass-internal.h> +#include <test/test.h> #include <test/ut.h> /* Basic test of the virtio uclass */
test/dm/wdt.c +1 -0
@@ -9,6 +9,7 @@#include <asm/state.h> #include <asm/test.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> /* Test that watchdog driver functions are called */
test/lib/lmb.c +2 -0
@@ -4,8 +4,10 @@*/ #include <common.h> +#include <dm.h> #include <lmb.h> #include <dm/test.h> +#include <test/test.h> #include <test/ut.h> static int check_lmb(struct unit_test_state *uts, struct lmb *lmb,
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 11/30 fs: fs-loader: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
drivers/fpga/socfpga_arria10.c | 1 + include/fs_loader.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/socfpga_arria10.c +1 -0
@@ -11,6 +11,7 @@#include <altera.h> #include <asm/arch/pinmux.h> #include <common.h> +#include <dm.h> #include <dm/ofnode.h> #include <errno.h> #include <fs_loader.h>
include/fs_loader.h +1 -1
@@ -6,7 +6,7 @@#ifndef _FS_LOADER_H_#define _FS_LOADER_H_ -#include <dm.h> +struct udevice ;/** * struct phandle_part - A place for storing phandle of node and its partition
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 12/30 net: Drop dm.h header file from phy.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use other headers and C inclusions instead.
---
cmd/mdio.c | 1 + cmd/mii.c | 1 + include/dm/read.h | 1 + include/phy.h | 5 ++++- net/eth_legacy.c | 1 + 5 files changed, 8 insertions(+), 1 deletion(-)
cmd/mdio.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <miiphy.h> #include <phy.h>
cmd/mii.c +1 -0
@@ -10,6 +10,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <miiphy.h> typedef struct _MII_field_desc_t {
include/dm/read.h +1 -0
@@ -9,6 +9,7 @@#ifndef _DM_READ_H#define _DM_READ_H +#include <dm/device.h> #include <dm/fdtaddr.h> #include <dm/ofnode.h> #include <dm/uclass.h>
include/phy.h +4 -1
@@ -9,13 +9,16 @@#ifndef _PHY_H#define _PHY_H -#include <dm.h> +#include <dm/ofnode.h> +#include <dm/read.h> #include <linux/list.h> #include <linux/mii.h> #include <linux/ethtool.h> #include <linux/mdio.h> #include <phy_interface.h> +struct udevice ; +#define PHY_FIXED_ID 0xa5a55a5a/* * There is no actual id for this.
net/eth_legacy.c +1 -0
@@ -7,6 +7,7 @@#include <common.h> #include <command.h> +#include <dm.h> #include <env.h> #include <net.h> #include <phy.h>
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 13/30 sf: Drop dm.h header file from spi_flash.h
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
arch/x86/cpu/ivybridge/sdram.c | 1 + include/spi_flash.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/cpu/ivybridge/sdram.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <dm.h> #include <errno.h> #include <fdtdec.h> #include <malloc.h>
include/spi_flash.h +2 -1
@@ -9,10 +9,11 @@#ifndef _SPI_FLASH_H_#define _SPI_FLASH_H_ -#include <dm.h> /* Because we dereference struct udevice here */ #include <linux/types.h> #include <linux/mtd/spi-nor.h> +struct udevice ; +/* by default ENV use the same parameters than SF command */ #ifndef CONFIG_ENV_SPI_BUS # define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 14/30 thermal: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
arch/arm/mach-imx/cpu.c | 1 + include/thermal.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-imx/cpu.c +1 -0
@@ -8,6 +8,7 @@#include <bootm.h> #include <common.h> +#include <dm.h> #include <netdev.h> #include <linux/errno.h> #include <asm/io.h>
include/thermal.h +1 -1
@@ -7,7 +7,7 @@#ifndef _THERMAL_H_#define _THERMAL_H_ -#include <dm.h> +struct udevice ;int thermal_get_temp (struct udevice *dev,int *temp);
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 15/30 w1: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
board/atmel/common/board.c | 1 + cmd/w1.c | 1 + include/w1.h | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
board/atmel/common/board.c +1 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <dm.h> #include <env.h> #include <w1.h> #include <w1-eeprom.h>
cmd/w1.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> #include <command.h> +#include <dm.h> #include <w1.h> #include <w1-eeprom.h> #include <dm/device-internal.h>
include/w1.h +1 -1
@@ -8,7 +8,7 @@#ifndef __W1_H#define __W1_H -#include <dm.h> +struct udevice ;#define W1_FAMILY_DS24B33 0x23#define W1_FAMILY_DS2431 0x2d
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 16/30 efi: Tidy up header includes
In reply to Simon GlassTwo files relay on efi_driver.h to include common.h and dm.h which is incorrect. The former should always be included in a non-host C file and the latter should be included if driver model is used.
---
include/efi_driver.h | 2 -- lib/efi_driver/efi_block_device.c | 2 ++ lib/efi_driver/efi_uclass.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)
include/efi_driver.h +0 -2
@@ -8,8 +8,6 @@#ifndef _EFI_DRIVER_H#define _EFI_DRIVER_H 1 -#include <common.h> -#include <dm.h> #include <efi_loader.h> /*
lib/efi_driver/efi_block_device.c +2 -0
@@ -28,6 +28,8 @@* iPXE uses the simple file protocol to load Grub or the Linux Kernel. */ +#include <common.h> +#include <dm.h> #include <efi_driver.h> #include <dm/device-internal.h> #include <dm/root.h>
lib/efi_driver/efi_uclass.c +2 -0
@@ -17,6 +17,8 @@* controllers. */ +#include <common.h> +#include <dm.h> #include <efi_driver.h> /**
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 16/30 efi: Tidy up header includes
On 10/27/19 4:53 PM, Simon Glass wrote:> Two files relay on efi_driver.h to include common.h and dm.h which is
%s/relay/rely/
Quoted 2 lines
incorrect. The former should always be included in a non-host C file and the latter should be included if driver model is used.
https://www.denx.de/wiki/U-Boot/CodingStyle does no mention these requirements. Does the wiki need an update?
Non-host C files not including common.h at all or not as the first include call for trouble, cf.
https://lists.denx.de/pipermail/u-boot/2019-October/388406.html
https://lists.denx.de/pipermail/u-boot/2019-October/388408.html
As your patch makes it obvious that common.h is included first:
Quoted 49 lines
Signed-off-by Simon Glass <[email protected]>---
include/efi_driver.h | 2 -- lib/efi_driver/efi_block_device.c | 2 ++ lib/efi_driver/efi_uclass.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)include/efi_driver.h +0
-2@@ -8,8 +8,6 @@#ifndef _EFI_DRIVER_H#define _EFI_DRIVER_H 1 -#include <common.h> -#include <dm.h> #include <efi_loader.h> /* lib/efi_driver/efi_block_device.c +2
-0@@ -28,6 +28,8 @@* iPXE uses the simple file protocol to load Grub or the Linux Kernel. */ +#include <common.h> +#include <dm.h> #include <efi_driver.h> #include <dm/device-internal.h> #include <dm/root.h> lib/efi_driver/efi_uclass.c +2
-0@@ -17,6 +17,8 @@* controllers. */ +#include <common.h> +#include <dm.h> #include <efi_driver.h> /**
PATCH 16/30 efi: Tidy up header includes
Hi Heinrich,
Quoted 10 lines · Heinrich Schuchardt
On 10/27/19 4:53 PM, Simon Glass wrote:> Two files relay on
efi_driver.hto includecommon.handdm.hwhich is
%s/relay/rely/Quoted 2 lines
incorrect. The former should always be included in a non-host C file and the latter should be included if driver model is used.
https://www.denx.de/wiki/U-Boot/CodingStyle does no mention these requirements. Does the wiki need an update?
OK I added a bit of an update. Feel free to improve it.
Quoted 11 lines
Non-host C files not including
common.hat all or not as the first include call for trouble, cf.https://lists.denx.de/pipermail/u-boot/2019-October/388406.html
https://lists.denx.de/pipermail/u-boot/2019-October/388408.htmlAs your patch makes it obvious that
common.his included first:Reviewed-by Heinrich Schuchardt <[email protected]>
Thanks...at some point we might consider running a tool over the code base to sort the includes.
Regards,
Simon
PATCH 17/30 power: Tidy up inclusion of regulator_common.h
In reply to Simon GlassThis file should not include common.h and dm.h so remove them. Also move the inclusion of this file to after the normal includes.
---
drivers/power/regulator/fixed.c | 3 ++- drivers/power/regulator/gpio-regulator.c | 3 ++- drivers/power/regulator/regulator_common.c | 4 +++- drivers/power/regulator/regulator_common.h | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-)
drivers/power/regulator/fixed.c +2 -1
@@ -5,13 +5,14 @@* Przemyslaw Marczak <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <errno.h> #include <dm.h> #include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +static int fixed_regulator_ofdata_to_platdata (struct udevice *dev) {struct dm_regulator_uclass_platdata *uc_pdata;
drivers/power/regulator/gpio-regulator.c +2 -1
@@ -4,7 +4,6 @@* Keerthy <[email protected]> */ -#include "regulator_common.h" #include <common.h> #include <fdtdec.h> #include <errno.h>
@@ -14,6 +13,8 @@#include <power/pmic.h> #include <power/regulator.h> +#include "regulator_common.h" +#define GPIO_REGULATOR_MAX_STATES 2DECLARE_GLOBAL_DATA_PTR ;
drivers/power/regulator/regulator_common.c +3 -1
@@ -4,10 +4,12 @@* Sven Schwermer <[email protected]> */ -#include "regulator_common.h" #include <common.h> +#include <dm.h> #include <power/regulator.h> +#include "regulator_common.h" +int regulator_common_ofdata_to_platdata (struct udevice *dev,struct regulator_common_platdata *dev_pdata,const char *enable_gpio_name) {
drivers/power/regulator/regulator_common.h +0 -2
@@ -7,9 +7,7 @@ #ifndef _REGULATOR_COMMON_H #define _REGULATOR_COMMON_H -#include <common.h> #include <asm/gpio.h> -#include <dm.h> struct regulator_common_platdata { struct gpio_desc gpio; /* GPIO for regulator enable control */
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 18/30 mmc: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/mmc/sdhci.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/sdhci.c +0 -1
@@ -13,7 +13,6 @@#include <malloc.h> #include <mmc.h> #include <sdhci.h> -#include <dm.h> #if defined(CONFIG_FIXED_SDHCI_ALIGNED_BUFFER )void *aligned_buffer = (void *)CONFIG_FIXED_SDHCI_ALIGNED_BUFFER ;
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 19/30 spi: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/spi/mscc_bb_spi.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/mscc_bb_spi.c +0 -1
@@ -10,7 +10,6 @@#include <errno.h> #include <malloc.h> #include <spi.h> -#include <dm.h> #include <asm/gpio.h> #include <asm/io.h> #include <linux/delay.h>
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 20/30 ti: am654: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
drivers/ram/k3-am654-ddrss.c | 1 - 1 file changed, 1 deletion(-)
drivers/ram/k3-am654-ddrss.c +0 -1
@@ -12,7 +12,6 @@#include <ram.h> #include <asm/io.h> #include <power-domain.h> -#include <dm.h> #include <asm/arch/sys_proto.h> #include <power/regulator.h> #include "k3-am654-ddrss.h"
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 20/30 ti: am654: Drop duplicate dm.h inclusion
Quoted 3 lines · Simon Glass
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>
Thanks and regards,
Lokesh
Quoted 18 lines
---
drivers/ram/k3-am654-ddrss.c | 1 - 1 file changed, 1 deletion(-)drivers/ram/k3-am654-ddrss.c +0
-1@@ -12,7 +12,6 @@#include <ram.h> #include <asm/io.h> #include <power-domain.h> -#include <dm.h> #include <asm/arch/sys_proto.h> #include <power/regulator.h> #include "k3-am654-ddrss.h"
PATCH 21/30 liebherr: Drop duplicate dm.h inclusion
In reply to Simon GlassWe only need to include this header once. Drop the duplicate.
---
board/liebherr/display5/display5.c | 1 - 1 file changed, 1 deletion(-)
board/liebherr/display5/display5.c +0 -1
@@ -23,7 +23,6 @@#include <netdev.h> #include <i2c.h> -#include <dm.h> #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h>
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 21/30 liebherr: Drop duplicate dm.h inclusion
Quoted 13 lines · On Sun, 27 Oct 2019 09:54:01 -0600 Simon Glass <[email protected]> wrote:
We only need to include this header once. Drop the duplicate.
Signed-off-by Simon Glass <[email protected]>---
board/liebherr/display5/display5.c | 1 - 1 file changed, 1 deletion(-)(quoted diff) +0
-0
b/board/liebherr/display5/display5.cindex85ca777c1d..14bae67886100644 ---a/board/liebherr/display5/display5.c
+++b/board/liebherr/display5/display5.c
board/liebherr/display5/display5.c line 28
Quoted 7 lines
board/liebherr/display5/display5.c +0
-1@@ -23,7 +23,6 @@#include <netdev.h> #include <i2c.h> -#include <dm.h> #include <dm/platform_data/serial_mxc.h> #include <dm/platdata.h>
Thanks Simon for spotting it.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191101/64deffa0/attachment.sig>
PATCH 22/30 pci: Drop dm.h inclusion from header file
In reply to Simon GlassThe layerscape header should not include dm.h so remove it.
---
drivers/pci/pcie_layerscape.h | 1 - drivers/pci/pcie_layerscape_fixup.c | 1 + drivers/pci/pcie_layerscape_gen4.h | 1 - drivers/pci/pcie_layerscape_gen4_fixup.c | 1 + 4 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pcie_layerscape.h +0 -1
@@ -8,7 +8,6 @@#ifndef _PCIE_LAYERSCAPE_H_#define _PCIE_LAYERSCAPE_H_#include <pci.h> -#include <dm.h> #ifndef CONFIG_SYS_PCI_MEMORY_BUS #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE
drivers/pci/pcie_layerscape_fixup.c +1 -0
@@ -6,6 +6,7 @@*/ #include <common.h> +#include <dm.h> #include <pci.h> #include <asm/arch/fsl_serdes.h> #include <asm/io.h>
drivers/pci/pcie_layerscape_gen4.h +0 -1
@@ -9,7 +9,6 @@#ifndef _PCIE_LAYERSCAPE_GEN4_H_#define _PCIE_LAYERSCAPE_GEN4_H_#include <pci.h> -#include <dm.h> #ifndef CONFIG_SYS_PCI_MEMORY_SIZE #define CONFIG_SYS_PCI_MEMORY_SIZE (4 * 1024 * 1024 * 1024ULL)
drivers/pci/pcie_layerscape_gen4_fixup.c +1 -0
@@ -8,6 +8,7 @@*/ #include <common.h> +#include <dm.h> #include <pci.h> #include <asm/arch/fsl_serdes.h> #include <asm/io.h>
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 23/30 video: meson: Drop unnecessary header includes
In reply to Simon GlassThese files should not be included in meson header files. Drop them and tidy up the affected C files.
---
drivers/video/meson/meson_canvas.c | 4 ++++ drivers/video/meson/meson_plane.c | 5 +++++ drivers/video/meson/meson_vclk.c | 2 ++ drivers/video/meson/meson_venc.c | 4 ++++ drivers/video/meson/meson_vpu.c | 18 +++++++++++++++--- drivers/video/meson/meson_vpu.h | 17 +++++------------ drivers/video/meson/meson_vpu_init.c | 4 ++++ include/video.h | 2 ++ 8 files changed, 41 insertions(+), 15 deletions(-)
drivers/video/meson/meson_canvas.c +4 -0
@@ -6,6 +6,10 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* DMC Registers */
drivers/video/meson/meson_plane.c +5 -0
@@ -6,6 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include <linux/bitfield.h> +#include "meson_vpu.h" /* OSDx_BLKx_CFG */
drivers/video/meson/meson_vclk.c +2 -0
@@ -6,6 +6,8 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> #include "meson_vpu.h" #include <linux/iopoll.h>
drivers/video/meson/meson_venc.c +4 -0
@@ -6,7 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> +#include <fdtdec.h> +#include <asm/io.h> #include "meson_vpu.h" enum {
drivers/video/meson/meson_vpu.c +15 -3
@@ -6,13 +6,17 @@* Author: Neil Armstrong <[email protected]> */ -#include "meson_vpu.h" +#include <common.h> +#include <display.h> +#include <dm.h> #include <efi_loader.h> -#include <dm/device-internal.h> -#include <dm/uclass-internal.h> #include <fdt_support.h> #include <linux/sizes.h> #include <asm/arch/mem.h> +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +#include "meson_vpu.h" #include "meson_registers.h" #include "simplefb_common.h"
@@ -27,6 +31,14 @@ static struct meson_framebuffer {bool is_cvbs; } meson_fb = { 0 }; +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family) +{ +enum vpu_compatible compat =dev_get_driver_data (priv->dev); + +return compat == family; +} +static int meson_vpu_setup_mode (struct udevice *dev,struct udevice *disp) {struct video_uc_platdata *uc_plat =dev_get_uclass_platdata (dev);
drivers/video/meson/meson_vpu.h +5 -12
@@ -9,14 +9,12 @@#ifndef __MESON_VPU_H__#define __MESON_VPU_H__ -#include <common.h> -#include <dm.h> #include <video.h> -#include <display.h> -#include <linux/io.h> -#include <linux/bitfield.h> #include "meson_registers.h" +struct display_timing ; +struct udevice ; +enum {/* Maximum size we support */ VPU_MAX_WIDTH = 3840,
@@ -38,13 +36,8 @@ struct meson_vpu_priv {void __iomem *dmc_base; }; -static inline bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, -enum vpu_compatible family) -{ -enum vpu_compatible compat =dev_get_driver_data (priv->dev); - -return compat == family; -} +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family);#define hhi_update_bits (offset, mask, value) \ writel_bits(mask, value, priv->hhi_base + offset)
drivers/video/meson/meson_vpu_init.c +4 -0
@@ -8,6 +8,10 @@#define DEBUG +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* HHI Registers */
include/video.h +2 -0
@@ -17,6 +17,8 @@#include <stdio_dev.h> +struct udevice ; +struct video_uc_platdata {uint align;uint size;
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 23/30 video: meson: Drop unnecessary header includes
Quoted 4 lines · On Sun, 27 Oct 2019 09:54:03 -0600 Simon Glass sjg at chromium.org wrote:
These files should not be included in meson header files. Drop them and tidy up the affected C files.
Signed-off-by Simon Glass <[email protected]>
PATCH 23/30 video: meson: Drop unnecessary header includes
In reply to Simon GlassQuoted 175 lines · Simon Glass
These files should not be included in meson header files. Drop them and tidy up the affected C files.
Signed-off-by Simon Glass <[email protected]>---
drivers/video/meson/meson_canvas.c | 4 ++++ drivers/video/meson/meson_plane.c | 5 +++++ drivers/video/meson/meson_vclk.c | 2 ++ drivers/video/meson/meson_venc.c | 4 ++++ drivers/video/meson/meson_vpu.c | 18 +++++++++++++++--- drivers/video/meson/meson_vpu.h | 17 +++++------------ drivers/video/meson/meson_vpu_init.c | 4 ++++ include/video.h | 2 ++ 8 files changed, 41 insertions(+), 15 deletions(-)drivers/video/meson/meson_canvas.c +4
-0@@ -6,6 +6,10 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* DMC Registers */ drivers/video/meson/meson_plane.c +5
-0@@ -6,6 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include <linux/bitfield.h> +#include "meson_vpu.h" /* OSDx_BLKx_CFG */ drivers/video/meson/meson_vclk.c +2
-0@@ -6,6 +6,8 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> #include "meson_vpu.h" #include <linux/iopoll.h> drivers/video/meson/meson_venc.c +4
-0@@ -6,7 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> +#include <fdtdec.h> +#include <asm/io.h> #include "meson_vpu.h" enum {drivers/video/meson/meson_vpu.c +15
-3@@ -6,13 +6,17 @@* Author: Neil Armstrong <[email protected]> */ -#include "meson_vpu.h" +#include <common.h> +#include <display.h> +#include <dm.h> #include <efi_loader.h> -#include <dm/device-internal.h> -#include <dm/uclass-internal.h> #include <fdt_support.h> #include <linux/sizes.h> #include <asm/arch/mem.h> +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +#include "meson_vpu.h" #include "meson_registers.h" #include "simplefb_common.h" @@ -27,6 +31,14 @@ static struct meson_framebuffer {bool is_cvbs; } meson_fb = { 0 }; +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family) +{ +enum vpu_compatible compat =dev_get_driver_data (priv->dev); + +return compat == family; +} +static int meson_vpu_setup_mode (struct udevice *dev,struct udevice *disp) {struct video_uc_platdata *uc_plat =dev_get_uclass_platdata (dev);drivers/video/meson/meson_vpu.h +5
-12@@ -9,14 +9,12 @@#ifndef __MESON_VPU_H__#define __MESON_VPU_H__ -#include <common.h> -#include <dm.h> #include <video.h> -#include <display.h> -#include <linux/io.h> -#include <linux/bitfield.h> #include "meson_registers.h" +struct display_timing ; +struct udevice ; +enum {/* Maximum size we support */ VPU_MAX_WIDTH = 3840,@@ -38,13 +36,8 @@ struct meson_vpu_priv {void __iomem *dmc_base; }; -static inline bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, -enum vpu_compatible family) -{ -enum vpu_compatible compat =dev_get_driver_data (priv->dev); - -return compat == family; -} +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family);#define hhi_update_bits (offset, mask, value) \ writel_bits(mask, value, priv->hhi_base + offset)drivers/video/meson/meson_vpu_init.c +4
-0@@ -8,6 +8,10 @@#define DEBUG +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* HHI Registers */ include/video.h +0
-0
include/video.h line 24
Quoted 8 lines
include/video.h +2
-0@@ -17,6 +17,8 @@#include <stdio_dev.h> +struct udevice ; +struct video_uc_platdata {uint align;uint size;
PATCH 23/30 video: meson: Drop unnecessary header includes
Quoted 178 lines · Neil Armstrong
Quoted 177 lines · Simon Glass
These files should not be included in meson header files. Drop them and tidy up the affected C files.
Signed-off-by Simon Glass <[email protected]>---
drivers/video/meson/meson_canvas.c | 4 ++++ drivers/video/meson/meson_plane.c | 5 +++++ drivers/video/meson/meson_vclk.c | 2 ++ drivers/video/meson/meson_venc.c | 4 ++++ drivers/video/meson/meson_vpu.c | 18 +++++++++++++++--- drivers/video/meson/meson_vpu.h | 17 +++++------------ drivers/video/meson/meson_vpu_init.c | 4 ++++ include/video.h | 2 ++ 8 files changed, 41 insertions(+), 15 deletions(-)drivers/video/meson/meson_canvas.c +4
-0@@ -6,6 +6,10 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* DMC Registers */ drivers/video/meson/meson_plane.c +5
-0@@ -6,6 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include <linux/bitfield.h> +#include "meson_vpu.h" /* OSDx_BLKx_CFG */ drivers/video/meson/meson_vclk.c +2
-0@@ -6,6 +6,8 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> #include "meson_vpu.h" #include <linux/iopoll.h> drivers/video/meson/meson_venc.c +4
-0@@ -6,7 +6,11 @@* Author: Neil Armstrong <[email protected]> */ +#include <common.h> +#include <dm.h> #include <edid.h> +#include <fdtdec.h> +#include <asm/io.h> #include "meson_vpu.h" enum {drivers/video/meson/meson_vpu.c +15
-3@@ -6,13 +6,17 @@* Author: Neil Armstrong <[email protected]> */ -#include "meson_vpu.h" +#include <common.h> +#include <display.h> +#include <dm.h> #include <efi_loader.h> -#include <dm/device-internal.h> -#include <dm/uclass-internal.h> #include <fdt_support.h> #include <linux/sizes.h> #include <asm/arch/mem.h> +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> + +#include "meson_vpu.h" #include "meson_registers.h" #include "simplefb_common.h" @@ -27,6 +31,14 @@ static struct meson_framebuffer {bool is_cvbs; } meson_fb = { 0 }; +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family) +{ +enum vpu_compatible compat =dev_get_driver_data (priv->dev); + +return compat == family; +} +static int meson_vpu_setup_mode (struct udevice *dev,struct udevice *disp) {struct video_uc_platdata *uc_plat =dev_get_uclass_platdata (dev);drivers/video/meson/meson_vpu.h +5
-12@@ -9,14 +9,12 @@#ifndef __MESON_VPU_H__#define __MESON_VPU_H__ -#include <common.h> -#include <dm.h> #include <video.h> -#include <display.h> -#include <linux/io.h> -#include <linux/bitfield.h> #include "meson_registers.h" +struct display_timing ; +struct udevice ; +enum {/* Maximum size we support */ VPU_MAX_WIDTH = 3840,@@ -38,13 +36,8 @@ struct meson_vpu_priv {void __iomem *dmc_base; }; -static inline bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, -enum vpu_compatible family) -{ -enum vpu_compatible compat =dev_get_driver_data (priv->dev); - -return compat == family; -} +bool meson_vpu_is_compatible (struct meson_vpu_priv *priv, +enum vpu_compatible family);#define hhi_update_bits (offset, mask, value) \ writel_bits(mask, value, priv->hhi_base + offset)drivers/video/meson/meson_vpu_init.c +4
-0@@ -8,6 +8,10 @@#define DEBUG +#include <common.h> +#include <dm.h> +#include <asm/io.h> +#include "meson_vpu.h" /* HHI Registers */ include/video.h +0
-0@@ -17,6 +17,8 @@#include <stdio_dev.h>
Quoted 9 lines
include/video.h line 24
Quoted 6 lines
include/video.h +2
-0+struct udevice ; +struct video_uc_platdata {uint align;uint size;Acked-by Neil Armstrong <[email protected]>
Applied to u-boot-amlogic
Neil
PATCH 24/30 mediatek: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
arch/arm/include/asm/arch-mediatek/reset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/arch-mediatek/reset.h +1 -1
@@ -6,7 +6,7 @@#ifndef __MEDIATEK_RESET_H#define __MEDIATEK_RESET_H -#include <dm.h> +struct udevice ;int mediatek_reset_bind (struct udevice *pdev,u32 regofs,u32 num_regs);
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 25/30 mscc: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it from each one and use a forward declaration instead.
---
arch/mips/mach-mscc/include/mach/jr2/jr2.h | 3 --- arch/mips/mach-mscc/include/mach/luton/luton.h | 3 --- arch/mips/mach-mscc/include/mach/ocelot/ocelot.h | 3 --- arch/mips/mach-mscc/include/mach/serval/serval.h | 3 --- arch/mips/mach-mscc/include/mach/servalt/servalt.h | 3 --- board/mscc/servalt/servalt.c | 2 ++ 6 files changed, 2 insertions(+), 15 deletions(-)
arch/mips/mach-mscc/include/mach/jr2/jr2.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_JR2_H_#define _MSCC_JR2_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/luton/luton.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_OCELOT_H_#define _MSCC_OCELOT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/ocelot/ocelot.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_OCELOT_H_#define _MSCC_OCELOT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/serval/serval.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_SERVAL_H_#define _MSCC_SERVAL_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
arch/mips/mach-mscc/include/mach/servalt/servalt.h +0 -3
@@ -8,9 +8,6 @@#ifndef _MSCC_SERVALT_H_#define _MSCC_SERVALT_H_ -#include <linux/bitops.h> -#include <dm.h> -/* * Target offset base(s) */
board/mscc/servalt/servalt.c +2 -0
@@ -7,6 +7,8 @@#include <asm/io.h> #include <led.h> +DECLARE_GLOBAL_DATA_PTR ; +enum {BOARD_TYPE_PCB116 =0xAABBCE00 , };
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 26/30 adc: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Drop the common.h inclusion also.
---
drivers/adc/stm32-adc-core.c | 1 + drivers/adc/stm32-adc-core.h | 4 ++-- drivers/adc/stm32-adc.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-)
drivers/adc/stm32-adc-core.c +1 -0
@@ -7,6 +7,7 @@*/ #include <common.h> +#include <dm.h> #include <asm/io.h> #include <power/regulator.h> #include "stm32-adc-core.h"
drivers/adc/stm32-adc-core.h +2 -2
@@ -26,9 +26,9 @@#define STM32_ADC_MAX_ADCS 3#define STM32_ADCX_COMN_OFFSET 0x300 -#include <common.h> #include <clk.h> -#include <dm.h> + +struct udevice ;/** * struct stm32_adc_common - stm32 ADC driver common data (for all instances)
drivers/adc/stm32-adc.c +1 -0
@@ -8,6 +8,7 @@#include <common.h> #include <adc.h> +#include <dm.h> #include <asm/io.h> #include <linux/iopoll.h> #include "stm32-adc-core.h"
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 27/30 nand: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
---
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c | 4 ++++ drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.c +4 -0
@@ -1,6 +1,10 @@// SPDX-License-Identifier: GPL-2.0+ #include <common.h> +#include <clk.h> +#include <dm.h> +#include <linux/err.h> +#include "brcmnand_compat.h" struct clk *devm_clk_get (struct udevice *dev,const char *id)
drivers/mtd/nand/raw/brcmnand/brcmnand_compat.h +2 -2
@@ -3,8 +3,8 @@#ifndef __BRCMNAND_COMPAT_H#define __BRCMNAND_COMPAT_H -#include <clk.h> -#include <dm.h> +struct clk ; +struct udevice ;struct clk *devm_clk_get (struct udevice *dev,const char *id);int clk_prepare_enable (struct clk *clk);
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 28/30 ufs: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Also drop asm.io
---
drivers/ufs/cdns-platform.c | 1 + drivers/ufs/ufs.c | 2 +- drivers/ufs/ufs.h | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/ufs/cdns-platform.c +1 -0
@@ -9,6 +9,7 @@#include <common.h> #include <dm.h> #include <ufs.h> +#include <asm/io.h> #include "ufs.h"
drivers/ufs/ufs.c +1 -1
@@ -16,7 +16,7 @@#include <malloc.h> #include <hexdump.h> #include <scsi.h> - +#include <asm/io.h> #include <asm/dma-mapping.h> #include "ufs.h"
drivers/ufs/ufs.h +2 -3
@@ -2,11 +2,10 @@#ifndef __UFS_H#define __UFS_H -#include <asm/io.h> -#include <dm.h> -#include "unipro.h" +struct udevice ; +#define UFS_CDB_SIZE 16#define UPIU_TRANSACTION_UIC_CMD 0x1F#define UIC_CMD_SIZE (sizeof(u32) * 4)
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 29/30 usb: Drop dm.h header file
In reply to Simon GlassThis header file should not be included in other header files. Remove it and use a forward declaration instead.
Also move the inline function out into a C file. We should not include C code in headers.
---
drivers/usb/musb-new/musb_uboot.c | 37 +++++++++++++++++++++++++ drivers/usb/musb-new/pic32.c | 1 + drivers/usb/musb-new/usb-compat.h | 45 +++++++------------------------ 3 files changed, 47 insertions(+), 36 deletions(-)
drivers/usb/musb-new/musb_uboot.c +37 -0
@@ -1,5 +1,6 @@#include <common.h> #include <console.h> +#include <dm.h> #include <watchdog.h> #include <linux/errno.h> #include <linux/usb/ch9.h>
@@ -449,3 +450,39 @@ struct musb *musb_register(struct musb_hdrc_platform_data *plat, void *bdata,return *musbp; } + +#if CONFIG_IS_ENABLED (DM_USB ) +struct usb_device *usb_dev_get_parent (struct usb_device *udev) +{ +struct udevice *parent = udev->dev->parent; + +/* +* When called from usb-uclass.c: usb_scan_device() udev->dev points +* to the parent udevice, not the actual udevice belonging to the +* udev as the device is not instantiated yet. +* +* If dev is an usb-bus, then we are called from usb_scan_device() for +* an usb-device plugged directly into the root port, return NULL. +*/ +if (device_get_uclass_id (udev->dev) ==UCLASS_USB ) +return NULL ; + +/* +* If these 2 are not the same we are being called from +* usb_scan_device() and udev itself is the parent. +*/ +if (dev_get_parent_priv (udev->dev) != udev) +return udev; + +/* We are being called normally, use the parent pointer */ +if (device_get_uclass_id (parent) ==UCLASS_USB_HUB ) +return dev_get_parent_priv (parent); + +return NULL ; +} +#else +struct usb_device *usb_dev_get_parent (struct usb_device *udev) +{ +return udev->parent; +} +#endif
drivers/usb/musb-new/pic32.c +1 -0
@@ -10,6 +10,7 @@*/ #include <common.h> +#include <dm.h> #include <linux/usb/musb.h> #include "linux-compat.h" #include "musb_core.h"
drivers/usb/musb-new/usb-compat.h +9 -36
58 lines not on this page · raw message
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 30/30 dm: core: Guard against including dm.h in header files
In reply to Simon GlassHeader files generally should not include header files just for a struct, since forward declarations work just as well and reduce overhead.
Add a warning for dm.h being included, since this has crept into U-Boot.
dm: Avoid including dm.h in header files
At present a small number of header files include the dm.h header file. The intent with driver model is for C files that use it to define dm.h themselves. This helps indicate that driver model is supported and also reduces the amount of code pointlessly included and relying on header guards. Ultimately (combined with the reduction in size of common.h) this should speed up U-Boot compilation.
This series removes all uses of dm.h in header files and adds a warning to avert more such activity.
END
---
include/dm.h | 4 ++++ 1 file changed, 4 insertions(+)
include/dm.h +4 -0
@@ -3,6 +3,10 @@* Copyright (c) 2013 Google, Inc */ +#ifdef _DM_H_ +#warning "Suspect dm.h is included from a header file - please fix" +#endif +#ifndef _DM_H_#define _DM_H_
Signature · 1 line
2.24.0.rc0.303.g954a862665-goog
PATCH 1/30 lib: Allow crc32 to be disabled.
In reply to Simon GlassQuoted 18 lines · Simon Glass
Unfortunately this table seems to appear in TPL with gcc 7.3 even if it is not used. Fix it by creating a
Kconfigthat can be used to disable this routine.It is enabled by default, since most boards use it.
Signed-off-by Simon Glass <[email protected]>---
lib/Kconfig | 29 +++++++++++++++++++++++++++++ lib/Makefile | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-)lib/Kconfig +0
-0
lib/Kconfig config SHA_PROG_HW_ACCEL · line 357
Quoted 5 lines
lib/Kconfig +2
-0@@ -353,6 +353,35 @@ config SHA_PROG_HW_ACCEL config MD5 bool +config CRC32 + bool "Enable crc32 routine"
env/common.c uses crc32(). I could not find how to disable building it. So this configuration option seems to be superfluous. Otherwise please, add all reverse dependencies like EFI_LOADER, CMD_UBIFS, ...
lib/Kconfig config SHA_PROG_HW_ACCEL · line 367
Quoted 10 lines
lib/Kconfig +10
-0+ default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine. It is + typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + +config SPL_CRC32 + bool "Enable crc32 routine in SPL" + depends on SPL
Reverse dependencies are missing here, e.g.
selected by SPL_EFI_PARTITION
Best regards
Heinrich
Quoted 34 lines
lib/Kconfig +17
-0+ default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It + is typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + +config TPL_CRC32 + bool "Enable crc32 routine in SPL" + depends on TPL + default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine in SPL. It + is typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + config CRC32C boollib/Makefile +1
-1@@ -84,7 +84,7 @@ obj-y += errno.o obj-y += display_options.o CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"') obj-$(CONFIG_BCH) += bch.o -obj-y += crc32.o +obj-$(CONFIG_$(SPL_TPL_)CRC32) += crc32.o obj-$(CONFIG_CRC32C) += crc32c.o obj-y += ctype.o obj-y += div64.o
PATCH 1/30 lib: Allow crc32 to be disabled.
Quoted 42 lines · Heinrich Schuchardt
Quoted 18 lines · Simon Glass
Unfortunately this table seems to appear in TPL with gcc 7.3 even if it is not used. Fix it by creating a
Kconfigthat can be used to disable this routine.It is enabled by default, since most boards use it.
Signed-off-by Simon Glass <[email protected]>---
lib/Kconfig | 29 +++++++++++++++++++++++++++++ lib/Makefile | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-)lib/Kconfig +0
-0lib/Kconfig config SHA_PROG_HW_ACCEL · line 357
Quoted 5 lines
lib/Kconfig +2
-0@@ -353,6 +353,35 @@ config SHA_PROG_HW_ACCEL config MD5 bool +config CRC32 + bool "Enable crc32 routine"
env/common.cusescrc32(). I could not find how to disable building it. So this configuration option seems to be superfluous. Otherwise please, add all reverse dependencies likeEFI_LOADER,CMD_UBIFS, ...lib/Kconfig config SHA_PROG_HW_ACCEL · line 367
Quoted 10 lines
lib/Kconfig +10
-0+ default y + help + This enables a 32-bit CRC (cyclic-redundancy check) routine. It is + typically used to check for changes in a group of bytes. Even a + small change typically produces a very different CRC value. This + algorithm is simple and quite fast. + +config SPL_CRC32 + bool "Enable crc32 routine in SPL" + depends on SPLReverse dependencies are missing here, e.g.
Quoted 1 line
selected by
SPL_EFI_PARTITION
I think the problem is that for 'CRC32' itself, we need to not have it be a visible symbol as it's non-optional in main U-Boot. And then it should be select'd as needed by SPL_xxx and TPL_xxx symbols. Thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191108/f239a2b0/attachment.sig>