[coreboot-gerrit] Patch set updated for coreboot: 0cd4d87 samus: Fix codec interrupt and add GPIO defines

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Thu Apr 2 16:44:12 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9216

-gerrit

commit 0cd4d8729bb75a732cda08d7c8a190ad587fc90c
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Mon Sep 29 09:30:36 2014 -0700

    samus: Fix codec interrupt and add GPIO defines
    
    The codec interrupt needs to come from codec GPIO1, so use the
    HOTWORD_DET GPIO as the codec IRQ and the DSP_INT as the wake.The
    
    This means codec interrupt is GPIO46 which is PIRQO and should be
    interrupt 30.
    
    Also add GPIO defines for the GPIOs attached to the codec itself.
    These are defined by index, and I used the same "jack detect" and
    "mic present" indices that were used in baytrail.
    
    The codec interrupt to the host is added at index 2 and the
    hostword detect interrupt to the host is added at index 3.
    
    These can be changed as we work through the implementation in the
    kernel driver.
    
    BUG=chrome-os-partner:29649
    BRANCH=samus
    TEST=build and boot on samus
    
    Change-Id: Id9cb083ddf9df161be314da4148740ed9f4d0fe6
    Signed-off-by: Stefan Reinauer <reinauer at chromium.org>
    Original-Commit-Id: 3958efb28813c664a8a4219f78bdd0fcfe75c706
    Original-Change-Id: I1c1ac1b6095fab7e3f4412555db4f9a9138e528b
    Original-Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/220326
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/mainboard/google/samus/acpi/mainboard.asl | 57 +++++++++++++++++----------
 src/mainboard/google/samus/gpio.h             |  4 +-
 2 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/src/mainboard/google/samus/acpi/mainboard.asl b/src/mainboard/google/samus/acpi/mainboard.asl
index 6a2cb97..2bb34fd 100644
--- a/src/mainboard/google/samus/acpi/mainboard.asl
+++ b/src/mainboard/google/samus/acpi/mainboard.asl
@@ -169,6 +169,8 @@ Scope (\_SB.PCI0.I2C0)
 		Name (_HID, "RT5677CE")
 		Name (_DDN, "RT5667 Codec")
 		Name (_UID, 1)
+		Name (WAKE, 45) /* DSP_INT (use as codec wake) */
+
 		Name (_CRS, ResourceTemplate()
 		{
 			I2cSerialBus (
@@ -178,38 +180,53 @@ Scope (\_SB.PCI0.I2C0)
 				AddressingMode7Bit,       // AddressingMode
 				"\\_SB.PCI0.I2C0",        // ResourceSource
 			)
-			Interrupt (ResourceConsumer, Edge, ActiveLow){ 30 }
-		})
-		Method (_STA)
-		{
-			If (LEqual (\S1EN, 1)) {
-				Return (0xF)
-			} Else {
-				Return (0x0)
-			}
-		}
-	}
 
-	Device (HOTW)
-	{
-		Name (_HID, "PNP0A05")
-		Name (_DDN, "Hotword Wake")
-		Name (_UID, 1)
-		Name (GPIO, 46) /* HOTWORD_DET_L_3V3 */
+			/* GPIO46 is PIRQO (use HOTWORD_DET as codec IRQ) */
+			Interrupt (ResourceConsumer, Edge, ActiveLow) { 30 }
+
+			/*
+			 * Codec GPIOs are 1-based in the schematic
+			 *
+			 * [0] = Jack Detect (INPUT)
+			 * [1] = Mic Present (INPUT)
+			 * [2] = Interrupt to the host (OUTPUT)
+			 * [3] = Interrupt to the host (OUTPUT)
+			 */
+
+			/* Index 0:  Jack Detect - PLUG_DET is GPIO5 */
+			GpioIo (Exclusive, PullUp, , , IoRestrictionInputOnly,
+				"\\_SB.PCI0.I2C0.CODC") { 4 }
+
+			/* Index 1:  Mic Present - MIC_PRESENT_L is GPIO6 */
+			GpioIo (Exclusive, PullUp, , , IoRestrictionInputOnly,
+				"\\_SB.PCI0.I2C0.CODC") { 5 }
+
+			/* Index 2:  Codec IRQ - HOTWORD_DET_L is GPIO1 */
+			GpioIo (Exclusive, PullUp, , , IoRestrictionOutputOnly,
+				"\\_SB.PCI0.I2C0.CODC") { 0 }
+
+			/* Index 3:  Codec Wake - DSP_INT is GPIO4 */
+			GpioIo (Exclusive, PullUp, , , IoRestrictionOutputOnly,
+				"\\_SB.PCI0.I2C0.CODC") { 3 }
+		})
 
-		Name (_PRW, Package() { GPIO, 3 })
+		Name (_PRW, Package() { WAKE, 3 })
 
 		Method (_DSW, 3, NotSerialized)
 		{
 			If (LEqual (Arg0, 1)) {
 				// Enable GPIO as wake source
-				\_SB.PCI0.LPCB.GPIO.GWAK (^GPIO)
+				\_SB.PCI0.LPCB.GPIO.GWAK (^WAKE)
 			}
 		}
 
 		Method (_STA)
 		{
-			Return (0xF)
+			If (LEqual (\S1EN, 1)) {
+				Return (0xF)
+			} Else {
+				Return (0x0)
+			}
 		}
 	}
 }
diff --git a/src/mainboard/google/samus/gpio.h b/src/mainboard/google/samus/gpio.h
index f293dee..393a14f 100644
--- a/src/mainboard/google/samus/gpio.h
+++ b/src/mainboard/google/samus/gpio.h
@@ -73,8 +73,8 @@ static const struct gpio_config mainboard_gpio_config[] = {
 	PCH_GPIO_UNUSED,        /* 42: WLAN_DISABLE_L */
 	PCH_GPIO_OUT_HIGH,      /* 43: PP1800_CODEC_EN */
 	PCH_GPIO_UNUSED,        /* 44: UNUSED */
-	PCH_GPIO_PIRQ,          /* 45: DSP_INT (PIRQN) */
-	PCH_GPIO_ACPI_SCI,      /* 46: HOTWORD_DET_L_3V3 (WAKE) */
+	PCH_GPIO_ACPI_SCI,      /* 45: DSP_INT - Codec Wake */
+	PCH_GPIO_PIRQ,          /* 46: HOTWORD_DET_L_3V3 (PIRQO) - Codec IRQ */
 	PCH_GPIO_OUT_LOW,       /* 47: SSD_RESET_L */
 	PCH_GPIO_UNUSED,        /* 48: UNUSED */
 	PCH_GPIO_UNUSED,        /* 49: UNUSED */



More information about the coreboot-gerrit mailing list