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: 7275 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6ED3823E29 for ; Wed, 14 Mar 2012 06:42:29 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 29436A186D2 for ; Wed, 14 Mar 2012 06:42:29 +0000 (UTC) Received: by iage36 with SMTP id e36so2598602iag.11 for ; Tue, 13 Mar 2012 23:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=HEbug3oZQKhftQUz2sUsn3nAGZdNecaMInUQ8gb7v10=; b=gmpL1G9AZXRYHoDyUV7IF2XuIEv769l3Qt6d0DLzKKyVLrPFC71WsNry8nWwJl3u/Y WMjFJe612jeY+DEPbw2K7ZhAqUihQNF0d1lUcFyNX5Tk8F1kDBnNI5GbRggCTZAimn7a hiPd4/aCX4uBDQB1IK6q1B8G/ui0Z5UNTDn0GsNS2rbs0xpXgSapEiTVPwxeFJVScdfm QzqUWsvujiK7dSxgNRtKWorsXUW1Hqd8XrtHErUOccY4nRdJl4VGr5vgJCUdyG2GSuSo n1fXYKkPn83XThvPrYz8YMu7nKAaLU5v4DAq9fTEwsGaSr7kyYYkVm7VrLGYtKlAUZ6H P/7Q== Received: by 10.50.158.133 with SMTP id wu5mr9669847igb.50.1331707348441; Tue, 13 Mar 2012 23:42:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp2837ibg; Tue, 13 Mar 2012 23:42:28 -0700 (PDT) Received: by 10.68.191.168 with SMTP id gz8mr2041888pbc.37.1331707347675; Tue, 13 Mar 2012 23:42:27 -0700 (PDT) Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com [209.85.210.45]) by mx.google.com with ESMTPS id a4si3024446pbd.242.2012.03.13.23.42.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Mar 2012 23:42:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.45 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) client-ip=209.85.210.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.45 is neither permitted nor denied by best guess record for domain of chander.kashyap@linaro.org) smtp.mail=chander.kashyap@linaro.org Received: by dadp14 with SMTP id p14so5899608dad.18 for ; Tue, 13 Mar 2012 23:42:26 -0700 (PDT) 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 Cc: mk7.kang@samsung.com, bjlee@samsung.com, patches@linaro.org, samsung@lists.linaro.org, linaro-dev@lists.linaro.org, Chander Kashyap Subject: [PATCH] EXYNOS: Detect cpuid based on Exynos product codes 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: ALoCoQl0a/NQkTjSFB81SfHKHPZRMxAPuelmTtzBBoJWkfs1GNBqrpoMPBVtH9HK2u4fdYzs7R07 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)