Commit 6852215a32d0f63a0f3497df3b4638f5eac428d3

Authored by R Sricharan
Committed by Rajendra Nayak
1 parent 6d0fc190c8

ARM: DRA7: id: Add cpu detection support for DRA7xx based SoCs'

The DRA7xx is a high-performance, infotainment application device,
based on enhanced OMAP architecture integrated on a 28-nm technology.

Since DRA7 is a platform supported only using DT, the cpu detection
is based on the compatibles passed from DT blobs as suggested here
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-July/187712.html

Suggested-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: R Sricharan <r.sricharan@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>

Showing 3 changed files with 20 additions and 2 deletions Side-by-side Diff

arch/arm/mach-omap1/include/mach/soc.h
... ... @@ -195,6 +195,7 @@
195 195 #define cpu_is_omap34xx() 0
196 196 #define cpu_is_omap44xx() 0
197 197 #define soc_is_omap54xx() 0
  198 +#define soc_is_dra7xx() 0
198 199 #define soc_is_am33xx() 0
199 200 #define cpu_class_is_omap1() 1
200 201 #define cpu_class_is_omap2() 0
arch/arm/mach-omap2/id.c
... ... @@ -61,7 +61,7 @@
61 61 val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
62 62 } else if (cpu_is_omap44xx()) {
63 63 val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
64   - } else if (soc_is_omap54xx()) {
  64 + } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
65 65 val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
66 66 val &= OMAP5_DEVICETYPE_MASK;
67 67 val >>= 6;
... ... @@ -116,7 +116,7 @@
116 116  
117 117 void omap_get_die_id(struct omap_die_id *odi)
118 118 {
119   - if (cpu_is_omap44xx() || soc_is_omap54xx()) {
  119 + if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
120 120 odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
121 121 odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
122 122 odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
arch/arm/mach-omap2/soc.h
... ... @@ -8,6 +8,7 @@
8 8 * Written by Tony Lindgren <tony.lindgren@nokia.com>
9 9 *
10 10 * Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
  11 + * Added DRA7xxx specific defines - Sricharan R<r.sricharan@ti.com>
11 12 *
12 13 * This program is free software; you can redistribute it and/or modify
13 14 * it under the terms of the GNU General Public License as published by
... ... @@ -35,6 +36,7 @@
35 36 #ifndef __ASSEMBLY__
36 37  
37 38 #include <linux/bitops.h>
  39 +#include <linux/of.h>
38 40  
39 41 /*
40 42 * Test if multicore OMAP support is needed
... ... @@ -105,6 +107,15 @@
105 107 # endif
106 108 #endif
107 109  
  110 +#ifdef CONFIG_SOC_DRA7XX
  111 +# ifdef OMAP_NAME
  112 +# undef MULTI_OMAP2
  113 +# define MULTI_OMAP2
  114 +# else
  115 +# define OMAP_NAME DRA7XX
  116 +# endif
  117 +#endif
  118 +
108 119 /*
109 120 * Omap device type i.e. EMU/HS/TST/GP/BAD
110 121 */
... ... @@ -233,6 +244,7 @@
233 244 #define cpu_is_omap447x() 0
234 245 #define soc_is_omap54xx() 0
235 246 #define soc_is_omap543x() 0
  247 +#define soc_is_dra7xx() 0
236 248  
237 249 #if defined(MULTI_OMAP2)
238 250 # if defined(CONFIG_ARCH_OMAP2)
... ... @@ -377,6 +389,11 @@
377 389 # undef soc_is_omap543x
378 390 # define soc_is_omap54xx() is_omap54xx()
379 391 # define soc_is_omap543x() is_omap543x()
  392 +#endif
  393 +
  394 +#if defined(CONFIG_SOC_DRA7XX)
  395 +#undef soc_is_dra7xx
  396 +#define soc_is_dra7xx() (of_machine_is_compatible("ti,dra7"))
380 397 #endif
381 398  
382 399 /* Various silicon revisions for omap2 */