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)
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 @@
 
 	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;
 }