Skip to contentSkip to conversation

exynos: Include missing CPU headers

PATCH In review Sam Protsenko 2 participants 5 messages Oct 20, 2023 – Nov 14, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover 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(+)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/3 arm: exynos: Include missing CPU header in soc.c

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.

---
 arch/arm/mach-exynos/soc.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-exynos/soc.c +1 -0
index a07c87a2c8e2..6fe61cf9288d 100644
@@ -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
 /*
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/3 arm: exynos: Include missing CPU header in gpio.h

In reply to Sam Protsenko

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 },
              |    ^~~~~~~~~~~~~~~~~~~~~~~
---
 arch/arm/mach-exynos/include/mach/gpio.h | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-exynos/include/mach/gpio.h +3 -0
index f9975d7919f2..9eeeb7699963 100644
@@ -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;
Signature · 1 line
2.39.2
#3 lore raw

PATCH 3/3 watchdog: s5p_wdt: Include missing CPU header

In reply to Sam Protsenko

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.

---
 drivers/watchdog/s5p_wdt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/watchdog/s5p_wdt.c +1 -0
index 5ad7d2609f04..80524a00101b 100644
@@ -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
Signature · 1 line
2.39.2
#4 lore raw
In reply to Sam Protsenko

Hi

2023년 10월 21일 (토) 06:46, Sam Protsenko <[email protected]>님이 작성:

Quoted 9 lines

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

Quoted 8 lines
 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.