From patchwork Mon Feb 27 10:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 61918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2350095wrd; Mon, 27 Feb 2023 03:03:39 -0800 (PST) X-Google-Smtp-Source: AK7set/9cV6ZxRT02E38iwbzBlY4bVyPNjlL0UB0zjC7mYuNuwM7k+mg3dQW1M0P/SaTafmi9f/d X-Received: by 2002:a17:90b:5109:b0:237:ae98:a47f with SMTP id sc9-20020a17090b510900b00237ae98a47fmr8665589pjb.1.1677495819312; Mon, 27 Feb 2023 03:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677495819; cv=none; d=google.com; s=arc-20160816; b=rgP3uhjm84pv8gynoHfMogUb+aQSetTv7YoIEEZPD3h/7MVPUuBK+gshqdWnIov6oQ yvOpYHLFxLerDjC/voLPaqvAbEPztsAIp/N+gJ2Q4sDdTuVJl8ZMDK04zTIzafhFIhBo F4rSd9ux/6Q/4oezMPAkplOfU3pM4VaWumDLMnA+vL05gBtCBv+D2TbFSb5nVGT2DvQq hLUrPF3XJD9N/P4SQkhI8EKJ5iBuiYuV3nRGWOM3vpGNCYUVp7F1hRHiaIyva/zGedWi JKvbxPR3s+rqliHDAPnqPDYTPiLONEKvY1KsGTdS3oT7QJdsEGWfRVITF/h2nIKYr021 kRfQ== ARC-Message-Signature: i=1; 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 :dkim-signature; bh=brrg22pJXALLuqjwL3ofKoGSohLv11kyaas+ufZNm48=; b=TguJ7l6fnEMgtiQOUPixnkq5m1+wY1K2zyJp3DxIM/MZmyfWI16ErZ2jxplvxatXxl mSn9O9LvFOJiIT0i6ZkzDJBEA3cz+EZu/0QRK8UiIaidRvgRRYFlAuj18lsC5c+UsMRg wLVTvibTHdtoQ5fRWU6yLSdYdPy1UIGGYiaClkmhUyBVd7HYsrDcOZYtgqoKSWZvS+ll KF74oIuDi58N4kQrwqFCe/dyCEBRjbto187qUFmK57s8z3CF9vxiY6PArr4u0a/7IgcP eoEzdzbrGzg8MI+Y+e3VJi94ewQY8TWv4MhD0XLpEDvEUsrtJrGUZLgovnf62abbwMPc DQfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="RIhWaol/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a17090adc0800b002376d8568e1si10166615pjv.114.2023.02.27.03.03.26; Mon, 27 Feb 2023 03:03:39 -0800 (PST) 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=@gmail.com header.s=20210112 header.b="RIhWaol/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbjB0K6r (ORCPT + 99 others); Mon, 27 Feb 2023 05:58:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230118AbjB0K6X (ORCPT ); Mon, 27 Feb 2023 05:58:23 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73D7E1B572; Mon, 27 Feb 2023 02:58:19 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id q16so5750438wrw.2; Mon, 27 Feb 2023 02:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=brrg22pJXALLuqjwL3ofKoGSohLv11kyaas+ufZNm48=; b=RIhWaol/uA/GNrRqyAErinRj1oB4C/GL0DLtY0DOT2EJ+VVYsUi/YSlfPHNlwGpN1x FGP8CNWcKOnQjKERksMLpDjk0u+4UGV3ExIzToMCsEKTR5Maapq5t4cXkvxT9iYSWLAG ritysr5OvqfRTuwE97V4/8yaRrBWX06n11KuQtEz/Dd9IJCLwReXZ9HZtn+2PwYU76+f O7ACNKJl2yFoFOnKoFtQ/KhGM94bTFMP9i5HLXWkgSe/L/M5Fpq2uumH747ryXgM9B4g dG5k5YpxI7VmMcb/m6md6KDLFFSc/We4MJCGDadidjJ8li4dxHUJGINPO5G8youlnUD1 QphA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=brrg22pJXALLuqjwL3ofKoGSohLv11kyaas+ufZNm48=; b=bY+RwKuCz7eFPQu60J5atcamzns9BRkQmRsqgsNu3ZR33sn2pqk3IauVo3itX+qlgr f12AwV+C7ScrO1UEnou01px36fWZtZeAojI488qgHon0uxk7t2632meMXlvzvbdM+KFf c+8VcP3URM71xmXOCubzTZGgYWkUkPkuCaliIhbyIzbbUvUAcNMjYiUFlyEP35GmjKcm 9HOlBLyZr/lQGbtjoR/UvICUJNNzm9XJx04wHnWI11st1vr2EVuF2zaEs4uNxYeKIf4P VtGCfORvWMmbtAxtqPbolHEc6viQbZOjs/U9G9pRtEM8F9ANEawE/NyqGdrUdFIJxv0v dOAQ== X-Gm-Message-State: AO0yUKV3XtGBBqZ79RK6X+4Dct8xWxOr8PNELzWoXfrkM+j+bFkNb5pK hmoWhV6QaTkSttWw9wV0VH1UWLonLY4= X-Received: by 2002:adf:dd45:0:b0:2c7:a55:bef5 with SMTP id u5-20020adfdd45000000b002c70a55bef5mr14150209wrm.23.1677495497782; Mon, 27 Feb 2023 02:58:17 -0800 (PST) Received: from localhost.localdomain (106.red-88-13-29.dynamicip.rima-tde.net. [88.13.29.106]) by smtp.gmail.com with ESMTPSA id a4-20020a5d5704000000b002c559843748sm6806122wrv.10.2023.02.27.02.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 02:58:17 -0800 (PST) From: Sergio Paracuellos To: linux-mips@vger.kernel.org Cc: tsbogend@alpha.franken.de, john@phrozen.org, linux-kernel@vger.kernel.org, git@johnthomson.fastmail.com.au Subject: [PATCH 10/12] mips: ralink: mt7620: define MT7620_SYSC_BASE with __iomem Date: Mon, 27 Feb 2023 11:58:04 +0100 Message-Id: <20230227105806.2394101-11-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227105806.2394101-1-sergio.paracuellos@gmail.com> References: <20230227105806.2394101-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758981856606669446?= X-GMAIL-MSGID: =?utf-8?q?1758981856606669446?= So that MT7620_SYSC_BASE can be used later in multiple functions without needing to repeat this __iomem declaration each time Signed-off-by: Sergio Paracuellos --- arch/mips/include/asm/mach-ralink/mt7620.h | 3 ++- arch/mips/ralink/mt7620.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/mips/include/asm/mach-ralink/mt7620.h b/arch/mips/include/asm/mach-ralink/mt7620.h index d51dfad8f543..3e37705ea9cf 100644 --- a/arch/mips/include/asm/mach-ralink/mt7620.h +++ b/arch/mips/include/asm/mach-ralink/mt7620.h @@ -11,7 +11,8 @@ #ifndef _MT7620_REGS_H_ #define _MT7620_REGS_H_ -#define MT7620_SYSC_BASE 0x10000000 +#define IOMEM(x) ((void __iomem *)(KSEG1ADDR(x))) +#define MT7620_SYSC_BASE IOMEM(0x10000000) #define SYSC_REG_CHIP_NAME0 0x00 #define SYSC_REG_CHIP_NAME1 0x04 diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c index ae1fa0391c88..c13b73b6ee3f 100644 --- a/arch/mips/ralink/mt7620.c +++ b/arch/mips/ralink/mt7620.c @@ -326,7 +326,6 @@ mt7628_dram_init(struct ralink_soc_info *soc_info) void __init prom_soc_init(struct ralink_soc_info *soc_info) { - void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7620_SYSC_BASE); unsigned char *name = NULL; u32 n0; u32 n1; @@ -336,9 +335,9 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info) u32 pmu1; u32 bga; - n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0); - n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1); - rev = __raw_readl(sysc + SYSC_REG_CHIP_REV); + n0 = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_CHIP_NAME0); + n1 = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_CHIP_NAME1); + rev = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_CHIP_REV); bga = (rev >> CHIP_REV_PKG_SHIFT) & CHIP_REV_PKG_MASK; if (n0 == MT7620_CHIP_NAME0 && n1 == MT7620_CHIP_NAME1) { @@ -352,7 +351,7 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info) soc_info->compatible = "ralink,mt7620n-soc"; } } else if (n0 == MT7620_CHIP_NAME0 && n1 == MT7628_CHIP_NAME1) { - u32 efuse = __raw_readl(sysc + SYSC_REG_EFUSE_CFG); + u32 efuse = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_EFUSE_CFG); if (efuse & EFUSE_MT7688) { ralink_soc = MT762X_SOC_MT7688; @@ -372,7 +371,7 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info) (rev >> CHIP_REV_VER_SHIFT) & CHIP_REV_VER_MASK, (rev & CHIP_REV_ECO_MASK)); - cfg0 = __raw_readl(sysc + SYSC_REG_SYSTEM_CONFIG0); + cfg0 = __raw_readl(MT7620_SYSC_BASE + SYSC_REG_SYSTEM_CONFIG0); if (is_mt76x8()) { dram_type = cfg0 & DRAM_TYPE_MT7628_MASK; } else { @@ -388,8 +387,8 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info) else mt7620_dram_init(soc_info); - pmu0 = __raw_readl(sysc + PMU0_CFG); - pmu1 = __raw_readl(sysc + PMU1_CFG); + pmu0 = __raw_readl(MT7620_SYSC_BASE + PMU0_CFG); + pmu1 = __raw_readl(MT7620_SYSC_BASE + PMU1_CFG); pr_info("Analog PMU set to %s control\n", (pmu0 & PMU_SW_SET) ? ("sw") : ("hw"));