From patchwork Fri Mar 16 16:20:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 886983 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 402rYF1yclz9sMM for ; Sat, 17 Mar 2018 03:30:41 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DA952C21E34; Fri, 16 Mar 2018 16:24:08 +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 02496C21E9F; Fri, 16 Mar 2018 16:21:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8B213C21E6A; Fri, 16 Mar 2018 16:21:02 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id 8F6FEC21E0F for ; Fri, 16 Mar 2018 16:20:58 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 402rKt200rz9tvQd; Fri, 16 Mar 2018 17:20:50 +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 JhFG8StBbCt6; Fri, 16 Mar 2018 17:20:50 +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 402rKt1YZfz9tvPl; Fri, 16 Mar 2018 17:20:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 306658BBB1; Fri, 16 Mar 2018 17:20:58 +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 XQs4xYUXZXWb; Fri, 16 Mar 2018 17:20:58 +0100 (CET) Received: from po15720vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.30]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 035B88BBAA; Fri, 16 Mar 2018 17:20:58 +0100 (CET) Received: by po15720vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C5DFD6F128; Fri, 16 Mar 2018 17:20:57 +0100 (CET) Message-Id: In-Reply-To: References: From: Christophe Leroy To: Tom Rini , Wolfgang Denk Date: Fri, 16 Mar 2018 17:20:57 +0100 (CET) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 14/16] powerpc: mpc8xx: refactorise reginfo 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" reginfo is redundant with some of the commands in immap.c, so move reginfo into that file and remove duplicated info. Signed-off-by: Christophe Leroy --- arch/powerpc/cpu/mpc8xx/Makefile | 1 - arch/powerpc/cpu/mpc8xx/immap.c | 20 +++++++++++ arch/powerpc/cpu/mpc8xx/reginfo.c | 71 --------------------------------------- 3 files changed, 20 insertions(+), 72 deletions(-) delete mode 100644 arch/powerpc/cpu/mpc8xx/reginfo.c diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile index 40f38923ece..35ff18a7b3b 100644 --- a/arch/powerpc/cpu/mpc8xx/Makefile +++ b/arch/powerpc/cpu/mpc8xx/Makefile @@ -12,6 +12,5 @@ obj-y += cpu_init.o obj-$(CONFIG_OF_LIBFDT) += fdt.o obj-$(CONFIG_CMD_IMMAP) += immap.o obj-y += interrupts.o -obj-$(CONFIG_CMD_REGINFO) += reginfo.o obj-y += speed.o obj-y += cache.o diff --git a/arch/powerpc/cpu/mpc8xx/immap.c b/arch/powerpc/cpu/mpc8xx/immap.c index 6164de281bd..8e732555baf 100644 --- a/arch/powerpc/cpu/mpc8xx/immap.c +++ b/arch/powerpc/cpu/mpc8xx/immap.c @@ -342,6 +342,26 @@ static int do_brginfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } +#ifdef CONFIG_CMD_REGINFO +void print_reginfo(void) +{ + immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; + sit8xx_t __iomem *timers = &immap->im_sit; + + printf("\nSystem Configuration registers\n" + "\tIMMR\t0x%08X\n", get_immr()); + do_siuinfo(NULL, 0, 0, NULL); + + printf("Memory Controller Registers\n"); + do_memcinfo(NULL, 0, 0, NULL); + + printf("\nSystem Integration Timers\n"); + printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n", + in_be16(&timers->sit_tbscr), in_be16(&timers->sit_rtcsc)); + printf("\tPISCR\t0x%04X\n", in_be16(&timers->sit_piscr)); +} +#endif + /***************************************************/ U_BOOT_CMD( diff --git a/arch/powerpc/cpu/mpc8xx/reginfo.c b/arch/powerpc/cpu/mpc8xx/reginfo.c deleted file mode 100644 index d48ea265f83..00000000000 --- a/arch/powerpc/cpu/mpc8xx/reginfo.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (C) Copyright 2000 - * Subodh Nijsure, SkyStream Networks, snijsure@skystream.com - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include - -void print_reginfo(void) -{ - immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR; - memctl8xx_t __iomem *memctl = &immap->im_memctl; - sysconf8xx_t __iomem *sysconf = &immap->im_siu_conf; - sit8xx_t __iomem *timers = &immap->im_sit; - - /* Hopefully more PowerPC knowledgable people will add code to display - * other useful registers - */ - - printf("\nSystem Configuration registers\n" - "\tIMMR\t0x%08X\n", get_immr()); - - printf("\tSIUMCR\t0x%08X", in_be32(&sysconf->sc_siumcr)); - printf("\tSYPCR\t0x%08X\n", in_be32(&sysconf->sc_sypcr)); - - printf("\tSWT\t0x%08X", in_be32(&sysconf->sc_swt)); - printf("\tSWSR\t0x%04X\n", in_be16(&sysconf->sc_swsr)); - - printf("\tSIPEND\t0x%08X\tSIMASK\t0x%08X\n", - in_be32(&sysconf->sc_sipend), in_be32(&sysconf->sc_simask)); - printf("\tSIEL\t0x%08X\tSIVEC\t0x%08X\n", - in_be32(&sysconf->sc_siel), in_be32(&sysconf->sc_sivec)); - printf("\tTESR\t0x%08X\tSDCR\t0x%08X\n", - in_be32(&sysconf->sc_tesr), in_be32(&sysconf->sc_sdcr)); - - printf("Memory Controller Registers\n"); - printf("\tBR0\t0x%08X\tOR0\t0x%08X\n", in_be32(&memctl->memc_br0), - in_be32(&memctl->memc_or0)); - printf("\tBR1\t0x%08X\tOR1\t0x%08X\n", in_be32(&memctl->memc_br1), - in_be32(&memctl->memc_or1)); - printf("\tBR2\t0x%08X\tOR2\t0x%08X\n", in_be32(&memctl->memc_br2), - in_be32(&memctl->memc_or2)); - printf("\tBR3\t0x%08X\tOR3\t0x%08X\n", in_be32(&memctl->memc_br3), - in_be32(&memctl->memc_or3)); - printf("\tBR4\t0x%08X\tOR4\t0x%08X\n", in_be32(&memctl->memc_br4), - in_be32(&memctl->memc_or4)); - printf("\tBR5\t0x%08X\tOR5\t0x%08X\n", in_be32(&memctl->memc_br5), - in_be32(&memctl->memc_or5)); - printf("\tBR6\t0x%08X\tOR6\t0x%08X\n", in_be32(&memctl->memc_br6), - in_be32(&memctl->memc_or6)); - printf("\tBR7\t0x%08X\tOR7\t0x%08X\n", in_be32(&memctl->memc_br7), - in_be32(&memctl->memc_or7)); - printf("\n\tmamr\t0x%08X\tmbmr\t0x%08X\n", in_be32(&memctl->memc_mamr), - in_be32(&memctl->memc_mbmr)); - printf("\tmstat\t0x%04X\tmptpr\t0x%04X\n", in_be16(&memctl->memc_mstat), - in_be16(&memctl->memc_mptpr)); - printf("\tmdr\t0x%08X\n", in_be32(&memctl->memc_mdr)); - - printf("\nSystem Integration Timers\n"); - printf("\tTBSCR\t0x%04X\tRTCSC\t0x%04X\n", - in_be16(&timers->sit_tbscr), in_be16(&timers->sit_rtcsc)); - printf("\tPISCR\t0x%04X\n", in_be16(&timers->sit_piscr)); - - /* - * May be some CPM info here? - */ -}