Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154544
b: refs/heads/master
c: 8e25ad9
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman authored and Tony Lindgren committed Jun 23, 2009
1 parent e55a05e commit a621991
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 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: 091a58af0ba1765d80b1e74382c7572baceb1bdc
refs/heads/master: 8e25ad964aac0bf6b30dd013303750089f819679
22 changes: 22 additions & 0 deletions trunk/arch/arm/mach-omap2/id.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ int omap_chip_is(struct omap_chip_id oci)
}
EXPORT_SYMBOL(omap_chip_is);

int omap_type(void)
{
u32 val = 0;

if (cpu_is_omap24xx())
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
else if (cpu_is_omap34xx())
val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
else {
pr_err("Cannot detect omap type!\n");
goto out;
}

val &= OMAP2_DEVICETYPE_MASK;
val >>= 8;

out:
return val;
}
EXPORT_SYMBOL(omap_type);


/*----------------------------------------------------------------------------*/

#define OMAP_TAP_IDCODE 0x0204
Expand Down
22 changes: 11 additions & 11 deletions trunk/arch/arm/plat-omap/include/mach/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
#ifndef __ASM_ARCH_OMAP_CPU_H
#define __ASM_ARCH_OMAP_CPU_H

/*
* Omap device type i.e. EMU/HS/TST/GP/BAD
*/
#define OMAP2_DEVICE_TYPE_TEST 0
#define OMAP2_DEVICE_TYPE_EMU 1
#define OMAP2_DEVICE_TYPE_SEC 2
#define OMAP2_DEVICE_TYPE_GP 3
#define OMAP2_DEVICE_TYPE_BAD 4

int omap_type(void);

struct omap_chip_id {
u8 oc;
u8 type;
Expand Down Expand Up @@ -424,17 +435,6 @@ IS_OMAP_TYPE(3430, 0x3430)


int omap_chip_is(struct omap_chip_id oci);
int omap_type(void);

/*
* Macro to detect device type i.e. EMU/HS/TST/GP/BAD
*/
#define OMAP2_DEVICE_TYPE_TEST 0
#define OMAP2_DEVICE_TYPE_EMU 1
#define OMAP2_DEVICE_TYPE_SEC 2
#define OMAP2_DEVICE_TYPE_GP 3
#define OMAP2_DEVICE_TYPE_BAD 4

void omap2_check_revision(void);

#endif /* defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) */

0 comments on commit a621991

Please sign in to comment.