summaryrefslogtreecommitdiff
path: root/board/netphone/phone_console.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-04-18 10:13:26 +0000
committerwdenk <wdenk>2004-04-18 10:13:26 +0000
commitc26e454dfc6650428854fa2db3b1ed7f19e0ba0e (patch)
tree2ad2368558e366e127683028a71381cb1dd37140 /board/netphone/phone_console.c
parentea66bc8804b66633faae5b7066571c9d68b4d14a (diff)
downloadu-boot-imx-c26e454dfc6650428854fa2db3b1ed7f19e0ba0e.zip
u-boot-imx-c26e454dfc6650428854fa2db3b1ed7f19e0ba0e.tar.gz
u-boot-imx-c26e454dfc6650428854fa2db3b1ed7f19e0ba0e.tar.bz2
Patches by Pantelis Antoniou, 16 Apr 2004:
- add support for a new version of an Intracom board and fix various other things on others. - add verify support to the crc32 command (define CONFIG_CRC32_VERIFY to enable it) - fix FEC driver for MPC8xx systems: 1. fix compilation problems for boards that use dynamic allocation of DPRAM 2. shut down FEC after network transfers - HUSH parser fixes: 1. A new test command was added. This is a simplified version of the one in the bourne shell. 2. A new exit command was added which terminates the current executing script. 3. Fixed handing of $? (exit code of last executed command)
Diffstat (limited to 'board/netphone/phone_console.c')
-rw-r--r--board/netphone/phone_console.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/board/netphone/phone_console.c b/board/netphone/phone_console.c
index 0a7e607..a0485b0 100644
--- a/board/netphone/phone_console.c
+++ b/board/netphone/phone_console.c
@@ -62,6 +62,7 @@
#define KP_FORCE_DELAY_HZ (CFG_HZ/2) /* key was force pressed */
#define KP_IDLE_DELAY_HZ (CFG_HZ/2) /* key was released and idle */
+#if CONFIG_NETPHONE_VERSION == 1
#define KP_SPI_RXD_PORT (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat)
#define KP_SPI_RXD_MASK 0x0008
@@ -70,6 +71,16 @@
#define KP_SPI_CLK_PORT (((volatile immap_t *)CFG_IMMR)->im_ioport.iop_pcdat)
#define KP_SPI_CLK_MASK 0x0001
+#elif CONFIG_NETPHONE_VERSION == 2
+#define KP_SPI_RXD_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
+#define KP_SPI_RXD_MASK 0x00000008
+
+#define KP_SPI_TXD_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
+#define KP_SPI_TXD_MASK 0x00000004
+
+#define KP_SPI_CLK_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pbdat)
+#define KP_SPI_CLK_MASK 0x00000002
+#endif
#define KP_CS_PORT (((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat)
#define KP_CS_MASK 0x00000010
@@ -975,9 +986,19 @@ unsigned int kp_get_col_mask(unsigned int row_mask)
val = 0x80 | (row_mask & 0x7F);
(void)kp_data_transfer(val);
+#if CONFIG_NETPHONE_VERSION == 1
col_mask = kp_data_transfer(val) & 0x0F;
+#elif CONFIG_NETPHONE_VERSION == 2
+ col_mask = ((volatile immap_t *)CFG_IMMR)->im_cpm.cp_pedat & 0x0f;
+ /* XXX FUCK FUCK FUCK FUCK FUCK!!!! */
+ col_mask = ((col_mask & 0x08) >> 3) | /* BKBR1 */
+ ((col_mask & 0x04) << 1) | /* BKBR2 */
+ (col_mask & 0x02) | /* BKBR3 */
+ ((col_mask & 0x01) << 2); /* BKBR4 */
+#endif
/* printf("col_mask(row_mask = 0x%x) -> col_mask = 0x%x\n", row_mask, col_mask); */
+
return col_mask;
}