summaryrefslogtreecommitdiff
path: root/board/pcs440ep/pcs440ep.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/pcs440ep/pcs440ep.c')
-rw-r--r--board/pcs440ep/pcs440ep.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/board/pcs440ep/pcs440ep.c b/board/pcs440ep/pcs440ep.c
index ada6b82..696423e 100644
--- a/board/pcs440ep/pcs440ep.c
+++ b/board/pcs440ep/pcs440ep.c
@@ -85,8 +85,9 @@ static void status_led_blink (void)
/* set all LED which are on, to state BLINKING */
for (i = 0; i < 4; i++) {
- if (val & 0x08) status_led_set (i, STATUS_LED_BLINKING);
- val = val << 1;
+ if (val & 0x01) status_led_set (3 - i, STATUS_LED_BLINKING);
+ else status_led_set (3 - i, STATUS_LED_OFF);
+ val = val >> 1;
}
}
@@ -113,12 +114,14 @@ void show_boot_progress (int val)
status_led_set (1, STATUS_LED_ON);
status_led_set (2, STATUS_LED_ON);
break;
+#if 0
case 64:
/* starting Ethernet configuration */
status_led_set (0, STATUS_LED_OFF);
status_led_set (1, STATUS_LED_OFF);
status_led_set (2, STATUS_LED_ON);
break;
+#endif
case 80:
/* loading Image */
status_led_set (0, STATUS_LED_ON);
@@ -235,7 +238,13 @@ void load_sernum_ethaddr (void)
}
/* Env doesnt exist -> hang */
status_led_blink ();
- hang ();
+ /* here we do this "handy" because we have no interrupts
+ at this time */
+ puts ("### EEPROM ERROR ### Please RESET the board ###\n");
+ for (;;) {
+ __led_toggle (12);
+ udelay (100000);
+ }
return;
}
@@ -404,13 +413,22 @@ static void pcs440ep_checksha1 (void)
int ret;
char *cs_test;
+ status_led_set (0, STATUS_LED_OFF);
+ status_led_set (1, STATUS_LED_OFF);
+ status_led_set (2, STATUS_LED_ON);
ret = pcs440ep_sha1 (1);
if (ret == 0) return;
if ((cs_test = getenv ("cs_test")) == NULL) {
/* Env doesnt exist -> hang */
status_led_blink ();
- hang ();
+ /* here we do this "handy" because we have no interrupts
+ at this time */
+ puts ("### SHA1 ERROR ### Please RESET the board ###\n");
+ for (;;) {
+ __led_toggle (2);
+ udelay (100000);
+ }
}
if (strncmp (cs_test, "off", 3) == 0) {
@@ -511,7 +529,7 @@ void spd_ddr_init_hang (void)
status_led_set (1, STATUS_LED_ON);
/* we cannot use hang() because we are still running from
Flash, and so the status_led driver is not initialized */
- puts ("### ERROR ### Please RESET the board ###\n");
+ puts ("### SDRAM ERROR ### Please RESET the board ###\n");
for (;;) {
__led_toggle (4);
udelay (100000);
@@ -751,28 +769,41 @@ void hw_watchdog_reset(void)
************************************************************************/
int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- int rcode = 0;
+ int rcode = 0, i;
ulong pattern = 0;
- pattern = simple_strtoul (argv[1], NULL, 10);
- if (pattern > 200) {
+ pattern = simple_strtoul (argv[1], NULL, 16);
+ if (pattern > 0x400) {
+ int val = GET_LEDS;
+ printf ("led: %x\n", val);
+ return rcode;
+ }
+ if (pattern > 0x200) {
status_led_blink ();
hang ();
return rcode;
}
- if (pattern > 100) {
+ if (pattern > 0x100) {
status_led_blink ();
return rcode;
}
pattern &= 0x0f;
- set_leds (pattern);
+ for (i = 0; i < 4; i++) {
+ if (pattern & 0x01) status_led_set (i, STATUS_LED_ON);
+ else status_led_set (i, STATUS_LED_OFF);
+ pattern = pattern >> 1;
+ }
return rcode;
}
U_BOOT_CMD(
led, 2, 1, do_led,
- "led - set the led\n",
- NULL
+ "led [bitmask] - set the DIAG-LED\n",
+ "[bitmask] 0x01 = DIAG 1 on\n"
+ " 0x02 = DIAG 2 on\n"
+ " 0x04 = DIAG 3 on\n"
+ " 0x08 = DIAG 4 on\n"
+ " > 0x100 set the LED, who are on, to state blinking\n"
);
#if defined(CONFIG_SHA1_CHECK_UB_IMG)