imx233: fix ocotop/debug and usb-core for stmp3600

Currently we don't know where the serial number is stored on the
stmp3600. It is probably using the laser fuses but this needs to
be investigated

Change-Id: I1ac25e38b8f65635abb68788ceb65df0a740dabd
This commit is contained in:
Amaury Pouly 2013-06-23 18:59:13 +02:00
parent be5fadff94
commit d938ae692c
3 changed files with 36 additions and 9 deletions

View file

@ -537,13 +537,13 @@ bool dbg_hw_info_pinctrl(void)
}
}
#if IMX233_SUBTARGET >= 3700
struct
{
const char *name;
volatile uint32_t *addr;
} dbg_ocotp[] =
{
#if IMX233_SUBTARGET >= 3700
#define E(n,v) { .name = n, .addr = &v }
E("CUST0", HW_OCOTP_CUSTn(0)), E("CUST1", HW_OCOTP_CUSTn(1)),
E("CUST2", HW_OCOTP_CUSTn(2)), E("CUST0", HW_OCOTP_CUSTn(3)),
@ -559,6 +559,23 @@ struct
E("ROM2", HW_OCOTP_ROMn(2)), E("ROM3", HW_OCOTP_ROMn(3)),
E("ROM4", HW_OCOTP_ROMn(4)), E("ROM5", HW_OCOTP_ROMn(5)),
E("ROM6", HW_OCOTP_ROMn(6)), E("ROM7", HW_OCOTP_ROMn(7)),
#undef E
#else
#define E(n,v) { .name = n, .addr = &v }
E("LASERFUSE0", HW_RTC_LASERFUSEn(0)),
E("LASERFUSE1", HW_RTC_LASERFUSEn(1)),
E("LASERFUSE2", HW_RTC_LASERFUSEn(2)),
E("LASERFUSE3", HW_RTC_LASERFUSEn(3)),
E("LASERFUSE4", HW_RTC_LASERFUSEn(4)),
E("LASERFUSE5", HW_RTC_LASERFUSEn(5)),
E("LASERFUSE6", HW_RTC_LASERFUSEn(6)),
E("LASERFUSE7", HW_RTC_LASERFUSEn(7)),
E("LASERFUSE8", HW_RTC_LASERFUSEn(8)),
E("LASERFUSE9", HW_RTC_LASERFUSEn(9)),
E("LASERFUSE10", HW_RTC_LASERFUSEn(10)),
E("LASERFUSE11", HW_RTC_LASERFUSEn(11)),
#undef E
#endif
};
bool dbg_hw_info_ocotp(void)
@ -608,12 +625,6 @@ bool dbg_hw_info_ocotp(void)
yield();
}
}
#else
bool dbg_hw_info_ocotp(void)
{
return true;
}
#endif
bool dbg_hw_info_pwm(void)
{

View file

@ -24,9 +24,12 @@
#include "config.h"
#include "system.h"
#include "regs/regs-ocotp.h"
/** STMP3700 and over have OCOTP registers
* where STMP3600 has laser fuses. */
#if IMX233_SUBTARGET >= 3700
#include "regs/regs-ocotp.h"
#define IMX233_NUM_OCOTP_CUST 4
#define IMX233_NUM_OCOTP_CRYPTO 4
#define IMX233_NUM_OCOTP_HWCAP 6
@ -53,6 +56,18 @@ static inline uint32_t imx233_ocotp_read(volatile uint32_t *reg)
imx233_ocotp_open_banks(false);
return val;
}
#else
#include "regs/regs-rtc.h"
#define IMX233_NUM_OCOTP_LASERFUSE 12
static inline uint32_t imx233_ocotp_read(volatile uint32_t *reg)
{
BF_WR_V(RTC_UNLOCK, KEY, VAL);
uint32_t val = *reg;
BF_WR(RTC_UNLOCK, KEY, 0);
return val;
}
#endif
#endif /* OCOTP_IMX233_H */

View file

@ -333,7 +333,8 @@ static void set_serial_descriptor(void)
}
usb_string_iSerial.bLength = 36 + (2 * AS3514_UID_LEN);
}
#elif (CONFIG_CPU == IMX233)
#elif (CONFIG_CPU == IMX233) && IMX233_SUBTARGET >= 3700
// FIXME where is the STMP3600 serial number stored ?
static void set_serial_descriptor(void)
{
short* p = &usb_string_iSerial.wString[1];