Skip to contentSkip to conversation

common: spl: move armv7m-specific code to spl_perform_fixups()

PATCH In review Ovidiu Panait 4 participants 16 messages Jan 1, 2022 – Jan 18, 2022

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

PATCH v2 1/7 common: spl: move armv7m-specific code to spl_perform_fixups()

Factor out armv7m fragment to spl_perform_fixups(), which is an arch/board specific function designed for this purpose.

---

(no changes since v1)

 arch/arm/cpu/armv7m/cpu.c | 6 ++++++
 common/spl/spl.c          | 3 ---
 2 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/cpu/armv7m/cpu.c +6 -0
index 63721018c1..65427b5312 100644
@@ -12,6 +12,7 @@
 #include <irq_func.h>
 #include <asm/io.h>
 #include <asm/armv7m.h>
+#include <spl.h>
 
 /*
  * This is called right before passing control to
@@ -56,3 +57,8 @@ void reset_cpu(void)
 		| (V7M_SCB->aircr & V7M_AIRCR_PRIGROUP_MSK)
 		| V7M_AIRCR_SYSRESET, &V7M_SCB->aircr);
 }
+
+void spl_perform_fixups(struct spl_image_info *spl_image)
+{
+	spl_image->entry_point |= 0x1;
+}
common/spl/spl.c +0 -3
index 4c101ec5d3..dab0f5fe38 100644
@@ -770,9 +770,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 			       ret);
 	}
 
-#ifdef CONFIG_CPU_V7M
-	spl_image.entry_point |= 0x1;
-#endif
 	switch (spl_image.os) {
 	case IH_OS_U_BOOT:
 		debug("Jumping to %s...\n", spl_phase_name(spl_next_phase()));
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 2/7 common: remove bedbug debugger support

Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot.

---

Changes in v2:
- new patch

 arch/powerpc/cpu/mpc83xx/traps.c |    7 -
 arch/powerpc/cpu/mpc85xx/traps.c |    7 -
 cmd/Kconfig                      |    7 -
 cmd/Makefile                     |    1 -
 cmd/bedbug.c                     |  410 ----------
 common/Makefile                  |    1 -
 common/bedbug.c                  | 1254 ------------------------------
 common/board_r.c                 |    9 +-
 doc/README.bedbug                |   56 --
 include/bedbug/bedbug.h          |   40 -
 include/bedbug/ppc.h             |  408 ----------
 include/bedbug/regs.h            |  400 ----------
 include/bedbug/tables.h          |  601 --------------
 include/bedbug/type.h            |   29 -
 post/lib_powerpc/string.c        |    1 -
 15 files changed, 1 insertion(+), 3230 deletions(-)
 delete mode 100644 cmd/bedbug.c
 delete mode 100644 common/bedbug.c
 delete mode 100644 doc/README.bedbug
 delete mode 100644 include/bedbug/bedbug.h
 delete mode 100644 include/bedbug/ppc.h
 delete mode 100644 include/bedbug/regs.h
 delete mode 100644 include/bedbug/tables.h
 delete mode 100644 include/bedbug/type.h
arch/powerpc/cpu/mpc83xx/traps.c +0 -7
index 22e451c58d..94e6323d73 100644
@@ -204,15 +204,8 @@ void UnknownException(struct pt_regs *regs)
 	_exception(0, regs);
 }
 
-#if defined(CONFIG_CMD_BEDBUG)
-extern void do_bedbug_breakpoint(struct pt_regs *);
-#endif
-
 void DebugException(struct pt_regs *regs)
 {
 	printf("Debugger trap at @ %lx\n", regs->nip );
 	show_regs(regs);
-#if defined(CONFIG_CMD_BEDBUG)
-	do_bedbug_breakpoint( regs );
-#endif
 }
arch/powerpc/cpu/mpc85xx/traps.c +0 -7
index def47285ba..97ed24a6eb 100644
@@ -60,10 +60,6 @@ static __inline__ unsigned long get_esr(void)
 #define ESR_DIZ 0x00400000
 #define ESR_U0F 0x00008000
 
-#if defined(CONFIG_CMD_BEDBUG)
-extern void do_bedbug_breakpoint(struct pt_regs *);
-#endif
-
 /*
  * Trap & Exception support
  */
@@ -285,7 +281,4 @@ void DebugException(struct pt_regs *regs)
 {
 	printf("Debugger trap at @ %lx\n", regs->nip );
 	show_regs(regs);
-#if defined(CONFIG_CMD_BEDBUG)
-	do_bedbug_breakpoint( regs );
-#endif
 }
cmd/Kconfig +0 -7
index 02c298fdbe..a6f95b1813 100644
@@ -2303,13 +2303,6 @@ endmenu
 
 menu "Debug commands"
 
-config CMD_BEDBUG
-	bool "bedbug"
-	help
-	  The bedbug (emBEDded deBUGger) command provides debugging features
-	  for some PowerPC processors. For details please see the
-	  documentation in doc/README.bedbug.
-
 config CMD_CBSYSINFO
 	bool "cbsysinfo"
 	depends on X86
cmd/Makefile +0 -1
index e31ac15ef7..abf5d2a55d 100644
@@ -22,7 +22,6 @@ obj-$(CONFIG_HAVE_BLOCK_DEVICE) += blk_common.o
 obj-$(CONFIG_CMD_SOURCE) += source.o
 obj-$(CONFIG_CMD_BCB) += bcb.o
 obj-$(CONFIG_CMD_BDI) += bdinfo.o
-obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
 obj-$(CONFIG_CMD_BIND) += bind.o
 obj-$(CONFIG_CMD_BINOP) += binop.o
 obj-$(CONFIG_CMD_BLOBLIST) += bloblist.o
cmd/bedbug.c deleted +0 -410

410 lines not on this page · raw message

common/Makefile +0 -1
index c500bcd7d8..2935a08b4f 100644
@@ -17,7 +17,6 @@ obj-y += board_r.o
 obj-$(CONFIG_DISPLAY_BOARDINFO) += board_info.o
 obj-$(CONFIG_DISPLAY_BOARDINFO_LATE) += board_info.o
 
-obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
 obj-$(CONFIG_MII) += miiphyutil.o
 obj-$(CONFIG_CMD_MII) += miiphyutil.o
common/bedbug.c deleted +0 -1254

1,254 lines not on this page · raw message

common/board_r.c +1 -8
index 31a59c585a..cc0e6fa92e 100644
@@ -23,10 +23,6 @@
 #include <asm/cache.h>
 #include <asm/global_data.h>
 #include <u-boot/crc.h>
-/* TODO: can we just include all these headers whether needed or not? */
-#if defined(CONFIG_CMD_BEDBUG)
-#include <bedbug/type.h>
-#endif
 #include <binman.h>
 #include <command.h>
 #include <console.h>
@@ -37,6 +33,7 @@
 #include <ide.h>
 #include <init.h>
 #include <initcall.h>
+/* TODO: can we just include all these headers whether needed or not? */
 #if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
 #endif
@@ -796,10 +793,6 @@ static init_fnc_t init_sequence_r[] = {
 	 */
 	last_stage_init,
 #endif
-#ifdef CONFIG_CMD_BEDBUG
-	INIT_FUNC_WATCHDOG_RESET
-	bedbug_init,
-#endif
 #if defined(CONFIG_PRAM)
 	initr_mem,
 #endif
doc/README.bedbug deleted +0 -56

56 lines not on this page · raw message

include/bedbug/bedbug.h deleted +0 -40
deleted file mode 100644
index 0c5d687f83..0000000000
@@ -1,40 +0,0 @@
-/* $Id$ */
-
-#ifndef _BEDBUG_H
-#define _BEDBUG_H
-
-#ifndef NULL
-#define NULL	0
-#endif
-
-#define _USE_PROTOTYPES
-
-#ifndef isblank
-#define isblank(c) isspace((int)(c))
-#endif
-
-#ifndef __P
-#if defined(_USE_PROTOTYPES) && (defined(__STDC__) || defined(__cplusplus))
-#define __P(protos)	protos		/* full-blown ANSI C */
-#else
-#define __P(protos)	()		/* traditional C preprocessor */
-#endif
-#endif
-
-#endif /* _BEDBUG_H */
-
-
-/*
- * Copyright (c) 2001 William L. Pitts
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are freely
- * permitted provided that the above copyright notice and this
- * paragraph and the following disclaimer are duplicated in all
- * such forms.
- *
- * This software is provided "AS IS" and without any express or
- * implied warranties, including, without limitation, the implied
- * warranties of merchantability and fitness for a particular
- * purpose.
- */
include/bedbug/ppc.h deleted +0 -408

408 lines not on this page · raw message

include/bedbug/regs.h deleted +0 -400

400 lines not on this page · raw message

include/bedbug/tables.h deleted +0 -601

346 lines not on this page · raw message

include/bedbug/type.h deleted +0 -29
deleted file mode 100644
index f7a719caf0..0000000000

Lines of this file are not shown. View the raw message.

post/lib_powerpc/string.c +0 -1
index fc460ceb9f..0d8d280b27 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

Reviewed-by on v2 2/7
#2 lore raw

Re: [PATCH v2 2/7] common: remove bedbug debugger support

Quoted 27 lines · Ovidiu Panait

Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot.

---

Changes in v2:
- new patch

  arch/powerpc/cpu/mpc83xx/traps.c |    7 -
  arch/powerpc/cpu/mpc85xx/traps.c |    7 -
  cmd/Kconfig                      |    7 -
  cmd/Makefile                     |    1 -
  cmd/bedbug.c                     |  410 ----------
  common/Makefile                  |    1 -
  common/bedbug.c                  | 1254 ------------------------------
  common/board_r.c                 |    9 +-
  doc/README.bedbug                |   56 --
  include/bedbug/bedbug.h          |   40 -
  include/bedbug/ppc.h             |  408 ----------
  include/bedbug/regs.h            |  400 ----------
  include/bedbug/tables.h          |  601 --------------
  include/bedbug/type.h            |   29 -
  post/lib_powerpc/string.c        |    1 -
  15 files changed, 1 insertion(+), 3230 deletions(-)
Quoted 8 lines

delete mode 100644 cmd/bedbug.c
delete mode 100644 common/bedbug.c
delete mode 100644 doc/README.bedbug
delete mode 100644 include/bedbug/bedbug.h
delete mode 100644 include/bedbug/ppc.h
delete mode 100644 include/bedbug/regs.h
delete mode 100644 include/bedbug/tables.h
delete mode 100644 include/bedbug/type.h

Reviewed-by on v2 2/7
#3 lore raw

Re: [PATCH v2 2/7] common: remove bedbug debugger support

In reply to Ovidiu Panait
Quoted 28 lines · Ovidiu Panait

Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot.

---

Changes in v2:
- new patch

 arch/powerpc/cpu/mpc83xx/traps.c |    7 -
 arch/powerpc/cpu/mpc85xx/traps.c |    7 -
 cmd/Kconfig                      |    7 -
 cmd/Makefile                     |    1 -
 cmd/bedbug.c                     |  410 ----------
 common/Makefile                  |    1 -
 common/bedbug.c                  | 1254 ------------------------------
 common/board_r.c                 |    9 +-
 doc/README.bedbug                |   56 --
 include/bedbug/bedbug.h          |   40 -
 include/bedbug/ppc.h             |  408 ----------
 include/bedbug/regs.h            |  400 ----------
 include/bedbug/tables.h          |  601 --------------
 include/bedbug/type.h            |   29 -
 post/lib_powerpc/string.c        |    1 -
 15 files changed, 1 insertion(+), 3230 deletions(-)
Quoted 8 lines
 delete mode 100644 cmd/bedbug.c
 delete mode 100644 common/bedbug.c
 delete mode 100644 doc/README.bedbug
 delete mode 100644 include/bedbug/bedbug.h
 delete mode 100644 include/bedbug/ppc.h
 delete mode 100644 include/bedbug/regs.h
 delete mode 100644 include/bedbug/tables.h
 delete mode 100644 include/bedbug/type.h
#4 lore raw

Re: [PATCH v2 2/7] common: remove bedbug debugger support

In reply to Ovidiu Panait
Quoted 8 lines · Ovidiu Panait

Commit 98f705c9cefd ("powerpc: remove 4xx support") removed (in 2017) the last code that made use of bedbug debugger support. Since there aren't any boards left that define either CONFIG_CMD_BEDBUG or a real bedbug_init(), drop this feature from u-boot.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#5 lore raw

PATCH v2 3/7 common: board_r: drop initr_kgdb wrapper

In reply to Ovidiu Panait

Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init().

---

Changes in v2:
- drop extern and add function comment

 common/board_r.c | 11 +----------
 common/kgdb.c    |  7 +++++--
 include/kgdb.h   | 11 ++++++++++-
 3 files changed, 16 insertions(+), 13 deletions(-)
common/board_r.c +1 -10
index cc0e6fa92e..5905921caa 100644
@@ -498,15 +498,6 @@ static int initr_ethaddr(void)
 }
 #endif /* CONFIG_CMD_NET */
 
-#ifdef CONFIG_CMD_KGDB
-static int initr_kgdb(void)
-{
-	puts("KGDB:  ");
-	kgdb_init();
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_LED_STATUS)
 static int initr_status_led(void)
 {
@@ -745,7 +736,7 @@ static init_fnc_t init_sequence_r[] = {
 #endif
 	INIT_FUNC_WATCHDOG_RESET
 #ifdef CONFIG_CMD_KGDB
-	initr_kgdb,
+	kgdb_init,
 #endif
 	interrupt_init,
 #if defined(CONFIG_MICROBLAZE) || defined(CONFIG_M68K)
common/kgdb.c +5 -2
index 4493a15919..29b09fcfe5 100644
@@ -527,15 +527,18 @@ handle_exception (struct pt_regs *regs)
  * kgdb_init must be called *after* the
  * monitor is relocated into ram
  */
-void
-kgdb_init(void)
+int kgdb_init(void)
 {
+	puts("KGDB:  ");
+
 	kgdb_serial_init();
 	debugger_exception_handler = handle_exception;
 	initialized = 1;
 
 	putDebugStr("kgdb ready\n");
 	puts("ready\n");
+
+	return 0;
 }
 
 void
include/kgdb.h +10 -1
index 616ce4451f..bdba347a7f 100644
@@ -39,7 +39,16 @@ typedef
 kgdb_data;
 
 /* these functions are provided by the generic kgdb support */
-extern void kgdb_init(void);
+/**
+ * kgdb_init()
+ *
+ * Perform initializations to allow debugging U-Boot with gdb over a serial
+ * link. It is called during the generic board init sequence.
+ *
+ * Return: 0 if OK
+ */
+int kgdb_init(void);
+
 extern void kgdb_error(int);
 extern int kgdb_output_string(const char *, unsigned int);
 extern void breakpoint(void);
Signature · 1 line
2.25.1
#6 lore raw

Re: [PATCH v2 3/7] common: board_r: drop initr_kgdb wrapper

Quoted 6 lines · Ovidiu Panait

Add a return value to kgdb_init and use it directly in the post-relocation init sequence, rather than using a wrapper stub. Also, move the "KGDB" print message inside kgdb_init().

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#7 lore raw

PATCH v2 4/7 common: board_r: drop initr_addr_map wrapper

In reply to Ovidiu Panait

Add a return value to init_addr_map and use it directly in the post-relocation init sequence, rather than using a wrapper stub.

---

(no changes since v1)

 arch/arm/include/asm/mmu.h     |  2 +-
 arch/arm/mach-bcm283x/init.c   |  4 +++-
 arch/powerpc/cpu/mpc85xx/tlb.c |  4 ++--
 arch/powerpc/include/asm/mmu.h |  2 +-
 common/board_r.c               | 11 +----------
 5 files changed, 8 insertions(+), 15 deletions(-)
arch/arm/include/asm/mmu.h +1 -1
index 9ac16f599e..8449720fad 100644
@@ -3,6 +3,6 @@
 #ifndef __ASM_ARM_MMU_H
 #define __ASM_ARM_MMU_H
 
-void init_addr_map(void);
+int init_addr_map(void);
 
 #endif
arch/arm/mach-bcm283x/init.c +3 -1
index 9803499985..183650a90a 100644
@@ -152,7 +152,7 @@ int mach_cpu_init(void)
 #include <addr_map.h>
 #include <asm/system.h>
 
-void init_addr_map(void)
+int init_addr_map(void)
 {
 	mmu_set_region_dcache_behaviour_phys(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT,
 					     BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS,
@@ -165,6 +165,8 @@ void init_addr_map(void)
 	addrmap_set_entry(BCM2711_RPI4_PCIE_XHCI_MMIO_VIRT,
 			  BCM2711_RPI4_PCIE_XHCI_MMIO_PHYS,
 			  BCM2711_RPI4_PCIE_XHCI_MMIO_SIZE, 1);
+
+	return 0;
 }
 #endif
 
arch/powerpc/cpu/mpc85xx/tlb.c +2 -2
index 973b6fbe4b..aa9b59d487 100644
@@ -219,7 +219,7 @@ int find_tlb_idx(void *addr, u8 tlbsel)
 }
 
 #ifdef CONFIG_ADDR_MAP
-void init_addr_map(void)
+int init_addr_map(void)
 {
 	int i;
 	unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
@@ -235,7 +235,7 @@ void init_addr_map(void)
 			addrmap_set_entry(epn, rpn, TSIZE_TO_BYTES(tsize), i);
 	}
 
-	return ;
+	return 0;
 }
 #endif
 
arch/powerpc/include/asm/mmu.h +1 -1
index 353dc4e874..cb5b26cd77 100644
@@ -138,7 +138,7 @@ extern void _tlbie(unsigned long va);	/* invalidate a TLB entry */
 extern void _tlbia(void);		/* invalidate all TLB entries */
 
 #ifdef CONFIG_ADDR_MAP
-extern void init_addr_map(void);
+extern int init_addr_map(void);
 #endif
 
 typedef enum {
common/board_r.c +1 -10
index 5905921caa..b0840c70b2 100644
@@ -186,15 +186,6 @@ __weak int arch_initr_trap(void)
 	return 0;
 }
 
-#ifdef CONFIG_ADDR_MAP
-static int initr_addr_map(void)
-{
-	init_addr_map();
-
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
 static int initr_unlock_ram_in_cache(void)
 {
@@ -623,7 +614,7 @@ static init_fnc_t init_sequence_r[] = {
 	initr_dm,
 #endif
 #ifdef CONFIG_ADDR_MAP
-	initr_addr_map,
+	init_addr_map,
 #endif
 #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) || defined(CONFIG_RISCV) || \
 	defined(CONFIG_SANDBOX)
Signature · 1 line
2.25.1
#9 lore raw

PATCH v2 5/7 common: board_r: move init_addr_map() to init.h

In reply to Ovidiu Panait

asm/mmu.h include is currently guarded by CONFIG_ADDR_MAP ifdef because the header is only present on arm and powerpc. In order to remove the dependency on this header and the associated ifdef, move init_addr_map() declaration to init.h, since it is only called during the common init sequence.

---

(no changes since v1)

 arch/arm/include/asm/mmu.h                  |  8 --------
 arch/powerpc/cpu/mpc85xx/tlb.c              |  1 +
 arch/powerpc/include/asm/mmu.h              |  4 ----
 board/freescale/common/fsl_chain_of_trust.c |  5 +----
 common/board_r.c                            |  3 ---
 include/init.h                              | 10 ++++++++++
 6 files changed, 12 insertions(+), 19 deletions(-)
 delete mode 100644 arch/arm/include/asm/mmu.h
arch/arm/include/asm/mmu.h deleted +0 -8
deleted file mode 100644
index 8449720fad..0000000000
@@ -1,8 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-
-#ifndef __ASM_ARM_MMU_H
-#define __ASM_ARM_MMU_H
-
-int init_addr_map(void);
-
-#endif
arch/powerpc/cpu/mpc85xx/tlb.c +1 -0
index aa9b59d487..550d45da0e 100644
@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <init.h>
 #include <asm/bitops.h>
 #include <asm/global_data.h>
 #include <asm/processor.h>
arch/powerpc/include/asm/mmu.h +0 -4
index cb5b26cd77..2e6255f0d6 100644
@@ -137,10 +137,6 @@ typedef struct _MMU_context {
 extern void _tlbie(unsigned long va);	/* invalidate a TLB entry */
 extern void _tlbia(void);		/* invalidate all TLB entries */
 
-#ifdef CONFIG_ADDR_MAP
-extern int init_addr_map(void);
-#endif
-
 typedef enum {
 	IBAT0 = 0, IBAT1, IBAT2, IBAT3,
 	DBAT0, DBAT1, DBAT2, DBAT3,
board/freescale/common/fsl_chain_of_trust.c +1 -4
index cafb24971b..7ffb315bc9 100644
@@ -6,6 +6,7 @@
 #include <common.h>
 #include <dm.h>
 #include <env.h>
+#include <init.h>
 #include <fsl_validate.h>
 #include <fsl_secboot_err.h>
 #include <fsl_sfp.h>
@@ -16,10 +17,6 @@
 #include <spl.h>
 #endif
 
-#ifdef CONFIG_ADDR_MAP
-#include <asm/mmu.h>
-#endif
-
 #ifdef CONFIG_FSL_CORENET
 #include <asm/fsl_pamu.h>
 #endif
common/board_r.c +0 -3
index b0840c70b2..7c45e494ed 100644
@@ -59,9 +59,6 @@
 #ifdef CONFIG_XEN
 #include <xen.h>
 #endif
-#ifdef CONFIG_ADDR_MAP
-#include <asm/mmu.h>
-#endif
 #include <asm/sections.h>
 #include <dm/root.h>
 #include <dm/ofnode.h>
include/init.h +10 -0
index f2cd46dead..d8278f1c00 100644
@@ -307,6 +307,16 @@ int board_early_init_r(void);
  */
 int arch_initr_trap(void);
 
+/**
+ * init_addr_map()
+ *
+ * Initialize non-identity virtual-physical memory mappings for 32bit CPUs.
+ * It is called during the generic board init sequence, after relocation.
+ *
+ * Return: 0 if OK
+ */
+int init_addr_map(void);
+
 /**
  * main_loop() - Enter the main loop of U-Boot
  *
Signature · 1 line
2.25.1
#10 lore raw

Re: [PATCH v2 5/7] common: board_r: move init_addr_map() to init.h

Quoted 8 lines · Ovidiu Panait

asm/mmu.h include is currently guarded by CONFIG_ADDR_MAP ifdef because the header is only present on arm and powerpc. In order to remove the dependency on this header and the associated ifdef, move init_addr_map() declaration to init.h, since it is only called during the common init sequence.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#11 lore raw

PATCH v2 6/7 common: board_r: include asm-generic/gpio.h

In reply to Ovidiu Panait

Not all architectures define <asm/gpio.h> and even on those that do, the header cannot be included for all boards without causing various build failures.

Since common/board_r.c only needs gpio_hog_probe_all() declaration, include <asm-generic/gpio.h> and drop the associated ifdef.

---

(no changes since v1)

 common/board_r.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
common/board_r.c +1 -3
index 7c45e494ed..be225d8f87 100644
@@ -66,9 +66,7 @@
 #include <linux/err.h>
 #include <efi_loader.h>
 #include <wdt.h>
-#if defined(CONFIG_GPIO_HOG)
-#include <asm/gpio.h>
-#endif
+#include <asm-generic/gpio.h>
 #ifdef CONFIG_EFI_SETUP_EARLY
 #include <efi_loader.h>
 #endif
Signature · 1 line
2.25.1
#12 lore raw

Re: [PATCH v2 6/7] common: board_r: include asm-generic/gpio.h

Quoted 9 lines · Ovidiu Panait

Not all architectures define <asm/gpio.h> and even on those that do, the header cannot be included for all boards without causing various build failures.

Since common/board_r.c only needs gpio_hog_probe_all() declaration, include <asm-generic/gpio.h> and drop the associated ifdef.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#13 lore raw

PATCH v2 7/7 common: board_r: drop ifdefs around header includes

In reply to Ovidiu Panait

Drop the remaining ifdefs around header includes, to fix an old TODO.

---

(no changes since v1)

 common/board_r.c | 9 ---------
 1 file changed, 9 deletions(-)
common/board_r.c +0 -9
index be225d8f87..bac386f021 100644
@@ -33,16 +33,11 @@
 #include <ide.h>
 #include <init.h>
 #include <initcall.h>
-/* TODO: can we just include all these headers whether needed or not? */
-#if defined(CONFIG_CMD_KGDB)
 #include <kgdb.h>
-#endif
 #include <irq_func.h>
 #include <malloc.h>
 #include <mapmem.h>
-#ifdef CONFIG_BITBANGMII
 #include <miiphy.h>
-#endif
 #include <mmc.h>
 #include <mux.h>
 #include <nand.h>
@@ -56,9 +51,7 @@
 #include <timer.h>
 #include <trace.h>
 #include <watchdog.h>
-#ifdef CONFIG_XEN
 #include <xen.h>
-#endif
 #include <asm/sections.h>
 #include <dm/root.h>
 #include <dm/ofnode.h>
@@ -67,9 +60,7 @@
 #include <efi_loader.h>
 #include <wdt.h>
 #include <asm-generic/gpio.h>
-#ifdef CONFIG_EFI_SETUP_EARLY
 #include <efi_loader.h>
-#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.25.1