Hello! I'm having problems with K-TEK-M275TP-FN-BL-ML keyboard
(http://www.key-tek.cn/Productview.asp?id=777). It is USB device with
keyboard and touchpad combined. It works in OS correctly, but doesn't work
in SeaBIOS.
I've tried to debug this issue and found that "usb_kbd_setup" function fails
on "(epdesc->wMaxPacketSize != 8)" check, cause "epdesc->wMaxPacketSize" is
actually 32. I've modified this "if" statement to pass 32 value also and now
function completes successfully. But it didn't help to solve my issue. There
are no interrupts from keyboard, "ehci_poll_intr" always returns -1 on
check:
if (token & QTD_STS_ACTIVE) {
// No intrs found.
return -1;
}
I don't know what to do now. What should I check next?
Does SeaBIOS support USB keyboard+touchpad devices at all?
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Hi,
The following series implements a limited TPM CRB driver. The TIS
device with a TPM 2.0 seems to be ignored by Windows 10, so I
implemented a simple CRB device that I will send shortly on the
qemu-devel. With the CRB device, Windows 10 correctly recognized and
exchange with a TPM 2.0.
As long as the device isn't in qemu, I suppose this series should
remain RFC.
Feedback welcome!
Marc-André Lureau (4):
x86: add readq()
tpm: generalize init_timeout()
tpm: use get_tpm_version() callback
WIP: add TPM CRB device support
src/hw/tpm_drivers.c | 226 ++++++++++++++++++++++++++++++++++++++++++++++++---
src/hw/tpm_drivers.h | 26 ++++++
src/x86.h | 5 ++
3 files changed, 245 insertions(+), 12 deletions(-)
--
2.14.1.146.gd35faa819
Kevin,
is it possible to save a few bytes, a pointer, across a reboot? I
have tried to do this by allocating a memory chunk in the fsegement and
storing the pointer there surrounded by 2 'magic' 32 bit values. When
trying to find the magic values on reboot early in handle_post() it
doesn't seem to find them anymore. Is there another memory segment where
SeaBIOS could store the few bytes and find them again?
Regards,
Stefan
Hello,
I am using Seabios for qemu startup, and interested in the debugging by
GDB to see how the bios works.
Currently, I do it as https://www.seabios.org/Debugging said but met
some problems so that couldn't move on. :(
Could someone give some pointers on what I missed or have to do to
enable the gdb debugging?
Note:
Arch: x86_64 PC
CONFIG_DEBUG_SERIAL is enabled.
CONFIG_RELOCATE_INIT is disabled.
1. After Qemu starts, I run "gdb out/rom32seg.o" in another session,
and do "target remote localhost:1234", it warns me that
"Selected architecture i386 is not compatible with reported target
architecture i386:x86_64". But I didn't find any 64bit rom.
2. I can't set any breakpoints (e.g. maininit), because "Function
maininit not defined". So where does seabios put the symbol table? And
how to break the seabios functions when qemu starts?
Looking forward to your response!
Thanks,
Jing
Several fixes to the floppy driver, so it works on a real floppy controller
with a real floppy. Tested with Coreboot on a motherboard with an ITE IT8712
Super I/O chip (and its built-in floppy controller) and a 1.44MB floppy.
Only one floppy is supported for now and only 1.44MB, but more formats will be
added in the future.
Signed-off-by: Nikolay Nikolov <nickysn(a)users.sourceforge.net>
---
src/hw/floppy.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 69 insertions(+), 14 deletions(-)
diff --git a/src/hw/floppy.c b/src/hw/floppy.c
index f2577c5..674909d 100644
--- a/src/hw/floppy.c
+++ b/src/hw/floppy.c
@@ -34,6 +34,11 @@
#define FLOPPY_GAPLEN 0x1B
#define FLOPPY_FORMAT_GAPLEN 0x6c
#define FLOPPY_PIO_TIMEOUT 1000
+#define FLOPPY_IRQ_TIMEOUT 5000
+#define FLOPPY_STARTUP_TIME 8
+#define FLOPPY_MOTOR_HOLD 255 // Magic value, means motor must not be turned off
+#define FLOPPY_SPECIFY1 0xAF // step rate 12ms, head unload 240ms
+#define FLOPPY_SPECIFY2 0x02 // head load time 4ms, DMA used
// New diskette parameter table adding 3 parameters from IBM
// Since no provisions are made for multiple drive types, most
@@ -191,7 +196,8 @@ static void
floppy_disable_controller(void)
{
dprintf(2, "Floppy_disable_controller\n");
- floppy_dor_write(0x00);
+ // Clear the reset bit (enter reset state) and clear 'enable IRQ and DMA'
+ floppy_dor_write(GET_LOW(FloppyDOR) & ~0x0c);
}
static int
@@ -199,8 +205,9 @@ floppy_wait_irq(void)
{
u8 frs = GET_BDA(floppy_recalibration_status);
SET_BDA(floppy_recalibration_status, frs & ~FRS_IRQ);
+ u32 end = timer_calc(FLOPPY_IRQ_TIMEOUT);
for (;;) {
- if (!GET_BDA(floppy_motor_counter)) {
+ if (timer_check(end)) {
warn_timeout();
floppy_disable_controller();
return DISK_RET_ETIMEOUT;
@@ -226,6 +233,7 @@ floppy_wait_irq(void)
#define FC_READ (0xe6 | (8<<8) | (7<<12) | FCF_WAITIRQ)
#define FC_WRITE (0xc5 | (8<<8) | (7<<12) | FCF_WAITIRQ)
#define FC_FORMAT (0x4d | (5<<8) | (7<<12) | FCF_WAITIRQ)
+#define FC_SPECIFY (0x03 | (2<<8) | (0<<12))
// Send the specified command and it's parameters to the floppy controller.
static int
@@ -302,9 +310,12 @@ static int
floppy_enable_controller(void)
{
dprintf(2, "Floppy_enable_controller\n");
- SET_BDA(floppy_motor_counter, FLOPPY_MOTOR_TICKS);
- floppy_dor_write(0x00);
- floppy_dor_write(0x0c);
+ // Clear the reset bit (enter reset state), but set 'enable IRQ and DMA'
+ floppy_dor_write((GET_LOW(FloppyDOR) & ~0x04) | 0x08);
+ // Real hardware needs a 4 microsecond delay
+ udelay(4);
+ // Set the reset bit (normal operation) and keep 'enable IRQ and DMA' on
+ floppy_dor_write(GET_LOW(FloppyDOR) | 0x0c);
int ret = floppy_wait_irq();
if (ret)
return ret;
@@ -313,6 +324,30 @@ floppy_enable_controller(void)
return floppy_pio(FC_CHECKIRQ, param);
}
+static void
+floppy_turn_on_motor(u8 floppyid)
+{
+ // prevent the motor from being turned off
+ SET_BDA(floppy_motor_counter, FLOPPY_MOTOR_HOLD);
+
+ u8 motor_mask = 0x10 << floppyid;
+ if (GET_LOW(FloppyDOR) & motor_mask) {
+ // If the motor has been started, there's no need to wait for it again
+ floppy_dor_write(motor_mask | 0x0c | floppyid);
+ } else {
+ floppy_dor_write(motor_mask | 0x0c | floppyid);
+
+ msleep(FLOPPY_STARTUP_TIME * 125);
+ }
+}
+
+static void
+floppy_turn_off_motor_delayed(void)
+{
+ // reset the disk motor timeout value of INT 08
+ SET_BDA(floppy_motor_counter, FLOPPY_MOTOR_TICKS);
+}
+
// Activate a drive and send a command to it.
static int
floppy_drive_pio(u8 floppyid, int command, u8 *param)
@@ -324,11 +359,8 @@ floppy_drive_pio(u8 floppyid, int command, u8 *param)
return ret;
}
- // reset the disk motor timeout value of INT 08
- SET_BDA(floppy_motor_counter, FLOPPY_MOTOR_TICKS);
-
- // Turn on motor of selected drive, DMA & int enabled, normal operation
- floppy_dor_write((floppyid ? 0x20 : 0x10) | 0x0c | floppyid);
+ // Turn on motor of selected drive and wait for it to get up to speed
+ floppy_turn_on_motor(floppyid);
// Send command.
int ret = floppy_pio(command, param);
@@ -363,6 +395,15 @@ floppy_drive_recal(u8 floppyid)
return DISK_RET_SUCCESS;
}
+static int
+floppy_drive_specify(void)
+{
+ u8 param[2];
+ param[0] = FLOPPY_SPECIFY1;
+ param[1] = FLOPPY_SPECIFY2;
+ return floppy_pio(FC_SPECIFY, param);
+}
+
static int
floppy_drive_readid(u8 floppyid, u8 data_rate, u8 head)
{
@@ -433,13 +474,23 @@ floppy_prep(struct drive_s *drive_gf, u8 cylinder)
!(GET_BDA(floppy_media_state[floppyid]) & FMS_MEDIA_DRIVE_ESTABLISHED)) {
// Recalibrate drive.
int ret = floppy_drive_recal(floppyid);
- if (ret)
+ if (ret) {
+ floppy_turn_off_motor_delayed();
return ret;
+ }
// Sense media.
ret = floppy_media_sense(drive_gf);
- if (ret)
+ if (ret) {
+ floppy_turn_off_motor_delayed();
+ return ret;
+ }
+
+ ret = floppy_drive_specify();
+ if (ret) {
+ floppy_turn_off_motor_delayed();
return ret;
+ }
}
// Seek to cylinder if needed.
@@ -449,8 +500,10 @@ floppy_prep(struct drive_s *drive_gf, u8 cylinder)
param[0] = floppyid;
param[1] = cylinder;
int ret = floppy_drive_pio(floppyid, FC_SEEK, param);
- if (ret)
+ if (ret) {
+ floppy_turn_off_motor_delayed();
return ret;
+ }
SET_BDA(floppy_track[floppyid], cylinder);
}
@@ -489,9 +542,11 @@ floppy_dma_cmd(struct disk_op_s *op, int count, int command, u8 *param)
dprintf(1, "floppy error: %02x %02x %02x %02x %02x %02x %02x\n"
, param[0], param[1], param[2], param[3]
, param[4], param[5], param[6]);
+ floppy_turn_off_motor_delayed();
return DISK_RET_ECONTROLLER;
}
+ floppy_turn_off_motor_delayed();
return DISK_RET_SUCCESS;
}
@@ -663,7 +718,7 @@ floppy_tick(void)
// time to turn off drive(s)?
u8 fcount = GET_BDA(floppy_motor_counter);
- if (fcount) {
+ if (fcount && (fcount != FLOPPY_MOTOR_HOLD)) {
fcount--;
SET_BDA(floppy_motor_counter, fcount);
if (fcount == 0)
--
2.14.3
I'm looking for a simple method that enables a dynamic way to select one of
the several options listed into CBFS bootorder file but unfortunatelly I'm
finding out that this file is static and it could be edited and configured
just on build time.
My specific goal is about a dynamic OS bootstrapping or via USB storage
device or via pci netcard automatically without pressing any keyboard
buttons.
(the auto mode is guaranteed with a gpio signal that it is switches between
these 2 scenarios.)
Is it correct? Do you know if I can use it differently?
Allow setting the path to as, ld, objcopy, objdump, strip and python
from the environment.
This is required for building SeaBIOS on FreeBSD, which will switch
the default ld to lld very soon, and lld is not capable of building
SeaBIOS at the moment.
Building SeaBIOS on FreeBSD after the switch to lld will require
setting LD=/path/to/gnu/ld at build time.
Signed-off-by: Roger Pau Monné <roger.pau(a)citrix.com>
---
Cc: Kevin O'Connor <kevin(a)koconnor.net>
Cc: Ed Maste <emaste(a)freebsd.org>
---
Makefile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index eb8ad58..0fcb1bf 100644
--- a/Makefile
+++ b/Makefile
@@ -17,12 +17,12 @@ CROSS_PREFIX=
ifneq ($(CROSS_PREFIX),)
CC=$(CROSS_PREFIX)gcc
endif
-AS=$(CROSS_PREFIX)as
-LD=$(CROSS_PREFIX)ld
-OBJCOPY=$(CROSS_PREFIX)objcopy
-OBJDUMP=$(CROSS_PREFIX)objdump
-STRIP=$(CROSS_PREFIX)strip
-PYTHON=python
+AS?=$(CROSS_PREFIX)as
+LD?=$(CROSS_PREFIX)ld
+OBJCOPY?=$(CROSS_PREFIX)objcopy
+OBJDUMP?=$(CROSS_PREFIX)objdump
+STRIP?=$(CROSS_PREFIX)strip
+PYTHON?=python
CPP=cpp
IASL:=iasl
LD32BIT_FLAG:=-melf_i386
--
2.15.1
Hi,
could anyone explain what is to implement to support different TFT panel sizes and resolutions other than 640x480 in SeaVGABIOS (geodeVGA) for the Geode LX platform?
Regards,
Wolfgang Kamp