summaryrefslogtreecommitdiff
path: root/board/lwmon/lwmon.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/lwmon/lwmon.c')
-rw-r--r--board/lwmon/lwmon.c56
1 files changed, 20 insertions, 36 deletions
diff --git a/board/lwmon/lwmon.c b/board/lwmon/lwmon.c
index b359ec758d..f1544ae38e 100644
--- a/board/lwmon/lwmon.c
+++ b/board/lwmon/lwmon.c
@@ -38,6 +38,7 @@ V* Verification: dzu@denx.de
#include <commproc.h>
#include <i2c.h>
#include <command.h>
+#include <cmd_bsp.h>
#include <malloc.h>
#include <post.h>
@@ -72,9 +73,9 @@ const uint sdram_table[] =
/*
* SDRAM Initialization (offset 5 in UPM RAM)
*
- * This is no UPM entry point. The following definition uses
- * the remaining space to establish an initialization
- * sequence, which is executed by a RUN command.
+ * This is no UPM entry point. The following definition uses
+ * the remaining space to establish an initialization
+ * sequence, which is executed by a RUN command.
*
*/
0x1FF5FC34, 0xEFEABC34, 0x1FB57C35, /* last */
@@ -120,9 +121,9 @@ const uint sdram_table[] =
/*
* SDRAM Initialization (offset 5 in UPM RAM)
*
- * This is no UPM entry point. The following definition uses
- * the remaining space to establish an initialization
- * sequence, which is executed by a RUN command.
+ * This is no UPM entry point. The following definition uses
+ * the remaining space to establish an initialization
+ * sequence, which is executed by a RUN command.
*
*/
0x1FF5FC34, 0xEFEABC34, 0x1FB57C35, /* last */
@@ -131,7 +132,7 @@ const uint sdram_table[] =
*/
0x0E2DBC04, 0x10AF7C04, 0xF0AFFC00, 0xF0AFFC00,
0xF1AFFC00, 0xEFBAFC00, 0x1FF5FC47, /* last */
- _NOT_USED_,
+ _NOT_USED_,
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
/*
@@ -145,7 +146,7 @@ const uint sdram_table[] =
*/
0x0E29BC04, 0x10A77C00, 0xF0AFFC00, 0xF0AFFC00,
0xE1BAFC04, 0x1FF5FC47, /* last */
- _NOT_USED_, _NOT_USED_,
+ _NOT_USED_, _NOT_USED_,
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
_NOT_USED_, _NOT_USED_, _NOT_USED_, _NOT_USED_,
/*
@@ -510,9 +511,12 @@ static void kbd_init (void)
int i;
i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
-
+
gd->kbd_status = 0;
+ /* Forced by PIC. Delays <= 175us loose */
+ udelay(1000);
+
/* Read initial keyboard error code */
val = KEYBD_CMD_READ_STATUS;
i2c_write (kbd_addr, 0, 0, &val, 1);
@@ -542,13 +546,13 @@ static void kbd_init (void)
/*
* Read current keyboard state.
*
- * After the error reset it may take some time before the
- * keyboard PIC picks up a valid keyboard scan - the total
- * scan time is approx. 1.6 ms (information by Martin Rajek,
- * 28 Sep 2002). We read a couple of times for the keyboard
- * to stabilize, using a big enough delay.
- * 10 times should be enough. If the data is still changing,
- * we use what we get :-(
+ * After the error reset it may take some time before the
+ * keyboard PIC picks up a valid keyboard scan - the total
+ * scan time is approx. 1.6 ms (information by Martin Rajek,
+ * 28 Sep 2002). We read a couple of times for the keyboard
+ * to stabilize, using a big enough delay.
+ * 10 times should be enough. If the data is still changing,
+ * we use what we get :-(
*/
memset (tmp_data, 0xFF, KEYBD_DATALEN); /* impossible value */
@@ -848,12 +852,6 @@ int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
printf ("Usage:\n%s\n", cmdtp->usage);
return 1;
}
-cmd_tbl_t U_BOOT_CMD(pic) = MK_CMD_ENTRY(
- "pic", 4, 1, do_pic,
- "pic - read and write PIC registers\n",
- "read reg - read PIC register `reg'\n"
- "pic write reg val - write value `val' to PIC register `reg'\n"
-);
/***********************************************************************
F* Function: int do_kbd (cmd_tbl_t *cmdtp, int flag,
@@ -907,12 +905,6 @@ int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-cmd_tbl_t U_BOOT_CMD(kdb) = MK_CMD_ENTRY(
- "kbd", 1, 1, do_kbd,
- "kbd - read keyboard status\n",
- NULL
-);
-
/* Read and set LSB switch */
#define CFG_PC_TXD1_ENA 0x0008 /* PC.12 */
@@ -979,14 +971,6 @@ int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
-cmd_tbl_t U_BOOT_CMD(lsb) = MK_CMD_ENTRY(
- "lsb", 2, 1, do_lsb,
- "lsb - check and set LSB switch\n",
- "on - switch LSB on\n"
- "lsb off - switch LSB off\n"
- "lsb - print current setting\n"
-);
-
#endif /* CFG_CMD_BSP */
/*----------------------------- Utilities -----------------------------*/