From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B545DECAAD3 for ; Mon, 19 Sep 2022 11:23:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9210C8171B; Mon, 19 Sep 2022 13:23:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="OFhvtPqX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7BEDC810F6; Mon, 19 Sep 2022 13:23:00 +0200 (CEST) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 99C668171B for ; Mon, 19 Sep 2022 13:22:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kconsul@ventanamicro.com Received: by mail-pj1-x1030.google.com with SMTP id q35-20020a17090a752600b002038d8a68fbso2765655pjk.0 for ; Mon, 19 Sep 2022 04:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=FVgy1t9sQUy9SG4bQjvuuR0yuuDtCWTm9NJ0vvsup9Y=; b=OFhvtPqXD8DZPrDGAEoZU9/kAU7/DFeMN13GuKWcZ3VFaiyRe0aflrOOUlXbMcIpDw x5bamC7oVtOwcD+KPRWs+UZTgM833561BTz7l/NHLvlSZL5NhwZZL1Y3Zmfun8JsBu2r P4in9SqXfydQEwrsgnfdfzoz9H2aLL4pcB8PfdNtYOVr3KDUmZBMOLN0zfHcFLrfeT7e 0blD08qLJyN8ICyouy7TD++9vOkHEQ6etUc/sp71sFwVZe2PmO9rzbbnflCgEMupNe59 iYZSH3AmsGMyWQECuAHJPxBnNqFOhDhiRJI9HNSsEl5ye0oWrvB3tEpubNTDjMj3gnWs x6UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=FVgy1t9sQUy9SG4bQjvuuR0yuuDtCWTm9NJ0vvsup9Y=; b=pTCZN0viRWhvx2xlcazQ6mzcFjI+5KpKIc+6rrS45sdmdEZap7Gavt/+LQGWwDdU4L OP+m91RwnVJcXb7p4WeG1pK0EQqp3omFG/OjEq6gFWVNIzG+kN1tWS+po3tXHiyq3b9z h+UOwweBkicTMWjDQfauVlv9CFVdagpgH0nTTgYi8E9Y9y0m6N6MGeIqU3EeY/vjZXHS qNP6STHz1I/bFA9quh8csSl8sMilLOTHzAZenhtiQaLowABQNzFjHmvO3eWhx1bVcHG9 5v2cnaLlN+ypebjiKTLv/Q6MnSF9eI7Ojox7wTm1aJNYLAQdam1n6LG7pl02nxf7Zs/b mCNg== X-Gm-Message-State: ACrzQf05kI63aHSkn+ccZrpnM9lTBk7nH0JrHSjZGihbi2PvPSaBl3Es AmjtTFod7jrulANvNL3ZCMH+BA== X-Google-Smtp-Source: AMsMyM6xiL0W/ildzJ8S8CA2QAAPaPUuTM6WvSIS7xWAc6GsV/j8go+ssNpb5VNr12b0YPLTGfakVQ== X-Received: by 2002:a17:903:1c3:b0:177:ef4b:c614 with SMTP id e3-20020a17090301c300b00177ef4bc614mr12432031plh.17.1663586574766; Mon, 19 Sep 2022 04:22:54 -0700 (PDT) Received: from performance-PowerEdge-T440.. ([103.97.165.210]) by smtp.googlemail.com with ESMTPSA id k29-20020aa7973d000000b00537ff911a89sm20101415pfg.105.2022.09.19.04.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 04:22:54 -0700 (PDT) From: Kautuk Consul To: Bharat Gooty , Rayagonda Kokatanur , Sean Anderson , Rick Chen , Leo , Simon Glass , Heinrich Schuchardt , Ilias Apalodimas , Alexandru Gagniuc , Philippe Reynes , Rasmus Villemoes , Stefan Roese , Loic Poulain , Bin Meng Cc: u-boot@lists.denx.de, Kautuk Consul Subject: [PATCH v3 0/3] Add riscv semihosting support in u-boot Date: Mon, 19 Sep 2022 16:52:40 +0530 Message-Id: <20220919112243.2758726-1-kconsul@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Semihosting is a mechanism that enables code running on a target to communicate and use the Input/Output facilities on a host computer that is running a debugger. This patchset adds support for semihosting in u-boot for RISCV64 targets. CHANGES since v2: - Move the arch/arm/Kconfig common *SEMIHOSTING* config options from arch/arm/Kconfig to lib/Kconfig. - Improve the *SEMIHOSTING_FALLBACK config options in lib/Kconfig to depend on RISCV or ARM64. - Remove the arch/riscv/include/asm/semhosting.h file. - Improve the arch/riscv/lib/semihosting.c by removing the jump statement and moving the .align 4 to before the 2 .option directives. Kautuk Consul (3): lib: Add common semihosting library arch/riscv: add semihosting support for RISC-V board: qemu-riscv: enable semihosting arch/arm/Kconfig | 46 ------- arch/arm/lib/semihosting.c | 181 +------------------------- arch/riscv/include/asm/spl.h | 1 + arch/riscv/lib/Makefile | 2 + arch/riscv/lib/interrupts.c | 11 ++ arch/riscv/lib/semihosting.c | 24 ++++ configs/qemu-riscv32_defconfig | 4 + configs/qemu-riscv32_smode_defconfig | 4 + configs/qemu-riscv32_spl_defconfig | 7 + configs/qemu-riscv64_defconfig | 4 + configs/qemu-riscv64_smode_defconfig | 4 + configs/qemu-riscv64_spl_defconfig | 7 + include/semihosting.h | 11 ++ lib/Kconfig | 46 +++++++ lib/Makefile | 2 + lib/semihosting.c | 186 +++++++++++++++++++++++++++ 16 files changed, 314 insertions(+), 226 deletions(-) create mode 100644 arch/riscv/lib/semihosting.c create mode 100644 lib/semihosting.c -- 2.34.1