Index: c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/ChangeLog	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -1,2 +1,7 @@
+2010-01-18      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
+
+	* configure.ac, console/console.c, include/bsp.h, irq/irq.c,
+	spi/spi.c: various fixes
+
 2009-12-16      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
 
Index: c/src/lib/libbsp/powerpc/tqm8xx/configure.ac
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/configure.ac	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/configure.ac	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -52,5 +52,5 @@
 
 RTEMS_BSPOPTS_SET([CONS_SMC1_MODE],[tqm8xx_stk8xx],[CONS_MODE_POLLED])
-RTEMS_BSPOPTS_SET([CONS_SMC1_MODE],[pghplus],[CONS_MODE_POLLED])
+RTEMS_BSPOPTS_SET([CONS_SMC1_MODE],[pghplus],[CONS_MODE_IRQ])
 RTEMS_BSPOPTS_SET([CONS_SMC1_MODE],[*],[CONS_MODE_UNUSED])
 RTEMS_BSPOPTS_HELP([CONS_SMC1_MODE],
@@ -90,4 +90,22 @@
  interrupt driven (spooled) operation. Set it to CONS_MODE_UNUSED, if not used])
 
+RTEMS_BSPOPTS_SET([SPI_BOARD_INIT_FNC],[pghplus],[bsp_pghplus_spi_init])
+RTEMS_BSPOPTS_SET([SPI_BOARD_INIT_FNC],[*],[bsp_dummy_spi_init])
+RTEMS_BSPOPTS_HELP([SPI_BOARD_INIT_FNC],
+[(BSP--SPI board init function) Specify the function that inits the board 
+ port lines and further devices.])
+
+RTEMS_BSPOPTS_SET([SPI_SEND_STOP_FNC],[pghplus],[bsp_pghplus_spi_send_stop])
+RTEMS_BSPOPTS_SET([SPI_SEND_STOP_FNC],[*],[bsp_dummy_spi_send_stop])
+RTEMS_BSPOPTS_HELP([SPI_SEND_STOP_FNC],
+[(BSP--SPI send stop function) Specify the function that deaddresses SPI 
+ devices. Set to bsp_dummy_spi_send_stop for dummy implementation])
+
+RTEMS_BSPOPTS_SET([SPI_SEND_ADDR_FNC],[pghplus],[bsp_pghplus_spi_sel_addr])
+RTEMS_BSPOPTS_SET([SPI_SEND_ADDR_FNC],[*],[bsp_dummy_spi_sel_addr])
+RTEMS_BSPOPTS_HELP([SPI_SEND_ADDR_FNC],
+[(BSP--SPI send address function) Specify the function that addresses SPI 
+ devices. Set to bsp_dummy_spi_sel_addr for dummy implementation])
+
 # add selection of primary network interface
 RTEMS_BSPOPTS_SET([BSP_USE_NETWORK_FEC],[pghplus],[1])
Index: c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/console/console.c	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/console/console.c	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -500,5 +500,6 @@
 mpc8xx_console_irq_on(const rtems_irq_connect_data *irq)
 {
-    CHN_MASK_SET(irq->name,3);	/* Enable TX and RX interrupts */
+    CHN_MASK_SET(irq->name - BSP_CPM_IRQ_LOWEST_OFFSET,
+		 3);	/* Enable TX and RX interrupts */
 }
 
@@ -506,5 +507,6 @@
 mpc8xx_console_irq_off(const rtems_irq_connect_data *irq)
 {
-    CHN_MASK_SET(irq->name,0);	/* Disable TX and RX interrupts */
+    CHN_MASK_SET(irq->name - BSP_CPM_IRQ_LOWEST_OFFSET,
+		 0);	/* Disable TX and RX interrupts */
 }
 
@@ -512,5 +514,5 @@
 mpc8xx_console_irq_isOn(const rtems_irq_connect_data *irq)
 {
-  return (0 != CHN_MASK_GET(irq->name)); /* Check TX and RX interrupts */
+  return (0 != CHN_MASK_GET(irq->name - BSP_CPM_IRQ_LOWEST_OFFSET)); /* Check TX and RX interrupts */
 }
 
Index: c/src/lib/libbsp/powerpc/tqm8xx/include/bsp.h
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/include/bsp.h	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/include/bsp.h	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -133,4 +133,19 @@
 
 /*
+ * SPI driver configuration
+ */
+
+  /* select values for SPI addressing */
+#define PGHPLUS_SPI_ADDR_EEPROM 0
+#define PGHPLUS_SPI_ADDR_DISP4  1
+  /* NOTE: DISP4 occupies two consecutive addresses for data and control port */
+#define PGHPLUS_SPI_ADDR_DISP4_DATA  (PGHPLUS_SPI_ADDR_DISP4)
+#define PGHPLUS_SPI_ADDR_DISP4_CTRL  (PGHPLUS_SPI_ADDR_DISP4_DATA+1)
+
+  /* bit masks for Port B lines */
+#define PGHPLUS_PB_SPI_EEP_CE_MSK     (1<< 0)
+#define PGHPLUS_PB_SPI_DISP4_RS_MSK   (1<<15)
+#define PGHPLUS_PB_SPI_DISP4_CE_MSK   (1<<14)
+/*
  * our (internal) bus frequency
  */
Index: c/src/lib/libbsp/powerpc/tqm8xx/irq/irq.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/irq/irq.c	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/irq/irq.c	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -53,5 +53,5 @@
 {
   rtems_vector_number vecnum = irqnum - BSP_CPM_IRQ_LOWEST_OFFSET;
-  m8xx.cimr &= ~(1 << (31 - vecnum));
+  m8xx.cimr &= ~(1 << (vecnum));
   return RTEMS_SUCCESSFUL;
 }
@@ -60,5 +60,5 @@
 {
   rtems_vector_number vecnum = irqnum - BSP_CPM_IRQ_LOWEST_OFFSET;
-  m8xx.cimr |= (1 << (31 - vecnum));
+  m8xx.cimr |= (1 << (vecnum));
   return RTEMS_SUCCESSFUL;
 }
@@ -194,8 +194,10 @@
    * make sure CPIC request proper level at SIU interrupt controller
    */
-  m8xx.cicr  = (0x00e41f00 |
+  m8xx.cicr  = (0x00e41f80 |
 		((BSP_CPM_INTERRUPT/2) << 13));
-
-  return RTEMS_SUCCESSFUL;
+  /*
+   * enable CPIC interrupt in SIU interrupt controller
+   */
+  return bsp_irq_enable_at_SIU(BSP_CPM_INTERRUPT);
 }
 
Index: c/src/lib/libbsp/powerpc/tqm8xx/spi/spi.c
===================================================================
--- c/src/lib/libbsp/powerpc/tqm8xx/spi/spi.c	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/lib/libbsp/powerpc/tqm8xx/spi/spi.c	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -20,5 +20,6 @@
 #include <bsp.h>
 #include <mpc8xx.h>
-#include "spi.h"
+#include <bsp/spi.h>
+#include <libchip/disp_hcms29xx.h>
 #include <rtems/error.h>
 #include <rtems/bspIo.h>
@@ -626,5 +627,5 @@
 | Function:                                                                 |
 \*-------------------------------------------------------------------------*/
-static rtems_status_code bsp_spi_sel_addr
+static rtems_status_code bsp_dummy_spi_sel_addr
 (
 /*-------------------------------------------------------------------------*\
@@ -640,35 +641,98 @@
 /*-------------------------------------------------------------------------*\
 | Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+{			    
+  return  RTEMS_SUCCESSFUL;
+}
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+static rtems_status_code bsp_dummy_spi_send_start
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   dummy function, SPI has no start condition                              |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+ rtems_libi2c_bus_t *bh                  /* bus specifier structure        */
+)
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
 |    o = ok or error code                                                   |
 \*=========================================================================*/
 {
-#if defined(PGH360)
+  return RTEMS_SUCCESSFUL;
+}
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+static rtems_status_code bsp_dummy_spi_send_stop
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   deselect SPI                                                            |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+ rtems_libi2c_bus_t *bh                  /* bus specifier structure        */
+)
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    o = ok or error code                                                   |
+\*=========================================================================*/
+{
+  return RTEMS_SUCCESSFUL;
+}
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+static rtems_status_code bsp_pghplus_spi_sel_addr
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   address a slave device on the bus                                       |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+ rtems_libi2c_bus_t *bh,                 /* bus specifier structure        */
+ uint32_t addr,                          /* address to send on bus         */
+ int rw                                  /* 0=write,1=read                 */
+)
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+{			    
+#if defined(PGHPLUS)
+  pbdat_val = m8xx.pbdat | (PGHPLUS_SPI_PB_DISP4_RS_MSK |
+			    PGHPLUS_SPI_PB_DISP4_CE_MSK |
+			    PGHPLUS_SPI_PB_EEP_CE_MSK);
   /*
    * select given device
    */
-  /*
-   * GPIO1[24] is SPI_A0
-   * GPIO1[25] is SPI_A1
-   * GPIO1[26] is SPI_A2
-   * set pins to address
-   */
   switch(addr) {
-  case PGH360_SPI_ADDR_EEPROM:
-    m8xx.pbdat &= ~PGH360_PB_SPI_EEP_CE_MSK;
+  case PGHPLUS_SPI_ADDR_EEPROM:
+    pbdat_val &= ~PGHPLUS_SPI_PB_EEP_CE_MSK;
     break;
-  case PGH360_SPI_ADDR_DISP4_DATA:
-    m8xx.pbdat = (m8xx.pbdat
-		  & ~(PGH360_PB_SPI_DISP4_CE_MSK |
-		      PGH360_PB_SPI_DISP4_RS_MSK));
+  case PGHPLUS_SPI_ADDR_DISP4_DATA:
+    pbdat_val = (m8xx.pbdat
+		  & ~(PGHPLUS_PB_SPI_DISP4_CE_MSK |
+		      PGHPLUS_PB_SPI_DISP4_RS_MSK));
     break;
-  case PGH360_SPI_ADDR_DISP4_CTRL:
-    m8xx.pbdat = (m8xx.pbdat
-		  & ~(PGH360_PB_SPI_DISP4_CE_MSK)
-		  |   PGH360_PB_SPI_DISP4_RS_MSK);
+  case PGHPLUS_SPI_ADDR_DISP4_CTRL:
+    pbdat_val = (m8xx.pbdat
+		  & ~(PGHPLUS_PB_SPI_DISP4_CE_MSK)
+		  |   PGHPLUS_PB_SPI_DISP4_RS_MSK);
     break;
   default:
     return RTEMS_INVALID_NUMBER;
   }
-#endif /* PGH360 */
+  m8xx_pbdat = pbdat_val
+#endif /* PGHPLUS */
   return  RTEMS_SUCCESSFUL;
 }
@@ -677,9 +741,9 @@
 | Function:                                                                 |
 \*-------------------------------------------------------------------------*/
-static rtems_status_code bsp_spi_send_start_dummy
-(
-/*-------------------------------------------------------------------------*\
-| Purpose:                                                                  |
-|   dummy function, SPI has no start condition                              |
+static rtems_status_code bsp_pghplus_spi_send_stop
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   deselect SPI                                                            |
 +---------------------------------------------------------------------------+
 | Input Parameters:                                                         |
@@ -692,19 +756,30 @@
 \*=========================================================================*/
 {
-  return 0;
-}
-
-/*=========================================================================*\
-| Function:                                                                 |
-\*-------------------------------------------------------------------------*/
-static rtems_status_code bsp_spi_send_stop
-(
-/*-------------------------------------------------------------------------*\
-| Purpose:                                                                  |
-|   deselect SPI                                                            |
-+---------------------------------------------------------------------------+
-| Input Parameters:                                                         |
-\*-------------------------------------------------------------------------*/
- rtems_libi2c_bus_t *bh                  /* bus specifier structure        */
+#if defined(DEBUG)
+  printk("bsp_pghplus_spi_send_stop called... ");
+#endif
+    m8xx.pbdat = (m8xx.pbdat
+		  | PGHPLUS_PB_SPI_DISP4_CE_MSK
+		  | PGHPLUS_PB_SPI_EEP_CE_MSK);
+#if defined(DEBUG)
+  printk("... exit OK\r\n");
+#endif
+  return RTEMS_SUCCESSFUL;
+}
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+static rtems_status_code bsp_pghplus_spi_init
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   do board specific init:                                                 |
+|   - initialize pins for addressing                                        |
+|   - register further drivers                                              |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+ int spi_busno
 )
 /*-------------------------------------------------------------------------*\
@@ -713,16 +788,87 @@
 \*=========================================================================*/
 {
-#if defined(DEBUG)
-  printk("bsp_spi_send_stop called... ");
-#endif
-#if defined(PGH360)
-    m8xx.pbdat = (m8xx.pbdat
-		  | PGH360_PB_SPI_DISP4_CE_MSK
-		  | PGH360_PB_SPI_EEP_CE_MSK);
-#endif
+  int ret_code;
+
+#if defined(DEBUG)
+  printk("bsp_pghplus_spi_init called... ");
+#endif
+
+  /*
+   * init port pins used to address/select SPI devices
+   */
+
+  /*
+   * set up ports
+   * LINE      PAR  DIR  DAT
+   * -----------------------
+   * EEP_CE     0    1 act-high
+   * DISP4_CS   0    1 act-high
+   * DISP4_RS   0    1 active
+   */
+
+  /* set Port B Pin Assignment Register... */
+  m8xx.pbpar =
+    (m8xx.pbpar
+     & ~(PGHPLUS_PB_SPI_EEP_CE_MSK
+	 | PGHPLUS_PB_SPI_DISP4_CE_MSK
+	 | PGHPLUS_PB_SPI_DISP4_RS_MSK));
+
+    /* set Port B Data Direction Register... */
+  m8xx.pbdir =
+    m8xx.pbdir
+    | PGHPLUS_PB_SPI_EEP_CE_MSK
+    | PGHPLUS_PB_SPI_DISP4_CE_MSK
+    | PGHPLUS_PB_SPI_DISP4_RS_MSK;
+
+  /* set Port B Data Register to inactive CE state */
+  m8xx.pbdat =
+    m8xx.pbdat
+    | PGHPLUS_PB_SPI_DISP4_CE_MSK
+    | PGHPLUS_PB_SPI_DISP4_RS_MSK;
+
+  /*
+   * register devices
+   */
+  ret_code = rtems_libi2c_register_drv("disp",
+				       disp_hcms29xx_driver_descriptor,
+				       spi_busno,PGHPLUS_SPI_ADDR_DISP4);
+  if (ret_code < 0) {
+    return -ret_code;
+  }
+
 #if defined(DEBUG)
   printk("... exit OK\r\n");
 #endif
-  return 0;
+  return RTEMS_SUCCESSFUL;
+}
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+static rtems_status_code bsp_dummy_spi_init
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   do board specific init:                                                 |
+|   - initialize pins for addressing                                        |
+|   - register further drivers                                              |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+ int spi_busno
+)
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    o = ok or error code                                                   |
+\*=========================================================================*/
+{
+#if defined(DEBUG)
+  printk("bsp_dummy_spi_init called... ");
+#endif
+
+#if defined(DEBUG)
+  printk("... exit OK\r\n");
+#endif
+  return RTEMS_SUCCESSFUL;
 }
 
@@ -733,7 +879,7 @@
 rtems_libi2c_bus_ops_t bsp_spi_ops = {
   init:             m8xx_spi_init,
-  send_start:       bsp_spi_send_start_dummy,
-  send_stop:        bsp_spi_send_stop,
-  send_addr:        bsp_spi_sel_addr,
+  send_start:       bsp_dummy_spi_send_start,
+  send_stop:        SPI_SEND_STOP_FNC,
+  send_addr:        SPI_SEND_ADDR_FNC,
   read_bytes:       m8xx_spi_read_bytes,
   write_bytes:      m8xx_spi_write_bytes,
@@ -781,39 +927,4 @@
   rtems_libi2c_initialize ();
 
-  /*
-   * init port pins used to address/select SPI devices
-   */
-
-#if defined(PGH360)
-
-  /*
-   * set up ports
-   * LINE      PAR  DIR  DAT
-   * -----------------------
-   * EEP_CE     0    1 act-high
-   * DISP4_CS   0    1 act-high
-   * DISP4_RS   0    1 active
-   */
-
-  /* set Port B Pin Assignment Register... */
-  m8xx.pbpar =
-    (m8xx.pbpar
-     & ~(PGH360_PB_SPI_EEP_CE_MSK
-	 | PGH360_PB_SPI_DISP4_CE_MSK
-	 | PGH360_PB_SPI_DISP4_RS_MSK));
-
-    /* set Port B Data Direction Register... */
-  m8xx.pbdir =
-    m8xx.pbdir
-    | PGH360_PB_SPI_EEP_CE_MSK
-    | PGH360_PB_SPI_DISP4_CE_MSK
-    | PGH360_PB_SPI_DISP4_RS_MSK;
-
-  /* set Port B Data Register to inactive CE state */
-  m8xx.pbdat =
-    m8xx.pbdat
-    | PGH360_PB_SPI_DISP4_CE_MSK
-    | PGH360_PB_SPI_DISP4_RS_MSK;
-#endif
 
   /*
@@ -826,22 +937,11 @@
   }
   spi_busno = ret_code;
-#if defined(PGH360)
-  /*
-   * register devices
-   */
-#if 0
-  ret_code = rtems_libi2c_register_drv(RTEMS_BSP_SPI_FLASH_DEVICE_NAME,
-				       spi_flash_m25p40_rw_driver_descriptor,
-				       spi_busno,0x00);
-  if (ret_code < 0) {
-    return -ret_code;
-  }
-#endif
-#endif /* defined(PGH360) */
+
+  SPI_BOARD_INIT_FNC(spi_busno);
   /*
    * FIXME: further drivers, when available
    */
-  return 0;
-}
-
-
+  return RTEMS_SUCCESSFUL;
+}
+
+
Index: c/src/libchip/display/disp_hcms29xx.c
===================================================================
--- c/src/libchip/display/disp_hcms29xx.c	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/libchip/display/disp_hcms29xx.c	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -34,5 +34,5 @@
 #include <bsp.h>
 #include <rtems/libi2c.h>
-#include "disp_hcms29xx.h"
+#include <libchip/disp_hcms29xx.h>
 #include "font_hcms29xx.h"
 #define FONT_BASE font_hcms29xx_base
@@ -59,4 +59,6 @@
   .idle_char = 0
 };
+
+static disp_hcms29xx_drv_t disp_hcms29xx_drv_tbl;
 
 /*=========================================
@@ -545,5 +547,5 @@
 | Input Parameters:                                                         |
 \*-------------------------------------------------------------------------*/
-   rtems_task_argument argument /* softc_ptr */
+   rtems_task_argument argument 
 )
 /*-------------------------------------------------------------------------*\
@@ -556,5 +558,5 @@
   int disp_offset = 0;
   rtems_id disp_hcms29xx_timer_id;
-  disp_hcms29xx_drv_t *softc_ptr = (disp_hcms29xx_drv_t *)argument;
+  disp_hcms29xx_drv_t *softc_ptr = &disp_hcms29xx_drv_tbl;
 
   /*
@@ -749,9 +751,5 @@
 {
   rtems_status_code rc = RTEMS_SUCCESSFUL;
-  static char *devname = {"/dev/disp"};
-  disp_hcms29xx_drv_t *softc_ptr = NULL;
-  /*
-   * FIXME: get softc_ptr
-   */
+  disp_hcms29xx_drv_t *softc_ptr = &disp_hcms29xx_drv_tbl;
 
   /*
@@ -804,11 +802,5 @@
   if (rc == RTEMS_SUCCESSFUL) {
     rc = rtems_task_start(softc_ptr->disp_param.task_id,
-			  disp_hcms29xx_update_task, 0 );
-  }
-  /*
-   * Register the device
-   */
-  if (rc == RTEMS_SUCCESSFUL) {
-    rc = rtems_io_register_name (devname, major, 0);
+			  disp_hcms29xx_update_task,0);
   }
   return rc;
@@ -835,8 +827,5 @@
 \*=========================================================================*/
 {
-  disp_hcms29xx_drv_t *softc_ptr = NULL;
-  /*
-   * FIXME: get softc_ptr
-   */
+  disp_hcms29xx_drv_t *softc_ptr = &disp_hcms29xx_drv_tbl;
   /*
    * ensure, that disp_hcms29xx device is assumed to be empty
@@ -869,8 +858,5 @@
   rtems_libio_rw_args_t *args = arg;
   uint32_t cnt;
-  disp_hcms29xx_drv_t *softc_ptr = NULL;
-  /*
-   * FIXME: get softc_ptr
-   */
+  disp_hcms29xx_drv_t *softc_ptr = &disp_hcms29xx_drv_tbl;
 
   for (cnt = 0;cnt < args->count;cnt++) {
@@ -925,21 +911,29 @@
 \*=========================================================================*/
 {
-  disp_hcms29xx_drv_t *softc_ptr = NULL;
-
-  /*
-   * FIXME: get softc_ptr
-   */
-  return RTEMS_NOT_IMPLEMENTED;
-
-  /* flush buffer, if not empty */
-  if (softc_ptr->disp_param.dev_buf_cnt > 0) {
-      softc_ptr->disp_param.dev_buffer[softc_ptr->disp_param.dev_buf_cnt] =
-	'\0';
-      /*
-       * transfer string to display string, redisplay it...
-       */
-      disp_hcms29xx_update(softc_ptr,softc_ptr->disp_param.dev_buffer);
-      softc_ptr->disp_param.dev_buf_cnt = 0;
-  }
+
   return RTEMS_SUCCESSFUL;
 }
+
+/*
+ * driver operation tables
+ */
+static rtems_driver_address_table disp_hcms29xx_ops = {
+  initialization_entry: disp_hcms29xx_dev_initialize,
+  open_entry:           disp_hcms29xx_dev_open,
+  write_entry:          disp_hcms29xx_dev_write,
+  close_entry:          disp_hcms29xx_dev_close
+};
+
+
+static disp_hcms29xx_drv_t disp_hcms29xx_drv_tbl = {
+  {/* public fields */
+  ops:         &disp_hcms29xx_ops, 
+  size:        sizeof (disp_hcms29xx_drv_t),
+  },
+  { /* our private fields */
+  }
+};
+
+rtems_libi2c_drv_t *disp_hcms29xx_driver_descriptor = 
+  &disp_hcms29xx_drv_tbl.libi2c_drv_entry;
+
Index: c/src/libchip/display/disp_hcms29xx.h
===================================================================
--- c/src/libchip/display/disp_hcms29xx.h	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/libchip/display/disp_hcms29xx.h	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -33,5 +33,5 @@
 
   typedef struct {
-    rtems_device_major_number minor;   /* minor device number            */
+    rtems_device_minor_number minor;   /* minor device number            */
     /*
      * in the disp_buffer, the string to be displayed is placed
@@ -61,6 +61,96 @@
    * pass this descriptor pointer to rtems_libi2c_register_drv
    */
-  extern rtems_libi2c_drv_t *disp_hcms29xx__driver_descriptor;
+  extern rtems_libi2c_drv_t *disp_hcms29xx_driver_descriptor;
 
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+rtems_device_driver disp_hcms29xx_dev_initialize
+  (
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   prepare the display device driver to accept write calls                 |
+|   register device with its name                                           |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+   );
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+rtems_device_driver disp_hcms29xx_dev_open
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   open the display device                                                 |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+ );
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+rtems_device_driver disp_hcms29xx_dev_write
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   write to display device                                                 |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+ );
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+
+/*=========================================================================*\
+| Function:                                                                 |
+\*-------------------------------------------------------------------------*/
+rtems_device_driver disp_hcms29xx_dev_close
+(
+/*-------------------------------------------------------------------------*\
+| Purpose:                                                                  |
+|   close the display device                                                |
++---------------------------------------------------------------------------+
+| Input Parameters:                                                         |
+\*-------------------------------------------------------------------------*/
+  rtems_device_major_number  major,
+  rtems_device_minor_number  minor,
+  void                      *arg
+ );
+/*-------------------------------------------------------------------------*\
+| Return Value:                                                             |
+|    rtems_status_code                                                      |
+\*=========================================================================*/
+
+#define DISP_HCMS29XX_DRIVER {			\
+    disp_hcms29xx_dev_initialize,		\
+      disp_hcms29xx_dev_open,			\
+      NULL,					\
+      disp_hcms29xx_dev_write,			\
+      NULL,					\
+      disp_hcms29xx_dev_close}
+  
+    
 #ifdef __cplusplus
 }
Index: c/src/libchip/display/font_hcms29xx.c
===================================================================
--- c/src/libchip/display/font_hcms29xx.c	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/libchip/display/font_hcms29xx.c	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -1561,5 +1561,5 @@
 };
 
-const struct disp_font_base font_base_hp_fixed_5_7 = {
+const struct disp_font_base font_hcms29xx_base = {
   1,               /* trans */
   {5, 7, 0, -1},  /* fbb w, h, x, y */
Index: c/src/libchip/display/font_hcms29xx.h
===================================================================
--- c/src/libchip/display/font_hcms29xx.h	(revision 1ba96ef99a86794a0fccc477c2f48ac6c3f66a4a)
+++ c/src/libchip/display/font_hcms29xx.h	(revision de592aa6f1a466df53a687173918f2e24a54a925)
@@ -32,6 +32,4 @@
 #endif
 
-extern disp_font_t font_hcms29xx;
-
 extern struct disp_font_base font_hcms29xx_base;
 
