Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260466
b: refs/heads/master
c: cc0170b
h: refs/heads/master
v: v3
  • Loading branch information
Aneesh V authored and Tony Lindgren committed Jul 8, 2011
1 parent b82aa58 commit d95e9f3
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa54dccddc8f4a53c223d53c56c54c61ea7d2623
refs/heads/master: cc0170b2d929b8a31fec3da66a132822a99f550b
40 changes: 33 additions & 7 deletions trunk/arch/arm/mach-omap2/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
static struct omap_chip_id omap_chip;
static unsigned int omap_revision;

u32 omap3_features;
u32 omap_features;

unsigned int omap_rev(void)
{
Expand Down Expand Up @@ -183,14 +183,14 @@ static void __init omap24xx_check_revision(void)
#define OMAP3_CHECK_FEATURE(status,feat) \
if (((status & OMAP3_ ##feat## _MASK) \
>> OMAP3_ ##feat## _SHIFT) != FEAT_ ##feat## _NONE) { \
omap3_features |= OMAP3_HAS_ ##feat; \
omap_features |= OMAP3_HAS_ ##feat; \
}

static void __init omap3_check_features(void)
{
u32 status;

omap3_features = 0;
omap_features = 0;

status = omap_ctrl_readl(OMAP3_CONTROL_OMAP_STATUS);

Expand All @@ -200,21 +200,46 @@ static void __init omap3_check_features(void)
OMAP3_CHECK_FEATURE(status, NEON);
OMAP3_CHECK_FEATURE(status, ISP);
if (cpu_is_omap3630())
omap3_features |= OMAP3_HAS_192MHZ_CLK;
omap_features |= OMAP3_HAS_192MHZ_CLK;
if (!cpu_is_omap3505() && !cpu_is_omap3517())
omap3_features |= OMAP3_HAS_IO_WAKEUP;
omap_features |= OMAP3_HAS_IO_WAKEUP;

omap3_features |= OMAP3_HAS_SDRC;
omap_features |= OMAP3_HAS_SDRC;

/*
* TODO: Get additional info (where applicable)
* e.g. Size of L2 cache.
*/
}

static void __init omap4_check_features(void)
{
u32 si_type;

if (cpu_is_omap443x())
omap_features |= OMAP4_HAS_MPU_1GHZ;


if (cpu_is_omap446x()) {
si_type =
read_tap_reg(OMAP4_CTRL_MODULE_CORE_STD_FUSE_PROD_ID_1);
switch ((si_type & (3 << 16)) >> 16) {
case 2:
/* High performance device */
omap_features |= OMAP4_HAS_MPU_1_5GHZ;
break;
case 1:
default:
/* Standard device */
omap_features |= OMAP4_HAS_MPU_1_2GHZ;
break;
}
}
}

static void __init ti816x_check_features(void)
{
omap3_features = OMAP3_HAS_NEON;
omap_features = OMAP3_HAS_NEON;
}

static void __init omap3_check_revision(void)
Expand Down Expand Up @@ -527,6 +552,7 @@ void __init omap2_check_revision(void)
return;
} else if (cpu_is_omap44xx()) {
omap4_check_revision();
omap4_check_features();
return;
} else {
pr_err("OMAP revision unknown, please fix!\n");
Expand Down
23 changes: 21 additions & 2 deletions trunk/arch/arm/plat-omap/include/plat/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void omap2_check_revision(void);
/*
* Runtime detection of OMAP3 features
*/
extern u32 omap3_features;
extern u32 omap_features;

#define OMAP3_HAS_L2CACHE BIT(0)
#define OMAP3_HAS_IVA BIT(1)
Expand All @@ -488,11 +488,15 @@ extern u32 omap3_features;
#define OMAP3_HAS_192MHZ_CLK BIT(5)
#define OMAP3_HAS_IO_WAKEUP BIT(6)
#define OMAP3_HAS_SDRC BIT(7)
#define OMAP4_HAS_MPU_1GHZ BIT(8)
#define OMAP4_HAS_MPU_1_2GHZ BIT(9)
#define OMAP4_HAS_MPU_1_5GHZ BIT(10)


#define OMAP3_HAS_FEATURE(feat,flag) \
static inline unsigned int omap3_has_ ##feat(void) \
{ \
return (omap3_features & OMAP3_HAS_ ##flag); \
return omap_features & OMAP3_HAS_ ##flag; \
} \

OMAP3_HAS_FEATURE(l2cache, L2CACHE)
Expand All @@ -504,4 +508,19 @@ OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)
OMAP3_HAS_FEATURE(io_wakeup, IO_WAKEUP)
OMAP3_HAS_FEATURE(sdrc, SDRC)

/*
* Runtime detection of OMAP4 features
*/
extern u32 omap_features;

#define OMAP4_HAS_FEATURE(feat, flag) \
static inline unsigned int omap4_has_ ##feat(void) \
{ \
return omap_features & OMAP4_HAS_ ##flag; \
} \

OMAP4_HAS_FEATURE(mpu_1ghz, MPU_1GHZ)
OMAP4_HAS_FEATURE(mpu_1_2ghz, MPU_1_2GHZ)
OMAP4_HAS_FEATURE(mpu_1_5ghz, MPU_1_5GHZ)

#endif

0 comments on commit d95e9f3

Please sign in to comment.