Merge branch 'master' of git://git.denx.de/u-boot-arm

This commit is contained in:
Wolfgang Denk 2009-03-15 22:09:18 +01:00
commit 06ecf08847
9 changed files with 50 additions and 0 deletions

View File

@ -116,6 +116,8 @@ int misc_init_r(void)
beagle_identify();
dieid_num_r();
return 0;
}

View File

@ -68,6 +68,8 @@ int misc_init_r(void)
setup_net_chip();
#endif
dieid_num_r();
return 0;
}

View File

@ -60,6 +60,8 @@ int misc_init_r(void)
{
power_init_r();
dieid_num_r();
return 0;
}

View File

@ -77,6 +77,8 @@ int misc_init_r(void)
writel(GPIO28, &gpio5_base->setdataout);
writel(GPIO4, &gpio6_base->setdataout);
dieid_num_r();
return 0;
}

View File

@ -61,6 +61,7 @@ int board_init(void)
int misc_init_r(void)
{
power_init_r();
dieid_num_r();
return 0;
}

View File

@ -36,6 +36,32 @@ static gpmc_csx_t *gpmc_cs_base = (gpmc_csx_t *)GPMC_CONFIG_CS0_BASE;
static sdrc_t *sdrc_base = (sdrc_t *)OMAP34XX_SDRC_BASE;
static ctrl_t *ctrl_base = (ctrl_t *)OMAP34XX_CTRL_BASE;
/*****************************************************************
* dieid_num_r(void) - read and set die ID
*****************************************************************/
void dieid_num_r(void)
{
ctrl_id_t *id_base = (ctrl_id_t *)OMAP34XX_ID_L4_IO_BASE;
char *uid_s, die_id[34];
u32 id[4];
memset(die_id, 0, sizeof(die_id));
uid_s = getenv("dieid#");
if (uid_s == NULL) {
id[3] = readl(&id_base->die_id_0);
id[2] = readl(&id_base->die_id_1);
id[1] = readl(&id_base->die_id_2);
id[0] = readl(&id_base->die_id_3);
sprintf(die_id, "%08x%08x%08x%08x", id[0], id[1], id[2], id[3]);
setenv("dieid#", die_id);
uid_s = die_id;
}
printf("Die ID #%s\n", uid_s);
}
/******************************************
* get_cpu_type(void) - extract cpu info
******************************************/

View File

@ -60,6 +60,19 @@ typedef struct ctrl {
#define OMAP3525 0x4c00
#define OMAP3530 0x0c00
#ifndef __ASSEMBLY__
typedef struct ctrl_id {
unsigned char res1[0x4];
unsigned int idcode; /* 0x04 */
unsigned int prod_id; /* 0x08 */
unsigned char res2[0x0C];
unsigned int die_id_0; /* 0x18 */
unsigned int die_id_1; /* 0x1C */
unsigned int die_id_2; /* 0x20 */
unsigned int die_id_3; /* 0x24 */
} ctrl_id_t;
#endif /* __ASSEMBLY__ */
/* device type */
#define DEVICE_MASK (0x7 << 8)
#define SYSBOOT_MASK 0x1F

View File

@ -43,6 +43,7 @@
*/
#define OMAP34XX_CORE_L4_IO_BASE 0x48000000
#define OMAP34XX_WAKEUP_L4_IO_BASE 0x48300000
#define OMAP34XX_ID_L4_IO_BASE 0x4830A200
#define OMAP34XX_L4_PER 0x49000000
#define OMAP34XX_L4_IO_BASE OMAP34XX_CORE_L4_IO_BASE

View File

@ -66,5 +66,6 @@ void sdelay(unsigned long);
void make_cs1_contiguous(void);
void omap_nand_switch_ecc(int);
void power_init_r(void);
void dieid_num_r(void);
#endif