From patchwork Mon Aug 12 21:15:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 266645 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 898022C008A for ; Tue, 13 Aug 2013 07:51:26 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E45014A0C3; Mon, 12 Aug 2013 23:51:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qI2Pr4Bht1Z0; Mon, 12 Aug 2013 23:51:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D0194A0BA; Mon, 12 Aug 2013 23:51:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4CF354A0BA for ; Mon, 12 Aug 2013 23:51:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZaKCoUM5QjLp for ; Mon, 12 Aug 2013 23:51:12 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from mo4.mail-out.ovh.net (17.mo4.mail-out.ovh.net [46.105.41.16]) by theia.denx.de (Postfix) with ESMTP id B9BF64A0B9 for ; Mon, 12 Aug 2013 23:51:05 +0200 (CEST) Received: from mail638.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 58026104DE98 for ; Mon, 12 Aug 2013 23:15:18 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 12 Aug 2013 23:16:47 +0200 Received: from 095160000134.warszawa.vectranet.pl (HELO localhost.localdomain) (l.majewski%majess.pl@95.160.0.134) by ns0.ovh.net with SMTP; 12 Aug 2013 23:16:45 +0200 From: Lukasz Majewski To: u-boot@lists.denx.de X-Ovh-Mailout: 178.32.228.4 (mo4.mail-out.ovh.net) Date: Mon, 12 Aug 2013 23:15:08 +0200 Message-Id: <1376342108-319-4-git-send-email-l.majewski@majess.pl> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376342108-319-1-git-send-email-l.majewski@majess.pl> References: <1374443434-11047-1-git-send-email-l.majewski@majess.pl> <1376342108-319-1-git-send-email-l.majewski@majess.pl> X-Ovh-Tracer-Id: 5817806294043640349 X-Ovh-Remote: 95.160.0.134 (095160000134.warszawa.vectranet.pl) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeikedrudejucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeikedrudejucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Subject: [U-Boot] [PATCH v3 3/3] arm:samsung:cpu_info: Rename s5p_* to samsung_* X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Common CPU info code has been refactored to use more generic name - namely samsung_* instead of s5p_*. This change will prevent code duplication for non armv7a based SoCs (e.g. s3c64xx). Signed-off-by: Lukasz Majewski --- Changes for v3: - New patch --- arch/arm/cpu/samsung-common/cpu_info.c | 10 +++++----- arch/arm/include/asm/arch-exynos/cpu.h | 24 ++++++++++++------------ arch/arm/include/asm/arch-s5pc1xx/cpu.h | 12 ++++++------ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/arch/arm/cpu/samsung-common/cpu_info.c b/arch/arm/cpu/samsung-common/cpu_info.c index e18c4f6..89dc80d 100644 --- a/arch/arm/cpu/samsung-common/cpu_info.c +++ b/arch/arm/cpu/samsung-common/cpu_info.c @@ -9,14 +9,14 @@ #include /* Default is s5pc100 */ -unsigned int s5p_cpu_id = 0xC100; +unsigned int samsung_cpu_id = 0xC100; /* Default is EVT1 */ -unsigned int s5p_cpu_rev = 1; +unsigned int samsung_cpu_rev = 1; #ifdef CONFIG_ARCH_CPU_INIT int arch_cpu_init(void) { - s5p_set_cpu_id(); + samsung_set_cpu_id(); return 0; } @@ -24,7 +24,7 @@ int arch_cpu_init(void) u32 get_device_type(void) { - return s5p_cpu_id; + return samsung_cpu_id; } #ifdef CONFIG_DISPLAY_CPUINFO @@ -32,7 +32,7 @@ int print_cpuinfo(void) { char buf[32]; - printf("CPU:\t%s%X@%sMHz\n", s5p_get_cpu_name(), s5p_cpu_id, + printf("CPU:\t%s%X@%sMHz\n", samsung_get_cpu_name(), samsung_cpu_id, strmhz(buf, get_arm_clk())); return 0; diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index cb924fb..17106df 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -124,40 +124,40 @@ #ifndef __ASSEMBLY__ #include /* CPU detection macros */ -extern unsigned int s5p_cpu_id; -extern unsigned int s5p_cpu_rev; +extern unsigned int samsung_cpu_id; +extern unsigned int samsung_cpu_rev; static inline int s5p_get_cpu_rev(void) { - return s5p_cpu_rev; + return samsung_cpu_rev; } -static inline void s5p_set_cpu_id(void) +static inline void samsung_set_cpu_id(void) { unsigned int pro_id = (readl(EXYNOS4_PRO_ID) & 0x00FFF000) >> 12; switch (pro_id) { case 0x200: /* Exynos4210 EVT0 */ - s5p_cpu_id = 0x4210; - s5p_cpu_rev = 0; + samsung_cpu_id = 0x4210; + samsung_cpu_rev = 0; break; case 0x210: /* Exynos4210 EVT1 */ - s5p_cpu_id = 0x4210; + samsung_cpu_id = 0x4210; break; case 0x412: /* Exynos4412 */ - s5p_cpu_id = 0x4412; + samsung_cpu_id = 0x4412; break; case 0x520: /* Exynos5250 */ - s5p_cpu_id = 0x5250; + samsung_cpu_id = 0x5250; break; } } -static inline char *s5p_get_cpu_name(void) +static inline char *samsung_get_cpu_name(void) { return EXYNOS_CPU_NAME; } @@ -165,7 +165,7 @@ static inline char *s5p_get_cpu_name(void) #define IS_SAMSUNG_TYPE(type, id) \ static inline int __attribute__((no_instrument_function)) cpu_is_##type(void) \ { \ - return (s5p_cpu_id >> 12) == id; \ + return (samsung_cpu_id >> 12) == id; \ } IS_SAMSUNG_TYPE(exynos4, 0x4) @@ -175,7 +175,7 @@ IS_SAMSUNG_TYPE(exynos5, 0x5) static inline int __attribute__((no_instrument_function)) \ proid_is_##type(void) \ { \ - return s5p_cpu_id == id; \ + return samsung_cpu_id == id; \ } IS_EXYNOS_TYPE(exynos4210, 0x4210) diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h b/arch/arm/include/asm/arch-s5pc1xx/cpu.h index 4fc5a0c..b3208ce 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h +++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h @@ -50,15 +50,15 @@ #ifndef __ASSEMBLY__ #include /* CPU detection macros */ -extern unsigned int s5p_cpu_id; +extern unsigned int samsung_cpu_id; -static inline void s5p_set_cpu_id(void) +static inline void samsung_set_cpu_id(void) { - s5p_cpu_id = readl(S5PC100_PRO_ID); - s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12); + samsung_cpu_id = readl(S5PC100_PRO_ID); + samsung_cpu_id = 0xC000 | ((samsung_cpu_id & 0x00FFF000) >> 12); } -static inline char *s5p_get_cpu_name(void) +static inline char *samsung_get_cpu_name(void) { return S5P_CPU_NAME; } @@ -66,7 +66,7 @@ static inline char *s5p_get_cpu_name(void) #define IS_SAMSUNG_TYPE(type, id) \ static inline int cpu_is_##type(void) \ { \ - return s5p_cpu_id == id ? 1 : 0; \ + return samsung_cpu_id == id ? 1 : 0; \ } IS_SAMSUNG_TYPE(s5pc100, 0xc100)