diff options
author | Yuriy Kolerov <kolerov93@gmail.com> | 2024-05-21 10:56:56 +0100 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2024-05-22 14:26:33 -0400 |
commit | 6f8ee57d0993c9606c950d311c2abd93e233491b (patch) | |
tree | dae22dd05411982e7a6b617853bc535efefa6778 /libgloss | |
parent | fc2e959a42fb56416daad21ffbe450c9efe31bd3 (diff) | |
download | newlib-6f8ee57d0993c9606c950d311c2abd93e233491b.zip newlib-6f8ee57d0993c9606c950d311c2abd93e233491b.tar.gz newlib-6f8ee57d0993c9606c950d311c2abd93e233491b.tar.bz2 |
arc: libgloss: Add support of EM SDP board
These specs files are introduced for EM SDP board:
* emsdp1.1.specs - EM SDP 1.1, everything in ICCM/DCCM memory
* emsdp1.1_ram.specs - EM SDP 1.1, startup code in ICCM
memory and everything else in RAM
* emsdp1.2.specs - EM SDP 1.2, everything in ICCM/DCCM memory
* emsdp1.2_ram.specs - EM SDP 1.2, startup code in ICCM
memory and everything else in RAM
An example of building an application:
$ arc-elf32-gcc -mcpu=em -specs=emsdp1.1_ram.specs main.c -o main
Signed-off-by: Vladimir Isaev <vvisaev@gmail.com>
Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
Diffstat (limited to 'libgloss')
-rw-r--r-- | libgloss/arc/emsdp-uart-setup.c | 32 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.1.ld | 15 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.1.specs | 18 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.1_ram.ld | 15 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.1_ram.specs | 18 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.2.ld | 15 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.2.specs | 18 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.2_ram.ld | 15 | ||||
-rw-r--r-- | libgloss/arc/emsdp1.2_ram.specs | 18 |
9 files changed, 164 insertions, 0 deletions
diff --git a/libgloss/arc/emsdp-uart-setup.c b/libgloss/arc/emsdp-uart-setup.c new file mode 100644 index 0000000..eacf980 --- /dev/null +++ b/libgloss/arc/emsdp-uart-setup.c @@ -0,0 +1,32 @@ +/* + * emsdp-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) +{ + void * const uart_base = (void *) 0xf0004000; + const int uart_aux_mapped = 0; + const uint32_t uart_clock = 100000000; + 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/emsdp1.1.ld b/libgloss/arc/emsdp1.1.ld new file mode 100644 index 0000000..c50ba06 --- /dev/null +++ b/libgloss/arc/emsdp1.1.ld @@ -0,0 +1,15 @@ +/* Memory map for ARC EM Software Development Platform 1.0 and 1.1 */ + +MEMORY +{ + PSRAM : ORIGIN = 0x10000000, LENGTH = 16M + ICCM0 : ORIGIN = 0x60000000, LENGTH = 128K + DCCM : ORIGIN = 0x80000000, LENGTH = 128K +} + +REGION_ALIAS("startup", ICCM0) +REGION_ALIAS("text", ICCM0) +REGION_ALIAS("data", DCCM) +REGION_ALIAS("sdata", DCCM) + +INCLUDE arcv2elf-common.ld diff --git a/libgloss/arc/emsdp1.1.specs b/libgloss/arc/emsdp1.1.specs new file mode 100644 index 0000000..965c8d5 --- /dev/null +++ b/libgloss/arc/emsdp1.1.specs @@ -0,0 +1,18 @@ +%rename link emsdp_link +%rename link_gcc_c_sequence emsdp_link_gcc_c_sequence +%rename startfile emsdp_startfile + +*link: +%(emsdp_link) -T emsdp1.1.ld%s + +*emsdp_libgloss: +-luart_8250 -lemsdp_uart + +*emsdp_libc: +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libgloss) --end-group + +*startfile: +%(emsdp_startfile) arc-main-helper%O%s diff --git a/libgloss/arc/emsdp1.1_ram.ld b/libgloss/arc/emsdp1.1_ram.ld new file mode 100644 index 0000000..743a480 --- /dev/null +++ b/libgloss/arc/emsdp1.1_ram.ld @@ -0,0 +1,15 @@ +/* Memory map for ARC EM Software Development Platform 1.0 and 1.1 */ + +MEMORY +{ + PSRAM : ORIGIN = 0x10000000, LENGTH = 16M + ICCM0 : ORIGIN = 0x60000000, LENGTH = 128K + DCCM : ORIGIN = 0x80000000, LENGTH = 128K +} + +REGION_ALIAS("startup", ICCM0) +REGION_ALIAS("text", PSRAM) +REGION_ALIAS("data", PSRAM) +REGION_ALIAS("sdata", PSRAM) + +INCLUDE arcv2elf-common.ld diff --git a/libgloss/arc/emsdp1.1_ram.specs b/libgloss/arc/emsdp1.1_ram.specs new file mode 100644 index 0000000..6fa74e8 --- /dev/null +++ b/libgloss/arc/emsdp1.1_ram.specs @@ -0,0 +1,18 @@ +%rename link emsdp_link +%rename link_gcc_c_sequence emsdp_link_gcc_c_sequence +%rename startfile emsdp_startfile + +*link: +%(emsdp_link) -T emsdp1.1_ram.ld%s + +*emsdp_libgloss: +-luart_8250 -lemsdp_uart + +*emsdp_libc: +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libgloss) --end-group + +*startfile: +%(emsdp_startfile) arc-main-helper%O%s diff --git a/libgloss/arc/emsdp1.2.ld b/libgloss/arc/emsdp1.2.ld new file mode 100644 index 0000000..7e536d0 --- /dev/null +++ b/libgloss/arc/emsdp1.2.ld @@ -0,0 +1,15 @@ +/* Memory map for ARC EM Software Development Platform 1.2 */ + +MEMORY +{ + ICCM0 : ORIGIN = 0x10000000, LENGTH = 128K + PSRAM : ORIGIN = 0x40000000, LENGTH = 16M + DCCM : ORIGIN = 0x80000000, LENGTH = 128K +} + +REGION_ALIAS("startup", ICCM0) +REGION_ALIAS("text", ICCM0) +REGION_ALIAS("data", DCCM) +REGION_ALIAS("sdata", DCCM) + +INCLUDE arcv2elf-common.ld diff --git a/libgloss/arc/emsdp1.2.specs b/libgloss/arc/emsdp1.2.specs new file mode 100644 index 0000000..0366fe5 --- /dev/null +++ b/libgloss/arc/emsdp1.2.specs @@ -0,0 +1,18 @@ +%rename link emsdp_link +%rename link_gcc_c_sequence emsdp_link_gcc_c_sequence +%rename startfile emsdp_startfile + +*link: +%(emsdp_link) -T emsdp1.2.ld%s + +*emsdp_libgloss: +-luart_8250 -lemsdp_uart + +*emsdp_libc: +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libgloss) --end-group + +*startfile: +%(emsdp_startfile) arc-main-helper%O%s diff --git a/libgloss/arc/emsdp1.2_ram.ld b/libgloss/arc/emsdp1.2_ram.ld new file mode 100644 index 0000000..3128c15 --- /dev/null +++ b/libgloss/arc/emsdp1.2_ram.ld @@ -0,0 +1,15 @@ +/* Memory map for ARC EM Software Development Platform 1.2 */ + +MEMORY +{ + ICCM0 : ORIGIN = 0x10000000, LENGTH = 128K + PSRAM : ORIGIN = 0x40000000, LENGTH = 16M + DCCM : ORIGIN = 0x80000000, LENGTH = 128K +} + +REGION_ALIAS("startup", ICCM0) +REGION_ALIAS("text", PSRAM) +REGION_ALIAS("data", PSRAM) +REGION_ALIAS("sdata", PSRAM) + +INCLUDE arcv2elf-common.ld diff --git a/libgloss/arc/emsdp1.2_ram.specs b/libgloss/arc/emsdp1.2_ram.specs new file mode 100644 index 0000000..97284fa --- /dev/null +++ b/libgloss/arc/emsdp1.2_ram.specs @@ -0,0 +1,18 @@ +%rename link emsdp_link +%rename link_gcc_c_sequence emsdp_link_gcc_c_sequence +%rename startfile emsdp_startfile + +*link: +%(emsdp_link) -T emsdp1.2_ram.ld%s + +*emsdp_libgloss: +-luart_8250 -lemsdp_uart + +*emsdp_libc: +%{!specs=nano.specs:-lc} %{specs=nano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libgloss) --end-group + +*startfile: +%(emsdp_startfile) arc-main-helper%O%s |