From patchwork Fri Jan 26 08:49:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 866304 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=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zSf3W0SPmz9ryQ for ; Fri, 26 Jan 2018 23:53:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9B544C22501; Fri, 26 Jan 2018 12:51:03 +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=1.1 required=5.0 tests=DATE_IN_PAST_03_06, RCVD_IN_DNSWL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2A7E4C224E9; Fri, 26 Jan 2018 12:50:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4B41EC224A8; Fri, 26 Jan 2018 12:50:17 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id DEC97C22441 for ; Fri, 26 Jan 2018 12:50:13 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 3zSdzT3hh4z9tvQg; Fri, 26 Jan 2018 13:50:13 +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 HCQ9T-1BwK8D; Fri, 26 Jan 2018 13:50:13 +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 3zSdzT365Vz9tvQD; Fri, 26 Jan 2018 13:50:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 519728B937; Fri, 26 Jan 2018 13:50:13 +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 YqLWaLLu2BhC; Fri, 26 Jan 2018 13:50:13 +0100 (CET) Received: from PO15451.localdomain (po15451.idsi0.si.c-s.fr [172.25.231.40]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 39E0E8B935; Fri, 26 Jan 2018 13:50:13 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id 2C6196EF85; Fri, 26 Jan 2018 13:50:13 +0100 (CET) Message-Id: <29c919b5d0e917281a75aef54af59b28b25b4b5e.1516968803.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Date: Fri, 26 Jan 2018 09:49:55 +0100 To: Tom Rini Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/7] powerpc/8xx: get rid of get_immr() 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" function get_immr() is almost not used and doesn't bring much added value. Just replace it with mfspr(SPRN_IMMR) at the two needed places. Signed-off-by: Christophe Leroy --- arch/powerpc/cpu/mpc8xx/cpu.c | 7 +++---- arch/powerpc/cpu/mpc8xx/reginfo.c | 2 +- arch/powerpc/cpu/mpc8xx/speed.c | 3 +-- arch/powerpc/include/asm/ppc.h | 8 -------- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index 1883440db3..0eabb714d3 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]; @@ -90,7 +90,7 @@ static int check_CPU(long clock, uint pvr, uint immr) int checkcpu(void) { ulong clock = gd->cpu_clk; - uint immr = get_immr(0); /* Return full IMMR contents */ + uint immr = mfspr(SPRN_IMMR); /* Return full IMMR contents */ uint pvr = get_pvr(); puts("CPU: "); @@ -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/reginfo.c b/arch/powerpc/cpu/mpc8xx/reginfo.c index 277d2753b2..1f6e606e52 100644 --- a/arch/powerpc/cpu/mpc8xx/reginfo.c +++ b/arch/powerpc/cpu/mpc8xx/reginfo.c @@ -22,7 +22,7 @@ void print_reginfo(void) */ printf("\nSystem Configuration registers\n" - "\tIMMR\t0x%08X\n", get_immr(0)); + "\tIMMR\t0x%08X\n", mfspr(SPRN_IMMR)); printf("\tSIUMCR\t0x%08X", in_be32(&sysconf->sc_siumcr)); printf("\tSYPCR\t0x%08X\n", in_be32(&sysconf->sc_sypcr)); diff --git a/arch/powerpc/cpu/mpc8xx/speed.c b/arch/powerpc/cpu/mpc8xx/speed.c index fa8f87cbc5..f8eb4a13ea 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); diff --git a/arch/powerpc/include/asm/ppc.h b/arch/powerpc/include/asm/ppc.h index 5e0aa08be9..db289ed707 100644 --- a/arch/powerpc/include/asm/ppc.h +++ b/arch/powerpc/include/asm/ppc.h @@ -40,14 +40,6 @@ #include -#if defined(CONFIG_8xx) -static inline uint get_immr(uint mask) -{ - uint immr = mfspr(SPRN_IMMR); - - return mask ? (immr & mask) : immr; -} -#endif static inline uint get_pvr(void) { return mfspr(PVR);