Vladimir Serbinenko (phcoder@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5242
-gerrit
commit 811491fed1c221e1e13aa4bc56b8e8629b1be38a Author: Vladimir Serbinenko phcoder@gmail.com Date: Sat Feb 15 19:13:00 2014 +0100
lenovo/x60: Enable Infrared port.
Change-Id: I8ce0195bc85a983627826b31eb9879c3dbc80dd9 Signed-off-by: Vladimir Serbinenko phcoder@gmail.com --- src/drivers/lenovo/lenovo.h | 3 ++- src/drivers/lenovo/wacom.c | 44 ++++++++++++++++++++++++++++++++- src/mainboard/lenovo/x201/acpi_tables.c | 2 +- src/mainboard/lenovo/x60/acpi_tables.c | 2 +- src/mainboard/lenovo/x60/devicetree.cb | 4 +++ src/mainboard/lenovo/x60/romstage.c | 2 +- 6 files changed, 52 insertions(+), 5 deletions(-)
diff --git a/src/drivers/lenovo/lenovo.h b/src/drivers/lenovo/lenovo.h index 4c44119..06b52e5 100644 --- a/src/drivers/lenovo/lenovo.h +++ b/src/drivers/lenovo/lenovo.h @@ -1,3 +1,4 @@ int drivers_lenovo_is_wacom_present(void); void drivers_lenovo_serial_ports_ssdt_generate(const char *scope, - int have_dock_serial); + int have_dock_serial, + int have_infrared); diff --git a/src/drivers/lenovo/wacom.c b/src/drivers/lenovo/wacom.c index f786ed1..f7987ff 100644 --- a/src/drivers/lenovo/wacom.c +++ b/src/drivers/lenovo/wacom.c @@ -90,7 +90,8 @@ drivers_lenovo_is_wacom_present(void)
void drivers_lenovo_serial_ports_ssdt_generate(const char *scope, - int have_dock_serial) + int have_dock_serial, + int have_infrared) { int scopelen, devicelen, reslen, methodlen;
@@ -132,6 +133,47 @@ drivers_lenovo_serial_ports_ssdt_generate(const char *scope, scopelen += devicelen; }
+ if (have_infrared) { + /* Device op. */ + scopelen += acpigen_emit_byte(0x5b); + scopelen += acpigen_emit_byte(0x82); + devicelen = acpigen_write_len_f(); + devicelen += acpigen_emit_namestring("FIR"); + + devicelen += acpigen_write_name("_HID"); + devicelen += acpigen_emit_eisaid("IBM0071"); + devicelen += acpigen_write_name("_CID"); + devicelen += acpigen_emit_eisaid("PNP0511"); + devicelen += acpigen_write_name("_UID"); + + /* One */ + devicelen += acpigen_write_byte(0x1); + devicelen += acpigen_write_name("_CRS"); + + reslen = acpigen_write_resourcetemplate_header(); + reslen += acpigen_write_io16(0x2f8, 0x2f8, 1, 8, 1); + reslen += acpigen_write_irq(0x08); + + devicelen += reslen; + devicelen += acpigen_write_resourcetemplate_footer(reslen); + + /* method op */ + devicelen += acpigen_emit_byte(0x14); + methodlen = acpigen_write_len_f(); + methodlen += acpigen_emit_namestring("_STA"); + /* no fnarg */ + methodlen += acpigen_emit_byte(0x00); + /* return */ + methodlen += acpigen_emit_byte(0xa4); + methodlen += acpigen_write_byte(0xf); + acpigen_patch_len(methodlen); + + devicelen += methodlen; + + acpigen_patch_len(devicelen - 1); + scopelen += devicelen; + } + if (have_dock_serial) { /* Device op. */ scopelen += acpigen_emit_byte(0x5b); diff --git a/src/mainboard/lenovo/x201/acpi_tables.c b/src/mainboard/lenovo/x201/acpi_tables.c index b6e99dd..710e369 100644 --- a/src/mainboard/lenovo/x201/acpi_tables.c +++ b/src/mainboard/lenovo/x201/acpi_tables.c @@ -94,7 +94,7 @@ unsigned long acpi_fill_ssdt_generator(unsigned long current, const char *oem_table_id) { generate_cpu_entries(); - drivers_lenovo_serial_ports_ssdt_generate("\_SB.PCI0.LPCB", 0); + drivers_lenovo_serial_ports_ssdt_generate("\_SB.PCI0.LPCB", 0, 0); return (unsigned long)(acpigen_get_current()); }
diff --git a/src/mainboard/lenovo/x60/acpi_tables.c b/src/mainboard/lenovo/x60/acpi_tables.c index cf07067..c8fce7f 100644 --- a/src/mainboard/lenovo/x60/acpi_tables.c +++ b/src/mainboard/lenovo/x60/acpi_tables.c @@ -87,7 +87,7 @@ unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_ssdt_generator(unsigned long current, const char *oem_table_id) { generate_cpu_entries(); - drivers_lenovo_serial_ports_ssdt_generate("\_SB.PCI0.LPCB", 1); + drivers_lenovo_serial_ports_ssdt_generate("\_SB.PCI0.LPCB", 1, 1); return (unsigned long) (acpigen_get_current()); }
diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb index 5b4e37f..acd5af3 100644 --- a/src/mainboard/lenovo/x60/devicetree.cb +++ b/src/mainboard/lenovo/x60/devicetree.cb @@ -125,6 +125,10 @@ chip northbridge/intel/i945 chip superio/nsc/pc87382 device pnp 164e.2 on # IR io 0x60 = 0x2f8 + irq 0x29 = 0xb0 + irq 0x70 = 0x3 + drq 0x74 = 0x1 + irq 0xf0 = 0x82 end
device pnp 164e.3 on # Digitizer diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c index 1198fb2..8eca464 100644 --- a/src/mainboard/lenovo/x60/romstage.c +++ b/src/mainboard/lenovo/x60/romstage.c @@ -86,7 +86,7 @@ static void ich7_enable_lpc(void) // decode range pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0210); // decode range - pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x1f0d); + pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x1f0f);
/* range 0x1600 - 0x167f */ pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x84, 0x1601);