From patchwork Tue Mar 6 12:06:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 882038 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zwbKc4qtkz9sZj for ; Tue, 6 Mar 2018 23:13:55 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A78A0C21E38; Tue, 6 Mar 2018 12:09:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 825B3C21FA6; Tue, 6 Mar 2018 12:07:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7D745C21FAA; Tue, 6 Mar 2018 12:06:49 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id CAF75C21EF0 for ; Tue, 6 Mar 2018 12:06:45 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zwb993MJGz9ttwF; Tue, 6 Mar 2018 13:06:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Mi7o4b52vsnt; Tue, 6 Mar 2018 13:06:37 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 3zwb992hrBz9ttCq; Tue, 6 Mar 2018 13:06:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 676E68B7FC; Tue, 6 Mar 2018 13:06:45 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id liInQR_zKejL; Tue, 6 Mar 2018 13:06:45 +0100 (CET) Received: from po15720vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.5]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5032C8B7E1; Tue, 6 Mar 2018 13:06:45 +0100 (CET) Received: by po15720vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 293B16F0E5; Tue, 6 Mar 2018 13:06:45 +0100 (CET) Message-Id: <84fd428cd60840bca3893dd66581b43a2537e655.1520334961.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy To: Tom Rini Date: Tue, 6 Mar 2018 13:06:45 +0100 (CET) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v3 11/15] powerpc: mpc8xx: harmonise initialisation of the immap local pointer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" In most places, immap local pointer is defined as immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; In a few places, it is defined as immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000); This patch replaces the few of the latest form by the other one. The two are fully equivalent since SPRN_IMMR is set with CONFIG_SYS_IMMR very early in start.S Signed-off-by: Christophe Leroy --- arch/powerpc/cpu/mpc8xx/cpu.c | 5 ++--- arch/powerpc/cpu/mpc8xx/speed.c | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index 1883440db34..20d042d3a19 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR; static int check_CPU(long clock, uint pvr, uint immr) { - immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000); + immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; uint k; char buf[32]; @@ -237,8 +237,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) */ unsigned long get_tbclk(void) { - uint immr = get_immr(0); /* Return full IMMR contents */ - immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000); + immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; ulong oscclk, factor, pll; if (in_be32(&immap->im_clkrst.car_sccr) & SCCR_TBS) diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c index fa8f87cbc5e..f8eb4a13eaf 100644 --- a/arch/powerpc/cpu/mpc8xx/speed.c +++ b/arch/powerpc/cpu/mpc8xx/speed.c @@ -17,8 +17,7 @@ DECLARE_GLOBAL_DATA_PTR; */ int get_clocks(void) { - uint immr = get_immr(0); /* Return full IMMR contents */ - immap_t __iomem *immap = (immap_t __iomem *)(immr & 0xFFFF0000); + immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; uint sccr = in_be32(&immap->im_clkrst.car_sccr); uint divider = 1 << (((sccr & SCCR_DFBRG11) >> 11) * 2);