Skip to contentSkip to conversation

ARC: more improvements

PATCH New Alexey Brodkin 1 participant 13 messages Feb 3, 2015 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

cover ARC: more improvements

This series is focused on following items:
* Move more config options to Kconfig
- Cache settings
- Endianess
- Monitor base

* Clean-up of board configuration headers

* Build libgcc in U-Boot for portability

Alexey Brodkin (11):
arc: remove CPU hard-coded selection from board description in
include/configs
arc: add more flavours of ARC700 series CPU
arc: define and use PTAG AUX regs for MMUv3 only
arc: select cache settings via menuconfig
arc: add selection of endianess in Kconfig
arc: hard-code CONFIG_SYS_GENERIC_BOARD into asm/config.h
arc: get rid of useless CONFIG_SKIP_LOWLEVEL_INIT
arc: hard-code CONFIG_ARCH_EARLY_INIT_R in asm/config.h
arc: move SYS_MONITOR_BASE setup in Konfig
arc: move CPU flags selection to the main "config.mk"
arc: build libgcc in U-Boot

Igor Guryanov (1):
arc: memcmp - fix zero-delay loop utilization

 Kconfig                        |   2 +-
 arch/Kconfig                   |   1 +
 arch/arc/Kconfig               |  71 ++++++++++++-
 arch/arc/config.mk             |  15 ++-
 arch/arc/cpu/arcv1/config.mk   |   7 --
 arch/arc/include/asm/arcregs.h |   6 +-
 arch/arc/include/asm/cache.h   |  19 ++--
 arch/arc/include/asm/config.h  |   2 +
 arch/arc/lib/Makefile          |   2 +
 arch/arc/lib/_millicodethunk.S | 226 +++++++++++++++++++++++++++++++++++++++++
 arch/arc/lib/cache.c           |   7 +-
 arch/arc/lib/libgcc2.c         | 161 +++++++++++++++++++++++++++++
 arch/arc/lib/libgcc2.h         | 132 ++++++++++++++++++++++++
 arch/arc/lib/memcmp.S          |   2 +
 board/synopsys/Kconfig         |  10 --
 board/synopsys/MAINTAINERS     |   1 -
 configs/arcangel4-be_defconfig |   4 +-
 configs/arcangel4_defconfig    |   1 +
 configs/axs101_defconfig       |   5 +-
 configs/tb100_defconfig        |   4 +-
 include/configs/arcangel4-be.h |  91 -----------------
 include/configs/arcangel4.h    |  12 ---
 include/configs/axs101.h       |  15 ---
 include/configs/tb100.h        |  10 --
 24 files changed, 639 insertions(+), 167 deletions(-)
 delete mode 100644 arch/arc/cpu/arcv1/config.mk
 create mode 100644 arch/arc/lib/_millicodethunk.S
 create mode 100644 arch/arc/lib/libgcc2.c
 create mode 100644 arch/arc/lib/libgcc2.h
 delete mode 100644 include/configs/arcangel4-be.h
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/12 arc: memcmp - fix zero-delay loop utilization

From: Igor Guryanov <[email protected]>

It's prohibited to put branch instruction in the very end of zero-delay loop. On execution this causes "Illegal instruction" exception.

---
 arch/arc/lib/memcmp.S | 2 ++
 1 file changed, 2 insertions(+)
arch/arc/lib/memcmp.S +2 -0
index fa5aac5..87bccab 100644
@@ -29,6 +29,7 @@ memcmp:
 	ld.a	%r4, [%r0, 8]
 	ld.a	%r5, [%r1, 8]
 	brne	WORD2, %r12, .Lodd
+	nop
 .Loop_end:
 	asl_s	SHIFT, SHIFT, 3
 	bhs_s	.Last_cmp
@@ -105,6 +106,7 @@ memcmp:
 	ldb.a	%r4, [%r0, 2]
 	ldb.a	%r5, [%r1, 2]
 	brne	%r3, %r12, .Lbyte_odd
+	nop
 .Lbyte_end:
 	bcc	.Lbyte_even
 	brne	%r4, %r5, .Lbyte_even
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/12 arc: remove CPU hard-coded selection from board description in include/configs

In reply to Alexey Brodkin

With switch to Kconfig we only need very board-specific descriptions in include/configs.

CPU selection is performed with either defconfig or manually via menuconfig.

---
 include/configs/arcangel4-be.h | 1 -
 include/configs/arcangel4.h    | 1 -
 include/configs/axs101.h       | 1 -
 include/configs/tb100.h        | 1 -
 4 files changed, 4 deletions(-)
include/configs/arcangel4-be.h +0 -1
index 76163ab..2ca209e 100644
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
include/configs/arcangel4.h +0 -1
index 81934a4..2afb63d 100644
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
include/configs/axs101.h +0 -1
index c61ddd6..a8a9cb3 100644
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
include/configs/tb100.h +0 -1
index e9218f7..a598343 100644
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC700
 #define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/12 arc: add more flavours of ARC700 series CPU

In reply to Alexey Brodkin

Now we may select a particular version of ARC700:
* ARC750D or
* ARC770D

It allows more flexible (or more fine tuned) configuration of U-Boot. Before that change we relied on minimal configuration but now we may use specific features of each CPU.

Moreover allows us to escape manual selection of options that exist in both CPUs but may have say different version like MMUv2 in ARC750D vs MMUv3 in ARC770D.

---
 arch/arc/Kconfig               | 40 ++++++++++++++++++++++++++++++++++++++++
 arch/arc/config.mk             |  4 ++++
 arch/arc/include/asm/arcregs.h |  2 ++
 arch/arc/include/asm/cache.h   |  6 ++++++
 include/configs/arcangel4-be.h |  1 -
 include/configs/arcangel4.h    |  1 -
 include/configs/axs101.h       |  1 -
 include/configs/tb100.h        |  1 -
 8 files changed, 52 insertions(+), 4 deletions(-)
arch/arc/Kconfig +40 -0
index c6b1efe..f7d2964 100644
@@ -8,6 +8,46 @@ config SYS_CPU
 	default "arcv1"
 
 choice
+	prompt "CPU selection"
+	default CPU_ARC770D
+
+config CPU_ARC750D
+	bool "ARC 750D"
+	select ARC_MMU_V2
+	help
+	  Choose this option to build an U-Boot for ARC750D CPU.
+
+config CPU_ARC770D
+	bool "ARC 770D"
+	select ARC_MMU_V3
+	help
+	  Choose this option to build an U-Boot for ARC770D CPU.
+
+endchoice
+
+choice
+	prompt "MMU Version"
+	default ARC_MMU_V3 if CPU_ARC770D
+	default ARC_MMU_V2 if CPU_ARC750D
+
+config ARC_MMU_V2
+	bool "MMU v2"
+	depends on CPU_ARC750D
+	help
+	  Fixed the deficiency of v1 - possible thrashing in memcpy sceanrio
+	  when 2 D-TLB and 1 I-TLB entries index into same 2way set.
+
+config ARC_MMU_V3
+	bool "MMU v3"
+	depends on CPU_ARC770D
+	help
+	  Introduced with ARC700 4.10: New Features
+	  Variable Page size (1k-16k), var JTLB size 128 x (2 or 4)
+	  Shared Address Spaces (SASID)
+
+endchoice
+
+choice
 	prompt "Target select"
 
 config TARGET_TB100
arch/arc/config.mk +4 -0
index 5321987..dd180ef 100644
@@ -25,6 +25,10 @@ ifdef CONFIG_ARC_MMU_VER
 CONFIG_MMU = 1
 endif
 
+ifdef CONFIG_CPU_ARC770D
+PLATFORM_CPPFLAGS += -mlock -mswape
+endif
+
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
 
 # Needed for relocation
arch/arc/include/asm/arcregs.h +2 -0
index 8ace87f..31627e6 100644
@@ -7,6 +7,8 @@
 #ifndef _ASM_ARC_ARCREGS_H
 #define _ASM_ARC_ARCREGS_H
 
+#include <asm/cache.h>
+
 /*
  * ARC architecture has additional address space - auxiliary registers.
  * These registers are mostly used for configuration purposes.
arch/arc/include/asm/cache.h +6 -0
index 16e7568..368d1f0 100644
@@ -20,4 +20,10 @@
 #define ARCH_DMA_MINALIGN	128
 #endif
 
+#if defined(CONFIG_ARC_MMU_V2)
+#define CONFIG_ARC_MMU_VER 2
+#elif defined(CONFIG_ARC_MMU_V3)
+#define CONFIG_ARC_MMU_VER 3
+#endif
+
 #endif /* __ASM_ARC_CACHE_H */
include/configs/arcangel4-be.h +0 -1
index 2ca209e..a43590b 100644
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
include/configs/arcangel4.h +0 -1
index 2afb63d..565f70e 100644
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
include/configs/axs101.h +0 -1
index a8a9cb3..b94687c 100644
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
include/configs/tb100.h +0 -1
index a598343..f353950 100644
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_ARC_MMU_VER		3
 #define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/12 arc: define and use PTAG AUX regs for MMUv3 only

In reply to Alexey Brodkin

DC_PTAG and IC_PTAG registers only exist in MMUv3.

---
 arch/arc/include/asm/arcregs.h | 4 ++--
 arch/arc/lib/cache.c           | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
arch/arc/include/asm/arcregs.h +2 -2
index 31627e6..6a36a81 100644
@@ -23,7 +23,7 @@
 #define ARC_AUX_IC_IVIC		0x10
 #define ARC_AUX_IC_CTRL		0x11
 #define ARC_AUX_IC_IVIL		0x19
-#if (CONFIG_ARC_MMU_VER > 2)
+#if (CONFIG_ARC_MMU_VER == 3)
 #define ARC_AUX_IC_PTAG		0x1E
 #endif
 #define ARC_BCR_IC_BUILD	0x77
@@ -42,7 +42,7 @@
 #define ARC_AUX_DC_IVDL		0x4A
 #define ARC_AUX_DC_FLSH		0x4B
 #define ARC_AUX_DC_FLDL		0x4C
-#if (CONFIG_ARC_MMU_VER > 2)
+#if (CONFIG_ARC_MMU_VER == 3)
 #define ARC_AUX_DC_PTAG		0x5C
 #endif
 #define ARC_BCR_DC_BUILD	0x72
arch/arc/lib/cache.c +3 -3
index fa19a13..fa2a1e7 100644
@@ -101,7 +101,7 @@ void flush_dcache_all(void)
 #ifndef CONFIG_SYS_DCACHE_OFF
 static void dcache_flush_line(unsigned addr)
 {
-#if (CONFIG_ARC_MMU_VER > 2)
+#if (CONFIG_ARC_MMU_VER == 3)
 	write_aux_reg(ARC_AUX_DC_PTAG, addr);
 #endif
 	write_aux_reg(ARC_AUX_DC_FLDL, addr);
@@ -115,7 +115,7 @@ static void dcache_flush_line(unsigned addr)
 	 * Invalidate I$ for addresses range just flushed from D$.
 	 * If we try to execute data flushed above it will be valid/correct
 	 */
-#if (CONFIG_ARC_MMU_VER > 2)
+#if (CONFIG_ARC_MMU_VER == 3)
 	write_aux_reg(ARC_AUX_IC_PTAG, addr);
 #endif
 	write_aux_reg(ARC_AUX_IC_IVIL, addr);
@@ -145,7 +145,7 @@ void invalidate_dcache_range(unsigned long start, unsigned long end)
 	end = end & (~(CONFIG_SYS_CACHELINE_SIZE - 1));
 
 	for (addr = start; addr <= end; addr += CONFIG_SYS_CACHELINE_SIZE) {
-#if (CONFIG_ARC_MMU_VER > 2)
+#if (CONFIG_ARC_MMU_VER == 3)
 		write_aux_reg(ARC_AUX_DC_PTAG, addr);
 #endif
 		write_aux_reg(ARC_AUX_DC_IVDL, addr);
Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/12 arc: select cache settings via menuconfig

In reply to Alexey Brodkin

This change allows to keep board description clean and minimalistic. This is especially helpful if one board may house different CPUs with different features.

It is applicable to both FPGA-based boards or those that have CPUs mounted on interchnagable daughter-boards.

---
 arch/arc/Kconfig               | 19 +++++++++++++++++++
 arch/arc/include/asm/cache.h   | 13 +++++--------
 arch/arc/lib/cache.c           |  1 +
 configs/axs101_defconfig       |  4 +++-
 configs/tb100_defconfig        |  3 ++-
 include/configs/arcangel4-be.h |  1 -
 include/configs/arcangel4.h    |  1 -
 include/configs/axs101.h       |  4 ----
 include/configs/tb100.h        |  1 -
 9 files changed, 30 insertions(+), 17 deletions(-)
arch/arc/Kconfig +19 -0
index f7d2964..397b179 100644
@@ -47,6 +47,25 @@ config ARC_MMU_V3
 
 endchoice
 
+config SYS_ICACHE_OFF
+	bool "Do not use Instruction Cache"
+	default n
+
+config SYS_DCACHE_OFF
+	bool "Do not use Data Cache"
+	default n
+
+config ARC_CACHE_LINE_SHIFT
+	int "Cache Line Length (as power of 2)"
+	range 5 7
+	default "6"
+	depends on !SYS_DCACHE_OFF || !SYS_DCACHE_OFF
+	help
+	  Starting with ARC700 4.9, Cache line length is configurable,
+	  This option specifies "N", with Line-len = 2 power N
+	  So line lengths of 32, 64, 128 are specified by 5,6,7, respectively
+	  Linux only supports same line lengths for I and D caches.
+
 choice
 	prompt "Target select"
 
arch/arc/include/asm/cache.h +5 -8
index 368d1f0..2725961 100644
@@ -9,15 +9,12 @@
 
 #include <config.h>
 
-/*
- * The current upper bound for ARC L1 data cache line sizes is 128 bytes.
- * We use that value for aligning DMA buffers unless the board config has
- * specified an alternate cache line size.
- */
-#ifdef CONFIG_SYS_CACHELINE_SIZE
-#define ARCH_DMA_MINALIGN	CONFIG_SYS_CACHELINE_SIZE
+#ifdef CONFIG_ARC_CACHE_LINE_SHIFT
+#define CONFIG_SYS_CACHELINE_SIZE	(1 << CONFIG_ARC_CACHE_LINE_SHIFT)
+#define ARCH_DMA_MINALIGN		CONFIG_SYS_CACHELINE_SIZE
 #else
-#define ARCH_DMA_MINALIGN	128
+/* Satisfy users of ARCH_DMA_MINALIGN */
+#define ARCH_DMA_MINALIGN		128
 #endif
 
 #if defined(CONFIG_ARC_MMU_V2)
arch/arc/lib/cache.c +1 -0
index fa2a1e7..a227723 100644
@@ -6,6 +6,7 @@
 
 #include <config.h>
 #include <asm/arcregs.h>
+#include <asm/cache.h>
 
 /* Bit values in IC_CTRL */
 #define IC_CTRL_CACHE_DISABLE	(1 << 0)
configs/axs101_defconfig +3 -1
index 5c0ca11..d165e41 100644
@@ -1,3 +1,5 @@
 CONFIG_ARC=y
 CONFIG_TARGET_AXS101=y
-CONFIG_SYS_CLK_FREQ=750000000
\ No newline at end of file
+CONFIG_SYS_CLK_FREQ=750000000
+CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_SYS_DCACHE_OFF=y
\ No newline at end of file
configs/tb100_defconfig +2 -1
index d2de03b..e17a495 100644
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
-CONFIG_SYS_CLK_FREQ=500000000
\ No newline@end of file
+CONFIG_SYS_CLK_FREQ=500000000
+CONFIG_ARC_CACHE_LINE_SHIFT=5
include/configs/arcangel4-be.h +0 -1
index a43590b..b0bc8bc 100644
@@ -11,7 +11,6 @@
  *  CPU configuration
  */
 #define CONFIG_SYS_BIG_ENDIAN
-#define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
 /*
include/configs/arcangel4.h +0 -1
index 565f70e..3268c56 100644
@@ -10,7 +10,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE	64
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
 /*
include/configs/axs101.h +0 -4
index b94687c..ff3fad3 100644
@@ -10,12 +10,8 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
-/* NAND controller DMA doesn't work correctly with D$ enabled */
-#define CONFIG_SYS_DCACHE_OFF
-
 /*
  * Board configuration
  */
include/configs/tb100.h +0 -1
index f353950..32675c4 100644
@@ -12,7 +12,6 @@
 /*
  *  CPU configuration
  */
-#define CONFIG_SYS_CACHELINE_SIZE	32
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
 /*
Signature · 1 line
2.1.0
#6 lore raw

PATCH 6/12 arc: add selection of endianess in Kconfig

In reply to Alexey Brodkin

This change allows to keep board description clean and minimalistic. This is especially helpful if one board may house different CPUs with different features.

It is applicable to both FPGA-based boards or those that have CPUs mounted on interchnagable daughter-boards.

---
 arch/arc/Kconfig               |  9 +++--
 arch/arc/config.mk             |  4 +-
 board/synopsys/Kconfig         | 10 -----
 board/synopsys/MAINTAINERS     |  1 -
 configs/arcangel4-be_defconfig |  3 +-
 include/configs/arcangel4-be.h | 88 ------------------------------------------
 6 files changed, 11 insertions(+), 104 deletions(-)
 delete mode 100644 include/configs/arcangel4-be.h
arch/arc/Kconfig +6 -3
index 397b179..04fc7b6 100644
@@ -47,6 +47,12 @@ config ARC_MMU_V3
 
 endchoice
 
+config CPU_BIG_ENDIAN
+	bool "Enable Big Endian Mode"
+	default n
+	help
+	  Build kernel for Big Endian Mode of ARC CPU
+
 config SYS_ICACHE_OFF
 	bool "Do not use Instruction Cache"
 	default n
@@ -75,9 +81,6 @@ config TARGET_TB100
 config TARGET_ARCANGEL4
 	bool "Support arcangel4"
 
-config TARGET_ARCANGEL4_BE
-	bool "Support arcangel4-be"
-
 config TARGET_AXS101
 	bool "Support axs101"
 
arch/arc/config.mk +3 -1
index dd180ef..4f2d31f 100644
@@ -4,8 +4,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SYS_BIG_ENDIAN
+ifndef CONFIG_CPU_BIG_ENDIAN
 CONFIG_SYS_LITTLE_ENDIAN = 1
+else
+CONFIG_SYS_BIG_ENDIAN = 1
 endif
 
 ifdef CONFIG_SYS_LITTLE_ENDIAN
board/synopsys/Kconfig +0 -10
index f614f88..8ab48cd 100644
@@ -7,13 +7,3 @@ config SYS_CONFIG_NAME
 	default "arcangel4"
 
 endif
-
-if TARGET_ARCANGEL4_BE
-
-config SYS_VENDOR
-	default "synopsys"
-
-config SYS_CONFIG_NAME
-	default "arcangel4-be"
-
-endif
board/synopsys/MAINTAINERS +0 -1
index 720edd8..43114ce 100644
@@ -3,5 +3,4 @@ M:	Alexey Brodkin <[email protected]>
 S:	Maintained
 F:	include/configs/arcangel4.h
 F:	configs/arcangel4_defconfig
-F:	include/configs/arcangel4-be.h
 F:	configs/arcangel4-be_defconfig
configs/arcangel4-be_defconfig +2 -1
index 0c3ab4e..5d2e126 100644
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
-CONFIG_TARGET_ARCANGEL4_BE=y
+CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=70000000
+CONFIG_CPU_BIG_ENDIAN=y
include/configs/arcangel4-be.h deleted +0 -88

88 lines not on this page · raw message

Signature · 1 line
2.1.0
#7 lore raw

PATCH 7/12 arc: hard-code CONFIG_SYS_GENERIC_BOARD into asm/config.h

In reply to Alexey Brodkin

There're no other options for ARC except "generic board" so ther's no point to define CONFIG_SYS_GENERIC_BOARD per board.

We now have it set fo all ARC boards.

---
 arch/arc/include/asm/config.h | 1 +
 include/configs/arcangel4.h   | 1 -
 include/configs/axs101.h      | 1 -
 include/configs/tb100.h       | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)
arch/arc/include/asm/config.h +1 -0
index e5be078..c1e9b44 100644
@@ -7,6 +7,7 @@
 #ifndef __ASM_ARC_CONFIG_H_
 #define __ASM_ARC_CONFIG_H_
 
+#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
include/configs/arcangel4.h +0 -1
index 3268c56..60f3077 100644
@@ -15,7 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is in RAM already */
 
 #define CONFIG_ARCH_EARLY_INIT_R
include/configs/axs101.h +0 -1
index ff3fad3..2340d99 100644
@@ -15,7 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is in RAM already */
 
 #define CONFIG_ARCH_EARLY_INIT_R
include/configs/tb100.h +0 -1
index 32675c4..c6878fc 100644
@@ -17,7 +17,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_ARCH_EARLY_INIT_R
 
 /*
Signature · 1 line
2.1.0
#8 lore raw

PATCH 8/12 arc: get rid of useless CONFIG_SKIP_LOWLEVEL_INIT

In reply to Alexey Brodkin

Currently there's nothing related to really low-level init on ARC so CONFIG_SKIP_LOWLEVEL_INIT definition makes no sense.

---
 include/configs/arcangel4.h | 2 --
 include/configs/axs101.h    | 2 --
 2 files changed, 4 deletions(-)
include/configs/arcangel4.h +0 -2
index 60f3077..003a45d 100644
@@ -15,8 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is in RAM already */
-
 #define CONFIG_ARCH_EARLY_INIT_R
 
 /*
include/configs/axs101.h +0 -2
index 2340d99..4064ed2 100644
@@ -15,8 +15,6 @@
 /*
  * Board configuration
  */
-#define CONFIG_SKIP_LOWLEVEL_INIT	/* U-Boot is in RAM already */
-
 #define CONFIG_ARCH_EARLY_INIT_R
 
 #define ARC_FPGA_PERIPHERAL_BASE	0xE0000000
Signature · 1 line
2.1.0
#9 lore raw

PATCH 9/12 arc: hard-code CONFIG_ARCH_EARLY_INIT_R in asm/config.h

In reply to Alexey Brodkin

Common arch_early_init_r() is used in "arc/lib/cpu.c" for all ARC boards so there's no sense in separate per-board definitions.

---
 arch/arc/include/asm/config.h | 1 +
 include/configs/arcangel4.h   | 5 -----
 include/configs/axs101.h      | 5 -----
 include/configs/tb100.h       | 5 -----
 4 files changed, 1 insertion(+), 15 deletions(-)
arch/arc/include/asm/config.h +1 -0
index c1e9b44..b4e9099 100644
@@ -10,6 +10,7 @@
 #define CONFIG_SYS_GENERIC_BOARD
 #define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
+#define CONFIG_ARCH_EARLY_INIT_R
 
 #define CONFIG_LMB
 
include/configs/arcangel4.h +0 -5
index 003a45d..80d6438 100644
@@ -13,11 +13,6 @@
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
 /*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
-/*
  * Memory configuration
  */
 #define CONFIG_SYS_TEXT_BASE		0x81000000
include/configs/axs101.h +0 -5
index 4064ed2..e9a3231 100644
@@ -12,11 +12,6 @@
  */
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
-/*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
 #define ARC_FPGA_PERIPHERAL_BASE	0xE0000000
 #define ARC_APB_PERIPHERAL_BASE		0xF0000000
 #define ARC_DWMMC_BASE			(ARC_FPGA_PERIPHERAL_BASE + 0x15000)
include/configs/tb100.h +0 -5
index c6878fc..54eca6f 100644
@@ -15,11 +15,6 @@
 #define CONFIG_SYS_TIMER_RATE		CONFIG_SYS_CLK_FREQ
 
 /*
- * Board configuration
- */
-#define CONFIG_ARCH_EARLY_INIT_R
-
-/*
  * Memory configuration
  */
 #define CONFIG_SYS_TEXT_BASE		0x84000000
Signature · 1 line
2.1.0
#10 lore raw

PATCH 10/12 arc: move SYS_MONITOR_BASE setup in Konfig

In reply to Alexey Brodkin

Following SPARK ARC now has SYS_MONITOR_BASE setup via Kconfig. This makes "include/configs/*.h" cleaner and more flexible.

---
 Kconfig                        | 2 +-
 configs/arcangel4-be_defconfig | 1 +
 configs/arcangel4_defconfig    | 1 +
 configs/axs101_defconfig       | 3 ++-
 configs/tb100_defconfig        | 1 +
 include/configs/arcangel4.h    | 1 -
 include/configs/axs101.h       | 1 -
 include/configs/tb100.h        | 1 -
 8 files changed, 6 insertions(+), 5 deletions(-)
Kconfig +1 -1
index 4157da3..145421a 100644
@@ -138,7 +138,7 @@ config SYS_EXTRA_OPTIONS
 	  new boards should not use this option.
 
 config SYS_TEXT_BASE
-	depends on SPARC
+	depends on SPARC || ARC
 	hex "Text Base"
 	help
 	  TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture
configs/arcangel4-be_defconfig +1 -0
index 5d2e126..979f26e 100644
@@ -2,3 +2,4 @@ CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=70000000
 CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_SYS_TEXT_BASE=0x81000000
configs/arcangel4_defconfig +1 -0
index a63ef21..797595f 100644
@@ -1,3 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_CLK_FREQ=70000000
+CONFIG_SYS_TEXT_BASE=0x81000000
configs/axs101_defconfig +2 -1
index d165e41..34ed963 100644
@@ -2,4 +2,5 @@ CONFIG_ARC=y
 CONFIG_TARGET_AXS101=y
 CONFIG_SYS_CLK_FREQ=750000000
 CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_SYS_DCACHE_OFF=y
\ No newline at end of file
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_SYS_TEXT_BASE=0x81000000
\ No newline at end of file
configs/tb100_defconfig +1 -0
index e17a495..b0e8c9f 100644
@@ -2,3 +2,4 @@ CONFIG_ARC=y
 CONFIG_TARGET_TB100=y
 CONFIG_SYS_CLK_FREQ=500000000
 CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_SYS_TEXT_BASE=0x84000000
include/configs/arcangel4.h +0 -1
index 80d6438..5e4097f 100644
@@ -15,7 +15,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE		0x81000000
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE	0x80000000
include/configs/axs101.h +0 -1
index e9a3231..5fb8aca 100644
@@ -20,7 +20,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE		0x81000000
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE	0x80000000
include/configs/tb100.h +0 -1
index 54eca6f..46df406 100644
@@ -17,7 +17,6 @@
 /*
  * Memory configuration
  */
-#define CONFIG_SYS_TEXT_BASE		0x84000000
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
 
 #define CONFIG_SYS_DDR_SDRAM_BASE	0x80000000
Signature · 1 line
2.1.0
#11 lore raw

PATCH 11/12 arc: move CPU flags selection to the main "config.mk"

In reply to Alexey Brodkin

As a preparation to ARCv2 port submission we're moving CPU slection flags to a common location.
Also it will allow us to have more flexible CPU specification, not only ISA version but CPU family as well checking CONFIG_ARC_CPU_xxx.

---
 arch/arc/config.mk           | 6 +++++-
 arch/arc/cpu/arcv1/config.mk | 7 -------
 2 files changed, 5 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arc/cpu/arcv1/config.mk
arch/arc/config.mk +5 -1
index 4f2d31f..3e75e60 100644
@@ -27,8 +27,12 @@ ifdef CONFIG_ARC_MMU_VER
 CONFIG_MMU = 1
 endif
 
+ifdef CONFIG_CPU_ARC750D
+PLATFORM_CPPFLAGS += -marc700
+endif
+
 ifdef CONFIG_CPU_ARC770D
-PLATFORM_CPPFLAGS += -mlock -mswape
+PLATFORM_CPPFLAGS += -marc700 -mlock -mswape
 endif
 
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2
arch/arc/cpu/arcv1/config.mk deleted +0 -7
deleted file mode 100644
index 3206ff4..0000000
@@ -1,7 +0,0 @@
-#
-# Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
-#
-# SPDX-License-Identifier:	GPL-2.0+
-#
-
-PLATFORM_CPPFLAGS += -mA7
Signature · 1 line
2.1.0
#12 lore raw

PATCH 12/12 arc: build libgcc in U-Boot

In reply to Alexey Brodkin

This way we may have very limited set of functions implemented so we save some space.

Also it allows us to build U-Boot for any ARC core with the same one toolchain because we don't rely on pre-built libgcc.

For example:
* we may use little-endian toolchain but build U-Boot for ether
endianess
* we may use non-multilibbed uClibc toolchain but build U-Boot for
whatever ARC CPU flavour that current GCC supports

Private libgcc built from generic C implementation contributes only 144 bytes to .text section so we don't see significant degradation of size:
--->8---

$ arc-linux-size u-boot.libgcc-prebuilt
   text	   data	    bss	    dec	    hex	filename
 222217	  24912	 214820	 461949	  70c7d	u-boot.libgcc-prebuilt
$ arc-linux-size u-boot.libgcc-private
   text	   data	    bss	    dec	    hex	filename
 222361	  24912	 214820	 462093	  70d0d	u-boot.libgcc-private
--->8---

Also I don't notice visible performance degradation compared to pre-built libgcc (where at least "*div*" functions are had-written in assembly) on typical operations of downloading 10Mb uImage over TFTP and bootm.

---
 arch/Kconfig                   |   1 +
 arch/arc/Kconfig               |   3 +
 arch/arc/config.mk             |   3 +
 arch/arc/lib/Makefile          |   2 +
 arch/arc/lib/_millicodethunk.S | 226 +++++++++++++++++++++++++++++++++++++++++
 arch/arc/lib/libgcc2.c         | 161 +++++++++++++++++++++++++++++
 arch/arc/lib/libgcc2.h         | 132 ++++++++++++++++++++++++
 7 files changed, 528 insertions(+)
 create mode 100644 arch/arc/lib/_millicodethunk.S
 create mode 100644 arch/arc/lib/libgcc2.c
 create mode 100644 arch/arc/lib/libgcc2.h
arch/Kconfig +1 -0
index f63cc5a..132123b 100644
@@ -4,6 +4,7 @@ choice
 
 config ARC
 	bool "ARC architecture"
+	select HAVE_PRIVATE_LIBGCC
 
 config ARM
 	bool "ARM architecture"
arch/arc/Kconfig +3 -0
index 04fc7b6..a8dc4e2 100644
@@ -4,6 +4,9 @@ menu "ARC architecture"
 config SYS_ARCH
 	default "arc"
 
+config USE_PRIVATE_LIBGCC
+	default y
+
 config SYS_CPU
 	default "arcv1"
 
arch/arc/config.mk +3 -0
index 3e75e60..f1e81b6 100644
@@ -12,11 +12,14 @@ endif
 
 ifdef CONFIG_SYS_LITTLE_ENDIAN
 ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc-
+PLATFORM_LDFLAGS += -EL
+PLATFORM_CPPFLAGS += -mlittle-endian
 endif
 
 ifdef CONFIG_SYS_BIG_ENDIAN
 ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc-
 PLATFORM_LDFLAGS += -EB
+PLATFORM_CPPFLAGS += -mbig-endian
 endif
 
 ifeq ($(CROSS_COMPILE),)
arch/arc/lib/Makefile +2 -0
index bae4419..b8028c9 100644
@@ -20,3 +20,5 @@ obj-y += reset.o
 obj-y += timer.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
+
+lib-$(CONFIG_USE_PRIVATE_LIBGCC) += _millicodethunk.o libgcc2.o
arch/arc/lib/_millicodethunk.S new file +226 -0

226 lines not on this page · raw message

arch/arc/lib/libgcc2.c new file +161 -0

161 lines not on this page · raw message

arch/arc/lib/libgcc2.h new file +132 -0

132 lines not on this page · raw message

Signature · 1 line
2.1.0