Skip to content

Commit

Permalink
ARM: DRA7: id: Add cpu detection support for DRA7xx based SoCs'
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
R Sricharan authored and Rajendra Nayak committed Aug 13, 2013
1 parent 6d0fc19 commit 6852215
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-omap1/include/mach/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ IS_OMAP_TYPE(1710, 0x1710)
#define cpu_is_omap34xx() 0
#define cpu_is_omap44xx() 0
#define soc_is_omap54xx() 0
#define soc_is_dra7xx() 0
#define soc_is_am33xx() 0
#define cpu_class_is_omap1() 1
#define cpu_class_is_omap2() 0
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-omap2/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int omap_type(void)
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
} else if (cpu_is_omap44xx()) {
val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
} else if (soc_is_omap54xx()) {
} else if (soc_is_omap54xx() || soc_is_dra7xx()) {
val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
val &= OMAP5_DEVICETYPE_MASK;
val >>= 6;
Expand Down Expand Up @@ -116,7 +116,7 @@ static u16 tap_prod_id;

void omap_get_die_id(struct omap_die_id *odi)
{
if (cpu_is_omap44xx() || soc_is_omap54xx()) {
if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
Expand Down
17 changes: 17 additions & 0 deletions arch/arm/mach-omap2/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Written by Tony Lindgren <tony.lindgren@nokia.com>
*
* Added OMAP4/5 specific defines - Santosh Shilimkar<santosh.shilimkar@ti.com>
* Added DRA7xxx specific defines - Sricharan R<r.sricharan@ti.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -35,6 +36,7 @@
#ifndef __ASSEMBLY__

#include <linux/bitops.h>
#include <linux/of.h>

/*
* Test if multicore OMAP support is needed
Expand Down Expand Up @@ -105,6 +107,15 @@
# endif
#endif

#ifdef CONFIG_SOC_DRA7XX
# ifdef OMAP_NAME
# undef MULTI_OMAP2
# define MULTI_OMAP2
# else
# define OMAP_NAME DRA7XX
# endif
#endif

/*
* Omap device type i.e. EMU/HS/TST/GP/BAD
*/
Expand Down Expand Up @@ -233,6 +244,7 @@ IS_AM_SUBCLASS(437x, 0x437)
#define cpu_is_omap447x() 0
#define soc_is_omap54xx() 0
#define soc_is_omap543x() 0
#define soc_is_dra7xx() 0

#if defined(MULTI_OMAP2)
# if defined(CONFIG_ARCH_OMAP2)
Expand Down Expand Up @@ -379,6 +391,11 @@ IS_OMAP_TYPE(3430, 0x3430)
# define soc_is_omap543x() is_omap543x()
#endif

#if defined(CONFIG_SOC_DRA7XX)
#undef soc_is_dra7xx
#define soc_is_dra7xx() (of_machine_is_compatible("ti,dra7"))
#endif

/* Various silicon revisions for omap2 */
#define OMAP242X_CLASS 0x24200024
#define OMAP2420_REV_ES1_0 OMAP242X_CLASS
Expand Down

0 comments on commit 6852215

Please sign in to comment.