From 75c83870e51e6bc48a83114c64177432d3204b1f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 5 Sep 2014 01:01:31 +0200 Subject: azalia: Shrink boilerplate Change-Id: Ib3e09644c0ee71aacb067adaa85653d151b52078 Signed-off-by: Vladimir Serbinenko Reviewed-on: http://review.coreboot.org/6840 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Edward O'Callaghan --- src/mainboard/google/bolt/hda_verb.c | 83 +++++++++++ src/mainboard/google/bolt/hda_verb.h | 77 ---------- src/mainboard/google/bolt/mainboard.c | 9 -- src/mainboard/google/butterfly/hda_verb.c | 232 +++++++++++++++++++++++++++++ src/mainboard/google/butterfly/hda_verb.h | 231 ---------------------------- src/mainboard/google/butterfly/mainboard.c | 12 -- src/mainboard/google/falco/hda_verb.c | 101 +++++++++++++ src/mainboard/google/falco/hda_verb.h | 100 ------------- src/mainboard/google/falco/mainboard.c | 12 -- src/mainboard/google/link/hda_verb.c | 140 +++++++++++++++++ src/mainboard/google/link/hda_verb.h | 139 ----------------- src/mainboard/google/link/mainboard.c | 11 -- src/mainboard/google/panther/hda_verb.c | 99 ++++++++++++ src/mainboard/google/panther/hda_verb.h | 98 ------------ src/mainboard/google/panther/mainboard.c | 12 -- src/mainboard/google/parrot/hda_verb.c | 145 ++++++++++++++++++ src/mainboard/google/parrot/hda_verb.h | 144 ------------------ src/mainboard/google/parrot/mainboard.c | 12 -- src/mainboard/google/peppy/hda_verb.c | 105 +++++++++++++ src/mainboard/google/peppy/hda_verb.h | 104 ------------- src/mainboard/google/peppy/mainboard.c | 12 -- src/mainboard/google/samus/hda_verb.c | 7 + src/mainboard/google/slippy/hda_verb.c | 96 ++++++++++++ src/mainboard/google/slippy/hda_verb.h | 95 ------------ src/mainboard/google/slippy/mainboard.c | 12 -- src/mainboard/google/stout/hda_verb.c | 95 ++++++++++++ src/mainboard/google/stout/hda_verb.h | 94 ------------ src/mainboard/google/stout/mainboard.c | 11 -- 28 files changed, 1103 insertions(+), 1185 deletions(-) create mode 100644 src/mainboard/google/bolt/hda_verb.c delete mode 100644 src/mainboard/google/bolt/hda_verb.h create mode 100644 src/mainboard/google/butterfly/hda_verb.c delete mode 100644 src/mainboard/google/butterfly/hda_verb.h create mode 100644 src/mainboard/google/falco/hda_verb.c delete mode 100644 src/mainboard/google/falco/hda_verb.h create mode 100644 src/mainboard/google/link/hda_verb.c delete mode 100644 src/mainboard/google/link/hda_verb.h create mode 100644 src/mainboard/google/panther/hda_verb.c delete mode 100644 src/mainboard/google/panther/hda_verb.h create mode 100644 src/mainboard/google/parrot/hda_verb.c delete mode 100644 src/mainboard/google/parrot/hda_verb.h create mode 100644 src/mainboard/google/peppy/hda_verb.c delete mode 100644 src/mainboard/google/peppy/hda_verb.h create mode 100644 src/mainboard/google/samus/hda_verb.c create mode 100644 src/mainboard/google/slippy/hda_verb.c delete mode 100644 src/mainboard/google/slippy/hda_verb.h create mode 100644 src/mainboard/google/stout/hda_verb.c delete mode 100644 src/mainboard/google/stout/hda_verb.h (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/bolt/hda_verb.c b/src/mainboard/google/bolt/hda_verb.c new file mode 100644 index 0000000000..b81da64014 --- /dev/null +++ b/src/mainboard/google/bolt/hda_verb.c @@ -0,0 +1,83 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 + 0x10ec0283, // Subsystem ID + 0x0000000b, // Number of jacks (NID entries) + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0283), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ + AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), + + /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ + // group 1, front left/right + // no connector, no jack detect + // speaker out, analog + // fixed function, internal + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x17) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) MIC1 PORTB */ + // group 1, cap 1 + // black, jack detect + // mic in, analog + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), + + /* Pin Complex (NID 0x19) MIC2 PORTF */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x1A) LINE1 PORTC */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1B) LINE2 PORTE */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1d) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, internal + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HPOUT PORT-I */ + // group1, + // black, jack detect + // HPOut, 1/8 stereo + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), + +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/bolt/hda_verb.h b/src/mainboard/google/bolt/hda_verb.h deleted file mode 100644 index 54f27f13ae..0000000000 --- a/src/mainboard/google/bolt/hda_verb.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 - 0x10ec0283, // Subsystem ID - 0x0000000b, // Number of jacks (NID entries) - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0283), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ - AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), - - /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ - // group 1, front left/right - // no connector, no jack detect - // speaker out, analog - // fixed function, internal - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x17) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) MIC1 PORTB */ - // group 1, cap 1 - // black, jack detect - // mic in, analog - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), - - /* Pin Complex (NID 0x19) MIC2 PORTF */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x1A) LINE1 PORTC */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1B) LINE2 PORTE */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1d) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, internal - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HPOUT PORT-I */ - // group1, - // black, jack detect - // HPOut, 1/8 stereo - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), - -}; diff --git a/src/mainboard/google/bolt/mainboard.c b/src/mainboard/google/bolt/mainboard.c index 961f58d18f..0ccf90da86 100644 --- a/src/mainboard/google/bolt/mainboard.c +++ b/src/mainboard/google/bolt/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" #include #include "ec.h" #include "onboard.h" @@ -44,13 +42,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_init(device_t dev) { @@ -100,7 +92,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = mainboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/butterfly/hda_verb.c b/src/mainboard/google/butterfly/hda_verb.c new file mode 100644 index 0000000000..97ff2f6e19 --- /dev/null +++ b/src/mainboard/google/butterfly/hda_verb.c @@ -0,0 +1,232 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* Vendor Name : IDT + * Vendor ID : 0x111d76e5 + * Subsystem ID : 0x103c18f9 + * Revision ID : 0x100303 + */ + + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x111D76E5, // Codec Vendor / Device ID: IDT 92HD99 + 0x103C18F9, // Subsystem ID + 0x00000073, // Number of 4 dword sets + +/* Bits 31:28 - Codec Address */ +/* Bits 27:20 - NID */ +/* Bits 19:8 - Verb ID */ +/* Bits 7:0 - Payload */ + +/* NID 0x01 - NodeInfo */ + AZALIA_SUBVENDOR(0x0, 0x103C18F9), + +/* NID 0x0A - External Microphone Connector + * Config=0x04A11020 (External,Right; MicIn,3.5mm; Black,JD; DA,Seq) + */ + AZALIA_PIN_CFG(0x0, 0x0A, 0x04A11020), + +/* NID 0x0B - Headphone Connector + * Config=0x0421101F (External,Right; HP,3.5mm; Black,JD; DA,Seq) + */ + AZALIA_PIN_CFG(0x0, 0x0B, 0x0421101F), + +/* NID 0x0C - Not connected + * Config=0x40F000F0 (N/A,N/A; Other,Unknown; Unknown,JD; DA,Seq) + */ + AZALIA_PIN_CFG(0x0, 0x0C, 0x40F000F0), + +/* NID 0x0D - Internal Speakers + * Config=0x90170110 (Fixed,Int; Speaker,Other Analog; Unknown,nJD; DA,Seq) + */ + AZALIA_PIN_CFG(0x0, 0x0D, 0x90170110), + +/* NID 0x0F - Not connected + * Config=0x40F000F0 + */ + AZALIA_PIN_CFG(0x0, 0x0F, 0x40F000F0), + +/* NID 0x11 - Internal Microphone + * Config=0xD5A30140 (Fixed internal,Top; Mic In,ATIPI; Unknown,nJD; DA,Seq) + */ + AZALIA_PIN_CFG(0x0, 0x11, 0xD5A30140), + + /* + * Hardware EQ Parameters + * Sample Rate 88200 + */ + 0x0227A63F, 0x0227A73E, 0x0227A8EB, 0x0227A93F, + 0x0227AA3E, 0x0227ABEB, 0x0227AC00, 0x0227AD80, + 0x0227A681, 0x0227A782, 0x0227A829, 0x0227A981, + 0x0227AA82, 0x0227AB29, 0x0227AC01, 0x0227AD80, + 0x0227A63F, 0x0227A73E, 0x0227A8EB, 0x0227A93F, + 0x0227AA3E, 0x0227ABEB, 0x0227AC02, 0x0227AD80, + 0x0227A67E, 0x0227A77B, 0x0227A846, 0x0227A97E, + 0x0227AA7B, 0x0227AB46, 0x0227AC03, 0x0227AD80, + 0x0227A6C1, 0x0227A77F, 0x0227A898, 0x0227A9C1, + 0x0227AA7F, 0x0227AB98, 0x0227AC04, 0x0227AD80, + 0x0227A63E, 0x0227A7D1, 0x0227A84F, 0x0227A93E, + 0x0227AAD1, 0x0227AB4F, 0x0227AC05, 0x0227AD80, + 0x0227A683, 0x0227A7BE, 0x0227A855, 0x0227A983, + 0x0227AABE, 0x0227AB55, 0x0227AC06, 0x0227AD80, + 0x0227A63D, 0x0227A7B9, 0x0227A856, 0x0227A93D, + 0x0227AAB9, 0x0227AB56, 0x0227AC07, 0x0227AD80, + 0x0227A67C, 0x0227A741, 0x0227A8AB, 0x0227A97C, + 0x0227AA41, 0x0227ABAB, 0x0227AC08, 0x0227AD80, + 0x0227A6C3, 0x0227A775, 0x0227A85A, 0x0227A9C3, + 0x0227AA75, 0x0227AB5A, 0x0227AC09, 0x0227AD80, + 0x0227A63F, 0x0227A79E, 0x0227A829, 0x0227A93F, + 0x0227AA9E, 0x0227AB29, 0x0227AC0A, 0x0227AD80, + 0x0227A682, 0x0227A7E3, 0x0227A867, 0x0227A982, + 0x0227AAE3, 0x0227AB67, 0x0227AC0B, 0x0227AD80, + 0x0227A63E, 0x0227A74F, 0x0227A89D, 0x0227A93E, + 0x0227AA4F, 0x0227AB9D, 0x0227AC0C, 0x0227AD80, + 0x0227A67D, 0x0227A71C, 0x0227A899, 0x0227A97D, + 0x0227AA1C, 0x0227AB99, 0x0227AC0D, 0x0227AD80, + 0x0227A6C2, 0x0227A712, 0x0227A839, 0x0227A9C2, + 0x0227AA12, 0x0227AB39, 0x0227AC0E, 0x0227AD80, + 0x0227A63F, 0x0227A708, 0x0227A856, 0x0227A93F, + 0x0227AA08, 0x0227AB56, 0x0227AC0F, 0x0227AD80, + 0x0227A68E, 0x0227A7ED, 0x0227A89D, 0x0227A98E, + 0x0227AAED, 0x0227AB9D, 0x0227AC10, 0x0227AD80, + 0x0227A637, 0x0227A78F, 0x0227A853, 0x0227A937, + 0x0227AA8F, 0x0227AB53, 0x0227AC11, 0x0227AD80, + 0x0227A671, 0x0227A712, 0x0227A863, 0x0227A971, + 0x0227AA12, 0x0227AB63, 0x0227AC12, 0x0227AD80, + 0x0227A6C9, 0x0227A768, 0x0227A856, 0x0227A9C9, + 0x0227AA68, 0x0227AB56, 0x0227AC13, 0x0227AD80, + 0x0227A642, 0x0227A709, 0x0227A838, 0x0227A942, + 0x0227AA09, 0x0227AB38, 0x0227AC14, 0x0227AD80, + 0x0227A69C, 0x0227A78A, 0x0227A867, 0x0227A99C, + 0x0227AA8A, 0x0227AB67, 0x0227AC15, 0x0227AD80, + 0x0227A634, 0x0227A717, 0x0227A8E3, 0x0227A934, + 0x0227AA17, 0x0227ABE3, 0x0227AC16, 0x0227AD80, + 0x0227A663, 0x0227A775, 0x0227A899, 0x0227A963, + 0x0227AA75, 0x0227AB99, 0x0227AC17, 0x0227AD80, + 0x0227A6C9, 0x0227A7DE, 0x0227A8E5, 0x0227A9C9, + 0x0227AADE, 0x0227ABE5, 0x0227AC18, 0x0227AD80, + 0x0227A640, 0x0227A700, 0x0227A800, 0x0227A940, + 0x0227AA00, 0x0227AB00, 0x0227AC19, 0x0227AD80, + + /* + * Hardware EQ Parameters + * Sample Rate 96000 + */ + 0x0227A63F, 0x0227A74E, 0x0227A888, 0x0227A93F, + 0x0227AA4E, 0x0227AB88, 0x0227AC1A, 0x0227AD80, + 0x0227A681, 0x0227A762, 0x0227A8EE, 0x0227A981, + 0x0227AA62, 0x0227ABEE, 0x0227AC1B, 0x0227AD80, + 0x0227A63F, 0x0227A74E, 0x0227A888, 0x0227A93F, + 0x0227AA4E, 0x0227AB88, 0x0227AC1C, 0x0227AD80, + 0x0227A67E, 0x0227A79A, 0x0227A8E7, 0x0227A97E, + 0x0227AA9A, 0x0227ABE7, 0x0227AC1D, 0x0227AD80, + 0x0227A6C1, 0x0227A760, 0x0227A8C3, 0x0227A9C1, + 0x0227AA60, 0x0227ABC3, 0x0227AC1E, 0x0227AD80, + 0x0227A63E, 0x0227A7E9, 0x0227A84B, 0x0227A93E, + 0x0227AAE9, 0x0227AB4B, 0x0227AC1F, 0x0227AD80, + 0x0227A683, 0x0227A76C, 0x0227A8F2, 0x0227A983, + 0x0227AA6C, 0x0227ABF2, 0x0227AC20, 0x0227AD80, + 0x0227A63D, 0x0227A7E7, 0x0227A880, 0x0227A93D, + 0x0227AAE7, 0x0227AB80, 0x0227AC21, 0x0227AD80, + 0x0227A67C, 0x0227A793, 0x0227A80E, 0x0227A97C, + 0x0227AA93, 0x0227AB0E, 0x0227AC22, 0x0227AD80, + 0x0227A6C3, 0x0227A72F, 0x0227A835, 0x0227A9C3, + 0x0227AA2F, 0x0227AB35, 0x0227AC23, 0x0227AD80, + 0x0227A63F, 0x0227A7A5, 0x0227A8FE, 0x0227A93F, + 0x0227AAA5, 0x0227ABFE, 0x0227AC24, 0x0227AD80, + 0x0227A682, 0x0227A798, 0x0227A89D, 0x0227A982, + 0x0227AA98, 0x0227AB9D, 0x0227AC25, 0x0227AD80, + 0x0227A63E, 0x0227A772, 0x0227A839, 0x0227A93E, + 0x0227AA72, 0x0227AB39, 0x0227AC26, 0x0227AD80, + 0x0227A67D, 0x0227A767, 0x0227A863, 0x0227A97D, + 0x0227AA67, 0x0227AB63, 0x0227AC27, 0x0227AD80, + 0x0227A6C1, 0x0227A7E7, 0x0227A8C8, 0x0227A9C1, + 0x0227AAE7, 0x0227ABC8, 0x0227AC28, 0x0227AD80, + 0x0227A63F, 0x0227A71B, 0x0227A81A, 0x0227A93F, + 0x0227AA1B, 0x0227AB1A, 0x0227AC29, 0x0227AD80, + 0x0227A68D, 0x0227A763, 0x0227A872, 0x0227A98D, + 0x0227AA63, 0x0227AB72, 0x0227AC2A, 0x0227AD80, + 0x0227A638, 0x0227A733, 0x0227A809, 0x0227A938, + 0x0227AA33, 0x0227AB09, 0x0227AC2B, 0x0227AD80, + 0x0227A672, 0x0227A79C, 0x0227A88E, 0x0227A972, + 0x0227AA9C, 0x0227AB8E, 0x0227AC2C, 0x0227AD80, + 0x0227A6C8, 0x0227A7B1, 0x0227A8DD, 0x0227A9C8, + 0x0227AAB1, 0x0227ABDD, 0x0227AC2D, 0x0227AD80, + 0x0227A641, 0x0227A7E1, 0x0227A8D8, 0x0227A941, + 0x0227AAE1, 0x0227ABD8, 0x0227AC2E, 0x0227AD80, + 0x0227A699, 0x0227A70D, 0x0227A820, 0x0227A999, + 0x0227AA0D, 0x0227AB20, 0x0227AC2F, 0x0227AD80, + 0x0227A634, 0x0227A7FE, 0x0227A823, 0x0227A934, + 0x0227AAFE, 0x0227AB23, 0x0227AC30, 0x0227AD80, + 0x0227A666, 0x0227A7F2, 0x0227A8E0, 0x0227A966, + 0x0227AAF2, 0x0227ABE0, 0x0227AC31, 0x0227AD80, + 0x0227A6C9, 0x0227A720, 0x0227A804, 0x0227A9C9, + 0x0227AA20, 0x0227AB04, 0x0227AC32, 0x0227AD80, + 0x0227A640, 0x0227A700, 0x0227A800, 0x0227A940, + 0x0227AA00, 0x0227AB00, 0x0227AC33, 0x0227AD80, + + /* SAFEDSP Parameters */ + 0x022782C1, 0x02277127, 0x02277227, 0x02278801, + 0x02278C58, 0x02278E90, 0x0227890A, 0x02278A14, + 0x02278B0F, 0x0017B008, + + /* Misc entries */ + 0x00B707C0, /* Enable PortB as Output with HP amp */ + 0x00D70740, /* Enable PortD as Output */ + 0x0017A200, /* Disable ClkEn of PortSenseTst */ + 0x0017C621, /* Slave Port - Port A used as microphone input for + combo Jack + Master Port - Port B used for Jack Presence Detect + Enable Combo Jack Detection */ + 0x0017A208, /* Enable ClkEn of PortSenseTst */ + 0x00170500, /* Set power state to D0 */ + + /* --- Next Codec --- */ + +/* Vendor Name : Intel + * Vendor ID : 0x80862806 + * Subsystem ID : 0x80860101 + * Revision ID : 0x100000 + */ + /* coreboot specific header */ + 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI + 0x80860101, // Subsystem ID + 0x00000004, // Number of IDs + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ + AZALIA_SUBVENDOR(0x3, 0x80860101), + + /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), + + /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), + + /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) +}; + +const u32 pc_beep_verbs[] = { + 0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */ +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/butterfly/hda_verb.h b/src/mainboard/google/butterfly/hda_verb.h deleted file mode 100644 index e06a1bea49..0000000000 --- a/src/mainboard/google/butterfly/hda_verb.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* Vendor Name : IDT - * Vendor ID : 0x111d76e5 - * Subsystem ID : 0x103c18f9 - * Revision ID : 0x100303 - */ - - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x111D76E5, // Codec Vendor / Device ID: IDT 92HD99 - 0x103C18F9, // Subsystem ID - 0x00000073, // Number of 4 dword sets - -/* Bits 31:28 - Codec Address */ -/* Bits 27:20 - NID */ -/* Bits 19:8 - Verb ID */ -/* Bits 7:0 - Payload */ - -/* NID 0x01 - NodeInfo */ - AZALIA_SUBVENDOR(0x0, 0x103C18F9), - -/* NID 0x0A - External Microphone Connector - * Config=0x04A11020 (External,Right; MicIn,3.5mm; Black,JD; DA,Seq) - */ - AZALIA_PIN_CFG(0x0, 0x0A, 0x04A11020), - -/* NID 0x0B - Headphone Connector - * Config=0x0421101F (External,Right; HP,3.5mm; Black,JD; DA,Seq) - */ - AZALIA_PIN_CFG(0x0, 0x0B, 0x0421101F), - -/* NID 0x0C - Not connected - * Config=0x40F000F0 (N/A,N/A; Other,Unknown; Unknown,JD; DA,Seq) - */ - AZALIA_PIN_CFG(0x0, 0x0C, 0x40F000F0), - -/* NID 0x0D - Internal Speakers - * Config=0x90170110 (Fixed,Int; Speaker,Other Analog; Unknown,nJD; DA,Seq) - */ - AZALIA_PIN_CFG(0x0, 0x0D, 0x90170110), - -/* NID 0x0F - Not connected - * Config=0x40F000F0 - */ - AZALIA_PIN_CFG(0x0, 0x0F, 0x40F000F0), - -/* NID 0x11 - Internal Microphone - * Config=0xD5A30140 (Fixed internal,Top; Mic In,ATIPI; Unknown,nJD; DA,Seq) - */ - AZALIA_PIN_CFG(0x0, 0x11, 0xD5A30140), - - /* - * Hardware EQ Parameters - * Sample Rate 88200 - */ - 0x0227A63F, 0x0227A73E, 0x0227A8EB, 0x0227A93F, - 0x0227AA3E, 0x0227ABEB, 0x0227AC00, 0x0227AD80, - 0x0227A681, 0x0227A782, 0x0227A829, 0x0227A981, - 0x0227AA82, 0x0227AB29, 0x0227AC01, 0x0227AD80, - 0x0227A63F, 0x0227A73E, 0x0227A8EB, 0x0227A93F, - 0x0227AA3E, 0x0227ABEB, 0x0227AC02, 0x0227AD80, - 0x0227A67E, 0x0227A77B, 0x0227A846, 0x0227A97E, - 0x0227AA7B, 0x0227AB46, 0x0227AC03, 0x0227AD80, - 0x0227A6C1, 0x0227A77F, 0x0227A898, 0x0227A9C1, - 0x0227AA7F, 0x0227AB98, 0x0227AC04, 0x0227AD80, - 0x0227A63E, 0x0227A7D1, 0x0227A84F, 0x0227A93E, - 0x0227AAD1, 0x0227AB4F, 0x0227AC05, 0x0227AD80, - 0x0227A683, 0x0227A7BE, 0x0227A855, 0x0227A983, - 0x0227AABE, 0x0227AB55, 0x0227AC06, 0x0227AD80, - 0x0227A63D, 0x0227A7B9, 0x0227A856, 0x0227A93D, - 0x0227AAB9, 0x0227AB56, 0x0227AC07, 0x0227AD80, - 0x0227A67C, 0x0227A741, 0x0227A8AB, 0x0227A97C, - 0x0227AA41, 0x0227ABAB, 0x0227AC08, 0x0227AD80, - 0x0227A6C3, 0x0227A775, 0x0227A85A, 0x0227A9C3, - 0x0227AA75, 0x0227AB5A, 0x0227AC09, 0x0227AD80, - 0x0227A63F, 0x0227A79E, 0x0227A829, 0x0227A93F, - 0x0227AA9E, 0x0227AB29, 0x0227AC0A, 0x0227AD80, - 0x0227A682, 0x0227A7E3, 0x0227A867, 0x0227A982, - 0x0227AAE3, 0x0227AB67, 0x0227AC0B, 0x0227AD80, - 0x0227A63E, 0x0227A74F, 0x0227A89D, 0x0227A93E, - 0x0227AA4F, 0x0227AB9D, 0x0227AC0C, 0x0227AD80, - 0x0227A67D, 0x0227A71C, 0x0227A899, 0x0227A97D, - 0x0227AA1C, 0x0227AB99, 0x0227AC0D, 0x0227AD80, - 0x0227A6C2, 0x0227A712, 0x0227A839, 0x0227A9C2, - 0x0227AA12, 0x0227AB39, 0x0227AC0E, 0x0227AD80, - 0x0227A63F, 0x0227A708, 0x0227A856, 0x0227A93F, - 0x0227AA08, 0x0227AB56, 0x0227AC0F, 0x0227AD80, - 0x0227A68E, 0x0227A7ED, 0x0227A89D, 0x0227A98E, - 0x0227AAED, 0x0227AB9D, 0x0227AC10, 0x0227AD80, - 0x0227A637, 0x0227A78F, 0x0227A853, 0x0227A937, - 0x0227AA8F, 0x0227AB53, 0x0227AC11, 0x0227AD80, - 0x0227A671, 0x0227A712, 0x0227A863, 0x0227A971, - 0x0227AA12, 0x0227AB63, 0x0227AC12, 0x0227AD80, - 0x0227A6C9, 0x0227A768, 0x0227A856, 0x0227A9C9, - 0x0227AA68, 0x0227AB56, 0x0227AC13, 0x0227AD80, - 0x0227A642, 0x0227A709, 0x0227A838, 0x0227A942, - 0x0227AA09, 0x0227AB38, 0x0227AC14, 0x0227AD80, - 0x0227A69C, 0x0227A78A, 0x0227A867, 0x0227A99C, - 0x0227AA8A, 0x0227AB67, 0x0227AC15, 0x0227AD80, - 0x0227A634, 0x0227A717, 0x0227A8E3, 0x0227A934, - 0x0227AA17, 0x0227ABE3, 0x0227AC16, 0x0227AD80, - 0x0227A663, 0x0227A775, 0x0227A899, 0x0227A963, - 0x0227AA75, 0x0227AB99, 0x0227AC17, 0x0227AD80, - 0x0227A6C9, 0x0227A7DE, 0x0227A8E5, 0x0227A9C9, - 0x0227AADE, 0x0227ABE5, 0x0227AC18, 0x0227AD80, - 0x0227A640, 0x0227A700, 0x0227A800, 0x0227A940, - 0x0227AA00, 0x0227AB00, 0x0227AC19, 0x0227AD80, - - /* - * Hardware EQ Parameters - * Sample Rate 96000 - */ - 0x0227A63F, 0x0227A74E, 0x0227A888, 0x0227A93F, - 0x0227AA4E, 0x0227AB88, 0x0227AC1A, 0x0227AD80, - 0x0227A681, 0x0227A762, 0x0227A8EE, 0x0227A981, - 0x0227AA62, 0x0227ABEE, 0x0227AC1B, 0x0227AD80, - 0x0227A63F, 0x0227A74E, 0x0227A888, 0x0227A93F, - 0x0227AA4E, 0x0227AB88, 0x0227AC1C, 0x0227AD80, - 0x0227A67E, 0x0227A79A, 0x0227A8E7, 0x0227A97E, - 0x0227AA9A, 0x0227ABE7, 0x0227AC1D, 0x0227AD80, - 0x0227A6C1, 0x0227A760, 0x0227A8C3, 0x0227A9C1, - 0x0227AA60, 0x0227ABC3, 0x0227AC1E, 0x0227AD80, - 0x0227A63E, 0x0227A7E9, 0x0227A84B, 0x0227A93E, - 0x0227AAE9, 0x0227AB4B, 0x0227AC1F, 0x0227AD80, - 0x0227A683, 0x0227A76C, 0x0227A8F2, 0x0227A983, - 0x0227AA6C, 0x0227ABF2, 0x0227AC20, 0x0227AD80, - 0x0227A63D, 0x0227A7E7, 0x0227A880, 0x0227A93D, - 0x0227AAE7, 0x0227AB80, 0x0227AC21, 0x0227AD80, - 0x0227A67C, 0x0227A793, 0x0227A80E, 0x0227A97C, - 0x0227AA93, 0x0227AB0E, 0x0227AC22, 0x0227AD80, - 0x0227A6C3, 0x0227A72F, 0x0227A835, 0x0227A9C3, - 0x0227AA2F, 0x0227AB35, 0x0227AC23, 0x0227AD80, - 0x0227A63F, 0x0227A7A5, 0x0227A8FE, 0x0227A93F, - 0x0227AAA5, 0x0227ABFE, 0x0227AC24, 0x0227AD80, - 0x0227A682, 0x0227A798, 0x0227A89D, 0x0227A982, - 0x0227AA98, 0x0227AB9D, 0x0227AC25, 0x0227AD80, - 0x0227A63E, 0x0227A772, 0x0227A839, 0x0227A93E, - 0x0227AA72, 0x0227AB39, 0x0227AC26, 0x0227AD80, - 0x0227A67D, 0x0227A767, 0x0227A863, 0x0227A97D, - 0x0227AA67, 0x0227AB63, 0x0227AC27, 0x0227AD80, - 0x0227A6C1, 0x0227A7E7, 0x0227A8C8, 0x0227A9C1, - 0x0227AAE7, 0x0227ABC8, 0x0227AC28, 0x0227AD80, - 0x0227A63F, 0x0227A71B, 0x0227A81A, 0x0227A93F, - 0x0227AA1B, 0x0227AB1A, 0x0227AC29, 0x0227AD80, - 0x0227A68D, 0x0227A763, 0x0227A872, 0x0227A98D, - 0x0227AA63, 0x0227AB72, 0x0227AC2A, 0x0227AD80, - 0x0227A638, 0x0227A733, 0x0227A809, 0x0227A938, - 0x0227AA33, 0x0227AB09, 0x0227AC2B, 0x0227AD80, - 0x0227A672, 0x0227A79C, 0x0227A88E, 0x0227A972, - 0x0227AA9C, 0x0227AB8E, 0x0227AC2C, 0x0227AD80, - 0x0227A6C8, 0x0227A7B1, 0x0227A8DD, 0x0227A9C8, - 0x0227AAB1, 0x0227ABDD, 0x0227AC2D, 0x0227AD80, - 0x0227A641, 0x0227A7E1, 0x0227A8D8, 0x0227A941, - 0x0227AAE1, 0x0227ABD8, 0x0227AC2E, 0x0227AD80, - 0x0227A699, 0x0227A70D, 0x0227A820, 0x0227A999, - 0x0227AA0D, 0x0227AB20, 0x0227AC2F, 0x0227AD80, - 0x0227A634, 0x0227A7FE, 0x0227A823, 0x0227A934, - 0x0227AAFE, 0x0227AB23, 0x0227AC30, 0x0227AD80, - 0x0227A666, 0x0227A7F2, 0x0227A8E0, 0x0227A966, - 0x0227AAF2, 0x0227ABE0, 0x0227AC31, 0x0227AD80, - 0x0227A6C9, 0x0227A720, 0x0227A804, 0x0227A9C9, - 0x0227AA20, 0x0227AB04, 0x0227AC32, 0x0227AD80, - 0x0227A640, 0x0227A700, 0x0227A800, 0x0227A940, - 0x0227AA00, 0x0227AB00, 0x0227AC33, 0x0227AD80, - - /* SAFEDSP Parameters */ - 0x022782C1, 0x02277127, 0x02277227, 0x02278801, - 0x02278C58, 0x02278E90, 0x0227890A, 0x02278A14, - 0x02278B0F, 0x0017B008, - - /* Misc entries */ - 0x00B707C0, /* Enable PortB as Output with HP amp */ - 0x00D70740, /* Enable PortD as Output */ - 0x0017A200, /* Disable ClkEn of PortSenseTst */ - 0x0017C621, /* Slave Port - Port A used as microphone input for - combo Jack - Master Port - Port B used for Jack Presence Detect - Enable Combo Jack Detection */ - 0x0017A208, /* Enable ClkEn of PortSenseTst */ - 0x00170500, /* Set power state to D0 */ - - /* --- Next Codec --- */ - -/* Vendor Name : Intel - * Vendor ID : 0x80862806 - * Subsystem ID : 0x80860101 - * Revision ID : 0x100000 - */ - /* coreboot specific header */ - 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI - 0x80860101, // Subsystem ID - 0x00000004, // Number of IDs - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ - AZALIA_SUBVENDOR(0x3, 0x80860101), - - /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), - - /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), - - /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x02177a00, /* Digital PCBEEP Gain: 0h=-9db, 1h=-6db ... 4h=+3db, 5h=+6db */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/google/butterfly/mainboard.c b/src/mainboard/google/butterfly/mainboard.c index 909ba8c0aa..655fc2fc14 100644 --- a/src/mainboard/google/butterfly/mainboard.c +++ b/src/mainboard/google/butterfly/mainboard.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include "hda_verb.h" #if CONFIG_CHROMEOS #include #else @@ -194,16 +192,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -294,7 +283,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = butterfly_onboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/falco/hda_verb.c b/src/mainboard/google/falco/hda_verb.c new file mode 100644 index 0000000000..5ea3c7bcca --- /dev/null +++ b/src/mainboard/google/falco/hda_verb.c @@ -0,0 +1,101 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 + 0x10ec0283, // Subsystem ID + 0x0000000d, // Number of jacks (NID entries) + + 0x0017ff00, // Function Reset + 0x0017ff00, // Double Function Reset + 0x000F0000, // Pad - get vendor id + 0x000F0002, // Pad - get revision id + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0283), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ + AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), + + /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ + // group 1, front left/right + // no connector, no jack detect + // speaker out, analog + // fixed function, internal + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x17) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) MIC1 PORTB */ + // group 1, cap 1 + // black, jack detect + // mic in, analog + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), + + /* Pin Complex (NID 0x19) MIC2 PORTF */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x1A) LINE1 PORTC */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1B) LINE2 PORTE */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1d) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, internal + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HPOUT PORT-I */ + // group1, + // black, jack detect + // HPOut, 1/8 stereo + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), + + /* Undocumented settings from Realtek (needed for beep_gen) */ + /* Widget node 0x20 */ + 0x02050010, + 0x02040c20, + 0x0205001b, + 0x0204081b, +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/falco/hda_verb.h b/src/mainboard/google/falco/hda_verb.h deleted file mode 100644 index 5c37f510ea..0000000000 --- a/src/mainboard/google/falco/hda_verb.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 - 0x10ec0283, // Subsystem ID - 0x0000000d, // Number of jacks (NID entries) - - 0x0017ff00, // Function Reset - 0x0017ff00, // Double Function Reset - 0x000F0000, // Pad - get vendor id - 0x000F0002, // Pad - get revision id - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0283), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ - AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), - - /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ - // group 1, front left/right - // no connector, no jack detect - // speaker out, analog - // fixed function, internal - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x17) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) MIC1 PORTB */ - // group 1, cap 1 - // black, jack detect - // mic in, analog - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), - - /* Pin Complex (NID 0x19) MIC2 PORTF */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x1A) LINE1 PORTC */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1B) LINE2 PORTE */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1d) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, internal - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HPOUT PORT-I */ - // group1, - // black, jack detect - // HPOut, 1/8 stereo - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), - - /* Undocumented settings from Realtek (needed for beep_gen) */ - /* Widget node 0x20 */ - 0x02050010, - 0x02040c20, - 0x0205001b, - 0x0204081b, -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - sizeof(mainboard_pc_beep_verbs) / sizeof(mainboard_pc_beep_verbs[0]); diff --git a/src/mainboard/google/falco/mainboard.c b/src/mainboard/google/falco/mainboard.c index acb975042b..0ccf90da86 100644 --- a/src/mainboard/google/falco/mainboard.c +++ b/src/mainboard/google/falco/mainboard.c @@ -33,8 +33,6 @@ #include #include #include -#include -#include "hda_verb.h" #include "ec.h" #include "onboard.h" @@ -44,16 +42,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -103,7 +92,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = mainboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/link/hda_verb.c b/src/mainboard/google/link/hda_verb.c new file mode 100644 index 0000000000..87bcf30a98 --- /dev/null +++ b/src/mainboard/google/link/hda_verb.c @@ -0,0 +1,140 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x11020011, // Codec Vendor / Device ID: Creative CA0132 + 0x144dc0c2, // Subsystem ID + 0x00000014, // Number of jacks + Number of Malcolm setup blocks. + + /* Malcolm Setup */ + + 0x01570d09, + 0x01570c23, + 0x01570a01, + 0x01570df0, + + 0x01570efe, + 0x01570775, + 0x015707d3, + 0x01570709, + + 0x01570753, + 0x015707d4, + 0x015707ef, + 0x01570775, + + 0x015707d3, + 0x01570709, + 0x01570702, + 0x01570737, + + 0x01570778, + 0x01553cce, + 0x015575c9, + 0x01553dce, + + 0x0155b7c9, + 0x01570de8, + 0x01570efe, + 0x01570702, + + 0x01570768, + 0x01570762, + 0x01553ace, + 0x015546c9, + + 0x01553bce, + 0x0155e8c9, + 0x01570d49, + 0x01570c88, + + 0x01570d20, + 0x01570e19, + 0x01570700, + 0x01571a05, + + 0x01571b29, + 0x01571a04, + 0x01571b29, + 0x01570a01, + + /* Pin Widget Verb Table */ + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x144DC0C2 */ + AZALIA_SUBVENDOR(0x0, 0x144dc0c2), + + /* Pin Complex (NID 0x0B) Port-G Analog Unknown Speaker at Int N/A */ + AZALIA_PIN_CFG(0x0, 0x0b, 0x901700f0), + + /* Pin Complex (NID 0x0C) N/C */ + AZALIA_PIN_CFG(0x0, 0x0c, 0x70f000f0), + + /* Pin Complex (NID 0x0D) N/C */ + AZALIA_PIN_CFG(0x0, 0x0d, 0x70f000f0), + + /* Pin Complex (NID 0x0E) N/C */ + AZALIA_PIN_CFG(0x0, 0x0e, 0x70f000f0), + + /* Pin Complex (NID 0x0F) N/C */ + AZALIA_PIN_CFG(0x0, 0x0f, 0x70f000f0), + + /* Pin Complex (NID 0x10) Port-D 1/8 Black HP Out at Ext Left */ + AZALIA_PIN_CFG(0x0, 0x10, 0x032110f0), + + /* Pin Complex (NID 0x11) Port-B Click Mic */ + AZALIA_PIN_CFG(0x0, 0x11, 0x90a700f0), + + /* Pin Complex (NID 0x12) Port-C Combo Jack Mic or D-Mic */ + AZALIA_PIN_CFG(0x0, 0x12, 0x03a110f0), + + /* Pin Complex (NID 0x13) What you hear */ + AZALIA_PIN_CFG(0x0, 0x13, 0x90d600f0), + + /* coreboot specific header */ + 0x80862806, // Codec Vendor / Device ID: Intel CougarPoint HDMI + 0x80860101, // Subsystem ID + 0x00000004, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ + AZALIA_SUBVENDOR(0x3, 0x80860101), + + /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), + + /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), + + /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) +}; + + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up codec */ + 0x00270500, /* power up DAC */ + 0x00b70500, /* power up speaker */ + 0x00b70740, /* enable speaker out */ + 0x00b78d00, /* enable EAPD pin */ + 0x00b70c02, /* set EAPD pin */ + 0x0143b013, /* beep volume */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/link/hda_verb.h b/src/mainboard/google/link/hda_verb.h deleted file mode 100644 index bb5ff106c5..0000000000 --- a/src/mainboard/google/link/hda_verb.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x11020011, // Codec Vendor / Device ID: Creative CA0132 - 0x144dc0c2, // Subsystem ID - 0x00000014, // Number of jacks + Number of Malcolm setup blocks. - - /* Malcolm Setup */ - - 0x01570d09, - 0x01570c23, - 0x01570a01, - 0x01570df0, - - 0x01570efe, - 0x01570775, - 0x015707d3, - 0x01570709, - - 0x01570753, - 0x015707d4, - 0x015707ef, - 0x01570775, - - 0x015707d3, - 0x01570709, - 0x01570702, - 0x01570737, - - 0x01570778, - 0x01553cce, - 0x015575c9, - 0x01553dce, - - 0x0155b7c9, - 0x01570de8, - 0x01570efe, - 0x01570702, - - 0x01570768, - 0x01570762, - 0x01553ace, - 0x015546c9, - - 0x01553bce, - 0x0155e8c9, - 0x01570d49, - 0x01570c88, - - 0x01570d20, - 0x01570e19, - 0x01570700, - 0x01571a05, - - 0x01571b29, - 0x01571a04, - 0x01571b29, - 0x01570a01, - - /* Pin Widget Verb Table */ - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x144DC0C2 */ - AZALIA_SUBVENDOR(0x0, 0x144dc0c2), - - /* Pin Complex (NID 0x0B) Port-G Analog Unknown Speaker at Int N/A */ - AZALIA_PIN_CFG(0x0, 0x0b, 0x901700f0), - - /* Pin Complex (NID 0x0C) N/C */ - AZALIA_PIN_CFG(0x0, 0x0c, 0x70f000f0), - - /* Pin Complex (NID 0x0D) N/C */ - AZALIA_PIN_CFG(0x0, 0x0d, 0x70f000f0), - - /* Pin Complex (NID 0x0E) N/C */ - AZALIA_PIN_CFG(0x0, 0x0e, 0x70f000f0), - - /* Pin Complex (NID 0x0F) N/C */ - AZALIA_PIN_CFG(0x0, 0x0f, 0x70f000f0), - - /* Pin Complex (NID 0x10) Port-D 1/8 Black HP Out at Ext Left */ - AZALIA_PIN_CFG(0x0, 0x10, 0x032110f0), - - /* Pin Complex (NID 0x11) Port-B Click Mic */ - AZALIA_PIN_CFG(0x0, 0x11, 0x90a700f0), - - /* Pin Complex (NID 0x12) Port-C Combo Jack Mic or D-Mic */ - AZALIA_PIN_CFG(0x0, 0x12, 0x03a110f0), - - /* Pin Complex (NID 0x13) What you hear */ - AZALIA_PIN_CFG(0x0, 0x13, 0x90d600f0), - - /* coreboot specific header */ - 0x80862806, // Codec Vendor / Device ID: Intel CougarPoint HDMI - 0x80860101, // Subsystem ID - 0x00000004, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ - AZALIA_SUBVENDOR(0x3, 0x80860101), - - /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), - - /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), - - /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) -}; - - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up codec */ - 0x00270500, /* power up DAC */ - 0x00b70500, /* power up speaker */ - 0x00b70740, /* enable speaker out */ - 0x00b78d00, /* enable EAPD pin */ - 0x00b70c02, /* set EAPD pin */ - 0x0143b013, /* beep volume */ -}; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/google/link/mainboard.c b/src/mainboard/google/link/mainboard.c index 9d86458912..ed40f8fa32 100644 --- a/src/mainboard/google/link/mainboard.c +++ b/src/mainboard/google/link/mainboard.c @@ -39,8 +39,6 @@ #include #include #include -#include -#include "hda_verb.h" /* placeholder for evenual link post. Not sure what we'll * do but it will look nice @@ -149,15 +147,7 @@ static int int15_handler(void) } #endif -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; -} static void mainboard_init(device_t dev) { @@ -222,7 +212,6 @@ static void mainboard_enable(device_t dev) /* Install custom int15 handler for VGA OPROM */ mainboard_interrupt_handlers(0x15, &int15_handler); #endif - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/panther/hda_verb.c b/src/mainboard/google/panther/hda_verb.c new file mode 100644 index 0000000000..7de91d9f21 --- /dev/null +++ b/src/mainboard/google/panther/hda_verb.c @@ -0,0 +1,99 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef HDA_VERB_H +#define HDA_VERB_H + +#include + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 + 0x10ec0283, // Subsystem ID + 0x0000000c, // Number of jacks (NID entries) + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0283), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC */ + AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), + + /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ + AZALIA_PIN_CFG(0x0, 0x14, 0x401111f0), + + /* Pin Complex (NID 0x17) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) MIC1 PORTB */ + // group 1, cap 1 + // black, jack detect + // mic in, analog + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), + + /* Pin Complex (NID 0x19) MIC2 PORTF */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x1A) LINE1 PORTC */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1B) LINE2 PORTE */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1d) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, internal + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HPOUT PORT-I */ + // group1, + // black, jack detect + // HPOut, 1/8 stereo + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), + + /* Undocumented settings from Realtek (needed for beep_gen) */ + /* Widget node 0x20 */ + 0x02050010, + 0x02040c20, + 0x0205001b, + 0x0204081b, +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; + + +#endif /* HDA_VERB_H */ +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/panther/hda_verb.h b/src/mainboard/google/panther/hda_verb.h deleted file mode 100644 index 47311e308d..0000000000 --- a/src/mainboard/google/panther/hda_verb.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef HDA_VERB_H -#define HDA_VERB_H - -#include - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 - 0x10ec0283, // Subsystem ID - 0x0000000c, // Number of jacks (NID entries) - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0283), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC */ - AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), - - /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ - AZALIA_PIN_CFG(0x0, 0x14, 0x401111f0), - - /* Pin Complex (NID 0x17) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) MIC1 PORTB */ - // group 1, cap 1 - // black, jack detect - // mic in, analog - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), - - /* Pin Complex (NID 0x19) MIC2 PORTF */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x1A) LINE1 PORTC */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1B) LINE2 PORTE */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1d) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, internal - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HPOUT PORT-I */ - // group1, - // black, jack detect - // HPOut, 1/8 stereo - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), - - /* Undocumented settings from Realtek (needed for beep_gen) */ - /* Widget node 0x20 */ - 0x02050010, - 0x02040c20, - 0x0205001b, - 0x0204081b, -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); - -#endif /* HDA_VERB_H */ diff --git a/src/mainboard/google/panther/mainboard.c b/src/mainboard/google/panther/mainboard.c index 60baf99c8d..5058eca145 100644 --- a/src/mainboard/google/panther/mainboard.c +++ b/src/mainboard/google/panther/mainboard.c @@ -32,9 +32,7 @@ #include #include #include -#include #include -#include "hda_verb.h" #include "onboard.h" @@ -44,16 +42,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -67,7 +56,6 @@ static void mainboard_enable(device_t dev) { dev->ops->init = mainboard_init; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/parrot/hda_verb.c b/src/mainboard/google/parrot/hda_verb.c new file mode 100644 index 0000000000..f79f69d8e3 --- /dev/null +++ b/src/mainboard/google/parrot/hda_verb.c @@ -0,0 +1,145 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Parrot audio ports: + * ALC269: + * out: + * Internal Speaker: PORT D (0x14) + * Headphone: PORT A - (0x21) (SenseA) + * + * in: + * Mic2: PORT F (0x19) (SenseB) + * Line2 (internal Mic): PORT E (0x1B) + * PCBeep + * + * HDMI PatherPoint + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269 + 0x10250742, // Subsystem ID + 0x0000000E, // Number of jacks (NID entries) + + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10250742 */ + AZALIA_SUBVENDOR(0x0, 0x10250742), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC */ + AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), + + /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ + // group 1, front left/right + // no connector, no jack detect + // speaker out, analog + // fixed function, internal + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x17) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) MIC1 PORTB */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x19) MIC2 PORTF */ + // group 2, cap 1 + // black, jack detect + // mic in, analog + // connector, right panel + AZALIA_PIN_CFG(0x0, 0x19, 0x04a71021), + + /* Pin Complex (NID 0x1A) LINE1 PORTC */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1B) LINE2 PORTE */ + // group 2, cap 0 + // no connector, no jack detect + // mic in, analog + // fixed function, internal + AZALIA_PIN_CFG(0x0, 0x1b, 0x90a70120), + + /* Pin Complex (NID 0x1d) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, internal + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HPOUT PORTA? */ + // group1, + // black, jack detect + // HPOut, 1/8 stereo + // connector, right panel + AZALIA_PIN_CFG(0x0, 0x21, 0x0421101f), + + /* Undocumented speaker output volume settings from Compal and Realtek */ + /* Widget node 0x20 */ + 0x02050011, + 0x02040710, + 0x02050012, + 0x02041901, + + 0x02050002, + 0x0204AAB8, + 0x0205000D, + 0x02044440, + + 0x02050008, + 0x02040300, + 0x02050017, + 0x020400AF, + + /* --- Next Codec --- */ + + /* coreboot specific header */ + 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI + 0x80860101, // Subsystem ID + 0x00000004, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ + AZALIA_SUBVENDOR(0x0, 0x80860101), + + /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), + + /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), + + /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/parrot/hda_verb.h b/src/mainboard/google/parrot/hda_verb.h deleted file mode 100644 index dfa7a817a3..0000000000 --- a/src/mainboard/google/parrot/hda_verb.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * Parrot audio ports: - * ALC269: - * out: - * Internal Speaker: PORT D (0x14) - * Headphone: PORT A - (0x21) (SenseA) - * - * in: - * Mic2: PORT F (0x19) (SenseB) - * Line2 (internal Mic): PORT E (0x1B) - * PCBeep - * - * HDMI PatherPoint - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269 - 0x10250742, // Subsystem ID - 0x0000000E, // Number of jacks (NID entries) - - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10250742 */ - AZALIA_SUBVENDOR(0x0, 0x10250742), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC */ - AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), - - /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ - // group 1, front left/right - // no connector, no jack detect - // speaker out, analog - // fixed function, internal - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x17) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) MIC1 PORTB */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x19) MIC2 PORTF */ - // group 2, cap 1 - // black, jack detect - // mic in, analog - // connector, right panel - AZALIA_PIN_CFG(0x0, 0x19, 0x04a71021), - - /* Pin Complex (NID 0x1A) LINE1 PORTC */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1B) LINE2 PORTE */ - // group 2, cap 0 - // no connector, no jack detect - // mic in, analog - // fixed function, internal - AZALIA_PIN_CFG(0x0, 0x1b, 0x90a70120), - - /* Pin Complex (NID 0x1d) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, internal - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HPOUT PORTA? */ - // group1, - // black, jack detect - // HPOut, 1/8 stereo - // connector, right panel - AZALIA_PIN_CFG(0x0, 0x21, 0x0421101f), - - /* Undocumented speaker output volume settings from Compal and Realtek */ - /* Widget node 0x20 */ - 0x02050011, - 0x02040710, - 0x02050012, - 0x02041901, - - 0x02050002, - 0x0204AAB8, - 0x0205000D, - 0x02044440, - - 0x02050008, - 0x02040300, - 0x02050017, - 0x020400AF, - - /* --- Next Codec --- */ - - /* coreboot specific header */ - 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI - 0x80860101, // Subsystem ID - 0x00000004, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ - AZALIA_SUBVENDOR(0x0, 0x80860101), - - /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), - - /* Pin Complex (NID 0x06) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x06, 0x18560020), - - /* Pin Complex (NID 0x07) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/google/parrot/mainboard.c b/src/mainboard/google/parrot/mainboard.c index 440596f730..547680e7e2 100644 --- a/src/mainboard/google/parrot/mainboard.c +++ b/src/mainboard/google/parrot/mainboard.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -48,16 +46,7 @@ void mainboard_suspend_resume(void) outb(0xe1, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -101,7 +90,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = parrot_onboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/peppy/hda_verb.c b/src/mainboard/google/peppy/hda_verb.c new file mode 100644 index 0000000000..a88d9f8890 --- /dev/null +++ b/src/mainboard/google/peppy/hda_verb.c @@ -0,0 +1,105 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 + 0x10ec0283, // Subsystem ID + 0x0000000c, // Number of jacks (NID entries) + + /* Bits 31:28 - Codec Address */ + /* Bits 27:20 - NID */ + /* Bits 19:8 - Verb ID */ + /* Bits 7:0 - Payload */ + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0283), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC - Disabled */ + AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), + + /* Pin Complex (NID 0x14) SPKR-OUT - Internal Speakers */ + // group 1, cap 0 + // no connector, no jack detect + // speaker out, analog + // fixed function, internal, Location N/A + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x17) MONO Out - Disabled */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) Disabled */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x19) MIC2 - 3.5mm Jack */ + // group2, cap 0 + // black, jack detect + // Mic in, 3.5mm Jack + // connector, External left panel + AZALIA_PIN_CFG(0x0, 0x19, 0x03a11020), + + /* Pin Complex (NID 0x1A) LINE1 - Internal Mic */ + // group 1, cap 1 + // no connector, no jack detect + // mic in, analog connection + // Fixed function, internal, Location N/A + AZALIA_PIN_CFG(0x0, 0x1a, 0x90a70111), + + /* Pin Complex (NID 0x1B) LINE2 - Disabled */ + AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), + + /* Pin Complex (NID 0x1D) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, Internal, Location N/A + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT - Disabled*/ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HP-OUT - 3.5mm Jack*/ + // group2, cap 1 + // black, jack detect + // HPOut, 3.5mm Jack + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x21, 0x03211021), + + /* Undocumented settings from Realtek (needed for beep_gen) */ + /* Widget node 0x20 */ + 0x02050010, + 0x02040c20, + 0x0205001b, + 0x0204081b, +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/peppy/hda_verb.h b/src/mainboard/google/peppy/hda_verb.h deleted file mode 100644 index 9203522443..0000000000 --- a/src/mainboard/google/peppy/hda_verb.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 - 0x10ec0283, // Subsystem ID - 0x0000000c, // Number of jacks (NID entries) - - /* Bits 31:28 - Codec Address */ - /* Bits 27:20 - NID */ - /* Bits 19:8 - Verb ID */ - /* Bits 7:0 - Payload */ - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0283), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC - Disabled */ - AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), - - /* Pin Complex (NID 0x14) SPKR-OUT - Internal Speakers */ - // group 1, cap 0 - // no connector, no jack detect - // speaker out, analog - // fixed function, internal, Location N/A - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x17) MONO Out - Disabled */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) Disabled */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x19) MIC2 - 3.5mm Jack */ - // group2, cap 0 - // black, jack detect - // Mic in, 3.5mm Jack - // connector, External left panel - AZALIA_PIN_CFG(0x0, 0x19, 0x03a11020), - - /* Pin Complex (NID 0x1A) LINE1 - Internal Mic */ - // group 1, cap 1 - // no connector, no jack detect - // mic in, analog connection - // Fixed function, internal, Location N/A - AZALIA_PIN_CFG(0x0, 0x1a, 0x90a70111), - - /* Pin Complex (NID 0x1B) LINE2 - Disabled */ - AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), - - /* Pin Complex (NID 0x1D) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, Internal, Location N/A - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT - Disabled*/ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HP-OUT - 3.5mm Jack*/ - // group2, cap 1 - // black, jack detect - // HPOut, 3.5mm Jack - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x21, 0x03211021), - - /* Undocumented settings from Realtek (needed for beep_gen) */ - /* Widget node 0x20 */ - 0x02050010, - 0x02040c20, - 0x0205001b, - 0x0204081b, -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - sizeof(mainboard_pc_beep_verbs) / sizeof(mainboard_pc_beep_verbs[0]); diff --git a/src/mainboard/google/peppy/mainboard.c b/src/mainboard/google/peppy/mainboard.c index 3fbec40dc8..0ccf90da86 100644 --- a/src/mainboard/google/peppy/mainboard.c +++ b/src/mainboard/google/peppy/mainboard.c @@ -33,10 +33,8 @@ #include #include #include -#include #include "ec.h" #include "onboard.h" -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -44,16 +42,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -103,7 +92,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = mainboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/samus/hda_verb.c b/src/mainboard/google/samus/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/google/samus/hda_verb.c @@ -0,0 +1,7 @@ +#include + +const u32 cim_verb_data[0] = {}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/slippy/hda_verb.c b/src/mainboard/google/slippy/hda_verb.c new file mode 100644 index 0000000000..68662c644f --- /dev/null +++ b/src/mainboard/google/slippy/hda_verb.c @@ -0,0 +1,96 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 Google Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 + 0x10ec0283, // Subsystem ID + 0x0000000c, // Number of jacks (NID entries) + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0283), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ + AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), + + /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ + // group 1, front left/right + // no connector, no jack detect + // speaker out, analog + // fixed function, internal + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x17) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18) MIC1 PORTB */ + // group 1, cap 1 + // black, jack detect + // mic in, analog + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), + + /* Pin Complex (NID 0x19) MIC2 PORTF */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + + /* Pin Complex (NID 0x1A) LINE1 PORTC */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1B) LINE2 PORTE */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1d) PCBeep */ + // eapd low on ex-amp, laptop, custom enable + // mute spkr on hpout + // pcbeep en able, checksum + // no physical, internal + AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), + + /* Pin Complex (NID 0x1E) SPDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Pin Complex (NID 0x21) HPOUT PORT-I */ + // group1, + // black, jack detect + // HPOut, 1/8 stereo + // connector, left panel + AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), + + /* Undocumented settings from Realtek (needed for beep_gen) */ + /* Widget node 0x20 */ + 0x02050010, + 0x02040c20, + 0x0205001b, + 0x0204081b, +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/slippy/hda_verb.h b/src/mainboard/google/slippy/hda_verb.h deleted file mode 100644 index b1f1cb6bf9..0000000000 --- a/src/mainboard/google/slippy/hda_verb.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 Google Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 - 0x10ec0283, // Subsystem ID - 0x0000000c, // Number of jacks (NID entries) - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0283 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0283), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12) DMIC - interior mobile lid */ - AZALIA_PIN_CFG(0x0, 0x12, 0xb7a61010), - - /* Pin Complex (NID 0x14) SPKR-OUT PORTD */ - // group 1, front left/right - // no connector, no jack detect - // speaker out, analog - // fixed function, internal - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x17) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18) MIC1 PORTB */ - // group 1, cap 1 - // black, jack detect - // mic in, analog - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x19, 0x03a71011), - - /* Pin Complex (NID 0x19) MIC2 PORTF */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - - /* Pin Complex (NID 0x1A) LINE1 PORTC */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1B) LINE2 PORTE */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1d) PCBeep */ - // eapd low on ex-amp, laptop, custom enable - // mute spkr on hpout - // pcbeep en able, checksum - // no physical, internal - AZALIA_PIN_CFG(0x0, 0x1d, 0x4015812d), - - /* Pin Complex (NID 0x1E) SPDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Pin Complex (NID 0x21) HPOUT PORT-I */ - // group1, - // black, jack detect - // HPOut, 1/8 stereo - // connector, left panel - AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), - - /* Undocumented settings from Realtek (needed for beep_gen) */ - /* Widget node 0x20 */ - 0x02050010, - 0x02040c20, - 0x0205001b, - 0x0204081b, -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; - -static const u32 mainboard_pc_beep_verbs_size = - sizeof(mainboard_pc_beep_verbs) / sizeof(mainboard_pc_beep_verbs[0]); diff --git a/src/mainboard/google/slippy/mainboard.c b/src/mainboard/google/slippy/mainboard.c index 4ccb5f9a71..0ccf90da86 100644 --- a/src/mainboard/google/slippy/mainboard.c +++ b/src/mainboard/google/slippy/mainboard.c @@ -35,8 +35,6 @@ #include #include "ec.h" #include "onboard.h" -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -44,16 +42,7 @@ void mainboard_suspend_resume(void) outb(0xcb, 0xb2); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; - -} static void mainboard_init(device_t dev) { @@ -103,7 +92,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = mainboard_smbios_data; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_EDP, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/google/stout/hda_verb.c b/src/mainboard/google/stout/hda_verb.c new file mode 100644 index 0000000000..3fcd4f5c65 --- /dev/null +++ b/src/mainboard/google/stout/hda_verb.c @@ -0,0 +1,95 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0269, // Codec Vendor / Device ID: Realtek + 0x17aa21fe, // Subsystem ID + 0x0000000c, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21fe */ + AZALIA_SUBVENDOR(0x0, 0x17aa21fe), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12): 0x90a60930 DMIC */ + AZALIA_PIN_CFG(0x0, 0x12, 0x90a60930), + + /* Pin Complex (NID 0x14): 0x90170110 SPEAKER-OUT (Port-D) */ + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + + /* Pin Complex (NID 0x15): 0x0321101f HP-OUT (Port-A) */ + AZALIA_PIN_CFG(0x0, 0x15, 0x0321101f), + + /* Pin Complex (NID 0x17): 0x411111f0 MONO-OUT (Port-H) */ + AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), + + /* Pin Complex (NID 0x18): 0x03a11820 MIC1 (Port-B) */ + AZALIA_PIN_CFG(0x0, 0x18, 0x03a11820), + + /* Pin Complex (NID 0x19): 0x411111f0 MIC2 (Port-F) */ + AZALIA_PIN_CFG(0x0, 0x19, 0x411111f0), + + /* Pin Complex (NID 0x1a): 0x411111f0 LINE1 (Port-C) */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), + + /* Pin Complex (NID 0x1b): 0x411111f0 LINE2 (Port-E) */ + AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), + + /* Pin Complex (NID 0x1d): 0x4016862d PC-BEEP */ + AZALIA_PIN_CFG(0x0, 0x1d, 0x4016862d), + + /* Pin Complex (NID 0x1e): 0x411111f0 S/PDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), + + /* Stout MIC detect setup */ + 0x02050018, + 0x02045184, + 0x02050008, + 0x02040300, + + /* coreboot specific header */ + 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI + 0x80860101, // Subsystem ID + 0x00000004, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ + AZALIA_SUBVENDOR(0x3, 0x80860101), + + /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ + AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), + + /* Pin Complex (NID 0x06) Not Connected */ + AZALIA_PIN_CFG(0x3, 0x06, 0x58560020), + + /* Pin Complex (NID 0x07) Not Connected */ + AZALIA_PIN_CFG(0x3, 0x07, 0x58560030) +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up everything (codec, dac, adc, mixers) */ + 0x01470740, /* enable speaker out */ + 0x01470c02, /* set speaker EAPD pin */ + 0x0143b01f, /* unmute speaker */ + 0x00c37100, /* unmute mixer nid 0xc input 1 */ + 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/stout/hda_verb.h b/src/mainboard/google/stout/hda_verb.h deleted file mode 100644 index 43dae91f85..0000000000 --- a/src/mainboard/google/stout/hda_verb.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0269, // Codec Vendor / Device ID: Realtek - 0x17aa21fe, // Subsystem ID - 0x0000000c, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21fe */ - AZALIA_SUBVENDOR(0x0, 0x17aa21fe), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12): 0x90a60930 DMIC */ - AZALIA_PIN_CFG(0x0, 0x12, 0x90a60930), - - /* Pin Complex (NID 0x14): 0x90170110 SPEAKER-OUT (Port-D) */ - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - - /* Pin Complex (NID 0x15): 0x0321101f HP-OUT (Port-A) */ - AZALIA_PIN_CFG(0x0, 0x15, 0x0321101f), - - /* Pin Complex (NID 0x17): 0x411111f0 MONO-OUT (Port-H) */ - AZALIA_PIN_CFG(0x0, 0x17, 0x411111f0), - - /* Pin Complex (NID 0x18): 0x03a11820 MIC1 (Port-B) */ - AZALIA_PIN_CFG(0x0, 0x18, 0x03a11820), - - /* Pin Complex (NID 0x19): 0x411111f0 MIC2 (Port-F) */ - AZALIA_PIN_CFG(0x0, 0x19, 0x411111f0), - - /* Pin Complex (NID 0x1a): 0x411111f0 LINE1 (Port-C) */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x411111f0), - - /* Pin Complex (NID 0x1b): 0x411111f0 LINE2 (Port-E) */ - AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), - - /* Pin Complex (NID 0x1d): 0x4016862d PC-BEEP */ - AZALIA_PIN_CFG(0x0, 0x1d, 0x4016862d), - - /* Pin Complex (NID 0x1e): 0x411111f0 S/PDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x411111f0), - - /* Stout MIC detect setup */ - 0x02050018, - 0x02045184, - 0x02050008, - 0x02040300, - - /* coreboot specific header */ - 0x80862806, // Codec Vendor / Device ID: Intel PantherPoint HDMI - 0x80860101, // Subsystem ID - 0x00000004, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x80860101 */ - AZALIA_SUBVENDOR(0x3, 0x80860101), - - /* Pin Complex (NID 0x05) Digital Out at Int HDMI */ - AZALIA_PIN_CFG(0x3, 0x05, 0x18560010), - - /* Pin Complex (NID 0x06) Not Connected */ - AZALIA_PIN_CFG(0x3, 0x06, 0x58560020), - - /* Pin Complex (NID 0x07) Not Connected */ - AZALIA_PIN_CFG(0x3, 0x07, 0x58560030) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up everything (codec, dac, adc, mixers) */ - 0x01470740, /* enable speaker out */ - 0x01470c02, /* set speaker EAPD pin */ - 0x0143b01f, /* unmute speaker */ - 0x00c37100, /* unmute mixer nid 0xc input 1 */ - 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ -}; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/google/stout/mainboard.c b/src/mainboard/google/stout/mainboard.c index 7562b5f622..9bcbfe4313 100644 --- a/src/mainboard/google/stout/mainboard.c +++ b/src/mainboard/google/stout/mainboard.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -48,15 +46,7 @@ void mainboard_suspend_resume(void) ec_write_cmd(EC_CMD_NOTIFY_ACPI_ENTER); } -/* Audio Setup */ -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); - pc_beep_verbs = mainboard_pc_beep_verbs; - pc_beep_verbs_size = mainboard_pc_beep_verbs_size; -} static void mainboard_init(device_t dev) { @@ -84,7 +74,6 @@ static void mainboard_enable(device_t dev) { dev->ops->init = mainboard_init; install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); - verb_setup(); } struct chip_operations mainboard_ops = { -- cgit v1.2.3