From patchwork Thu Jul 25 21:47: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: 261978 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 C701C2C00F7 for ; Fri, 26 Jul 2013 08:26:20 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B6CA4A019; Fri, 26 Jul 2013 00:26:17 +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 SB3l04TyNcXj; Fri, 26 Jul 2013 00:26:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C30DD4A01B; Fri, 26 Jul 2013 00:26:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E925E4A019 for ; Fri, 26 Jul 2013 00:26:03 +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 3UVTMC0C-O8O for ; Fri, 26 Jul 2013 00:25:57 +0200 (CEST) X-Greylist: delayed 2509 seconds by postgrey-1.27 at theia; Fri, 26 Jul 2013 00:25:49 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 mo1.mail-out.ovh.net (9.mo1.mail-out.ovh.net [178.32.108.172]) by theia.denx.de (Postfix) with ESMTP id 67E934A018 for ; Fri, 26 Jul 2013 00:25:49 +0200 (CEST) Received: from mail645.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo1.mail-out.ovh.net (Postfix) with SMTP id 1E19310043A1 for ; Thu, 25 Jul 2013 23:47:16 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 25 Jul 2013 23:46:53 +0200 Received: from 178235168002.warszawa.vectranet.pl (HELO localhost.localdomain) (l.majewski%majess.pl@178.235.168.2) by ns0.ovh.net with SMTP; 25 Jul 2013 23:46:52 +0200 From: Lukasz Majewski To: u-boot@lists.denx.de, Minkyu Kang X-Ovh-Mailout: 178.32.228.1 (mo1.mail-out.ovh.net) Date: Thu, 25 Jul 2013 23:47:08 +0200 Message-Id: <1374788828-6962-1-git-send-email-l.majewski@majess.pl> X-Mailer: git-send-email 1.7.10.4 X-Ovh-Tracer-Id: 11298405566587847194 X-Ovh-Remote: 178.235.168.2 (178235168002.warszawa.vectranet.pl) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeijedrgeegucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.5/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeijedrgeegucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Subject: [U-Boot] [PATCH] 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 --- This patch depends on: 1. arm:samsung:serial Extract common UART code http://patchwork.ozlabs.org/patch/260550/ 2. arm:samsung: Move common code from ./s5p-common to ./samsung-common/ http://patchwork.ozlabs.org/patch/260554/ --- 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 88743b9..1089829 100644 --- a/arch/arm/cpu/samsung-common/cpu_info.c +++ b/arch/arm/cpu/samsung-common/cpu_info.c @@ -25,14 +25,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; } @@ -40,7 +40,7 @@ int arch_cpu_init(void) u32 get_device_type(void) { - return s5p_cpu_id; + return samsung_cpu_id; } #ifdef CONFIG_DISPLAY_CPUINFO @@ -48,7 +48,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 1ff231b..b0be261 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -138,40 +138,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; } @@ -179,7 +179,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) @@ -189,7 +189,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 2362b99..8ab71ea 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h +++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h @@ -64,15 +64,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; } @@ -80,7 +80,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)