[PATCH 0/3] exynos: Include missing CPU headers

During porting a new Exynos-based board to U-Boot I faced a couple of similar build errors due to missing <asm/arch/cpu.h> inclusion. This series make sure it's fixed in all places I found.
Sam Protsenko (3): arm: exynos: Include missing CPU header in soc.c arm: exynos: Include missing CPU header in gpio.h watchdog: s5p_wdt: Include missing CPU header
arch/arm/mach-exynos/include/mach/gpio.h | 3 +++ arch/arm/mach-exynos/soc.c | 1 + drivers/watchdog/s5p_wdt.c | 1 + 3 files changed, 5 insertions(+)

samsung_get_base_swreset() is called in soc.c, but corresponding header with its prototype is not included. Fix this to avoid possible build errors.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- arch/arm/mach-exynos/soc.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-exynos/soc.c b/arch/arm/mach-exynos/soc.c index a07c87a2c8e2..6fe61cf9288d 100644 --- a/arch/arm/mach-exynos/soc.c +++ b/arch/arm/mach-exynos/soc.c @@ -9,6 +9,7 @@ #include <asm/cache.h> #include <asm/io.h> #include <asm/system.h> +#include <asm/arch/cpu.h>
#ifdef CONFIG_TARGET_ESPRESSO7420 /*

arch/arm/include/asm/arch/gpio.h relies on definitions from cpu.h. Include it explicitly in gpio.h. Otherwise next build error may occur:
In file included from ./arch/arm/include/asm/gpio.h:7, from include/cros_ec.h:14, from board/samsung/common/board.c:8: ./arch/arm/include/asm/arch/gpio.h:1357:4: error: 'EXYNOS4_GPIO_PART1_BASE' undeclared here (not in a function); did you mean 'EXYNOS4_GPIO_MAX_PORT'? 1357 | { EXYNOS4_GPIO_PART1_BASE, EXYNOS4_GPIO_MAX_PORT_PART_1 }, | ^~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- arch/arm/mach-exynos/include/mach/gpio.h | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-exynos/include/mach/gpio.h b/arch/arm/mach-exynos/include/mach/gpio.h index f9975d7919f2..9eeeb7699963 100644 --- a/arch/arm/mach-exynos/include/mach/gpio.h +++ b/arch/arm/mach-exynos/include/mach/gpio.h @@ -8,6 +8,9 @@ #define __ASM_ARCH_GPIO_H
#ifndef __ASSEMBLY__ + +#include <asm/arch/cpu.h> + struct s5p_gpio_bank { unsigned int con; unsigned int dat;

s5p watchdog driver calls samsung_get_base_watchdog() function, but its prototype is not included. That might lead to build warnings like this:
drivers/watchdog/s5p_wdt.c: In function 'wdt_stop': drivers/watchdog/s5p_wdt.c:16:26: warning: implicit declaration of function 'samsung_get_base_watchdog' [-Wimplicit-function-declaration] 16 | (struct s5p_watchdog *)samsung_get_base_watchdog(); | ^~~~~~~~~~~~~~~~~~~~~~~~~
Include asm/arch/cpu.h to fix that issue.
Signed-off-by: Sam Protsenko semen.protsenko@linaro.org --- drivers/watchdog/s5p_wdt.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/watchdog/s5p_wdt.c b/drivers/watchdog/s5p_wdt.c index 5ad7d2609f04..80524a00101b 100644 --- a/drivers/watchdog/s5p_wdt.c +++ b/drivers/watchdog/s5p_wdt.c @@ -6,6 +6,7 @@
#include <common.h> #include <asm/io.h> +#include <asm/arch/cpu.h> #include <asm/arch/watchdog.h>
#define PRESCALER_VAL 255

Hi
2023년 10월 21일 (토) 06:46, Sam Protsenko semen.protsenko@linaro.org님이 작성:
During porting a new Exynos-based board to U-Boot I faced a couple of similar build errors due to missing <asm/arch/cpu.h> inclusion. This series make sure it's fixed in all places I found.
Sam Protsenko (3): arm: exynos: Include missing CPU header in soc.c arm: exynos: Include missing CPU header in gpio.h watchdog: s5p_wdt: Include missing CPU header
arch/arm/mach-exynos/include/mach/gpio.h | 3 +++ arch/arm/mach-exynos/soc.c | 1 + drivers/watchdog/s5p_wdt.c | 1 + 3 files changed, 5 insertions(+)
-- 2.39.2
applied to u-boot-samsung.
Thanks. Minkyu Kang.
participants (2)
-
Minkyu Kang
-
Sam Protsenko