Skip to contentSkip to conversation

ARC updates

PATCH New Alexey Brodkin 1 participant 15 messages Mar 31, 2015 – Apr 3, 2015 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

v2 cover ARC updates

This patchset is meant to prepare ARC for device model utilization. The most important things done:

[1] Separation of interrupt vectore tables from start.S
[2] Merge of low-level start-up code (written in assembly) for ARCompat and ARCv2 architectures
[3] Separation of interrupt and exception handling code in a separate source file (ints_low.S)
[4] Major clean-up of start-up code and switch to heavy use of routines written in C (re-use implementations for x86 in board_f.c)

Changes in v2:
* Always build invalidate_icache_all() and invalidate_dcache_all()
* Unconditionally disable caches on early start, if required enable them later in init_cache_f_r()
* Fixed typo in commit message

Alexey Brodkin (7):
arc: cache - build invalidate_icache_all() and invalidate_dcache_all()
always
arc: merge common start-up code between ARC and ARCv2
arc: move low-level interrupt and exception handlers in a separate
file
arc: clean-up init procedure
arc: re-generate defconfigs
arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA
arc: minor fixes in Kconfig

 arch/arc/Kconfig                    |  10 +-
 arch/arc/cpu/arcv1/Makefile         |   2 +-
 arch/arc/cpu/arcv1/ivt.S            |  27 ++++
 arch/arc/cpu/arcv1/start.S          | 254 ------------------------------------
 arch/arc/cpu/arcv2/Makefile         |   2 +-
 arch/arc/cpu/arcv2/ivt.S            |  27 ++++
 arch/arc/cpu/arcv2/start.S          | 254 ------------------------------------
 arch/arc/include/asm/config.h       |   1 -
 arch/arc/include/asm/init_helpers.h |  12 ++
 arch/arc/include/asm/relocate.h     |  16 +++
 arch/arc/include/asm/u-boot-arc.h   |   3 +
 arch/arc/lib/Makefile               |   3 +
 arch/arc/lib/cache.c                |  12 +-
 arch/arc/lib/cpu.c                  |  13 --
 arch/arc/lib/init_helpers.c         |  25 ++++
 arch/arc/lib/ints_low.S             | 151 +++++++++++++++++++++
 arch/arc/lib/relocate.c             |  19 +++
 arch/arc/lib/start.S                |  59 +++++++++
 common/board_f.c                    |   8 +-
 configs/arcangel4-be_defconfig      |   4 +-
 configs/arcangel4_defconfig         |   2 +-
 configs/axs101_defconfig            |   6 +-
 configs/axs103_defconfig            |   4 +-
 configs/tb100_defconfig             |   4 +-
 24 files changed, 375 insertions(+), 543 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 delete mode 100644 arch/arc/cpu/arcv1/start.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c
 create mode 100644 arch/arc/lib/ints_low.S
 create mode 100644 arch/arc/lib/start.S
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/7 arc: cache - build invalidate_icache_all() and invalidate_dcache_all() always

Make both invalidate_icache_all() and invalidate_dcache_all() available even if U-Boot is configured with CONFIG_SYS_DCACHE_OFF and/or CONFIG_SYS_ICACHE_OFF.

This is useful because configuration of U-Boot may not match actual hardware features. Real board may have cache(s) but for some reason we may want to run U-Boot with cache(s) disabled (for example if some peripherals work improperly with existing drivers if data cache is enabled). So board may start with cache(s) enabled (that's the case for ARC cores with built-in caches) but early in U-Boot we disable cache(s) and make sure all contents of data cache gets flushed in RAM.

---
Changes in v2:
* This patch was introduced in v2 only

---
 arch/arc/lib/cache.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
arch/arc/lib/cache.c +8 -4
index a227723..30f045a 100644
@@ -49,10 +49,12 @@ void icache_disable(void)
 
 void invalidate_icache_all(void)
 {
-#ifndef CONFIG_SYS_ICACHE_OFF
+	/* If no cache in CPU exit immediately */
+	if (!(read_aux_reg(ARC_BCR_IC_BUILD) & CACHE_VER_NUM_MASK))
+		return;
+
 	/* Any write to IC_IVIC register triggers invalidation of entire I$ */
 	write_aux_reg(ARC_AUX_IC_IVIC, 1);
-#endif /* CONFIG_SYS_ICACHE_OFF */
 }
 
 int dcache_status(void)
@@ -156,10 +158,12 @@ void invalidate_dcache_range(unsigned long start, unsigned long end)
 
 void invalidate_dcache_all(void)
 {
-#ifndef CONFIG_SYS_DCACHE_OFF
+	/* If no cache in CPU exit immediately */
+	if (!(read_aux_reg(ARC_BCR_DC_BUILD) & CACHE_VER_NUM_MASK))
+		return;
+
 	/* Write 1 to DC_IVDC register triggers invalidation of entire D$ */
 	write_aux_reg(ARC_AUX_DC_IVDC, 1);
-#endif /* CONFIG_SYS_DCACHE_OFF */
 }
 
 void flush_cache(unsigned long start, unsigned long size)
Signature · 1 line
2.1.0
author Applied
#2 lore raw

PATCH v2 1/7 arc: cache - build invalidate_icache_all() and invalidate_dcache_all() always

Quoted 12 lines · Alexey Brodkin

Make both invalidate_icache_all() and invalidate_dcache_all() available even if U-Boot is configured with CONFIG_SYS_DCACHE_OFF and/or CONFIG_SYS_ICACHE_OFF.

This is useful because configuration of U-Boot may not match actual hardware features. Real board may have cache(s) but for some reason we may want to run U-Boot with cache(s) disabled (for example if some peripherals work improperly with existing drivers if data cache is enabled). So board may start with cache(s) enabled (that's the case for ARC cores with built-in caches) but early in U-Boot we disable cache(s) and make sure all contents of data cache gets flushed in RAM.

Quoted 1 line

Applied, thanks.

-Alexey

#3 lore raw

PATCH v2 2/7 arc: merge common start-up code between ARC and ARCv2

In reply to Alexey Brodkin

Even though ARCompact and ARCv2 are not binary compatible most of assembly instructions are used in both. With this change we'll get rid of duplicate code.

Still IVTs are implemented differently so we're keeping them in separate files.

---
No changes in v2

---
 arch/arc/cpu/arcv1/Makefile         |   2 +-
 arch/arc/cpu/arcv1/ivt.S            |  27 ++++
 arch/arc/cpu/arcv2/Makefile         |   2 +-
 arch/arc/cpu/arcv2/ivt.S            |  27 ++++
 arch/arc/cpu/arcv2/start.S          | 254 ------------------------------------
 arch/arc/lib/Makefile               |   1 +
 arch/arc/{cpu/arcv1 => lib}/start.S |  63 ++++-----
 7 files changed, 82 insertions(+), 294 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 rename arch/arc/{cpu/arcv1 => lib}/start.S (82%)
arch/arc/cpu/arcv1/Makefile +1 -1
index 3704ebe..6d17ab2 100644
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y += start.o
+obj-y += ivt.o
arch/arc/cpu/arcv1/ivt.S new file +27 -0
new file mode 100644
index 0000000..7df47a2
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+.section .ivt, "ax", at progbits
+.align 4
+_ivt:
+	/* Critical system events */
+	j	_start			/* 0 - 0x000 */
+	j	memory_error		/* 1 - 0x008 */
+	j	instruction_error	/* 2 - 0x010 */
+
+	/* Device interrupts */
+.rept	29
+	j	interrupt_handler	/* 3:31 - 0x018:0xF8 */
+.endr
+	/* Exceptions */
+	j	EV_MachineCheck		/* 0x100, Fatal Machine check  (0x20) */
+	j	EV_TLBMissI		/* 0x108, Intruction TLB miss  (0x21) */
+	j	EV_TLBMissD		/* 0x110, Data TLB miss        (0x22) */
+	j	EV_TLBProtV		/* 0x118, Protection Violation (0x23)
+							or Misaligned Access  */
+	j	EV_PrivilegeV		/* 0x120, Privilege Violation  (0x24) */
+	j	EV_Trap			/* 0x128, Trap exception       (0x25) */
+	j	EV_Extension		/* 0x130, Extn Intruction Excp (0x26) */
arch/arc/cpu/arcv2/Makefile +1 -1
index cc69e5a..e338a0a 100644
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-obj-y += start.o
+obj-y += ivt.o
arch/arc/cpu/arcv2/ivt.S new file +27 -0
new file mode 100644
index 0000000..d110b5b
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+.section .ivt, "a", at progbits
+.align 4
+	/* Critical system events */
+.word	_start			/* 0 - 0x000 */
+.word	memory_error		/* 1 - 0x008 */
+.word	instruction_error	/* 2 - 0x010 */
+
+	/* Exceptions */
+.word	EV_MachineCheck		/* 0x100, Fatal Machine check  (0x20) */
+.word	EV_TLBMissI		/* 0x108, Intruction TLB miss  (0x21) */
+.word	EV_TLBMissD		/* 0x110, Data TLB miss        (0x22) */
+.word	EV_TLBProtV		/* 0x118, Protection Violation (0x23)
+							or Misaligned Access  */
+.word	EV_PrivilegeV		/* 0x120, Privilege Violation  (0x24) */
+.word	EV_Trap			/* 0x128, Trap exception       (0x25) */
+.word	EV_Extension		/* 0x130, Extn Intruction Excp (0x26) */
+
+	/* Device interrupts */
+.rept	29
+	j	interrupt_handler	/* 3:31 - 0x018:0xF8 */
+.endr
arch/arc/cpu/arcv2/start.S deleted +0 -254

254 lines not on this page · raw message

arch/arc/lib/Makefile +1 -0
index b8028c9..ad66ac2 100644
@@ -18,6 +18,7 @@ obj-y += memcpy-700.o
 obj-y += memset.o
 obj-y += reset.o
 obj-y += timer.o
+obj-y += start.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 
arch/arc/lib/start.S renamed from arch/arc/cpu/arcv1/start.S +25 -38

134 lines not on this page · raw message

Signature · 1 line
2.1.0
author Applied
#4 lore raw

PATCH v2 2/7 arc: merge common start-up code between ARC and ARCv2

Quoted 9 lines · Alexey Brodkin

Even though ARCompact and ARCv2 are not binary compatible most of assembly instructions are used in both. With this change we'll get rid of duplicate code.

Still IVTs are implemented differently so we're keeping them in separate files.

---

Applied, thanks.

-Alexey

#5 lore raw

PATCH v2 3/7 arc: move low-level interrupt and exception handlers in a separate file

In reply to Alexey Brodkin

This separation makes maintenance of code easier because those low-level interrupt- or exception handling routines are pretty static and usually require not much care while start-up code is a subject of modifications and enhancements.

---
No changes in v2

---
 arch/arc/lib/Makefile                |   1 +
 arch/arc/lib/{start.S => ints_low.S} |  92 +---------------------
 arch/arc/lib/start.S                 | 144 -----------------------------------
 3 files changed, 2 insertions(+), 235 deletions(-)
 copy arch/arc/lib/{start.S => ints_low.S} (50%)
arch/arc/lib/Makefile +1 -0
index ad66ac2..b1f1fbe 100644
@@ -19,6 +19,7 @@ obj-y += memset.o
 obj-y += reset.o
 obj-y += timer.o
 obj-y += start.o
+obj-y += ints_low.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 
arch/arc/lib/ints_low.S renamed from arch/arc/lib/start.S +1 -91

110 lines not on this page · raw message

arch/arc/lib/start.S +0 -144

156 lines not on this page · raw message

Signature · 1 line
2.1.0
author Applied
#6 lore raw

PATCH v2 3/7 arc: move low-level interrupt and exception handlers in a separate file

Quoted 6 lines · Alexey Brodkin

This separation makes maintenance of code easier because those low-level interrupt- or exception handling routines are pretty static and usually require not much care while start-up code is a subject of modifications and enhancements.

Applied, thanks.

-Alexey

#7 lore raw

PATCH v2 4/7 arc: clean-up init procedure

In reply to Alexey Brodkin

Intention behind this work was elimination of as much assembly-written code as it is possible.

In case of ARC we already have relocation fix-up implemented in C so why don't we use C for U-Boot copying, .bss zeroing etc.

It turned out x86 uses pretty similar approach so we re-used parts of code in "board_f.c" initially implemented for x86.

Now assembly usage during init is limited to stack- and frame-pointer setup before and after relocation.

---
Changes in v2:
* Unconditionally disable caches on early start
* Only enable caches in init_cache_f_r() because all caches were disabled earlier

---
 arch/arc/include/asm/init_helpers.h | 12 ++++++
 arch/arc/include/asm/relocate.h     | 16 ++++++++
 arch/arc/include/asm/u-boot-arc.h   |  3 ++
 arch/arc/lib/Makefile               |  1 +
 arch/arc/lib/cpu.c                  | 13 ------
 arch/arc/lib/init_helpers.c         | 25 +++++++++++
 arch/arc/lib/relocate.c             | 19 +++++++++
 arch/arc/lib/start.S                | 82 ++++++++-----------------------------
 common/board_f.c                    |  8 ++--
 9 files changed, 98 insertions(+), 81 deletions(-)
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c
arch/arc/include/asm/init_helpers.h new file +12 -0
new file mode 100644
index 0000000..7607e19
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARC_INIT_HELPERS_H
+#define _ASM_ARC_INIT_HELPERS_H
+
+int init_cache_f_r(void);
+
+#endif	/* _ASM_ARC_INIT_HELPERS_H */
arch/arc/include/asm/relocate.h new file +16 -0
new file mode 100644
index 0000000..4c5f923
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef _ASM_ARC_RELOCATE_H
+#define _ASM_ARC_RELOCATE_H
+
+#include <common.h>
+
+int copy_uboot_to_ram(void);
+int clear_bss(void);
+int do_elf_reloc_fixups(void);
+
+#endif	/* _ASM_ARC_RELOCATE_H */
arch/arc/include/asm/u-boot-arc.h +3 -0
index 0c0e8e6..a56ccf1 100644
@@ -9,4 +9,7 @@
 
 int arch_early_init_r(void);
 
+void	board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
+void	board_init_f_r(void) __attribute__ ((noreturn));
+
 #endif	/* __ASM_ARC_U_BOOT_ARC_H__ */
arch/arc/lib/Makefile +1 -0
index b1f1fbe..b887904 100644
@@ -20,6 +20,7 @@ obj-y += reset.o
 obj-y += timer.o
 obj-y += start.o
 obj-y += ints_low.o
+obj-y += init_helpers.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 
arch/arc/lib/cpu.c +0 -13
index 50634b8..3c930bc 100644
@@ -12,19 +12,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int arch_cpu_init(void)
 {
-#ifdef CONFIG_SYS_ICACHE_OFF
-	icache_disable();
-#else
-	icache_enable();
-	invalidate_icache_all();
-#endif
-
-	flush_dcache_all();
-#ifdef CONFIG_SYS_DCACHE_OFF
-	dcache_disable();
-#else
-	dcache_enable();
-#endif
 	timer_init();
 
 /* In simulation (ISS) "CHIPID" and "ARCNUM" are all "ff" */
arch/arc/lib/init_helpers.c new file +25 -0
new file mode 100644
index 0000000..25690ee
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int init_cache_f_r(void)
+{
+#ifndef CONFIG_SYS_ICACHE_OFF
+	icache_enable();
+	/* Make sure no stale entries persist from before we disabled cache */
+	invalidate_icache_all();
+#endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+	dcache_enable();
+	/* Make sure no stale entries persist from before we disabled cache */
+	invalidate_dcache_all();
+#endif
+	return 0;
+}
arch/arc/lib/relocate.c +19 -0
index 7797782..5c2c2d1 100644
@@ -10,6 +10,25 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int copy_uboot_to_ram(void)
+{
+	size_t len = (size_t)&__image_copy_end - (size_t)&__image_copy_start;
+
+	memcpy((void *)gd->relocaddr, (void *)&__image_copy_start, len);
+
+	return 0;
+}
+
+int clear_bss(void)
+{
+	ulong dst_addr = (ulong)&__bss_start + gd->reloc_off;
+	size_t len = (size_t)&__bss_end - (size_t)&__bss_start;
+
+	memset((void *)dst_addr, 0x00, len);
+
+	return 0;
+}
+
 /*
  * Base functionality is taken from x86 version with added ARC-specifics
  */
arch/arc/lib/start.S +18 -64

102 lines not on this page · raw message

common/board_f.c +4 -4
index f7ffa54..cb956b8 100644
@@ -47,7 +47,7 @@
 #include <asm/errno.h>
 #include <asm/io.h>
 #include <asm/sections.h>
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) || defined(CONFIG_ARC)
 #include <asm/init_helpers.h>
 #include <asm/relocate.h>
 #endif
@@ -761,7 +761,7 @@ static int jump_to_copy(void)
 	 * similarly for all archs. When we do generic relocation, hopefully
 	 * we can make all archs enable the dcache prior to relocation.
 	 */
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) || defined(CONFIG_ARC)
 	/*
 	 * SDRAM and console are now initialised. The final stack can now
 	 * be setup in SDRAM. Code execution will continue in Flash, but
@@ -997,7 +997,7 @@ static init_fnc_t init_sequence_f[] = {
 	INIT_FUNC_WATCHDOG_RESET
 	reloc_fdt,
 	setup_reloc,
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) || defined(CONFIG_ARC)
 	copy_uboot_to_ram,
 	clear_bss,
 	do_elf_reloc_fixups,
@@ -1041,7 +1041,7 @@ void board_init_f(ulong boot_flags)
 #endif
 }
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) || defined(CONFIG_ARC)
 /*
  * For now this code is only used on x86.
  *
Signature · 1 line
2.1.0
author Applied
#8 lore raw

PATCH v2 4/7 arc: clean-up init procedure

Quoted 6 lines · Alexey Brodkin

Intention behind this work was elimination of as much assembly-written code as it is possible.

In case of ARC we already have relocation fix-up implemented in C so why don't we use C for U-Boot copying, .bss zeroing etc.

Quoted 8 lines

It turned out x86 uses pretty similar approach so we re-used parts of code in "board_f.c" initially implemented for x86.

Now assembly usage during init is limited to stack- and frame-pointer setup before and after relocation.

Applied, thanks.

-Alexey

#9 lore raw

PATCH v2 5/7 arc: re-generate defconfigs

In reply to Alexey Brodkin

Before that moment our defconfigs were manually modified with addition of new options. That means once anybody wants to add another option and re-genarate defconfig with "make defconfig" there will be lots of differences. So to make future modifications more clean we'll do bulk re-generation right away.

---
Changes in v2:
* Fixed typo, thanks to Masahiro-san

---
 configs/arcangel4-be_defconfig | 4 ++--
 configs/arcangel4_defconfig    | 2 +-
 configs/axs101_defconfig       | 6 +++---
 configs/axs103_defconfig       | 4 ++--
 configs/tb100_defconfig        | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
configs/arcangel4-be_defconfig +2 -2
index 979f26e..990c74a 100644
@@ -1,5 +1,5 @@
 CONFIG_ARC=y
-CONFIG_TARGET_ARCANGEL4=y
-CONFIG_SYS_CLK_FREQ=70000000
 CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_TEXT_BASE=0x81000000
+CONFIG_SYS_CLK_FREQ=70000000
configs/arcangel4_defconfig +1 -1
index 797595f..fbc0ffe 100644
@@ -1,4 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
-CONFIG_SYS_CLK_FREQ=70000000
 CONFIG_SYS_TEXT_BASE=0x81000000
+CONFIG_SYS_CLK_FREQ=70000000
configs/axs101_defconfig +3 -3
index 34ed963..e5e1d87 100644
@@ -1,6 +1,6 @@
 CONFIG_ARC=y
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_ARC_CACHE_LINE_SHIFT=5
 CONFIG_TARGET_AXS101=y
+CONFIG_SYS_TEXT_BASE=0x81000000
 CONFIG_SYS_CLK_FREQ=750000000
-CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_SYS_DCACHE_OFF=y
-CONFIG_SYS_TEXT_BASE=0x81000000
\ No newline at end of file
configs/axs103_defconfig +2 -2
index c63dd4a..7d662ad 100644
@@ -1,5 +1,5 @@
-CONFIG_SYS_TEXT_BASE=0x81000000
-CONFIG_SYS_CLK_FREQ=50000000
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
 CONFIG_TARGET_AXS101=y
+CONFIG_SYS_TEXT_BASE=0x81000000
+CONFIG_SYS_CLK_FREQ=50000000
configs/tb100_defconfig +2 -2
index b0e8c9f..c964272 100644
@@ -1,5 +1,5 @@
 CONFIG_ARC=y
-CONFIG_TARGET_TB100=y
-CONFIG_SYS_CLK_FREQ=500000000
 CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_TARGET_TB100=y
 CONFIG_SYS_TEXT_BASE=0x84000000
+CONFIG_SYS_CLK_FREQ=500000000
Signature · 1 line
2.1.0
author Applied
#10 lore raw

PATCH v2 5/7 arc: re-generate defconfigs

Quoted 8 lines · Alexey Brodkin

Before that moment our defconfigs were manually modified with addition of new options. That means once anybody wants to add another option and re-genarate defconfig with "make defconfig" there will be lots of differences. So to make future modifications more clean we'll do bulk re-generation right away.

Applied, thanks.

-Alexey

#11 lore raw

PATCH v2 6/7 arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA

In reply to Alexey Brodkin

As discussed on mailing list we're drifting away from CONFIG_SYS_GENERIC_GLOBAL_DATA in favour to use of board_init_f_mem() for global data.

So do this for ARC architecture.

---
No changes in v2

---
 arch/arc/include/asm/config.h | 1 -
 arch/arc/lib/start.S          | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
arch/arc/include/asm/config.h +0 -1
index 8936f5c..d2d7919 100644
@@ -7,7 +7,6 @@
 #ifndef __ASM_ARC_CONFIG_H_
 #define __ASM_ARC_CONFIG_H_
 
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_ARCH_EARLY_INIT_R
 
arch/arc/lib/start.S +8 -0
index 82045ae..48ee86e 100644
@@ -22,6 +22,14 @@ ENTRY(_start)
 	bl	dcache_disable
 	bl	icache_disable
 
+	/* Allocate and zero GD, update SP */
+	mov	%r0, %sp
+	bl	board_init_f_mem
+
+	/* Update stack- and frame-pointers */
+	mov	%sp, %r0
+	mov	%fp, %sp
+
 	/* Zero the one and only argument of "board_init_f" */
 	mov_s	%r0, 0
 	j	board_init_f
Signature · 1 line
2.1.0
author Applied
#12 lore raw

PATCH v2 6/7 arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA

Quoted 7 lines · Alexey Brodkin

As discussed on mailing list we're drifting away from CONFIG_SYS_GENERIC_GLOBAL_DATA in favour to use of board_init_f_mem() for global data.

So do this for ARC architecture.

Applied, thanks.

-Alexey

#13 lore raw

PATCH v2 7/7 arc: minor fixes in Kconfig

In reply to Alexey Brodkin

[1] Fix misspeling in ARC_CACHE_LINE_SHIFT dependency, now cache-line
lenth selection is correctly enabled if either I$ or D$ are enabled.

[2] Add dummy entry to target list to make sure target type is always
mentioned in defconfig. Otherwise defconfig for the first target in the list will not have target name and later on with addition of the new target on top of the list in Kconfig will lead to corrupted configuration expanded from defconfig.

---
No changes in v2

---
 arch/arc/Kconfig | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/arc/Kconfig +9 -1
index 24f5c02..c044ad4 100644
@@ -123,7 +123,7 @@ 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
+	depends on !SYS_DCACHE_OFF || !SYS_ICACHE_OFF
 	help
 	  Starting with ARC700 4.9, Cache line length is configurable,
 	  This option specifies "N", with Line-len = 2 power N
@@ -133,6 +133,14 @@ config ARC_CACHE_LINE_SHIFT
 choice
 	prompt "Target select"
 
+config TARGET_DUMMY
+	bool "Dummy target"
+	help
+	  Please select one of real target boards below!
+	  This target is only meant to force "makedefconfig" to put
+	  TARGET_xxx in defconfig even this is the first target from the list
+	  below.
+
 config TARGET_TB100
 	bool "Support tb100"
 
Signature · 1 line
2.1.0
author Applied
#14 lore raw

PATCH v2 7/7 arc: minor fixes in Kconfig

Quoted 10 lines · Alexey Brodkin

[1] Fix misspeling in ARC_CACHE_LINE_SHIFT dependency, now cache-line
lenth selection is correctly enabled if either I$ or D$ are enabled.

[2] Add dummy entry to target list to make sure target type is always
mentioned in defconfig. Otherwise defconfig for the first target in the list will not have target name and later on with addition of the new target on top of the list in Kconfig will lead to corrupted configuration expanded from defconfig.

Applied, thanks.

-Alexey