+ /* try to determine display type from the value
+ * defined by pull-ups
+ */
+ gpio->PCUP = (gpio->PCUP & 0xFFF0); /* activate GPC0...GPC3 pullups */
+ gpio->PCCON = (gpio->PCCON & 0xFFFFFF00); /* configure GPC0...GPC3 as inputs */
+ udelay (10); /* allow signals to settle */
+ vfd_board_id = (~gpio->PCDAT) & 0x000F; /* read GPC0...GPC3 port pins */
+
+ VFD_DISABLE; /* activate blank for the vfd */
+
+#define NEW_CPLD_CLK
+
+#ifdef NEW_CPLD_CLK
+ if (vfd_board_id) {
+ /* If new board revision, then use PWM 3 as cpld-clock */
+ /* Enable 500 Hz timer for fill level sensor to operate properly */
+ /* Configure TOUT3 as functional pin, disable pull-up */
+ gpio->PDCON &= ~0x30000;
+ gpio->PDCON |= 0x20000;
+ gpio->PDUP |= (1 << 8);
+
+ /* Configure the prescaler */
+ timers->TCFG0 &= ~0xff00;
+ timers->TCFG0 |= 0x0f00;
+
+ /* Select MUX input (divider) for timer3 (1/16) */
+ timers->TCFG1 &= ~0xf000;
+ timers->TCFG1 |= 0x3000;
+
+ /* Enable autoreload and set the counter and compare
+ * registers to values for the 500 Hz clock
+ * (for a given prescaler (15) and divider (16)):
+ * counter = (66000000 / 500) >> 9;
+ */
+ timers->ch[3].TCNTB = 0x101;
+ timers->ch[3].TCMPB = 0x101 / 2;
+
+ /* Start timer */
+ timers->TCON = (timers->TCON | UPDATE3 | RELOAD3) & ~INVERT3;
+ timers->TCON = (timers->TCON | START3) & ~UPDATE3;
+ }
+#endif
+ /* If old board revision, then use vm-signal as cpld-clock */
+ lcd->LCDCON2 = 0x00FFC000;
+ lcd->LCDCON3 = 0x0007FF00;
+ lcd->LCDCON4 = 0x00000000;
+ lcd->LCDCON5 = 0x00000400;
+ lcd->LCDCON1 = 0x00000B75;
+ /* VM (GPD1) is used as clock for the CPLD */
+ gpio->PDCON = (gpio->PDCON & 0xFFFFFFF3) | 0x00000008;