From patchwork Mon Oct 3 17:51:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 677778 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3snqPg6lLJz9s65 for ; Tue, 4 Oct 2016 04:52:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=qhh4BvY9; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CFCEDB3861; Mon, 3 Oct 2016 19:52:14 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XnB2vLWhToa3; Mon, 3 Oct 2016 19:52:14 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2AC1B383D; Mon, 3 Oct 2016 19:51:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 226F0B3817 for ; Mon, 3 Oct 2016 19:51:49 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gfpJ305EgYXu for ; Mon, 3 Oct 2016 19:51:49 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by theia.denx.de (Postfix) with ESMTPS id 2EA96B381B for ; Mon, 3 Oct 2016 19:51:44 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id b201so10681373wmb.1 for ; Mon, 03 Oct 2016 10:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lKWkYH+Q6TFRQ2ZhNLcfipW0d5ampr7zWfr+SLiQ234=; b=qhh4BvY9LdFzg0EwaircI9VrXss2LGqAgSx2cRCEBHYtaRWllGWZ7nbPwYmLc+3DiX hstaEEFewxh7PFVDFNuhiq/XahpRmVtdcYgtJWHJn1InppBqxxoM2zYSy44RqBQPh+gu ZYgmUc098RKUNEf2dHO4nQt7knDdEvlW6P+uheTr3ibkUSCYarbOlwAY/J0e+r6T6o6K pvpIR2MamvB9E+dqdjeYgEbZ3tQPUkrTgVIyHMzH4HouL4kk1F3XDXdSAnDv7yH4rA8m w4wVuln0u7sXm9jtIo5MDEZZW4bBLvX2Kz6LAaVFLH6sUa9mOg8ehGMlK66cE13gwfaf GVug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lKWkYH+Q6TFRQ2ZhNLcfipW0d5ampr7zWfr+SLiQ234=; b=Q62eY9L0As2UDm6uK29vvhIDrvB7RiVjI+UAkAR7qGGFhIXzP0xiU5IAXncDQElVFK hDwz4xF8y//YxESKY/nMZ361IhefxjXtveXP35391aDxg6ebPDzEVYiWWdPjjAwmUsLo UnCratQ6g/r6RgUjlwBVKMXNzs2VZ5GRVvr/8bLug3/141fLq6AK7HTej/cZ5avu1QlS pC18QjO9LRJmQsy95GD/6ZwgkcXxRhCHa+ttGQSpa40Do5dFrf/IgeiUpCE5OWMeFwyz 44lGwqTxBpLAfNObbZ2ZmRiEmJ9BwE2J6Pjj+VXl3IF2A/WIqJx0+wSdBLKfeAq38jTv QKsQ== X-Gm-Message-State: AA6/9Rnj58mt1Y1WhXgcGQEOBBTCioqmvP/zfIQIcwT/VvxmQX7q+xSd2Fvjz4EeL61voA== X-Received: by 10.194.79.67 with SMTP id h3mr3010131wjx.142.1475517104300; Mon, 03 Oct 2016 10:51:44 -0700 (PDT) Received: from workstation.zombienet.local (p2003005F2C3A130062A44CFFFE5E9229.dip0.t-ipconnect.de. [2003:5f:2c3a:1300:62a4:4cff:fe5e:9229]) by smtp.gmail.com with ESMTPSA id v189sm19972120wmv.12.2016.10.03.10.51.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Oct 2016 10:51:43 -0700 (PDT) From: Daniel Schwierzeck To: u-boot@lists.denx.de Date: Mon, 3 Oct 2016 19:51:23 +0200 Message-Id: <20161003175130.22471-3-daniel.schwierzeck@gmail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161003175130.22471-1-daniel.schwierzeck@gmail.com> References: <20161003175130.22471-1-daniel.schwierzeck@gmail.com> Cc: Marek Vasut , Purna Chandra Mandal , Wills Wang Subject: [U-Boot] [PATCH v2 2/9] MIPS: fix ROM exception vectors X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When booting from ROM, early exceptions can't be handled properly. Instead of busy-looping give the developer the possibilty to examine the situation. Invoke an UHI exception operation which can be read as unhandled exception by a hardware debugger if one is attached. If the debugger doesn't support UHI, the exception is read as unexpected breakpoint. Signed-off-by: Daniel Schwierzeck --- Changes in v2: - invoke UHI exception operation for all exception vectors but the EJTAG debug exception arch/mips/cpu/start.S | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/arch/mips/cpu/start.S b/arch/mips/cpu/start.S index 108d2df..2397b6c 100644 --- a/arch/mips/cpu/start.S +++ b/arch/mips/cpu/start.S @@ -52,6 +52,14 @@ .set noreorder + .macro uhi_mips_exception + move k0, t9 # preserve t9 in k0 + move k1, a0 # preserve a0 in k1 + li t9, 15 # UHI exception operation + li a0, 0 # Use hard register context + sdbbp 1 # Invoke UHI operation + .endm + ENTRY(_start) /* U-Boot entry point */ b reset @@ -79,30 +87,30 @@ ENTRY(_start) #endif #if defined(CONFIG_ROM_EXCEPTION_VECTORS) + /* + * Exception vector entry points. When running from ROM, an exception + * cannot be handled. Halt execution and transfer control to debugger, + * if one is attached. + */ .org 0x200 /* TLB refill, 32 bit task */ -1: b 1b - nop + uhi_mips_exception .org 0x280 /* XTLB refill, 64 bit task */ -1: b 1b - nop + uhi_mips_exception .org 0x300 /* Cache error exception */ -1: b 1b - nop + uhi_mips_exception .org 0x380 /* General exception */ -1: b 1b - nop + uhi_mips_exception .org 0x400 /* Catch interrupt exceptions */ -1: b 1b - nop + uhi_mips_exception .org 0x480 /* EJTAG debug exception */ @@ -222,6 +230,7 @@ reset: move a0, zero # a0 <-- boot_flags = 0 PTR_LA t9, board_init_f + jr t9 move ra, zero