diff mbox series

[2/5] arc: Cleanup and audit usage of <config.h>

Message ID 20231117225313.2144665-2-trini@konsulko.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [1/5] qe: Add <config.h> to linux/immap_qe.h | expand

Commit Message

Tom Rini Nov. 17, 2023, 10:53 p.m. UTC
We need to include <config.h> directly when a file needs to have
something such as CFG_SYS_SDRAM_SIZE referenced as this file is not
automatically globally included and is most commonly indirectly included
via common.h.  Remove most cases of arc including config.h directly, but
add it where needed. Further clean up the tb100 board config.h file so
that we don't rely on config.h being included there for a value used in
a single place.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: uboot-snps-arc@synopsys.com
---
 arch/arc/include/asm/arc-bcr.h |  2 --
 arch/arc/include/asm/arcregs.h |  1 -
 arch/arc/include/asm/cache.h   |  2 --
 arch/arc/lib/cpu.c             |  1 +
 board/abilis/tb100/tb100.c     |  4 ++++
 include/configs/tb100.h        | 21 ---------------------
 6 files changed, 5 insertions(+), 26 deletions(-)

Comments

Simon Glass Nov. 18, 2023, 5:09 p.m. UTC | #1
On Fri, 17 Nov 2023 at 15:53, Tom Rini <trini@konsulko.com> wrote:
>
> We need to include <config.h> directly when a file needs to have
> something such as CFG_SYS_SDRAM_SIZE referenced as this file is not
> automatically globally included and is most commonly indirectly included
> via common.h.  Remove most cases of arc including config.h directly, but
> add it where needed. Further clean up the tb100 board config.h file so
> that we don't rely on config.h being included there for a value used in
> a single place.
>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> Cc: uboot-snps-arc@synopsys.com
> ---
>  arch/arc/include/asm/arc-bcr.h |  2 --
>  arch/arc/include/asm/arcregs.h |  1 -
>  arch/arc/include/asm/cache.h   |  2 --
>  arch/arc/lib/cpu.c             |  1 +
>  board/abilis/tb100/tb100.c     |  4 ++++
>  include/configs/tb100.h        | 21 ---------------------
>  6 files changed, 5 insertions(+), 26 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/arch/arc/include/asm/arc-bcr.h b/arch/arc/include/asm/arc-bcr.h
index 823906d946e4..a6c972bf1e31 100644
--- a/arch/arc/include/asm/arc-bcr.h
+++ b/arch/arc/include/asm/arc-bcr.h
@@ -13,8 +13,6 @@ 
 #define __ARC_BCR_H
 #ifndef __ASSEMBLY__
 
-#include <config.h>
-
 union bcr_di_cache {
 	struct {
 #ifdef CONFIG_CPU_BIG_ENDIAN
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index a9f54f61e0cc..273fb8eed859 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -7,7 +7,6 @@ 
 #define _ASM_ARC_ARCREGS_H
 
 #include <asm/cache.h>
-#include <config.h>
 
 /*
  * ARC architecture has additional address space - auxiliary registers.
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 74cff716ef60..65dff4214830 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -6,8 +6,6 @@ 
 #ifndef __ASM_ARC_CACHE_H
 #define __ASM_ARC_CACHE_H
 
-#include <config.h>
-
 /*
  * As of today we may handle any L1 cache line length right in software.
  * For that essentially cache line length is a variable not constant.
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c
index 803dfd425580..593950449f2e 100644
--- a/arch/arc/lib/cpu.c
+++ b/arch/arc/lib/cpu.c
@@ -3,6 +3,7 @@ 
  * Copyright (C) 2013-2014, 2018 Synopsys, Inc. All rights reserved.
  */
 
+#include <config.h>
 #include <clock_legacy.h>
 #include <init.h>
 #include <malloc.h>
diff --git a/board/abilis/tb100/tb100.c b/board/abilis/tb100/tb100.c
index 3dc9e14ef8c0..eb7d12908134 100644
--- a/board/abilis/tb100/tb100.c
+++ b/board/abilis/tb100/tb100.c
@@ -14,6 +14,10 @@  void reset_cpu(void)
 	writel(0x1, (void *)CRM_SWRESET);
 }
 
+/*
+ * Ethernet configuration
+ */
+#define ETH0_BASE_ADDRESS		0xFE100000
 int board_eth_init(struct bd_info *bis)
 {
 	if (designware_initialize(ETH0_BASE_ADDRESS, 0) >= 0)
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 1318f5e5ee44..08b6f3219c33 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -21,25 +21,4 @@ 
  */
 #define CFG_SYS_NS16550_CLK		166666666
 
-/*
- * Even though the board houses Realtek RTL8211E PHY
- * corresponding PHY driver (drivers/net/phy/realtek.c) behaves unexpectedly.
- * In particular "parse_status" reports link is down.
- *
- * Until Realtek PHY driver is fixed fall back to generic PHY driver
- * which implements all required functionality and behaves much more stable.
- *
- *
- */
-
-/*
- * Ethernet configuration
- */
-#define ETH0_BASE_ADDRESS		0xFE100000
-#define ETH1_BASE_ADDRESS		0xFE110000
-
-/*
- * Console configuration
- */
-
 #endif /* _CONFIG_TB100_H_ */