bool have_key;
};
+/* Convert a lower-case character to its ctrl-char equivalent */
+#define CTL_CH(c) ((c) - 'a' + 1)
+
int serial_efi_setbrg(struct udevice *dev, int baudrate)
{
return 0;
static int serial_efi_getc(struct udevice *dev)
{
struct serial_efi_priv *priv = dev_get_priv(dev);
+ char conv_scan[10] = {0, 'p', 'n', 'f', 'b', 'a', 'e', 0, 8};
int ret, ch;
ret = serial_efi_get_key(priv);
* key scan code of 8. Handle this so that backspace works correctly
* in the U-Boot command line.
*/
- if (!ch && priv->key.scan_code == 8)
- ch = 8;
+ if (!ch && priv->key.scan_code < sizeof(conv_scan)) {
+ ch = conv_scan[priv->key.scan_code];
+ if (ch >= 'a')
+ ch -= 'a' - 1;
+ }
debug(" [%x %x %x] ", ch, priv->key.unicode_char, priv->key.scan_code);
return ch;