From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id 999CC3858D26; Wed, 22 May 2024 18:28:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 999CC3858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1716402512; bh=pTpl4rs7i2vOeNbQLrA74f7IEJnwvHhM24on+OYCnJE=; h=From:To:Subject:Date:From; b=cN9oIoVRlS+S1bdjKLTKcHhWArtVB22JKPY7uttiCugSPfz/IQFFWzCVYDnOYC+K6 f2mvpkGJZ6hDbAj0+fUEprQBB+TbJTqYpQmwpjksXl2JK2kC6eYMJy7G9kcXvn93kT k/gzpOxS9+/OURxH4mHtaSp3CZTwj/ORsIk1PE64= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] arc: libgloss: Add support of EM SDP board X-Act-Checkin: newlib-cygwin X-Git-Author: Yuriy Kolerov X-Git-Refname: refs/heads/main X-Git-Oldrev: fc2e959a42fb56416daad21ffbe450c9efe31bd3 X-Git-Newrev: 6f8ee57d0993c9606c950d311c2abd93e233491b Message-Id: <20240522182832.999CC3858D26@sourceware.org> Date: Wed, 22 May 2024 18:28:31 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D6f8ee57d099= 3c9606c950d311c2abd93e233491b commit 6f8ee57d0993c9606c950d311c2abd93e233491b Author: Yuriy Kolerov Date: Tue May 21 10:56:56 2024 +0100 arc: libgloss: Add support of EM SDP board =20 These specs files are introduced for EM SDP board: =20 * 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 =20 An example of building an application: =20 $ arc-elf32-gcc -mcpu=3Dem -specs=3Demsdp1.1_ram.specs main.c -o ma= in =20 Signed-off-by: Vladimir Isaev Signed-off-by: Yuriy Kolerov Diff: --- libgloss/arc/emsdp-uart-setup.c | 32 ++++++++++++++++++++++++++++++++ libgloss/arc/emsdp1.1.ld | 15 +++++++++++++++ libgloss/arc/emsdp1.1.specs | 18 ++++++++++++++++++ libgloss/arc/emsdp1.1_ram.ld | 15 +++++++++++++++ libgloss/arc/emsdp1.1_ram.specs | 18 ++++++++++++++++++ libgloss/arc/emsdp1.2.ld | 15 +++++++++++++++ libgloss/arc/emsdp1.2.specs | 18 ++++++++++++++++++ libgloss/arc/emsdp1.2_ram.ld | 15 +++++++++++++++ libgloss/arc/emsdp1.2_ram.specs | 18 ++++++++++++++++++ 9 files changed, 164 insertions(+) diff --git a/libgloss/arc/emsdp-uart-setup.c b/libgloss/arc/emsdp-uart-setu= p.c new file mode 100644 index 000000000..eacf98057 --- /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, provid= ed + * 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 =3D (void *) 0xf0004000; + const int uart_aux_mapped =3D 0; + const uint32_t uart_clock =3D 100000000; + const uint32_t uart_baud =3D 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 000000000..c50ba0684 --- /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 =3D 0x10000000, LENGTH =3D 16M + ICCM0 : ORIGIN =3D 0x60000000, LENGTH =3D 128K + DCCM : ORIGIN =3D 0x80000000, LENGTH =3D 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 000000000..965c8d532 --- /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=3Dnano.specs:-lc} %{specs=3Dnano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libglo= ss) --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 000000000..743a4808d --- /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 =3D 0x10000000, LENGTH =3D 16M + ICCM0 : ORIGIN =3D 0x60000000, LENGTH =3D 128K + DCCM : ORIGIN =3D 0x80000000, LENGTH =3D 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.sp= ecs new file mode 100644 index 000000000..6fa74e869 --- /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=3Dnano.specs:-lc} %{specs=3Dnano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libglo= ss) --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 000000000..7e536d07c --- /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 =3D 0x10000000, LENGTH =3D 128K + PSRAM : ORIGIN =3D 0x40000000, LENGTH =3D 16M + DCCM : ORIGIN =3D 0x80000000, LENGTH =3D 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 000000000..0366fe52c --- /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=3Dnano.specs:-lc} %{specs=3Dnano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libglo= ss) --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 000000000..3128c15c1 --- /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 =3D 0x10000000, LENGTH =3D 128K + PSRAM : ORIGIN =3D 0x40000000, LENGTH =3D 16M + DCCM : ORIGIN =3D 0x80000000, LENGTH =3D 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.sp= ecs new file mode 100644 index 000000000..97284fae2 --- /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=3Dnano.specs:-lc} %{specs=3Dnano.specs:-lc_nano} + +*link_gcc_c_sequence: +%(emsdp_link_gcc_c_sequence) --start-group %G %(emsdp_libc) %(emsdp_libglo= ss) --end-group + +*startfile: +%(emsdp_startfile) arc-main-helper%O%s