Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2681852iog; Mon, 27 Jun 2022 00:07:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+bx0PTr64FGhvjYaywOpxX+9sQYRdMlBLVQNo2Epj0AIZkCMguWzBaD70a0sJDarVSb8q X-Received: by 2002:a17:90b:378e:b0:1ec:d148:ea2d with SMTP id mz14-20020a17090b378e00b001ecd148ea2dmr19775615pjb.135.1656313672853; Mon, 27 Jun 2022 00:07:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656313672; cv=pass; d=google.com; s=arc-20160816; b=OGY4PjIU7E5Qjzy+vx+aIj9Wauv3fmYT5EIVAMDC0QrDEsKsGkRbsXgQ3lzt0LPcas Qg4qCvIzduqLmAT81FSXYdpSes6DUJKLSH283TY7cHRAI7LFuTlzNqjEz7ZchoGEePC3 Zd+PJ6v45U6T1JtcQprsUlfKtHR3KWZj3FY0ZVpJ+DTwspldtuKEEVw2w2qlTmxltAJp jWN5Jh0zjI47w8sFEouw17ejIRmtKIuKKvEkRw1hucaPxzwi0jfaqwlWvz+/6bu0gSrX rAftVrEepFqJXpyUSF9/7KA47EdafyhQ0hxNIi1RTBDp71LBsWxPTTtbKQAEt62OvtnX o+JQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :envelope-to:dkim-signature; bh=k35c4DTHitPe90OxGi3RmkKT6q5ZMMs03AoTFxBOeZE=; b=qFTNoTyQB11puAwD48dPfxZKCUFC7ISUYLbPMmx1Xb9R8tSYSl1QglO8wQCvbZO+BQ J2XqBYarXeiVv0bGWSda/qSZDjrH8kUeuOUQHKwm3NwbLVmaSIrTSxvCyYmZoLW20SNH icN1dETOqWnwjvy2fWumyY9tfBH15/XOPtyJQGEi/eJwcGhVIAwfGH0sPEvDOkmsIOr4 pJZpNOPv71Ih8r+Cpu2ZYsLzOmRSNHrC/UKEhYzeF/vpMJB+QfPPmYHINZIT4Xmqjrtn 4tFym0OKu8RsrPqDvY+DWzU0FF5rhmSwL7oN8d0xbFkYiTkBMI7SbungQU1Y6hkZXB8W /0IQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=RjcA9oEN; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v10-20020a63b64a000000b003fce4535435si14538644pgt.483.2022.06.27.00.07.40; Mon, 27 Jun 2022 00:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=RjcA9oEN; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbiF0Gkm (ORCPT + 99 others); Mon, 27 Jun 2022 02:40:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbiF0Gkl (ORCPT ); Mon, 27 Jun 2022 02:40:41 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2066.outbound.protection.outlook.com [40.107.223.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82F7E2BF9 for ; Sun, 26 Jun 2022 23:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KbTjzzd7cV6k43zDgmSjxFDQaZKtyzsp4m3TM8iOnwwyvotRS9rh6h2zakZvkcDE5KLMGvsEtV4W1S1UUbWyXoDEbhDxtfuMcrd8iOV4+5yKlyUPxwTN2gpXvTPKAzPEQ5jcAazB0Muzi2RuNEaL+CUshJJqAJaiPYRNSMeBmq72ynnvRqk6/cSSwYPk2DSNV6wdNFfhFHf5lAP9Nnkk7OgBa5NZxNAVvJH9/zlu/nKirz9Xk91cG8Vw6k/2JQibs8/GCp70xljBpLHAvzvflxI0zbDOcnkD12wAR0DAYxwqArSShPe7W7wMptuC47I+8JnZJAC4YozVTmaPmumT5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=k35c4DTHitPe90OxGi3RmkKT6q5ZMMs03AoTFxBOeZE=; b=Rc6gwqY7jzj04zIt/J7GtlfyZNYv48QAe1Q7ebRovMqSAUqEw1lTFQUqdLEW7x1cpRvt7VMdSPBwgqws7QbT9kgkTnRUNO+JJAAZ6z5CyX1TQ9YH4QDpHPWmoxZNBjmXhFhrMLfuwREtcbOtcnMfuQYUOVmnEfWNsEKCYR7XuHjmSXoB5/y7Sueut2cngP3odNfHeRPOgeKK4hq29XwaTMKuuw9KYCfvUiteESFQnrlE/dZNXU3XcrXpbe8ww+1VvOw9veB0B8y3motYNGjZIybC62xrI1RMpRr00RT6IsyZr6T7SB3a95O8cVSV5uWvbSb11e89I7YSTolIC70p6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=monstr.eu smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k35c4DTHitPe90OxGi3RmkKT6q5ZMMs03AoTFxBOeZE=; b=RjcA9oEN12wFLQMx7jUcEsH5XcXjpuxtff+X00eVdJ6WDl6Ksxmqk8cNJF0FADKzqodjZBaBuNXYHMRFDoMm7/oWvhqt5wXhNgxqUFd9jUGxjyCjc9rrhH38qyVkHQ5felA1+XhR/ZLV5zbG+Sm2kkUJaDJynHFINgYFpDGfsdA= Received: from BN0PR08CA0004.namprd08.prod.outlook.com (2603:10b6:408:142::22) by BYAPR02MB5559.namprd02.prod.outlook.com (2603:10b6:a03:a1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15; Mon, 27 Jun 2022 06:40:36 +0000 Received: from BN1NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:408:142:cafe::f7) by BN0PR08CA0004.outlook.office365.com (2603:10b6:408:142::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17 via Frontend Transport; Mon, 27 Jun 2022 06:40:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; pr=C Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT022.mail.protection.outlook.com (10.13.2.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5373.15 via Frontend Transport; Mon, 27 Jun 2022 06:40:35 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Sun, 26 Jun 2022 23:40:35 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Sun, 26 Jun 2022 23:40:35 -0700 Envelope-to: monstr@monstr.eu, arnd@arndb.de, shorne@gmail.com, ebiederm@xmission.com, appanad@amd.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sam@ravnborg.org Received: from [10.140.6.6] (port=50182 helo=xhdappanad40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1o5iQE-000Bsc-Nx; Sun, 26 Jun 2022 23:40:35 -0700 From: Appana Durga Kedareswara rao To: , , , , CC: , , , Appana Durga Kedareswara rao Subject: [PATCH 2/3] microblaze: Add custom break vector handler for mb manager Date: Mon, 27 Jun 2022 12:10:23 +0530 Message-ID: <20220627064024.771037-3-appana.durga.rao@xilinx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627064024.771037-1-appana.durga.rao@xilinx.com> References: <20220627064024.771037-1-appana.durga.rao@xilinx.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a331a52-60cf-4e5a-49da-08da5807f137 X-MS-TrafficTypeDiagnostic: BYAPR02MB5559:EE_ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 630nCEa7HZtPrBpR86+8e2JPCr3OHMrgX1U9X/ymSly3Ub0B4qZEjeOt/WpKBOQZcA5HvA+a22fFjPhIcEXkpTUIQXjdiltAu4wgvFzQzuUp+b13DmRLQTX6f4aPakdH3EXIcgDMlrIcXuFPDHSJGPrrjieL2MveSg+KIW9rfQuUttKQodgY3vcmQWl+XREUAcWYdsjNgzcoWVrjB0/F3711oswk+kVudxO8G5dZBnKhiQSyxU6dPa5/yIEcbfV8VcYCvN+cm6GAKGAiw6OYVU1sJjQNp7t5qQWzZC/sO9KPNpSbRHBBD8D/suYLy81R6QNU1RCG51qfmhNbX6jlicDtQrZF914wTPcFhoyrxa1STfrtlmstLMdaZE9sRJGo8SqMuOc5iQhbpY4BcgKDmKRhRl7kHiM4h54uLZIlc7Z7dRU8C6khwmVLatwlql/NGyQbIY+lIl6Or0g44UB+gsuKtHsaWeDnsGvrpuPe8ntiKcddmOC0etgxx4n3wbNN67/yiUKKudB1bLe/Flu2sZXhMGOAU/1VFqMusc/vvxZoJXsmiUYe32LFKMZfh9onL0y1Vg9qDi2bUD3sR/GpErE5Bg+gcUp88/WBs5MRHMJ2QV5TgR13CxeWeMCS6a1/FrbqMENJNkO+ZJR4dBuiyMZhhvGWvClJuyeyQbtLVG4tDTQvSTnPPht2uNkpbHpv8HSYc5Zol1I300vngP1nSV2PxKUlj2jyyP2eeU1orrJNU39jtqZOmKjdq8NIdLqC8fCYstlfCvYbabkmRUPx695bBYBDaM8vi5LyGxduBT5xRpfi0Z9Wc/po9b9S0IH4nTBGd+cfa5WDlDE+rvEvQA== X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(346002)(396003)(136003)(376002)(40470700004)(36840700001)(46966006)(316002)(83380400001)(40460700003)(103116003)(82740400003)(6666004)(41300700001)(9786002)(7696005)(426003)(47076005)(336012)(8676002)(186003)(1076003)(2616005)(478600001)(36756003)(4326008)(7636003)(40480700001)(70586007)(70206006)(107886003)(8936002)(356005)(54906003)(36860700001)(110136005)(5660300002)(26005)(82310400005)(2906002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2022 06:40:35.9888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a331a52-60cf-4e5a-49da-08da5807f137 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT022.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB5559 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the TMR Manager detects a fault Lockstep state it is signaled to the MicroBlaze processors by asserting a break signal, When Microblaze gets a break vector from tmr Microblaze it's needed to clear/block the break bit in the tmr manager before performing recovery. In order to perform recovery need to perform the following steps. 1) Store all internal MicroBlaze registers in RAM 2) Execute a suspend instruction which asserts the reset signal 3) Restore all registers from RAM and execute an RTBD instruction to return from the reset handler, to resume execution at the place where the break occurred. This API supports getting called from kernel space only. Signed-off-by: Appana Durga Kedareswara rao --- arch/microblaze/kernel/asm-offsets.c | 7 + arch/microblaze/kernel/entry.S | 206 ++++++++++++++++++++++++++- 2 files changed, 212 insertions(+), 1 deletion(-) diff --git a/arch/microblaze/kernel/asm-offsets.c b/arch/microblaze/kernel/asm-offsets.c index 47ee409508b1..104c3ac5f30c 100644 --- a/arch/microblaze/kernel/asm-offsets.c +++ b/arch/microblaze/kernel/asm-offsets.c @@ -120,5 +120,12 @@ int main(int argc, char *argv[]) DEFINE(CC_FSR, offsetof(struct cpu_context, fsr)); BLANK(); + /* struct cpuinfo */ + DEFINE(CI_DCS, offsetof(struct cpuinfo, dcache_size)); + DEFINE(CI_DCL, offsetof(struct cpuinfo, dcache_line_length)); + DEFINE(CI_ICS, offsetof(struct cpuinfo, icache_size)); + DEFINE(CI_ICL, offsetof(struct cpuinfo, icache_line_length)); + BLANK(); + return 0; } diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index b8e1dfe02d58..df367bf94b26 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S @@ -30,6 +30,7 @@ #include #include +#include #undef DEBUG @@ -287,6 +288,44 @@ syscall_debug_table: .text +.extern cpuinfo + +C_ENTRY(mb_flush_dcache): + addik r1, r1, -PT_SIZE + SAVE_REGS + + addik r3, r0, cpuinfo + lwi r7, r3, CI_DCS + lwi r8, r3, CI_DCL + sub r9, r7, r8 +1: + wdc.flush r9, r0 + bgtid r9, 1b + addk r9, r9, r8 + + RESTORE_REGS + addik r1, r1, PT_SIZE + rtsd r15, 8 + nop + +C_ENTRY(mb_invalidate_icache): + addik r1, r1, -PT_SIZE + SAVE_REGS + + addik r3, r0, cpuinfo + lwi r7, r3, CI_ICS + lwi r8, r3, CI_ICL + sub r9, r7, r8 +1: + wic r9, r0 + bgtid r9, 1b + addk r9, r9, r8 + + RESTORE_REGS + addik r1, r1, PT_SIZE + rtsd r15, 8 + nop + /* * User trap. * @@ -753,6 +792,160 @@ IRQ_return: /* MS: Make global symbol for debugging */ rtid r14, 0 nop +#ifdef CONFIG_MB_MANAGER + +#define PT_PID PT_SIZE +#define PT_TLBI PT_SIZE + 4 +#define PT_ZPR PT_SIZE + 8 +#define PT_TLBL0 PT_SIZE + 12 +#define PT_TLBH0 PT_SIZE + 16 + +C_ENTRY(_xtmr_manager_reset): + lwi r1, r0, xmb_manager_stackpointer + + /* Restore MSR */ + lwi r2, r1, PT_MSR + mts rmsr, r2 + bri 4 + + /* restore Special purpose registers */ + lwi r2, r1, PT_PID + mts rpid, r2 + + lwi r2, r1, PT_TLBI + mts rtlbx, r2 + + lwi r2, r1, PT_ZPR + mts rzpr, r2 + +#if CONFIG_XILINX_MICROBLAZE0_USE_FPU + lwi r2, r1, PT_FSR + mts rfsr, r2 +#endif + + /* restore all the tlb's */ + addik r3, r0, TOPHYS(tlb_skip) + addik r6, r0, PT_TLBL0 + addik r7, r0, PT_TLBH0 +restore_tlb: + add r6, r6, r1 + add r7, r7, r1 + lwi r2, r6, 0 + mts rtlblo, r2 + lwi r2, r7, 0 + mts rtlbhi, r2 + addik r6, r6, 4 + addik r7, r7, 4 + bgtid r3, restore_tlb + addik r3, r3, -1 + + lwi r5, r0, TOPHYS(xmb_manager_dev) + lwi r8, r0, TOPHYS(xmb_manager_reset_callback) + set_vms + /* return from reset need -8 to adjust for rtsd r15, 8 */ + addik r15, r0, ret_from_reset - 8 + rtbd r8, 0 + nop + +ret_from_reset: + set_bip /* Ints masked for state restore */ + VM_OFF + /* MS: Restore all regs */ + RESTORE_REGS + lwi r14, r1, PT_R14 + lwi r16, r1, PT_PC + addik r1, r1, PT_SIZE + 36 + rtbd r16, 0 + nop + +/* + * Break handler for MB Manager. Enter to _xmb_manager_break by + * injecting fault in one of the TMR Microblaze core. + * FIXME: This break handler supports getting + * called from kernel space only. + */ +C_ENTRY(_xmb_manager_break): + /* + * Reserve memory in the stack for context store/restore + * (which includes memory for storing tlbs (max two tlbs)) + */ + addik r1, r1, -PT_SIZE - 36 + swi r1, r0, xmb_manager_stackpointer + SAVE_REGS + swi r14, r1, PT_R14 /* rewrite saved R14 value */ + swi r16, r1, PT_PC; /* PC and r16 are the same */ + + lwi r6, r0, TOPHYS(xmb_manager_baseaddr) + lwi r7, r0, TOPHYS(xmb_manager_crval) + /* + * When the break vector gets asserted because of error injection, + * the break signal must be blocked before exiting from the + * break handler, below code configures the tmr manager + * control register to block break signal. + */ + swi r7, r6, 0 + + /* Save the special purpose registers */ + mfs r2, rpid + swi r2, r1, PT_PID + + mfs r2, rtlbx + swi r2, r1, PT_TLBI + + mfs r2, rzpr + swi r2, r1, PT_ZPR + +#if CONFIG_XILINX_MICROBLAZE0_USE_FPU + mfs r2, rfsr + swi r2, r1, PT_FSR +#endif + mfs r2, rmsr + swi r2, r1, PT_MSR + + /* Save all the tlb's */ + addik r3, r0, TOPHYS(tlb_skip) + addik r6, r0, PT_TLBL0 + addik r7, r0, PT_TLBH0 +save_tlb: + add r6, r6, r1 + add r7, r7, r1 + mfs r2, rtlblo + swi r2, r6, 0 + mfs r2, rtlbhi + swi r2, r7, 0 + addik r6, r6, 4 + addik r7, r7, 4 + bgtid r3, save_tlb + addik r3, r3, -1 + + lwi r5, r0, TOPHYS(xmb_manager_dev) + lwi r8, r0, TOPHYS(xmb_manager_callback) + /* return from break need -8 to adjust for rtsd r15, 8 */ + addik r15, r0, ret_from_break - 8 + rtbd r8, 0 + nop + +ret_from_break: + /* flush the d-cache */ + bralid r15, mb_flush_dcache + nop + + /* + * To make sure microblaze i-cache is in a proper state + * invalidate the i-cache. + */ + bralid r15, mb_invalidate_icache + nop + + set_bip; /* Ints masked for state restore */ + VM_OFF; + mbar 1 + mbar 2 + bri 4 + suspend + nop +#endif + /* * Debug trap for KGDB. Enter to _debug_exception by brki r16, 0x18 * and call handling function with saved pt_regs @@ -964,6 +1157,7 @@ ENTRY(_switch_to) .global xmb_manager_crval .global xmb_manager_callback .global xmb_manager_reset_callback +.global xmb_manager_stackpointer .align 4 xmb_manager_dev: .long 0 @@ -975,6 +1169,8 @@ xmb_manager_callback: .long 0 xmb_manager_reset_callback: .long 0 +xmb_manager_stackpointer: + .long 0 /* * When the break vector gets asserted because of error injection, @@ -1008,16 +1204,24 @@ ENTRY(_reset) /* These are compiled and loaded into high memory, then * copied into place in mach_early_setup */ .section .init.ivt, "ax" -#if CONFIG_MANUAL_RESET_VECTOR +#if CONFIG_MANUAL_RESET_VECTOR && !defined(CONFIG_MB_MANAGER) .org 0x0 brai CONFIG_MANUAL_RESET_VECTOR +#elif defined(CONFIG_MB_MANAGER) + .org 0x0 + brai TOPHYS(_xtmr_manager_reset); #endif .org 0x8 brai TOPHYS(_user_exception); /* syscall handler */ .org 0x10 brai TOPHYS(_interrupt); /* Interrupt handler */ +#ifdef CONFIG_MB_MANAGER + .org 0x18 + brai TOPHYS(_xmb_manager_break); /* microblaze manager break handler */ +#else .org 0x18 brai TOPHYS(_debug_exception); /* debug trap handler */ +#endif .org 0x20 brai TOPHYS(_hw_exception_handler); /* HW exception handler */ -- 2.25.1