From patchwork Sat Jan 6 21:20:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 1883295 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T6tYh1GQ9z1yPK for ; Sun, 7 Jan 2024 08:21:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id DAD4942159; Sat, 6 Jan 2024 21:21:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org DAD4942159 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZeZ62fJCZO7W; Sat, 6 Jan 2024 21:21:39 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 0E165420F9; Sat, 6 Jan 2024 21:21:37 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0E165420F9 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 944981BF295 for ; Sat, 6 Jan 2024 21:21:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6C49242087 for ; Sat, 6 Jan 2024 21:21:22 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6C49242087 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4PuHSIl_p_m7 for ; Sat, 6 Jan 2024 21:21:21 +0000 (UTC) Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by smtp4.osuosl.org (Postfix) with ESMTPS id B8B324150C for ; Sat, 6 Jan 2024 21:21:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B8B324150C Received: from pps.filterd (m0098572.ppops.net [127.0.0.1]) by mx0b-00230701.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 406Br3RL020007; Sat, 6 Jan 2024 13:21:18 -0800 Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0b-00230701.pphosted.com (PPS) with ESMTPS id 3vf6cg156x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 06 Jan 2024 13:21:17 -0800 (PST) Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id D22A140362; Sat, 6 Jan 2024 21:21:15 +0000 (UTC) Received: from us01arcgnu3.internal.synopsys.com (unknown [10.194.34.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 6640CA0071; Sat, 6 Jan 2024 21:21:13 +0000 (UTC) X-SNPS-Relay: synopsys.com To: buildroot@buildroot.org Date: Sat, 6 Jan 2024 13:20:58 -0800 Message-Id: <20240106212059.3739123-2-abrodkin@synopsys.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240106212059.3739123-1-abrodkin@synopsys.com> References: <20240106212059.3739123-1-abrodkin@synopsys.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: _cTlO2OlOGy3iEdeueCHlv_fZpA_Kk5k X-Proofpoint-GUID: _cTlO2OlOGy3iEdeueCHlv_fZpA_Kk5k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 clxscore=1015 phishscore=0 bulkscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401060139 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=pfptdkimsnps; bh=J7T5 G6Tt304Q4Swj4VnrPrGfwCfMpRCyJg1I6OoPPOU=; b=rK0OTINGafHMKVrGlmR9 /jJXLqUoK1SWN6Z1VO24qzuioVPL3R3VfCEpep/G6bKoPi/8QIVd9Ksm01zak11S BIGpO3hP+sF1ceAvvAOwRMKWXhElRMxDq5zrP4cf2qP6t4MI8GBJizX4pYuXKQUB /90AqMCwyRFAE3PhApytW+YHCV23lVfhjPr2iLanY8ZgW87L9cf9tlAFktn0OP1S BpoH4NIOhYdR7D8QotYKFGsEMgEeaUDQiihyvpHdcWdy6IivrPn7b5ICh00qhH9l 3ybq55ekddzT1qd72Xs3zMsS9PDqcc2hQTJke3oW/AH8EnmA3nq/wq2vOjTxf8i5 mg== X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1704576077; bh=N4iAwE5fsPnnyzHhEWw9F+27QGIjWmMSvsUKiwTaPSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+4H6CyLwVu5WuGmWqqSvm5HQSavxKx1QSsFzf0yfmsuGw8oP89uWljGRRbIJI8xV 5MRjV9DsoIk3KYC+EDoXfYBaQqLytCjIoclTCkkt6ej+bmB2cxmcGfJUaeC6gd2KjE KZSR2hPd4c6cSthOUEPOffHCHjiwhJYi99mgamB+iCi8mBO+70W18F1K+14R5MClom Z+PqhYA2nBviVJwBFojNOjlWo+yCgbFOBNu3ZBRUCBy+JvDK8tl5UK5Je9oz0KxawO PlryWG/p0mWveXI3/3CAncg+naUdWU61dFjKFCYYlw6ZWn5jFihdwagBJUoxBwnkYr ZiaBUYEwMNVUg== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=rK0OTING; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=O+4H6CyL Subject: [Buildroot] [PATCH v2 2/3] ARC: Add defconfigs for ARC HS58 & HS68 processors in simulators X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alexey Brodkin via buildroot From: Alexey Brodkin Reply-To: Alexey Brodkin Cc: Alexey Brodkin , thomas.petazzoni@bootlin.com, geomatsi@gmail.com, artem.panfilov@nokia.com, Shahab.Vahedi@synopsys.com, VVIsaev@gmail.com, vgupta@kernel.org Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" To simplify ramp-up with Linux on 32-bit ARC HS58 & 64-bit ARC HS68 processors we introduce 2 defconfigs with instructions on how to build embedded Linux image for them and how to run resultoing image. As with earlier images for simulated platforms it's possible to use the same image with either proprietary Synopsys nSIM simulator, QEMU or even with real FPGA-based prototyping platform called HAPS. That not only convenient, but also helps to work on observed issues, i.e. run the same image on so very different platforms and see if earlier observed problem is still there. That way we may easily verify various platforms against each other. For example, if one image works on nSIM & FPGA but doesn't work on QEMU, it's clear something needs to be fixed in QEMU. But if exactly the same though unexpected behavior is observed on all the platforms, we may say with quite some confidence, that we're dealing with a pure software or tools issue. Signed-off-by: Sergey Matyukevich Signed-off-by: Shahab Vahedi Signed-off-by: Vladimir Isaev Signed-off-by: Vineet Gupta Signed-off-by: Alexey Brodkin Tested-By: Waldemar Brodkorb --- Changes in v2: - Added Waldemar's Tested-by tag board/synopsys/nsim/hs5x.props | 30 +++++++++++++++++++++++++ board/synopsys/nsim/hs6x.props | 30 +++++++++++++++++++++++++ board/synopsys/nsim/post-image-arcv3.sh | 4 ++++ board/synopsys/nsim/readme.txt | 16 +++++++++++++ configs/snps_arc32_defconfig | 29 ++++++++++++++++++++++++ configs/snps_arc64_defconfig | 26 +++++++++++++++++++++ 6 files changed, 135 insertions(+) create mode 100644 board/synopsys/nsim/hs5x.props create mode 100644 board/synopsys/nsim/hs6x.props create mode 100755 board/synopsys/nsim/post-image-arcv3.sh create mode 100644 configs/snps_arc32_defconfig create mode 100644 configs/snps_arc64_defconfig diff --git a/board/synopsys/nsim/hs5x.props b/board/synopsys/nsim/hs5x.props new file mode 100644 index 0000000000..1d8974650e --- /dev/null +++ b/board/synopsys/nsim/hs5x.props @@ -0,0 +1,30 @@ +nsim_isa_family=av3hs +nsim_isa_dc_hw_prefetch=1 +nsim_isa_dual_issue_option=1 +nsim_isa_atomic_option=2 +nsim_isa_m128_option=0 +nsim_isa_ll64_option=1 +nsim_isa_mpy_option=9 +nsim_isa_div_rem_option=2 +nsim_isa_enable_timer_0=1 +nsim_isa_enable_timer_1=1 +nsim_isa_rtc_option=1 +icache=16384,64,4 +dcache=16384,64,2 +mmu_version=16 +mmu_pagesize=4096 +mmu_address_space=32 +nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24 +nsim_isa_number_of_interrupts=32 +nsim_isa_number_of_external_interrupts=32 +nsim_isa_has_fp=1 +nsim_isa_fp_dds_option=1 +nsim_isa_fp_div_option=1 +nsim_isa_fp_dp_option=1 +nsim_isa_fp_hp_option=1 +nsim_isa_fp_vec_option=1 +nsim_isa_fp_wide_option=1 +nsim_isa_mpy64=1 +nsim_isa_div64_option=1 +nsim_isa_dsp_option=3 +nsim_isa_dsp_wide_option=1 diff --git a/board/synopsys/nsim/hs6x.props b/board/synopsys/nsim/hs6x.props new file mode 100644 index 0000000000..e26cec0a64 --- /dev/null +++ b/board/synopsys/nsim/hs6x.props @@ -0,0 +1,30 @@ +nsim_fast=0 +nsim_isa_dual_issue_option=1 +nsim_isa_has_hw_pf=1 +nsim_isa_m128_option=1 +nsim_isa_has_hw_pf=1 +nsim_isa_vec64=1 +nsim_isa_family=arc64 +nsim_isa_enable_timer_0=1 +nsim_isa_enable_timer_1=1 +nsim_isa_rtc_option=1 +nsim_isa_addr_size=64 +nsim_isa_pc_size=64 +icache=16384,64,4,o +dcache=16384,64,4,o +mmu_version=16 +mmu_pagesize=4096 +mmu_address_space=48 +nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24 +nsim_isa_mpy_option=9 +nsim_isa_mpy64=1 +nsim_isa_div64_option=1 +nsim_isa_div_rem_option=2 +nsim_isa_atomic_option=2 +nsim_isa_has_fp=1 +nsim_isa_fp_dds_option=1 +nsim_isa_fp_div_option=1 +nsim_isa_fp_dp_option=1 +nsim_isa_fp_hp_option=1 +nsim_isa_fp_vec_option=1 +nsim_isa_fp_wide_option=1 diff --git a/board/synopsys/nsim/post-image-arcv3.sh b/board/synopsys/nsim/post-image-arcv3.sh new file mode 100755 index 0000000000..dd5a634661 --- /dev/null +++ b/board/synopsys/nsim/post-image-arcv3.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +# Install vmlinux with debug symbols +install -m 0644 ${2}/vmlinux ${1}/ diff --git a/board/synopsys/nsim/readme.txt b/board/synopsys/nsim/readme.txt index cc89cf87ac..e43a70038f 100644 --- a/board/synopsys/nsim/readme.txt +++ b/board/synopsys/nsim/readme.txt @@ -41,3 +41,19 @@ $ nsimdrv \ -prop=nsim_isa_pct_counters=8 \ -prop=nsim_isa_pct_size=48 \ output/images/vmlinux + +Build & run image on ARC HS58: + * Build: make snps_arc32_defconfig && make + * Run in nSIM: nsimdrv -propsfile=board/synopsys/nsim/hs5x.props output/images/loader + * Run in QEMU: qemu-system-arc -M virt,ram_start=0 -cpu hs5x -m 2G -display none \ + -nographic -monitor none -kernel output/images/loader \ + -netdev user,id=net0 -device virtio-net-device,netdev=net0 \ + -device virtio-rng-pci + +Build & run image on ARC HS58: + * Build: make snps_arc64_defconfig && make + * Run in nSIM: nsimdrv -propsfile=board/synopsys/nsim/hs6x.props output/images/loader + * Run in QEMU: qemu-system-arc64 -M virt,ram_start=0 -cpu hs6x -m 2G -display none \ + -nographic -monitor none -kernel output/images/loader \ + -netdev user,id=net0 -device virtio-net-device,netdev=net0 \ + -device virtio-rng-pci diff --git a/configs/snps_arc32_defconfig b/configs/snps_arc32_defconfig new file mode 100644 index 0000000000..e94b0fdfeb --- /dev/null +++ b/configs/snps_arc32_defconfig @@ -0,0 +1,29 @@ +#Architecture +BR2_arcle=y +BR2_arc32=y + +# System +BR2_SYSTEM_DHCP="eth0" +BR2_TARGET_GENERIC_GETTY=y + +# Filesystem +BR2_TARGET_ROOTFS_INITRAMFS=y + +# Image +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/synopsys/nsim/post-image-arcv3.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(LINUX_DIR)" + +# Toolchain +BR2_TOOLCHAIN_BUILDROOT_UCLIBC=y + +# Linux headers same as kernel +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6e9dab9d1dc1e8fa2acb75504bf5ff86b885b8e" +BR2_LINUX_KERNEL_DEFCONFIG="haps_hs5x" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="loader" diff --git a/configs/snps_arc64_defconfig b/configs/snps_arc64_defconfig new file mode 100644 index 0000000000..7275b233eb --- /dev/null +++ b/configs/snps_arc64_defconfig @@ -0,0 +1,26 @@ +#Architecture +BR2_arcle=y +BR2_arc64=y + +# System +BR2_SYSTEM_DHCP="eth0" +BR2_TARGET_GENERIC_GETTY=y + +# Filesystem +BR2_TARGET_ROOTFS_INITRAMFS=y + +# Image +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/synopsys/nsim/post-image-arcv3.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="$(LINUX_DIR)" + +# Linux headers same as kernel +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_16=y + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/foss-for-synopsys-dwc-arc-processors/linux.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="f6e9dab9d1dc1e8fa2acb75504bf5ff86b885b8e" +BR2_LINUX_KERNEL_DEFCONFIG="haps_arc64" +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y +BR2_LINUX_KERNEL_IMAGE_TARGET_NAME="loader"