staticunsignedchar led_type; /* bitmask of LED_HAS_XXX */ staticunsignedchar lastleds; /* LED state from most recent update */ staticunsignedchar lcd_new_text; staticunsignedchar lcd_text[20]; staticunsignedchar lcd_no_led_support; /* KittyHawk doesn't support LED on its LCD */
struct lcd_block { unsignedchar command; /* stores the command byte */ unsignedchar on; /* value for turning LED on */ unsignedchar off; /* value for turning LED off */
};
/* Structure returned by PDC_RETURN_CHASSIS_INFO */ /* NOTE: we use unsigned long:16 two times, since the following member
lcd_cmd_reg_addr needs to be 64bit aligned on 64bit PA2.0-machines */ struct pdc_chassis_lcd_info_ret_block { unsignedlong model:16; /* DISPLAY_MODEL_XXXX */ unsignedlong lcd_width:16; /* width of the LCD in chars (DISPLAY_MODEL_LCD only) */ unsignedlong lcd_cmd_reg_addr; /* ptr to LCD cmd-register & data ptr for LED */ unsignedlong lcd_data_reg_addr; /* ptr to LCD data-register (LCD only) */ unsignedint min_cmd_delay; /* delay in uS after cmd-write (LCD only) */ unsignedchar reset_cmd1; /* command #1 for writing LCD string (LCD only) */ unsignedchar reset_cmd2; /* command #2 for writing LCD string (LCD only) */ unsignedchar act_enable; /* 0 = no activity (LCD only) */ struct lcd_block heartbeat; struct lcd_block disk_io; struct lcd_block lan_rcv; struct lcd_block lan_tx; char _pad;
};
/* LCD_CMD and LCD_DATA for KittyHawk machines */ #define KITTYHAWK_LCD_CMD F_EXTEND(0xf0190000UL) #define KITTYHAWK_LCD_DATA (KITTYHAWK_LCD_CMD + 1)
/* lcd_info is pre-initialized to the values needed to program KittyHawk LCD's
* HP seems to have used Sharp/Hitachi HD44780 LCDs most of the time. */ staticstruct pdc_chassis_lcd_info_ret_block
lcd_info __attribute__((aligned(8))) =
{
.model = DISPLAY_MODEL_NONE,
.lcd_width = 16,
.lcd_cmd_reg_addr = KITTYHAWK_LCD_CMD,
.lcd_data_reg_addr = KITTYHAWK_LCD_DATA,
.min_cmd_delay = 80,
.reset_cmd1 = 0x80,
.reset_cmd2 = 0xc0,
};
/* direct access to some of the lcd_info variables */ #define LCD_CMD_REG lcd_info.lcd_cmd_reg_addr #define LCD_DATA_REG lcd_info.lcd_data_reg_addr #define LED_DATA_REG lcd_info.lcd_cmd_reg_addr /* LASI & ASP only */
/* ptr to LCD/LED-specific function */ staticvoid (*led_func_ptr) (unsignedchar);
staticvoid lcd_print_now(void)
{ int i; char *str = lcd_text;
if (lcd_info.model != DISPLAY_MODEL_LCD) return;
if (!lcd_new_text) return;
lcd_new_text = 0;
/* Set LCD Cursor to 1st character */
gsc_writeb(lcd_info.reset_cmd1, LCD_CMD_REG);
udelay(lcd_info.min_cmd_delay);
/* Print the string */ for (i = 0; i < lcd_info.lcd_width; i++) {
gsc_writeb(*str ? *str++ : ' ', LCD_DATA_REG);
udelay(lcd_info.min_cmd_delay);
}
}
/** *lcd_print() * *@str:stringtoshowontheLCD.IfNULL,printcurrentstringagain. * *DisplaysthegivenstringontheLCD-Displayofnewermachines.
*/ void lcd_print(constchar *str)
{ /* copy display string to buffer for procfs */ if (str)
strscpy(lcd_text, str, sizeof(lcd_text));
lcd_new_text = 1;
/* print now if LCD without any LEDs */ if (led_type == LED_HAS_LCD)
lcd_print_now();
}
#define LED_DATA 0x01 /* data to shift (0:on 1:off) */ #define LED_STROBE 0x02 /* strobe to clock data */
/* Work around the buggy PDC of KittyHawk-machines */ switch (CPU_HVERSION) { case0x580: /* KittyHawk DC2-100 (K100) */ case0x581: /* KittyHawk DC3-120 (K210) */ case0x582: /* KittyHawk DC3 100 (K400) */ case0x583: /* KittyHawk DC3 120 (K410) */ case0x58B: /* KittyHawk DC2 100 (K200) */
pr_info("LCD on KittyHawk-Machine found.\n");
lcd_info.model = DISPLAY_MODEL_LCD; /* KittyHawk has no LED support on its LCD, so skip LED detection */
lcd_no_led_support = 1; goto found; /* use the preinitialized values of lcd_info */
}
/* initialize the struct, so that we can check for valid return values */
chassis_info.actcnt = chassis_info.maxcnt = 0;
ret = pdc_chassis_info(&chassis_info, &lcd_info, sizeof(lcd_info)); if (ret != PDC_OK) {
not_found:
lcd_info.model = DISPLAY_MODEL_NONE; return1;
}
/* check the results. Some machines have a buggy PDC */ if (chassis_info.actcnt <= 0 || chassis_info.actcnt != chassis_info.maxcnt) goto not_found;
switch (lcd_info.model) { case DISPLAY_MODEL_LCD: /* LCD display */ if (chassis_info.actcnt <
offsetof(struct pdc_chassis_lcd_info_ret_block, _pad)-1) goto not_found; if (!lcd_info.act_enable) { /* PDC tells LCD should not be used. */ goto not_found;
} break;
case DISPLAY_MODEL_NONE: /* no LED or LCD available */ goto not_found;
case DISPLAY_MODEL_LASI: /* Lasi style 8 bit LED display */ if (chassis_info.actcnt != 8 && chassis_info.actcnt != 32) goto not_found; break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.