summaryrefslogtreecommitdiff
path: root/arch/arc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/Kconfig12
-rw-r--r--arch/arc/cpu/arcv2/ivt.S31
-rw-r--r--arch/arc/cpu/u-boot.lds51
-rw-r--r--arch/arc/dts/Makefile4
-rw-r--r--arch/arc/dts/nsim.dts (renamed from arch/arc/dts/arcangel4.dts)2
-rw-r--r--arch/arc/include/asm/sections.h2
-rw-r--r--arch/arc/lib/Makefile1
-rw-r--r--arch/arc/lib/interrupts.c26
-rw-r--r--arch/arc/lib/ints_low.S28
-rw-r--r--arch/arc/lib/relocate.c12
-rw-r--r--arch/arc/lib/sections.c23
11 files changed, 106 insertions, 86 deletions
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index f1dc6c8d77..4c5696be1c 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -118,21 +118,21 @@ config SYS_DCACHE_OFF
choice
prompt "Target select"
- default TARGET_AXS101
+ default TARGET_AXS10X
config TARGET_TB100
bool "Support tb100"
-config TARGET_ARCANGEL4
- bool "Support arcangel4"
+config TARGET_NSIM
+ bool "Support standalone nSIM & Free nSIM"
-config TARGET_AXS101
- bool "Support axs101"
+config TARGET_AXS10X
+ bool "Support Synopsys Designware SDP board (AXS101 & AXS103)"
endchoice
source "board/abilis/tb100/Kconfig"
source "board/synopsys/Kconfig"
-source "board/synopsys/axs101/Kconfig"
+source "board/synopsys/axs10x/Kconfig"
endmenu
diff --git a/arch/arc/cpu/arcv2/ivt.S b/arch/arc/cpu/arcv2/ivt.S
index d110b5bba5..7924375fb1 100644
--- a/arch/arc/cpu/arcv2/ivt.S
+++ b/arch/arc/cpu/arcv2/ivt.S
@@ -7,21 +7,26 @@
.section .ivt, "a",@progbits
.align 4
/* Critical system events */
-.word _start /* 0 - 0x000 */
-.word memory_error /* 1 - 0x008 */
-.word instruction_error /* 2 - 0x010 */
+.word _start /* 0x00 - Reset */
+.word memory_error /* 0x01 - Memory Error */
+.word instruction_error /* 0x02 - Instruction Error */
/* 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) */
+.word EV_MachineCheck /* 0x03 - Fatal Machine check */
+.word EV_TLBMissI /* 0x04 - Intruction TLB miss */
+.word EV_TLBMissD /* 0x05 - Data TLB miss */
+.word EV_TLBProtV /* 0x06 - Protection Violation or Misaligned Access */
+.word EV_PrivilegeV /* 0x07 - Privilege Violation */
+.word EV_SWI /* 0x08 - Software Interrupt */
+.word EV_Trap /* 0x09 - Trap */
+.word EV_Extension /* 0x0A - Extension Intruction Exception */
+.word EV_DivZero /* 0x0B - Division by Zero */
+.word EV_DCError /* 0x0C - Data cache consistency error */
+.word EV_Maligned /* 0x0D - Misaligned data access */
+.word 0 /* 0x0E - Unused */
+.word 0 /* 0x0F - Unused */
/* Device interrupts */
-.rept 29
- j interrupt_handler /* 3:31 - 0x018:0xF8 */
+.rept 240
+.word interrupt_handler /* 0x10 - 0xFF */
.endr
diff --git a/arch/arc/cpu/u-boot.lds b/arch/arc/cpu/u-boot.lds
index 693df74061..d3d0a53bf2 100644
--- a/arch/arc/cpu/u-boot.lds
+++ b/arch/arc/cpu/u-boot.lds
@@ -4,38 +4,29 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+#include <config.h>
+
OUTPUT_FORMAT("elf32-littlearc", "elf32-littlearc", "elf32-littlearc")
OUTPUT_ARCH(arc)
ENTRY(_start)
SECTIONS
{
- . = ALIGN(4);
+ . = CONFIG_SYS_TEXT_BASE;
+ __image_copy_start = .;
+ __text_start = .;
.text : {
- *(.__text_start)
- *(.__image_copy_start)
arch/arc/lib/start.o (.text*)
*(.text*)
}
-
- . = ALIGN(4);
- .text_end :
- {
- *(.__text_end)
- }
+ __text_end = .;
. = ALIGN(1024);
- .ivt_start : {
- *(.__ivt_start)
- }
-
+ __ivt_start = .;
.ivt :
{
*(.ivt)
}
-
- .ivt_end : {
- *(.__ivt_end)
- }
+ __ivt_end = .;
. = ALIGN(4);
.rodata : {
@@ -53,34 +44,20 @@ SECTIONS
}
. = ALIGN(4);
- .rel_dyn_start : {
- *(.__rel_dyn_start)
- }
-
+ __rel_dyn_start = .;
.rela.dyn : {
*(.rela.dyn)
}
-
- .rel_dyn_end : {
- *(.__rel_dyn_end)
- }
+ __rel_dyn_end = .;
. = ALIGN(4);
- .bss_start : {
- *(.__bss_start);
- }
-
+ __bss_start = .;
.bss : {
*(.bss*)
}
-
- .bss_end : {
- *(.__bss_end);
- }
+ __bss_end = .;
. = ALIGN(4);
- .image_copy_end : {
- *(.__image_copy_end)
- *(.__init_end)
- }
+ __image_copy_end = .;
+ __init_end = .;
}
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index d4772ecabb..1d94c082ab 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -2,8 +2,8 @@
# SPDX-License-Identifier: GPL-2.0+
#
-dtb-$(CONFIG_TARGET_AXS101) += axs10x.dtb
-dtb-$(CONFIG_TARGET_ARCANGEL4) += arcangel4.dtb
+dtb-$(CONFIG_TARGET_AXS10X) += axs10x.dtb
+dtb-$(CONFIG_TARGET_NSIM) += nsim.dtb
dtb-$(CONFIG_TARGET_TB100) += abilis_tb100.dtb
targets += $(dtb-y)
diff --git a/arch/arc/dts/arcangel4.dts b/arch/arc/dts/nsim.dts
index bfcb9d8369..69e16c2a1b 100644
--- a/arch/arc/dts/arcangel4.dts
+++ b/arch/arc/dts/nsim.dts
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com)
+ * Copyright (C) 2015-2016 Synopsys, Inc. (www.synopsys.com)
*
* SPDX-License-Identifier: GPL-2.0+
*/
diff --git a/arch/arc/include/asm/sections.h b/arch/arc/include/asm/sections.h
index b8f2a859fd..00f12172ab 100644
--- a/arch/arc/include/asm/sections.h
+++ b/arch/arc/include/asm/sections.h
@@ -9,9 +9,7 @@
#include <asm-generic/sections.h>
-extern ulong __text_end;
extern ulong __ivt_start;
extern ulong __ivt_end;
-extern ulong __image_copy_start;
#endif /* __ASM_ARC_SECTIONS_H */
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index e592802907..eb62b3c427 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -9,7 +9,6 @@ head-y := start.o
obj-y += cache.o
obj-y += cpu.o
obj-y += interrupts.o
-obj-y += sections.o
obj-y += relocate.o
obj-y += strchr-700.o
obj-y += strcmp.o
diff --git a/arch/arc/lib/interrupts.c b/arch/arc/lib/interrupts.c
index d7cab3bb40..ee638d506b 100644
--- a/arch/arc/lib/interrupts.c
+++ b/arch/arc/lib/interrupts.c
@@ -141,3 +141,29 @@ void do_extension(struct pt_regs *regs)
printf("Extension instruction exception\n");
bad_mode(regs);
}
+
+#ifdef CONFIG_ISA_ARCV2
+void do_swi(struct pt_regs *regs)
+{
+ printf("Software Interrupt exception\n");
+ bad_mode(regs);
+}
+
+void do_divzero(unsigned long address, struct pt_regs *regs)
+{
+ printf("Division by zero exception @ 0x%lx\n", address);
+ bad_mode(regs);
+}
+
+void do_dcerror(struct pt_regs *regs)
+{
+ printf("Data cache consistency error exception\n");
+ bad_mode(regs);
+}
+
+void do_maligned(unsigned long address, struct pt_regs *regs)
+{
+ printf("Misaligned data access exception @ 0x%lx\n", address);
+ bad_mode(regs);
+}
+#endif
diff --git a/arch/arc/lib/ints_low.S b/arch/arc/lib/ints_low.S
index 161cf37dc4..e3778847ab 100644
--- a/arch/arc/lib/ints_low.S
+++ b/arch/arc/lib/ints_low.S
@@ -149,3 +149,31 @@ ENTRY(EV_Extension)
mov %r0, %sp
j do_extension
ENDPROC(EV_Extension)
+
+#ifdef CONFIG_ISA_ARCV2
+ENTRY(EV_SWI)
+ SAVE_ALL_SYS
+ mov %r0, %sp
+ j do_swi
+ENDPROC(EV_SWI)
+
+ENTRY(EV_DivZero)
+ SAVE_ALL_SYS
+ SAVE_EXCEPTION_SOURCE
+ mov %r1, %sp
+ j do_divzero
+ENDPROC(EV_DivZero)
+
+ENTRY(EV_DCError)
+ SAVE_ALL_SYS
+ mov %r0, %sp
+ j do_dcerror
+ENDPROC(EV_DCError)
+
+ENTRY(EV_Maligned)
+ SAVE_ALL_SYS
+ SAVE_EXCEPTION_SOURCE
+ mov %r1, %sp
+ j do_maligned
+ENDPROC(EV_Maligned)
+#endif
diff --git a/arch/arc/lib/relocate.c b/arch/arc/lib/relocate.c
index 5c2c2d1930..7802f40545 100644
--- a/arch/arc/lib/relocate.c
+++ b/arch/arc/lib/relocate.c
@@ -6,7 +6,10 @@
#include <common.h>
#include <elf.h>
-#include <asm/sections.h>
+#include <asm-generic/sections.h>
+
+extern ulong __image_copy_start;
+extern ulong __ivt_end;
DECLARE_GLOBAL_DATA_PTR;
@@ -37,6 +40,9 @@ int do_elf_reloc_fixups(void)
Elf32_Rela *re_src = (Elf32_Rela *)(&__rel_dyn_start);
Elf32_Rela *re_end = (Elf32_Rela *)(&__rel_dyn_end);
+ debug("Section .rela.dyn is located at %08x-%08x\n",
+ (unsigned int)re_src, (unsigned int)re_end);
+
Elf32_Addr *offset_ptr_rom, *last_offset = NULL;
Elf32_Addr *offset_ptr_ram;
@@ -52,6 +58,10 @@ int do_elf_reloc_fixups(void)
offset_ptr_ram = (Elf32_Addr *)((ulong)offset_ptr_rom +
gd->reloc_off);
+ debug("Patching value @ %08x (relocated to %08x)\n",
+ (unsigned int)offset_ptr_rom,
+ (unsigned int)offset_ptr_ram);
+
/*
* Use "memcpy" because target location might be
* 16-bit aligned on ARC so we may need to read
diff --git a/arch/arc/lib/sections.c b/arch/arc/lib/sections.c
deleted file mode 100644
index a72c6946d5..0000000000
--- a/arch/arc/lib/sections.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-/*
- * For some reason linker sets linker-generated symbols to zero in PIE mode.
- * A work-around is substitution of linker-generated symbols with
- * compiler-generated symbols which are properly handled by linker in PAE mode.
- */
-
-char __bss_start[0] __attribute__((section(".__bss_start")));
-char __bss_end[0] __attribute__((section(".__bss_end")));
-char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
-char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
-char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
-char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
-char __text_start[0] __attribute__((section(".__text_start")));
-char __text_end[0] __attribute__((section(".__text_end")));
-char __init_end[0] __attribute__((section(".__init_end")));
-char __ivt_start[0] __attribute__((section(".__ivt_start")));
-char __ivt_end[0] __attribute__((section(".__ivt_end")));