Received: by 10.223.185.116 with SMTP id b49csp1169182wrg; Fri, 23 Feb 2018 13:11:55 -0800 (PST) X-Google-Smtp-Source: AH8x227+P0QW9gzNxX9zf429+Axdd8EkEZlyouAcrWLqDAMPbrG0BHosSIWQlfkS/LbTPuEbvyL+ X-Received: by 10.99.186.22 with SMTP id k22mr2348890pgf.7.1519420315420; Fri, 23 Feb 2018 13:11:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519420315; cv=none; d=google.com; s=arc-20160816; b=esl7BZHcyNPstIxwtfmkgwimn5i/2Tx7NGxq0l9JBFhBMTiz5jI3WpXIsAGWlNdyUX IKZ/fk8i3OXi1MLFpRy43THWoDyws7s5kSF7LKdqAD+Hdm34OMqsKfHerlrv+VnmvUKo dhJZKr/ZJRZF7xPZzLWI5YVmF9H5jiCav4YhQkYdT8ZE5ulr4qh+DKbbZlnxQhJgdpm8 LZmqtdFv3hGGpW3UbE0Tebc9rV3Uw+jp0ziQHbJ+p8nGqid/OSEcbaDLxDISnybckyar lIEkrSnSRQagM9NIfwSFHOHA8y8zFaNIc+o3IFqO31PBtwqTz88G9WNs0m7rCQ6MqZ9e WibA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=v8P8mYb7KVpQTvBbAGl7l1RRTcejKQ4TtODObPu7HUg=; b=VKtkpsA9u6WnAwgFlIuWpT+uC1sfolFU302YgJeLe/6GZcrE98/9oqrTOWokpw5U3d lK2Y5nmwFmXPo/hxclg+20J6PfK9nR9qLivsu52+ycwL8iCcuGJqsi6qxCAw1rci9i80 BDzlpheJdDFXf+HKMFb99zVrl4v7U0hpyN6Pn2j7C2Rkh89rHsjjgpzOoV3YZbKCV0am TNqNotT3inUJGxuRa1iGwlITn0tKpak8F9uY0wEwZZXSt847zw/7k89LjkJc9Shao0CH 8nNgszHJntGOU6ZWRgsy2aAKOsNhRokeByFXSX3iuo6racIVntBvxTYUqj7G6USIe3XW nZZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k6Y6//SX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si888349pfl.261.2018.02.23.13.11.40; Fri, 23 Feb 2018 13:11:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=k6Y6//SX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752447AbeBWVJ4 (ORCPT + 99 others); Fri, 23 Feb 2018 16:09:56 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:45642 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbeBWVJx (ORCPT ); Fri, 23 Feb 2018 16:09:53 -0500 Received: by mail-qt0-f196.google.com with SMTP id v90so12180611qte.12 for ; Fri, 23 Feb 2018 13:09:53 -0800 (PST) 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=v8P8mYb7KVpQTvBbAGl7l1RRTcejKQ4TtODObPu7HUg=; b=k6Y6//SXRNCes79xtEipWy4EhTxT8sSADqP4Gq53LqfWOmElok0frQvVJnAygIxAP2 qJI5wfNySFXRcj8Q3AQ1umyfaxoEOsvIWgJVWs8Fnwqyz2ES4iAeHpftbGPNhS1tgY/y DCwb2zwlXJZFOuNhIThPs79HxUN0VGV5XlpikDbHT+K0BrySmLBWS5J/v4PGlR5pA7N3 plSsd3XWe45RmMktBnxJQoyUemms8PcqPY3AMF+2OuZqHYUq/THYAeSTQi848aKB/MwR fovKXEIruKUJ7RcOvPrREnaLo5CqUla4GMtkhw4e1zR5nDh6aSVfsl2iJW6e6qLJDtEn HYWA== 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=v8P8mYb7KVpQTvBbAGl7l1RRTcejKQ4TtODObPu7HUg=; b=A66FAFugwnxmN4mrpPeRUtf+BRtruLWkh3fyeL1F8ifr6QcJruMuMTopDqQybYMvEf jpLct5mQgYz954CuaLK5CQQrNjGMXZlP4et3f/O8QpHy0gS/7slBMwxGv6N76D3ZOk1G HyUCwv5zFYGhli11tuhpnA8CqQq3yKle/8jg/xbK+piKo5d7awyJIZs2o4UNzBHg/MZw 4VuwMnpvm0vv3sf0ZUY6axmlBWC/cfm1h2Sjpd8LTXktgEV7UnnM/6tB1VVkEfhUSEFK +x8tIu2yaJwgA1CgbLPMg/2XIsD/aY0hYvqWm6ObT9CZ0Lqn3ggHUyyzHuoJ4EzdcNGM Dl6w== X-Gm-Message-State: APf1xPD9Mx4kda4vpOLGzPzdTG5F2ZwVX2oOtJYmVNTnCT2ye4BvEs1b 2F0mg5CohWyQbVSAi6T6Ekg= X-Received: by 10.200.81.146 with SMTP id c18mr4626534qtn.224.1519420192412; Fri, 23 Feb 2018 13:09:52 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id m13sm1912561qtf.31.2018.02.23.13.09.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 13:09:51 -0800 (PST) From: Florian Fainelli To: linux-arm-kernel@lists.infradead.org Cc: Doug Berger , Florian Fainelli , Russell King , Brian Norris , Gregory Fong , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE), Vladimir Murzin , Philippe Ombredanne , Greg Kroah-Hartman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 4/4] ARM: brcmstb: Add support for the V7 memory map Date: Fri, 23 Feb 2018 13:09:23 -0800 Message-Id: <20180223210923.544-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180223210923.544-1-f.fainelli@gmail.com> References: <20180223210923.544-1-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Doug Berger The 7278 device is the first device that includes support for the V7 memory map developed for use in 64-bit architecture brcmstb devices. This map relocates the register physical offset from 0xF0000000 to 0x0000000008000000. Since the ARM PERIPHBASE value is also relocated in the V7 memory map we can use its value to determine whether this device uses the new V7 memory map and therefore where to look for the SUN_TOP_CTRL register used to identify the chip family. Signed-off-by: Doug Berger Signed-off-by: Florian Fainelli --- arch/arm/include/debug/brcmstb.S | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/debug/brcmstb.S b/arch/arm/include/debug/brcmstb.S index c826f15d2f80..0f580caa81e5 100644 --- a/arch/arm/include/debug/brcmstb.S +++ b/arch/arm/include/debug/brcmstb.S @@ -11,20 +11,25 @@ * GNU General Public License for more details. */ #include +#include /* Physical register offset and virtual register offset */ #define REG_PHYS_BASE 0xf0000000 +#define REG_PHYS_BASE_V7 0x08000000 #define REG_VIRT_BASE 0xfc000000 #define REG_PHYS_ADDR(x) ((x) + REG_PHYS_BASE) +#define REG_PHYS_ADDR_V7(x) ((x) + REG_PHYS_BASE_V7) /* Product id can be read from here */ #define SUN_TOP_CTRL_BASE REG_PHYS_ADDR(0x404000) +#define SUN_TOP_CTRL_BASE_V7 REG_PHYS_ADDR_V7(0x404000) #define UARTA_3390 REG_PHYS_ADDR(0x40a900) #define UARTA_7250 REG_PHYS_ADDR(0x40b400) #define UARTA_7260 REG_PHYS_ADDR(0x40c000) #define UARTA_7268 UARTA_7260 #define UARTA_7271 UARTA_7268 +#define UARTA_7278 REG_PHYS_ADDR_V7(0x40c000) #define UARTA_7364 REG_PHYS_ADDR(0x40b000) #define UARTA_7366 UARTA_7364 #define UARTA_74371 REG_PHYS_ADDR(0x406b00) @@ -55,8 +60,21 @@ mov \rv, #0 @ yes; record init is done str \rv, [\tmp] + /* Check for V7 memory map if B53 */ + mrc p15, 0, \rv, c0, c0, 0 @ get Main ID register + ldr \rp, =ARM_CPU_PART_MASK + and \rv, \rv, \rp + ldr \rp, =ARM_CPU_PART_BRAHMA_B53 @ check for B53 CPU + cmp \rv, \rp + bne 10f + + /* if PERIPHBASE doesn't overlap REG_PHYS_BASE use V7 map */ + mrc p15, 1, \rv, c15, c3, 0 @ get PERIPHBASE from CBAR + ands \rv, \rv, #REG_PHYS_BASE + ldreq \rp, =SUN_TOP_CTRL_BASE_V7 + /* Check SUN_TOP_CTRL base */ - ldr \rp, =SUN_TOP_CTRL_BASE @ load SUN_TOP_CTRL PA +10: ldrne \rp, =SUN_TOP_CTRL_BASE @ load SUN_TOP_CTRL PA ldr \rv, [\rp, #0] @ get register contents ARM_BE8( rev \rv, \rv ) and \rv, \rv, #0xffffff00 @ strip revision bits [7:0] @@ -72,6 +90,7 @@ ARM_BE8( rev \rv, \rv ) 27: checkuart(\rp, \rv, 0x07437100, 74371) 28: checkuart(\rp, \rv, 0x74390000, 7439) 29: checkuart(\rp, \rv, 0x74450000, 7445) +30: checkuart(\rp, \rv, 0x72780000, 7278) /* No valid UART found */ 90: mov \rp, #0 -- 2.14.1