Add Goldfish serial port device
Goldfish serial port device emulation.
The following was taken from AOSP emulator documentation :
<AOSP>/external/qemu/GOLDFISH-VIRTUAL-HARDWARE.TXT
$QEMU=qemu-android : new code base QEMU with ranchu machine
$KERNEL=https://android.googlesource.com/kernel/goldfish.git
Relevant files:
$QEMU/hw/char/goldfish_tty.c
$KERNEL/drivers/char/goldfish_tty.c
Device properties:
Name: goldfish_tty
Id: 0 to N
IrqCount: 1
I/O Registers:
0x00 W PUT_CHAR : Write a single 8-bit value.
0x04 R BYTES_READY : Read the number of available input bytes.
0x08 W CMD : Send command (see below).
0x10 W DATA_PTR : Write kernel buffer address.
0x14 W DATA_LEN : Write kernel buffer size.
# For 64-bit guest CPUs only:
0x18 W DATA_PTR_HIGH : Write high 32 bits of kernel buffer address.
Each instance of this device implements a virtual serial port
that contains a small internal buffer where incoming data is
stored until the kernel fetches it.
The CMD I/O register is used to send various commands to the
device, identified by the following values:
0x00 CMD_INT_DISABLE Disable device.
0x01 CMD_INT_ENABLE Enable device.
0x02 CMD_WRITE_BUFFER Write buffer from kernel to device.
0x03 CMD_READ_BUFFER Read buffer from device to kernel.
Change-Id: Ide6593473f32f97e6e5b6d27fa795073a8ccf74a
2 files changed