From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id AFEEE3858416 for ; Tue, 21 May 2024 09:58:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFEEE3858416 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AFEEE3858416 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716285509; cv=none; b=ShPTb2uXsTSKBZYKn0N6Kzh9oabL/j4RL1iqWhCXrRV4Jn2LvAcmtMP8QZnrQaFpGixvax2d+GXiZ4fE81Dygevc8DHOAnZT4YSeGaFLJ7//O20YMXIhKMP8L0tkwyU1XHCQ56+4UstmmuI7DzwyZw49xo8kHqNLgVCPTqRs2Kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716285509; c=relaxed/simple; bh=fJbys/DHKmbFKBVkKyAC/TpR+ZxRLcLyxAfA+aDjrnk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=TDCcawsS6yPLEKTv7oLSrtlpWQlD20OMzt3+olzX4BfVWn5ZVpni3J7wHvxZRA1sk1GeVmaLRzgk3S188T/4hHeZfvm8vPcog0MdhBdkhker9Whdwxo4qlxxiqxv2mnRuHO10RpNALK7KG1mMBMFA8GcWsiGSQdP2dHqu7ZlXiU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-420180b5922so40428965e9.2 for ; Tue, 21 May 2024 02:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716285504; x=1716890304; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yhtrmZ8XX9izxYb7zTyIS0NpqV8RqtCn0ledTQWnKeM=; b=KYnr6XyHPqXVCCZ1WNmzoIKAkQdUWfjt47rrH/TRFN9CeNvjE9zmsxjzERcFC0aR69 TjXM0dKj5LhPqHxDt30wzc2RVGe8ltqP5gTmIJqrNRLTobKPzc8QjcVsAf6SvSy2P26P Bqty5IjNUEtM5tKF/oKth00wa50XBRTAr9C77i6ehAkdJdVRkzWJWXsKh+sJkDkOcLj/ Nv90Np7LhOtVNdFvmuW6Lshw7sr+N3XUNIv3FekJCE+YIyHqTd/lUSCqa04tLurM+6EH 5jcZqF263zVUrRoDvTR6/MPZCN41n4YXTJ2PsMp0C8Nysx/NPizhNzm7R3xGyzLcdJJ3 iq2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716285504; x=1716890304; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yhtrmZ8XX9izxYb7zTyIS0NpqV8RqtCn0ledTQWnKeM=; b=H3AKWtEt9/K7XVFgGY5qhnVanwcvX6EMHStJdEf+crtmU+aZHBb1KDL5WU7fJgYpDn 6DGgR3CXAQtMCEWbkU35KpKCCPlxJabXTORp4P2woOIZpIMsqV/Km5NN5JZ/adm+qybE gR94i5pUH3bQXeKNYFPtH6l8T5JlC73S5lrU7hAnimnhVUo1mmnNFKWz1BRofCTh4U4e VcxYiDjA4IMy7ECd8GfRSflDH/VtvO79I1cHlOFSNDb6b7L95gXtPHDaM+UQxEV6bzIL XufUM9FVUOWxxAHQr5ZTmOeQWhRUBPOwrDLcUr429LbfEEtMa+OXat0m+FhvXfSde/M6 xQ3Q== X-Gm-Message-State: AOJu0YwofNVQeS7BdA6IFtl2KGDJPn5Kr7OgAwbNXU1g3Qc2LOpU8UwY LdiJgkGrIBXtYvxMhGGPwjjJC8X4SPgf4rRx+YEw6ZOcQA16Q9f2WHSbv6ktA+E= X-Google-Smtp-Source: AGHT+IEJe8SUErXmGxYAS/U89C+pXUpXqk79c2YSsm0wrIdG/uEa0ocJPIk28L0SMLI1RWW4+67J3Q== X-Received: by 2002:a05:600c:19c8:b0:417:e60b:91f6 with SMTP id 5b1f17b1804b1-41fea9324d9mr342123215e9.4.1716285503872; Tue, 21 May 2024 02:58:23 -0700 (PDT) Received: from localhost.localdomain ([2a00:a041:e626:f00:a285:867a:5e98:7729]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41f87b2653bsm490773635e9.4.2024.05.21.02.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 02:58:23 -0700 (PDT) From: kolerov93@gmail.com To: newlib@sourceware.org Cc: shahab@synopsys.com, claziss@gmail.com, Yuriy Kolerov , Vladimir Isaev Subject: [PATCH 13/15] arc: libgloss: Add support of EM SDP board Date: Tue, 21 May 2024 10:56:56 +0100 Message-Id: <20240521095658.10311-14-kolerov93@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240521095658.10311-1-kolerov93@gmail.com> References: <20240521095658.10311-1-kolerov93@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Yuriy Kolerov 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 Signed-off-by: Yuriy Kolerov --- 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(+) create mode 100644 libgloss/arc/emsdp-uart-setup.c create mode 100644 libgloss/arc/emsdp1.1.ld create mode 100644 libgloss/arc/emsdp1.1.specs create mode 100644 libgloss/arc/emsdp1.1_ram.ld create mode 100644 libgloss/arc/emsdp1.1_ram.specs create mode 100644 libgloss/arc/emsdp1.2.ld create mode 100644 libgloss/arc/emsdp1.2.specs create mode 100644 libgloss/arc/emsdp1.2_ram.ld create mode 100644 libgloss/arc/emsdp1.2_ram.specs diff --git a/libgloss/arc/emsdp-uart-setup.c b/libgloss/arc/emsdp-uart-setup.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, 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 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 = 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 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=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 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 = 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 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=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 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 = 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 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=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 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 = 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 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=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 -- 2.39.2