Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172819
b: refs/heads/master
c: db40802
h: refs/heads/master
i:
  172817: ca29521
  172815: 1062810
v: v3
  • Loading branch information
Ajay Kumar Gupta authored and Tony Lindgren committed Nov 22, 2009
1 parent ed6ea33 commit e1b0b6a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50a1f7bfea7ba9330f984ecb7d35aeb93d326cc3
refs/heads/master: db408023b85644e1bee80d4004aff1ff188032e9
35 changes: 35 additions & 0 deletions trunk/arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,42 @@

#define OMAP3EVM_ETHR_START 0x2c000000
#define OMAP3EVM_ETHR_SIZE 1024
#define OMAP3EVM_ETHR_ID_REV 0x50
#define OMAP3EVM_ETHR_GPIO_IRQ 176
#define OMAP3EVM_SMC911X_CS 5

static u8 omap3_evm_version;

u8 get_omap3_evm_rev(void)
{
return omap3_evm_version;
}
EXPORT_SYMBOL(get_omap3_evm_rev);

static void __init omap3_evm_get_revision(void)
{
void __iomem *ioaddr;
unsigned int smsc_id;

/* Ethernet PHY ID is stored at ID_REV register */
ioaddr = ioremap_nocache(OMAP3EVM_ETHR_START, SZ_1K);
if (!ioaddr)
return;
smsc_id = readl(ioaddr + OMAP3EVM_ETHR_ID_REV) & 0xFFFF0000;
iounmap(ioaddr);

switch (smsc_id) {
/*SMSC9115 chipset*/
case 0x01150000:
omap3_evm_version = OMAP3EVM_BOARD_GEN_1;
break;
/*SMSC 9220 chipset*/
case 0x92200000:
default:
omap3_evm_version = OMAP3EVM_BOARD_GEN_2;
}
}

static struct resource omap3evm_smc911x_resources[] = {
[0] = {
.start = OMAP3EVM_ETHR_START,
Expand Down Expand Up @@ -321,6 +354,8 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {

static void __init omap3_evm_init(void)
{
omap3_evm_get_revision();

omap3_evm_i2c_init();

platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/arm/plat-omap/include/plat/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@

#include <plat/gpio-switch.h>

/*
* OMAP35x EVM revision
* Run time detection of EVM revision is done by reading Ethernet
* PHY ID -
* GEN_1 = 0x01150000
* GEN_2 = 0x92200000
*/
enum {
OMAP3EVM_BOARD_GEN_1 = 0, /* EVM Rev between A - D */
OMAP3EVM_BOARD_GEN_2, /* EVM Rev >= Rev E */
};

/* Different peripheral ids */
#define OMAP_TAG_CLOCK 0x4f01
#define OMAP_TAG_LCD 0x4f05
Expand Down Expand Up @@ -157,4 +169,10 @@ extern int omap_board_config_size;
/* for TI reference platforms sharing the same debug card */
extern int debug_card_init(u32 addr, unsigned gpio);

/* OMAP3EVM revision */
#if defined(CONFIG_MACH_OMAP3EVM)
u8 get_omap3_evm_rev(void);
#else
#define get_omap3_evm_rev() (-EINVAL)
#endif
#endif

0 comments on commit e1b0b6a

Please sign in to comment.