[14/15] arc: libgloss: Add support of EM Starter Kit board

Message ID 20240521095658.10311-15-kolerov93@gmail.com
State New
Headers
Series A series of fixes for ARC and libgloss update |

Commit Message

Yuriy Kolerov May 21, 2024, 9:56 a.m. UTC
  From: Yuriy Kolerov <kolerov93@gmail.com>

These specs files are introduced for EMSK board:

    * emsk1_em4.specs - EMSKv1 with EM4 core, everything in
      ICCM/DCCM memory
    * emsk1_em6.specs - EMSKv1 with EM6 core, everything in
      ICCM/DCCM memory
    * emsk1_em6_ram.specs - EMSKv1 with EM6 core, startup code
      in ICCM and everything else in RAM
    * emsk2.1_em5d.specs - EMSKv2.1 with EM5D core, everything
      in ICCM/DCCM memory
    * emsk2.1_em7d.specs - EMSKv2.1 with EM7D core, everything
      in ICCM/DCCM memory
    * emsk2.1_em7d_ram.specs - EMSKv2.1 with EM7D core, startup
      code in ICCM and everything else in RAM
    * emsk2.2_em7d.specs - EMSKv2.2+ with EM7D core, everything
      in ICCM/DCCM memory
    * emsk2.2_em7d_ram.specs - EMSKv2.2+ with EM7D core, startup
      code in ICCM and everything else in RAM
    * emsk2.2_em9d.specs - EMSKv2.2+ with EM9D core, everything
      in ICCM/DCCM memory
    * emsk2.2_em9d_ram.specs - EMSKv2.2+ with EM9D core, startup
      code in ICCM and everything else in RAM
    * emsk2.2_em11d.specs - EMSKv2.2+ with EM11D core, everything
      in ICCM/DCCM memory
    * emsk2.2_em11d_ram.specs - EMSKv2.2+ with EM11D core, startup
      code in ICCM and everything else in RAM

An example of building an application:

    $ arc-elf32-gcc -mcpu=em -specs=emsk2.2_em11d_ram.specs main.c -o main

Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
---
 libgloss/arc/emsk-uart-setup.c       | 33 ++++++++++++++++++++++++++++
 libgloss/arc/emsk1_em4.ld            | 14 ++++++++++++
 libgloss/arc/emsk1_em4.specs         | 18 +++++++++++++++
 libgloss/arc/emsk1_em6.ld            | 14 ++++++++++++
 libgloss/arc/emsk1_em6.specs         | 18 +++++++++++++++
 libgloss/arc/emsk1_em6_ram.ld        | 14 ++++++++++++
 libgloss/arc/emsk1_em6_ram.specs     | 18 +++++++++++++++
 libgloss/arc/emsk2.1_em5d.ld         | 14 ++++++++++++
 libgloss/arc/emsk2.1_em5d.specs      | 18 +++++++++++++++
 libgloss/arc/emsk2.1_em7d.ld         | 15 +++++++++++++
 libgloss/arc/emsk2.1_em7d.specs      | 18 +++++++++++++++
 libgloss/arc/emsk2.1_em7d_ram.ld     | 15 +++++++++++++
 libgloss/arc/emsk2.1_em7d_ram.specs  | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em11d.ld        | 15 +++++++++++++
 libgloss/arc/emsk2.2_em11d.specs     | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em11d_ram.ld    | 15 +++++++++++++
 libgloss/arc/emsk2.2_em11d_ram.specs | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em7d.ld         | 15 +++++++++++++
 libgloss/arc/emsk2.2_em7d.specs      | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em7d_ram.ld     | 15 +++++++++++++
 libgloss/arc/emsk2.2_em7d_ram.specs  | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em9d.ld         | 15 +++++++++++++
 libgloss/arc/emsk2.2_em9d.specs      | 18 +++++++++++++++
 libgloss/arc/emsk2.2_em9d_ram.ld     | 15 +++++++++++++
 libgloss/arc/emsk2.2_em9d_ram.specs  | 18 +++++++++++++++
 25 files changed, 425 insertions(+)
 create mode 100644 libgloss/arc/emsk-uart-setup.c
 create mode 100644 libgloss/arc/emsk1_em4.ld
 create mode 100644 libgloss/arc/emsk1_em4.specs
 create mode 100644 libgloss/arc/emsk1_em6.ld
 create mode 100644 libgloss/arc/emsk1_em6.specs
 create mode 100644 libgloss/arc/emsk1_em6_ram.ld
 create mode 100644 libgloss/arc/emsk1_em6_ram.specs
 create mode 100644 libgloss/arc/emsk2.1_em5d.ld
 create mode 100644 libgloss/arc/emsk2.1_em5d.specs
 create mode 100644 libgloss/arc/emsk2.1_em7d.ld
 create mode 100644 libgloss/arc/emsk2.1_em7d.specs
 create mode 100644 libgloss/arc/emsk2.1_em7d_ram.ld
 create mode 100644 libgloss/arc/emsk2.1_em7d_ram.specs
 create mode 100644 libgloss/arc/emsk2.2_em11d.ld
 create mode 100644 libgloss/arc/emsk2.2_em11d.specs
 create mode 100644 libgloss/arc/emsk2.2_em11d_ram.ld
 create mode 100644 libgloss/arc/emsk2.2_em11d_ram.specs
 create mode 100644 libgloss/arc/emsk2.2_em7d.ld
 create mode 100644 libgloss/arc/emsk2.2_em7d.specs
 create mode 100644 libgloss/arc/emsk2.2_em7d_ram.ld
 create mode 100644 libgloss/arc/emsk2.2_em7d_ram.specs
 create mode 100644 libgloss/arc/emsk2.2_em9d.ld
 create mode 100644 libgloss/arc/emsk2.2_em9d.specs
 create mode 100644 libgloss/arc/emsk2.2_em9d_ram.ld
 create mode 100644 libgloss/arc/emsk2.2_em9d_ram.specs
  

Patch

diff --git a/libgloss/arc/emsk-uart-setup.c b/libgloss/arc/emsk-uart-setup.c
new file mode 100644
index 000000000..b8e1ea859
--- /dev/null
+++ b/libgloss/arc/emsk-uart-setup.c
@@ -0,0 +1,33 @@ 
+/*
+ * emsk-uart-setup.c -- provide _setup_low_level() to initialize UART.
+ *
+ * Copyright (c) 2024 Synopsys Inc.
+ *
+ * The authors hereby grant permission to use, copy, modify, distribute,
+ * and license this software and its documentation for any purpose, provided
+ * that existing copyright notices are retained in all copies and that this
+ * notice is included verbatim in any distributions. No written agreement,
+ * license, or royalty fee is required for any of the authorized uses.
+ * Modifications to this software may be copyrighted by their authors
+ * and need not follow the licensing terms described here, provided that
+ * the new terms are clearly indicated on the first page of each file where
+ * they apply.
+ *
+ */
+
+#include "uart-8250.h"
+
+/* Setup UART parameters.  */
+int
+_setup_low_level (void)
+{
+  const uint32_t aux_dmp_per = 0x20a;
+  void * const uart_base = (char *)__builtin_arc_lr(aux_dmp_per) + 0x00009000;
+  const int uart_aux_mapped = 0;
+  const uint32_t uart_clock = 50000000;
+  const uint32_t uart_baud = 115200;
+
+  _uart_8250_setup (uart_base, uart_aux_mapped, uart_clock, uart_baud);
+
+  return 0;
+}
diff --git a/libgloss/arc/emsk1_em4.ld b/libgloss/arc/emsk1_em4.ld
new file mode 100644
index 000000000..416480587
--- /dev/null
+++ b/libgloss/arc/emsk1_em4.ld
@@ -0,0 +1,14 @@ 
+/* Memory map fo ARC EM Starter Kit v1 - EM4 */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 128K
+    DCCM : ORIGIN = 0x80000000, LENGTH =  64K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DCCM)
+REGION_ALIAS("sdata", DCCM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk1_em4.specs b/libgloss/arc/emsk1_em4.specs
new file mode 100644
index 000000000..06b991ed9
--- /dev/null
+++ b/libgloss/arc/emsk1_em4.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk1_em4.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk1_em6.ld b/libgloss/arc/emsk1_em6.ld
new file mode 100644
index 000000000..ab620c0c1
--- /dev/null
+++ b/libgloss/arc/emsk1_em6.ld
@@ -0,0 +1,14 @@ 
+/* Memory map for ARC EM Starter Kit v1 - EM6GP */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  32K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk1_em6.specs b/libgloss/arc/emsk1_em6.specs
new file mode 100644
index 000000000..51ce25e2b
--- /dev/null
+++ b/libgloss/arc/emsk1_em6.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk1_em6.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk1_em6_ram.ld b/libgloss/arc/emsk1_em6_ram.ld
new file mode 100644
index 000000000..5bc702b48
--- /dev/null
+++ b/libgloss/arc/emsk1_em6_ram.ld
@@ -0,0 +1,14 @@ 
+/* Memory map for ARC EM Starter Kit v1 - EM6GP */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  32K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", DRAM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk1_em6_ram.specs b/libgloss/arc/emsk1_em6_ram.specs
new file mode 100644
index 000000000..b3543ce19
--- /dev/null
+++ b/libgloss/arc/emsk1_em6_ram.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk1_em6_ram.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.1_em5d.ld b/libgloss/arc/emsk2.1_em5d.ld
new file mode 100644
index 000000000..57a4c4042
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em5d.ld
@@ -0,0 +1,14 @@ 
+/* ARC EM Starter Kit v2.1 - EM5D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 128K
+    DCCM : ORIGIN = 0x80000000, LENGTH = 256K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DCCM)
+REGION_ALIAS("sdata", DCCM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.1_em5d.specs b/libgloss/arc/emsk2.1_em5d.specs
new file mode 100644
index 000000000..e6f0f086b
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em5d.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.1_em5d.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.1_em7d.ld b/libgloss/arc/emsk2.1_em7d.ld
new file mode 100644
index 000000000..0f4f3305d
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em7d.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.1 - EM7D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  32K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH =  32K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.1_em7d.specs b/libgloss/arc/emsk2.1_em7d.specs
new file mode 100644
index 000000000..1eeb8716d
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em7d.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.1_em7d.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.1_em7d_ram.ld b/libgloss/arc/emsk2.1_em7d_ram.ld
new file mode 100644
index 000000000..931269cfc
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em7d_ram.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.1 - EM7D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  32K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH =  32K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", DRAM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.1_em7d_ram.specs b/libgloss/arc/emsk2.1_em7d_ram.specs
new file mode 100644
index 000000000..d4f1fd852
--- /dev/null
+++ b/libgloss/arc/emsk2.1_em7d_ram.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.1_em7d_ram.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em11d.ld b/libgloss/arc/emsk2.2_em11d.ld
new file mode 100644
index 000000000..551b0f443
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em11d.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM11D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  64K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH =  64K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DCCM)
+REGION_ALIAS("sdata", DCCM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em11d.specs b/libgloss/arc/emsk2.2_em11d.specs
new file mode 100644
index 000000000..455e67434
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em11d.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em11d.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em11d_ram.ld b/libgloss/arc/emsk2.2_em11d_ram.ld
new file mode 100644
index 000000000..3e58e91f1
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em11d_ram.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM11D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH =  64K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH =  64K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", DRAM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em11d_ram.specs b/libgloss/arc/emsk2.2_em11d_ram.specs
new file mode 100644
index 000000000..5a7c4aff2
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em11d_ram.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em11d_ram.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em7d.ld b/libgloss/arc/emsk2.2_em7d.ld
new file mode 100644
index 000000000..f7e0cf662
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em7d.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM7D and EM9D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 256K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH = 128K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DCCM)
+REGION_ALIAS("sdata", DCCM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em7d.specs b/libgloss/arc/emsk2.2_em7d.specs
new file mode 100644
index 000000000..6b1217473
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em7d.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em7d.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em7d_ram.ld b/libgloss/arc/emsk2.2_em7d_ram.ld
new file mode 100644
index 000000000..3f6ec312a
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em7d_ram.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM7D and EM9D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 256K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH = 128K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", DRAM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em7d_ram.specs b/libgloss/arc/emsk2.2_em7d_ram.specs
new file mode 100644
index 000000000..66917d2fb
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em7d_ram.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em7d_ram.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em9d.ld b/libgloss/arc/emsk2.2_em9d.ld
new file mode 100644
index 000000000..f7e0cf662
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em9d.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM7D and EM9D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 256K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH = 128K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", ICCM)
+REGION_ALIAS("data", DCCM)
+REGION_ALIAS("sdata", DCCM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em9d.specs b/libgloss/arc/emsk2.2_em9d.specs
new file mode 100644
index 000000000..db8a4bcde
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em9d.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em9d.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s
diff --git a/libgloss/arc/emsk2.2_em9d_ram.ld b/libgloss/arc/emsk2.2_em9d_ram.ld
new file mode 100644
index 000000000..3f6ec312a
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em9d_ram.ld
@@ -0,0 +1,15 @@ 
+/* Memory map for ARC EM Starter Kit v2.2 and 2.3 - EM7D and EM9D */
+
+MEMORY
+{
+    ICCM : ORIGIN = 0x00000000, LENGTH = 256K
+    DRAM : ORIGIN = 0x10000000, LENGTH = 128M
+    DCCM : ORIGIN = 0x80000000, LENGTH = 128K
+}
+
+REGION_ALIAS("startup", ICCM)
+REGION_ALIAS("text", DRAM)
+REGION_ALIAS("data", DRAM)
+REGION_ALIAS("sdata", DRAM)
+
+INCLUDE arcv2elf-common.ld
diff --git a/libgloss/arc/emsk2.2_em9d_ram.specs b/libgloss/arc/emsk2.2_em9d_ram.specs
new file mode 100644
index 000000000..a524453d5
--- /dev/null
+++ b/libgloss/arc/emsk2.2_em9d_ram.specs
@@ -0,0 +1,18 @@ 
+%rename link emsk_link
+%rename link_gcc_c_sequence emsk_link_gcc_c_sequence
+%rename startfile emsk_startfile
+
+*link:
+%(emsk_link) -T emsk2.2_em9d_ram.ld%s
+
+*emsk_libgloss:
+-luart_8250 -lemsk_uart
+
+*emsk_libc:
+%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano}
+
+*link_gcc_c_sequence:
+%(emsk_link_gcc_c_sequence) --start-group %G %(emsk_libc) %(emsk_libgloss) --end-group
+
+*startfile:
+%(emsk_startfile) arc-main-helper%O%s