new file mode 100644
@@ -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;
+}
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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
new file mode 100644
@@ -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