From patchwork Tue Mar 28 21:34:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Berger X-Patchwork-Id: 9650529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A7B3601D7 for ; Tue, 28 Mar 2017 21:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EEDF2839B for ; Tue, 28 Mar 2017 21:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5027528405; Tue, 28 Mar 2017 21:36:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1DCD2839B for ; Tue, 28 Mar 2017 21:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=T3PAVq123nvG+9BHNzaZpqj4b7rR0EtgCwuBAjCaXqs=; b=Tme8qxjC5rHCy7FhZH8NvtJsQl 9oOEPGU3Ct5MaomJomiuH4PEHMkKOPFfpWGF8EShm9XyilcPmGglBjySj7RlEp5rDd6mOgou1g2VM hG/dytFmgiodp8/PPJNLxDnEMoIsQ8k6G05awAp1UMnqbzkzdHLdmRSqNVSd4zuSXSrL150R1OirM eF2E4yoY0vPjiPiCty3HnFNDQJtRBavsgYG7lp5dtWUCIfQuUJQuQRon8atYLeRIYV+fIrEM4Q7gx 58ouv+7ylKKszjHmI2Y3to9BKcSwkwGHYdolbG0nWN/Y9Swoy6Irky+aFT0HJXP3KcDJ+M8Rp9bi5 87t9Raqw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1csymw-0004oH-Fq; Tue, 28 Mar 2017 21:36:26 +0000 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1csymD-0003nv-RD for linux-arm-kernel@lists.infradead.org; Tue, 28 Mar 2017 21:35:44 +0000 Received: by mail-qt0-x244.google.com with SMTP id r5so14003810qtb.2 for ; Tue, 28 Mar 2017 14:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cwsjb+7rQsflmQAWuwGTntiABuro8aSkOLUAew2xh5M=; b=gfTPyeJY2YTPLhNxZpFqhK++C9tFlVmL6P6WC9vGZ+G9RzwJJ1xdFIzZY022S71hb9 ATW6bt/wSoYZ5FsYOAFep+kUWgjkHwVgkAXgx0XYWZEKEhyST11rdQwSoVb8u0kCFhpu pPeS4eWKRWRsyNd85KRf4rgRy41no/NZUixHnIkdau/rhIXUNH43Y3i7nCAABUH/ofH5 ReY21Ch8DVaLwyb01saVadIbQzplzfBcbAb0c7eEpuakJlX8hJZWo2Uw4ZBDMYUF61BF aWYE/manavPOX12g8PFf5N8txB/nkuGNtmAdJMbnRX5hNooR8ppIgBJtGw7PIYh/h2gI pV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=cwsjb+7rQsflmQAWuwGTntiABuro8aSkOLUAew2xh5M=; b=aZyuJ/uWTFL+k7Ze6Jzfknzq4mEYI6glT4jqZ0bIPqdhh+dRcsaN9VRsJooozU3Rz8 proHl4ZR7aNGiDEh6AEUuycCucPC1/XATJqnhEvt/dylvYrh2rMDX6VKRJQVfADrRECM VXhEiDvlu45s081voBlcUbm+llICAFMmxpHMTkj56RGlLgc8ew8+72kYuvWMwrfl8BxG F7BApMdLFK8oxiCqqT3S+p2UtdW7XDrmC1D5BmkvkzG9riR6+3YtwiHIMReqx/6FmkYY ER2AnNTuqRjpSB0aeFTt2dX2rh6kLNzoTXG8GH3EIOI4KBhjGzV26slZi6POchkyA/+Y +FhQ== X-Gm-Message-State: AFeK/H1N9DEREx3YoCtIepcOuzLLJpplWLd1M8OBBVnj25OGJihGd5+c5qSP3fVo5Izr5Q== X-Received: by 10.200.43.85 with SMTP id 21mr27600912qtv.81.1490736920425; Tue, 28 Mar 2017 14:35:20 -0700 (PDT) Received: from stb-bld-02.irv.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id a26sm3540762qtb.28.2017.03.28.14.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 14:35:19 -0700 (PDT) From: Doug Berger To: mark.rutland@arm.com Subject: [PATCH v2 6/8] bus: brcmstb_gisb: Add ARM64 support Date: Tue, 28 Mar 2017 14:34:29 -0700 Message-Id: <20170328213431.10904-7-opendmb@gmail.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170328213431.10904-1-opendmb@gmail.com> References: <20170328213431.10904-1-opendmb@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170328_143542_159740_DF964386 X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wangkefeng.wang@huawei.com, catalin.marinas@arm.com, linus.walleij@linaro.org, will.deacon@arm.com, mingo@kernel.org, f.fainelli@gmail.com, jonathanh@nvidia.com, bgolaszewski@baylibre.com, bcm-kernel-feedback-list@broadcom.com, shijie.huang@arm.com, opendmb@gmail.com, treding@nvidia.com, devicetree@vger.kernel.org, suzuki.poulose@arm.com, robh+dt@kernel.org, gregory.0xf0@gmail.com, sandeepa.s.prabhu@gmail.com, linux-arm-kernel@lists.infradead.org, mirza.krak@gmail.com, linux-kernel@vger.kernel.org, james.morse@arm.com, olof@lixom.net, computersforpeace@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Florian Fainelli Hook to the ARM64 data abort exception #16: synchronous external abort, which is how the GISB errors will be funneled back to the ARM64 CPU in case of problems Signed-off-by: Florian Fainelli --- drivers/bus/Kconfig | 2 +- drivers/bus/brcmstb_gisb.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 0a52da439abf..d2a5f1184022 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -57,7 +57,7 @@ config ARM_CCN config BRCMSTB_GISB_ARB bool "Broadcom STB GISB bus arbiter" - depends on ARM || MIPS + depends on ARM || ARM64 || MIPS default ARCH_BRCMSTB || BMIPS_GENERIC help Driver for the Broadcom Set Top Box System-on-a-chip internal bus diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c index edf79432f899..500b6bb5c739 100644 --- a/drivers/bus/brcmstb_gisb.c +++ b/drivers/bus/brcmstb_gisb.c @@ -30,6 +30,11 @@ #include #endif +#ifdef CONFIG_ARM64 +#include +#include +#endif + #ifdef CONFIG_MIPS #include #endif @@ -225,7 +230,7 @@ static int brcmstb_gisb_arb_decode_addr(struct brcmstb_gisb_arb_device *gdev, return 0; } -#ifdef CONFIG_ARM +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { @@ -235,7 +240,7 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr, list_for_each_entry(gdev, &brcmstb_gisb_arb_device_list, next) brcmstb_gisb_arb_decode_addr(gdev, "bus error"); -#if !defined(CONFIG_ARM_LPAE) +#if defined(CONFIG_ARM) && !defined(CONFIG_ARM_LPAE) /* * If it was an imprecise abort, then we need to correct the * return address to be _after_ the instruction. @@ -247,7 +252,7 @@ static int brcmstb_bus_error_handler(unsigned long addr, unsigned int fsr, /* Always report unhandled exception */ return 1; } -#endif +#endif /* CONFIG_ARM || CONFIG_ARM64 */ #ifdef CONFIG_MIPS static int brcmstb_bus_error_handler(struct pt_regs *regs, int is_fixup) @@ -395,6 +400,10 @@ static int __init brcmstb_gisb_arb_probe(struct platform_device *pdev) "imprecise external abort"); #endif #endif /* CONFIG_ARM */ +#ifdef CONFIG_ARM64 + hook_fault_code(16, brcmstb_bus_error_handler, SIGBUS, 0, + "synchronous external abort"); +#endif #ifdef CONFIG_MIPS board_be_handler = brcmstb_bus_error_handler; #endif