From patchwork Wed Mar 14 06:42:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 146557 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 EB848B6EF4 for ; Wed, 14 Mar 2012 17:42:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 964E028082; Wed, 14 Mar 2012 07:42:46 +0100 (CET) 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 b9K4AVKF1xvd; Wed, 14 Mar 2012 07:42:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E0F172807B; Wed, 14 Mar 2012 07:42:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51CC82807B for ; Wed, 14 Mar 2012 07:42:40 +0100 (CET) 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 g6ub+od-+6Hd for ; Wed, 14 Mar 2012 07:42:32 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-gx0-f172.google.com (mail-gx0-f172.google.com [209.85.161.172]) by theia.denx.de (Postfix) with ESMTPS id 9F8A428078 for ; Wed, 14 Mar 2012 07:42:28 +0100 (CET) Received: by ggmi1 with SMTP id i1so1438276ggm.3 for ; Tue, 13 Mar 2012 23:42:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=HEbug3oZQKhftQUz2sUsn3nAGZdNecaMInUQ8gb7v10=; b=bUkai/QFtHzlXYTzl8fX2CcYJSm5dn3ZQxDJZCl8joHQkfOqjkSK/LN7HXt187hvzG bCZR0Zv0X8COPJUPX8WBvAuQwV5WGz2Xn0JvjkMtkwbjKky6lPZz4lZgy9WdwxCxjo8n ro5I3cnmvJYfF2yCuqGxRxSfh2+A9zRxrRkeYc5ajRX3EwXsUuGHiyPw9hUwTWxy2Jgq XaDAezntNwX9WpQC8Hr1IR7tbP7ZMQ8kpdfttH2zbSkFYtn5uPp+LOk/7uNWjtubnrsb CV+NG7Lb6o7Yxs5StT2nW8sHKdJqjBUf4Pgxj6+WgpGmKbZ45q0wvLP6gs7rOaL7ha2m OYgA== Received: by 10.68.227.99 with SMTP id rz3mr2043702pbc.39.1331707346741; Tue, 13 Mar 2012 23:42:26 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id 4sm1943722pbp.76.2012.03.13.23.42.23 (version=SSLv3 cipher=OTHER); Tue, 13 Mar 2012 23:42:26 -0700 (PDT) From: Chander Kashyap To: u-boot@lists.denx.de Date: Wed, 14 Mar 2012 12:12:12 +0530 Message-Id: <1331707332-11709-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQkg1eUxs4tGx4Whms6ftZx4coiaH81CRgmURoToF9dLh6dknYgNxPnDGTZnLrah3J2OXGkn Cc: linaro-dev@lists.linaro.org, bjlee@samsung.com, patches@linaro.org, mk7.kang@samsung.com, samsung@lists.linaro.org Subject: [U-Boot] [PATCH] EXYNOS: Detect cpuid based on Exynos product codes 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 Exynos based SoC's have two different naming conventions. One is S5PC_XXXX and other is EXXX_XXXX. This patch adds generic code to handle EXXX_XXXX connvention. Signed-off-by: Chander Kashyap --- arch/arm/include/asm/arch-exynos/cpu.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 89f2c2e..da89ccf 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -105,10 +105,13 @@ static inline void s5p_set_cpu_id(void) } } +#define EXYNOS_ID ((readl(EXYNOS4_PRO_ID) & (0xF << 24)) >> 24) #define IS_SAMSUNG_TYPE(type, id) \ static inline int cpu_is_##type(void) \ { \ - return s5p_cpu_id == id ? 1 : 0; \ + return ((s5p_cpu_id == id) \ + || (EXYNOS_ID == (#type[sizeof(#type) - 2] - '0'))) \ + ? 1 : 0; \ } IS_SAMSUNG_TYPE(exynos4, 0xc210)