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/device/Makefile.inc | 4 + src/device/azalia_device.c | 3 - src/include/device/azalia_device.h | 19 +- src/mainboard/apple/macbook21/hda_verb.c | 66 +++++++ src/mainboard/apple/macbook21/hda_verb.h | 60 ------ src/mainboard/apple/macbook21/mainboard.c | 4 - src/mainboard/asus/m2n-e/hda_verb.c | 81 ++++++++ src/mainboard/asus/m2n-e/hda_verb.h | 78 -------- src/mainboard/asus/m2n-e/mainboard.c | 8 - src/mainboard/dmp/vortex86ex/hda_verb.c | 68 +++++++ src/mainboard/dmp/vortex86ex/hda_verb.h | 62 ------ src/mainboard/dmp/vortex86ex/mainboard.c | 8 - src/mainboard/emulation/qemu-q35/hda_verb.c | 7 + src/mainboard/getac/p470/hda_verb.c | 72 +++++++ src/mainboard/getac/p470/hda_verb.h | 66 ------- src/mainboard/getac/p470/mainboard.c | 8 - src/mainboard/gigabyte/m57sli/mainboard.c | 8 - 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 -- src/mainboard/ibase/mb899/hda_verb.c | 7 + src/mainboard/ibase/mb899/mainboard.c | 9 - src/mainboard/intel/baskingridge/hda_verb.c | 71 +++++++ src/mainboard/intel/baskingridge/hda_verb.h | 65 ------- src/mainboard/intel/baskingridge/mainboard.c | 9 - src/mainboard/intel/cougar_canyon2/hda_verb.c | 40 ++++ src/mainboard/intel/cougar_canyon2/hda_verb.h | 37 ---- src/mainboard/intel/cougar_canyon2/mainboard.c | 9 - src/mainboard/intel/d945gclf/hda_verb.c | 7 + src/mainboard/intel/emeraldlake2/hda_verb.c | 71 +++++++ src/mainboard/intel/emeraldlake2/hda_verb.h | 65 ------- src/mainboard/intel/emeraldlake2/mainboard.c | 9 - src/mainboard/intel/wtm2/hda_verb.c | 71 +++++++ src/mainboard/intel/wtm2/hda_verb.h | 65 ------- src/mainboard/intel/wtm2/mainboard.c | 9 - src/mainboard/iwave/iWRainbowG6/hda_verb.c | 92 +++++++++ src/mainboard/iwave/iWRainbowG6/hda_verb.h | 91 --------- src/mainboard/iwave/iWRainbowG6/mainboard.c | 8 - src/mainboard/kontron/986lcd-m/hda_verb.c | 7 + src/mainboard/kontron/986lcd-m/mainboard.c | 9 - src/mainboard/kontron/ktqm77/hda_verb.c | 121 ++++++++++++ src/mainboard/kontron/ktqm77/hda_verb.h | 115 ----------- src/mainboard/kontron/ktqm77/mainboard.c | 9 - src/mainboard/lenovo/t520/hda_verb.c | 190 +++++++++++++++++++ src/mainboard/lenovo/t520/hda_verb.h | 189 ------------------- src/mainboard/lenovo/t520/mainboard.c | 12 -- src/mainboard/lenovo/t530/hda_verb.c | 252 +++++++++++++++++++++++++ src/mainboard/lenovo/t530/hda_verb.h | 251 ------------------------ src/mainboard/lenovo/t530/mainboard.c | 12 -- src/mainboard/lenovo/t60/hda_verb.c | 7 + src/mainboard/lenovo/x200/hda_verb.c | 51 +++++ src/mainboard/lenovo/x200/hda_verb.h | 48 ----- src/mainboard/lenovo/x200/mainboard.c | 11 -- src/mainboard/lenovo/x201/hda_verb.c | 81 ++++++++ src/mainboard/lenovo/x201/hda_verb.h | 75 -------- src/mainboard/lenovo/x201/mainboard.c | 9 - src/mainboard/lenovo/x220/hda_verb.c | 214 +++++++++++++++++++++ src/mainboard/lenovo/x220/hda_verb.h | 213 --------------------- src/mainboard/lenovo/x220/mainboard.c | 12 -- src/mainboard/lenovo/x230/hda_verb.c | 252 +++++++++++++++++++++++++ src/mainboard/lenovo/x230/hda_verb.h | 251 ------------------------ src/mainboard/lenovo/x230/mainboard.c | 12 -- src/mainboard/lenovo/x60/hda_verb.c | 7 + src/mainboard/msi/ms7260/mainboard.c | 8 - src/mainboard/msi/ms9282/mainboard.c | 8 - src/mainboard/msi/ms9652_fam10/mainboard.c | 9 - src/mainboard/nvidia/l1_2pvv/hda_verb.c | 67 +++++++ src/mainboard/nvidia/l1_2pvv/hda_verb.h | 66 ------- src/mainboard/nvidia/l1_2pvv/mainboard.c | 8 - src/mainboard/packardbell/ms2290/hda_verb.c | 66 +++++++ src/mainboard/packardbell/ms2290/hda_verb.h | 60 ------ src/mainboard/packardbell/ms2290/mainboard.c | 9 - src/mainboard/roda/rk886ex/hda_verb.c | 7 + src/mainboard/roda/rk9/hda_verb.c | 67 +++++++ src/mainboard/roda/rk9/hda_verb.h | 64 ------- src/mainboard/roda/rk9/mainboard.c | 11 -- src/mainboard/samsung/lumpy/hda_verb.c | 61 ++++++ src/mainboard/samsung/lumpy/hda_verb.h | 60 ------ src/mainboard/samsung/lumpy/mainboard.c | 11 -- src/mainboard/samsung/stumpy/hda_verb.c | 76 ++++++++ src/mainboard/samsung/stumpy/hda_verb.h | 75 -------- src/mainboard/samsung/stumpy/mainboard.c | 11 -- src/southbridge/intel/bd82x6x/Makefile.inc | 2 + src/southbridge/intel/bd82x6x/azalia.c | 6 +- src/southbridge/intel/i82801gx/Makefile.inc | 2 + src/southbridge/intel/i82801gx/azalia.c | 4 +- src/southbridge/intel/i82801ix/Makefile.inc | 2 + src/southbridge/intel/i82801ix/hdaudio.c | 6 +- src/southbridge/intel/ibexpeak/Makefile.inc | 2 + src/southbridge/intel/ibexpeak/azalia.c | 6 +- src/southbridge/intel/lynxpoint/Makefile.inc | 2 + src/southbridge/intel/lynxpoint/azalia.c | 8 +- 117 files changed, 3317 insertions(+), 3522 deletions(-) create mode 100644 src/mainboard/apple/macbook21/hda_verb.c delete mode 100644 src/mainboard/apple/macbook21/hda_verb.h create mode 100644 src/mainboard/asus/m2n-e/hda_verb.c delete mode 100644 src/mainboard/asus/m2n-e/hda_verb.h create mode 100644 src/mainboard/dmp/vortex86ex/hda_verb.c delete mode 100644 src/mainboard/dmp/vortex86ex/hda_verb.h create mode 100644 src/mainboard/emulation/qemu-q35/hda_verb.c create mode 100644 src/mainboard/getac/p470/hda_verb.c delete mode 100644 src/mainboard/getac/p470/hda_verb.h 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 create mode 100644 src/mainboard/ibase/mb899/hda_verb.c create mode 100644 src/mainboard/intel/baskingridge/hda_verb.c delete mode 100644 src/mainboard/intel/baskingridge/hda_verb.h create mode 100644 src/mainboard/intel/cougar_canyon2/hda_verb.c delete mode 100644 src/mainboard/intel/cougar_canyon2/hda_verb.h create mode 100644 src/mainboard/intel/d945gclf/hda_verb.c create mode 100644 src/mainboard/intel/emeraldlake2/hda_verb.c delete mode 100644 src/mainboard/intel/emeraldlake2/hda_verb.h create mode 100644 src/mainboard/intel/wtm2/hda_verb.c delete mode 100644 src/mainboard/intel/wtm2/hda_verb.h create mode 100644 src/mainboard/iwave/iWRainbowG6/hda_verb.c delete mode 100644 src/mainboard/iwave/iWRainbowG6/hda_verb.h create mode 100644 src/mainboard/kontron/986lcd-m/hda_verb.c create mode 100644 src/mainboard/kontron/ktqm77/hda_verb.c delete mode 100644 src/mainboard/kontron/ktqm77/hda_verb.h create mode 100644 src/mainboard/lenovo/t520/hda_verb.c delete mode 100644 src/mainboard/lenovo/t520/hda_verb.h create mode 100644 src/mainboard/lenovo/t530/hda_verb.c delete mode 100644 src/mainboard/lenovo/t530/hda_verb.h create mode 100644 src/mainboard/lenovo/t60/hda_verb.c create mode 100644 src/mainboard/lenovo/x200/hda_verb.c delete mode 100644 src/mainboard/lenovo/x200/hda_verb.h create mode 100644 src/mainboard/lenovo/x201/hda_verb.c delete mode 100644 src/mainboard/lenovo/x201/hda_verb.h create mode 100644 src/mainboard/lenovo/x220/hda_verb.c delete mode 100644 src/mainboard/lenovo/x220/hda_verb.h create mode 100644 src/mainboard/lenovo/x230/hda_verb.c delete mode 100644 src/mainboard/lenovo/x230/hda_verb.h create mode 100644 src/mainboard/lenovo/x60/hda_verb.c create mode 100644 src/mainboard/nvidia/l1_2pvv/hda_verb.c delete mode 100644 src/mainboard/nvidia/l1_2pvv/hda_verb.h create mode 100644 src/mainboard/packardbell/ms2290/hda_verb.c delete mode 100644 src/mainboard/packardbell/ms2290/hda_verb.h create mode 100644 src/mainboard/roda/rk886ex/hda_verb.c create mode 100644 src/mainboard/roda/rk9/hda_verb.c delete mode 100644 src/mainboard/roda/rk9/hda_verb.h create mode 100644 src/mainboard/samsung/lumpy/hda_verb.c delete mode 100644 src/mainboard/samsung/lumpy/hda_verb.h create mode 100644 src/mainboard/samsung/stumpy/hda_verb.c delete mode 100644 src/mainboard/samsung/stumpy/hda_verb.h (limited to 'src') diff --git a/src/device/Makefile.inc b/src/device/Makefile.inc index 0b870952b3..a7f336489d 100644 --- a/src/device/Makefile.inc +++ b/src/device/Makefile.inc @@ -14,6 +14,10 @@ ramstage-$(CONFIG_PCI) += pci_ops.c ramstage-$(CONFIG_PCI) += pci_early.c ramstage-y += smbus_ops.c +ifeq ($(CONFIG_AZALIA_PLUGIN_SUPPORT),y) +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c +endif + romstage-y += device_romstage.c romstage-$(CONFIG_PCI) += pci_early.c diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index cbc878d920..b250f3da7b 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -110,9 +110,6 @@ no_codec: return 0; } -const u32 *cim_verb_data = NULL; -u32 cim_verb_data_size = 0; - static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) { printk(BIOS_DEBUG, "azalia_audio: dev=%s\n", dev_path(dev)); diff --git a/src/include/device/azalia_device.h b/src/include/device/azalia_device.h index 4940cd238d..0f477a357a 100644 --- a/src/include/device/azalia_device.h +++ b/src/include/device/azalia_device.h @@ -20,15 +20,26 @@ #ifndef DEVICE_AZALIA_H #define DEVICE_AZALIA_H +#include +#include +#include +#include +#include +#include +#include + #include void azalia_audio_init(struct device *dev); extern struct device_operations default_azalia_audio_ops; -extern const u32 *cim_verb_data; -extern u32 cim_verb_data_size; -extern const u32 *pc_beep_verbs; -extern u32 pc_beep_verbs_size; +extern const u32 cim_verb_data[]; +extern const u32 cim_verb_data_size; +extern const u32 pc_beep_verbs[]; +extern const u32 pc_beep_verbs_size; + +#define AZALIA_ARRAY_SIZES const u32 pc_beep_verbs_size = ARRAY_SIZE(pc_beep_verbs); \ + const u32 cim_verb_data_size = sizeof(cim_verb_data) #define AZALIA_PIN_CFG(codec, pin, val) \ ((codec) << 28) | ((pin) << 20) | ( 0x71c << 8) | ((val) & 0xff), \ diff --git a/src/mainboard/apple/macbook21/hda_verb.c b/src/mainboard/apple/macbook21/hda_verb.c new file mode 100644 index 0000000000..1fe188e357 --- /dev/null +++ b/src/mainboard/apple/macbook21/hda_verb.c @@ -0,0 +1,66 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2014 Vladimir Serbinenko. + * + * 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, + * or (at your option) any later version. + * + * 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 */ + 0x83847680, /* Codec Vendor / Device ID: SigmaTel STAC9221 A1 */ + 0x106b2200, /* Subsystem ID */ + 0x0000000B, /* Number of 4 dword sets */ + + /* NID 0x01: Subsystem ID. */ + AZALIA_SUBVENDOR(0x0, 0x106B2200), + + /* NID 0x0A. */ + AZALIA_PIN_CFG(0x0, 0x0A, 0x0321E21F), + + /* NID 0x0B. */ + AZALIA_PIN_CFG(0x0, 0x0B, 0x03A1E02E), + + /* NID 0x0C. */ + AZALIA_PIN_CFG(0x0, 0x0C, 0x9017E110), + + /* NID 0x0D. */ + AZALIA_PIN_CFG(0x0, 0x0D, 0x9017E11F), + + /* NID 0x0E. */ + AZALIA_PIN_CFG(0x0, 0x0E, 0x400000FE), + + /* NID 0x0F */ + AZALIA_PIN_CFG(0x0, 0x0F, 0x0381E020), + + /* NID 0x10 */ + AZALIA_PIN_CFG(0x0, 0x10, 0x1345E230), + + /* NID 0x11 */ + AZALIA_PIN_CFG(0x0, 0x11, 0x13C5E240), + + /* NID 0x15 */ + AZALIA_PIN_CFG(0x0, 0x15, 0x400000FC), + + /* NID 0x1B. */ + AZALIA_PIN_CFG(0x0, 0x1B, 0x400000FB), + +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/apple/macbook21/hda_verb.h b/src/mainboard/apple/macbook21/hda_verb.h deleted file mode 100644 index 07fa6bc81e..0000000000 --- a/src/mainboard/apple/macbook21/hda_verb.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2014 Vladimir Serbinenko. - * - * 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, - * or (at your option) any later version. - * - * 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 */ - 0x83847680, /* Codec Vendor / Device ID: SigmaTel STAC9221 A1 */ - 0x106b2200, /* Subsystem ID */ - 0x0000000B, /* Number of 4 dword sets */ - - /* NID 0x01: Subsystem ID. */ - AZALIA_SUBVENDOR(0x0, 0x106B2200), - - /* NID 0x0A. */ - AZALIA_PIN_CFG(0x0, 0x0A, 0x0321E21F), - - /* NID 0x0B. */ - AZALIA_PIN_CFG(0x0, 0x0B, 0x03A1E02E), - - /* NID 0x0C. */ - AZALIA_PIN_CFG(0x0, 0x0C, 0x9017E110), - - /* NID 0x0D. */ - AZALIA_PIN_CFG(0x0, 0x0D, 0x9017E11F), - - /* NID 0x0E. */ - AZALIA_PIN_CFG(0x0, 0x0E, 0x400000FE), - - /* NID 0x0F */ - AZALIA_PIN_CFG(0x0, 0x0F, 0x0381E020), - - /* NID 0x10 */ - AZALIA_PIN_CFG(0x0, 0x10, 0x1345E230), - - /* NID 0x11 */ - AZALIA_PIN_CFG(0x0, 0x11, 0x13C5E240), - - /* NID 0x15 */ - AZALIA_PIN_CFG(0x0, 0x15, 0x400000FC), - - /* NID 0x1B. */ - AZALIA_PIN_CFG(0x0, 0x1B, 0x400000FB), - -}; diff --git a/src/mainboard/apple/macbook21/mainboard.c b/src/mainboard/apple/macbook21/mainboard.c index 846914cae2..99527c1e75 100644 --- a/src/mainboard/apple/macbook21/mainboard.c +++ b/src/mainboard/apple/macbook21/mainboard.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include "hda_verb.h" #define PANEL INT15_5F35_CL_DISPLAY_DEFAULT int get_cst_entries(acpi_cstate_t **entries) @@ -51,8 +49,6 @@ static void mainboard_init(device_t dev) static void mainboard_enable(device_t dev) { dev->ops->init = mainboard_init; - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/asus/m2n-e/hda_verb.c b/src/mainboard/asus/m2n-e/hda_verb.c new file mode 100644 index 0000000000..2f8fe87941 --- /dev/null +++ b/src/mainboard/asus/m2n-e/hda_verb.c @@ -0,0 +1,81 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2010 Uwe Hermann + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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 + */ + +/* + * HDA codec soldered onto the ASUS M2N-E: + * Analog Devices AD1988B (High Definition Audio SoundMAX Codec), rev. 0x100200 + * http://www.analog.com/static/imported-files/data_sheets/AD1988A_1988B.pdf + */ + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x11d4198b, /* Codec Vendor / Device ID: Analog Devices AD1988B */ + 0x104381f6, /* Subsystem ID (0x1043 == ASUS) */ + 0x0000000d, /* Number of "pin complex" entries in the table */ + + /* NID 0x01, FUNCTION, Designates this device as an audio codec */ + /* Set the Implementation ID (IID), here: 0x104381f6. */ + AZALIA_SUBVENDOR(0x0, 0x104381f6), + + /* "Pin complex" HDA widgets. Comments: Node ID, Name, Description. */ + + /* NID 0x11, Port A, Front panel headphone jack */ + AZALIA_PIN_CFG(0x0, 0x11, 0x02214130), + + /* NID 0x12, Port D, Rear panel front speaker jack */ + AZALIA_PIN_CFG(0x0, 0x12, 0x01014010), + + /* NID 0x13, MONO_OUT, Monaural output pin */ + AZALIA_PIN_CFG(0x0, 0x13, 0x511711f0), + + /* NID 0x14, Port B, Front panel microphone jack */ + AZALIA_PIN_CFG(0x0, 0x14, 0x02a19122), + + /* NID 0x15, Port C, Rear panel line-in jack */ + AZALIA_PIN_CFG(0x0, 0x15, 0x01813021), + + /* NID 0x16, Port F, Rear panel surround-back (5.1) jack */ + AZALIA_PIN_CFG(0x0, 0x16, 0x01011012), + + /* NID 0x17, Port E, Rear panel microphone jack */ + AZALIA_PIN_CFG(0x0, 0x17, 0x01a19020), + + /* NID 0x18, CD IN, Analog CD input */ + AZALIA_PIN_CFG(0x0, 0x18, 0x9933112e), + + /* NID 0x1a, Analog PCBEEP, External analog PCBEEP signal input */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x99f301f0), + + /* NID 0x1b, S/PDIF Out, S/PDIF output pin */ + AZALIA_PIN_CFG(0x0, 0x1b, 0x0145f1f0), + + /* NID 0x1c, S/PDIF In, S/PDIF input pin */ + AZALIA_PIN_CFG(0x0, 0x1c, 0x41c5f1f0), + + /* NID 0x24, Port G, Rear panel C/LFE jack */ + AZALIA_PIN_CFG(0x0, 0x24, 0x01016011), + + /* NID 0x25, Port H, Rear panel surround-side (7.1) jack */ + AZALIA_PIN_CFG(0x0, 0x25, 0x01012014), +}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/asus/m2n-e/hda_verb.h b/src/mainboard/asus/m2n-e/hda_verb.h deleted file mode 100644 index 9dd3d88ec9..0000000000 --- a/src/mainboard/asus/m2n-e/hda_verb.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2010 Uwe Hermann - * - * 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; either version 2 of the License, or - * (at your option) any later version. - * - * 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 - */ - -/* - * HDA codec soldered onto the ASUS M2N-E: - * Analog Devices AD1988B (High Definition Audio SoundMAX Codec), rev. 0x100200 - * http://www.analog.com/static/imported-files/data_sheets/AD1988A_1988B.pdf - */ - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x11d4198b, /* Codec Vendor / Device ID: Analog Devices AD1988B */ - 0x104381f6, /* Subsystem ID (0x1043 == ASUS) */ - 0x0000000d, /* Number of "pin complex" entries in the table */ - - /* NID 0x01, FUNCTION, Designates this device as an audio codec */ - /* Set the Implementation ID (IID), here: 0x104381f6. */ - AZALIA_SUBVENDOR(0x0, 0x104381f6), - - /* "Pin complex" HDA widgets. Comments: Node ID, Name, Description. */ - - /* NID 0x11, Port A, Front panel headphone jack */ - AZALIA_PIN_CFG(0x0, 0x11, 0x02214130), - - /* NID 0x12, Port D, Rear panel front speaker jack */ - AZALIA_PIN_CFG(0x0, 0x12, 0x01014010), - - /* NID 0x13, MONO_OUT, Monaural output pin */ - AZALIA_PIN_CFG(0x0, 0x13, 0x511711f0), - - /* NID 0x14, Port B, Front panel microphone jack */ - AZALIA_PIN_CFG(0x0, 0x14, 0x02a19122), - - /* NID 0x15, Port C, Rear panel line-in jack */ - AZALIA_PIN_CFG(0x0, 0x15, 0x01813021), - - /* NID 0x16, Port F, Rear panel surround-back (5.1) jack */ - AZALIA_PIN_CFG(0x0, 0x16, 0x01011012), - - /* NID 0x17, Port E, Rear panel microphone jack */ - AZALIA_PIN_CFG(0x0, 0x17, 0x01a19020), - - /* NID 0x18, CD IN, Analog CD input */ - AZALIA_PIN_CFG(0x0, 0x18, 0x9933112e), - - /* NID 0x1a, Analog PCBEEP, External analog PCBEEP signal input */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x99f301f0), - - /* NID 0x1b, S/PDIF Out, S/PDIF output pin */ - AZALIA_PIN_CFG(0x0, 0x1b, 0x0145f1f0), - - /* NID 0x1c, S/PDIF In, S/PDIF input pin */ - AZALIA_PIN_CFG(0x0, 0x1c, 0x41c5f1f0), - - /* NID 0x24, Port G, Rear panel C/LFE jack */ - AZALIA_PIN_CFG(0x0, 0x24, 0x01016011), - - /* NID 0x25, Port H, Rear panel surround-side (7.1) jack */ - AZALIA_PIN_CFG(0x0, 0x25, 0x01012014), -}; - diff --git a/src/mainboard/asus/m2n-e/mainboard.c b/src/mainboard/asus/m2n-e/mainboard.c index 51a44194d8..2c18100ea5 100644 --- a/src/mainboard/asus/m2n-e/mainboard.c +++ b/src/mainboard/asus/m2n-e/mainboard.c @@ -19,18 +19,10 @@ */ #include -#include -#include "hda_verb.h" -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/dmp/vortex86ex/hda_verb.c b/src/mainboard/dmp/vortex86ex/hda_verb.c new file mode 100644 index 0000000000..79ee44ed15 --- /dev/null +++ b/src/mainboard/dmp/vortex86ex/hda_verb.c @@ -0,0 +1,68 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013 DMP Electronics 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 */ + 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 + 0x10714700, // Subsystem ID + 0x0000000f, // Number of jacks + + /* ===== HDA Codec Subsystem ID Verb-table ===== */ + /* HDA Codec Subsystem ID : 0x10EC0000 */ + AZALIA_SUBVENDOR(0x0, 0x10ec0000), + + /* ===== Pin Widget Verb-table ===== */ + /* Widget node 0x01 : */ + 0x0017ff00, + 0x0017ff00, + 0x0017ff00, + 0x0017ff00, + /* Pin widget 0x11 - S/PDIF-OUT2 */ + AZALIA_PIN_CFG(0x0, 0x11, 0x40000000), + /* Pin widget 0x12 - DMIC */ + AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), + /* Pin widget 0x14 - LINE-OUT (Port-D) */ + AZALIA_PIN_CFG(0x0, 0x14, 0x01014110), + /* Pin widget 0x15 - HP-OUT (Port-A) */ + AZALIA_PIN_CFG(0x0, 0x15, 0x411111f0), + /* Pin widget 0x16 - MONO-OUT */ + AZALIA_PIN_CFG(0x0, 0x16, 0x411111f0), + /* Pin widget 0x18 - MIC1 (Port-B) */ + AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), + /* Pin widget 0x19 - MIC2 (Port-F) */ + AZALIA_PIN_CFG(0x0, 0x19, 0x02a19130), + /* Pin widget 0x1A - LINE1 (Port-C) */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x01813140), + /* Pin widget 0x1B - LINE2 (Port-E) */ + AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), + /* Pin widget 0x1C - CD-IN */ + AZALIA_PIN_CFG(0x0, 0x1c, 0x411111f0), + /* Pin widget 0x1D - BEEP-IN */ + AZALIA_PIN_CFG(0x0, 0x1d, 0x40354629), + /* Pin widget 0x1E - S/PDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x18561120), + /* Pin widget 0x1F - S/PDIF-IN */ + AZALIA_PIN_CFG(0x0, 0x1f, 0x411111f0), +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/dmp/vortex86ex/hda_verb.h b/src/mainboard/dmp/vortex86ex/hda_verb.h deleted file mode 100644 index 5402b621ef..0000000000 --- a/src/mainboard/dmp/vortex86ex/hda_verb.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2013 DMP Electronics 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 */ - 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 - 0x10714700, // Subsystem ID - 0x0000000f, // Number of jacks - - /* ===== HDA Codec Subsystem ID Verb-table ===== */ - /* HDA Codec Subsystem ID : 0x10EC0000 */ - AZALIA_SUBVENDOR(0x0, 0x10ec0000), - - /* ===== Pin Widget Verb-table ===== */ - /* Widget node 0x01 : */ - 0x0017ff00, - 0x0017ff00, - 0x0017ff00, - 0x0017ff00, - /* Pin widget 0x11 - S/PDIF-OUT2 */ - AZALIA_PIN_CFG(0x0, 0x11, 0x40000000), - /* Pin widget 0x12 - DMIC */ - AZALIA_PIN_CFG(0x0, 0x12, 0x411111f0), - /* Pin widget 0x14 - LINE-OUT (Port-D) */ - AZALIA_PIN_CFG(0x0, 0x14, 0x01014110), - /* Pin widget 0x15 - HP-OUT (Port-A) */ - AZALIA_PIN_CFG(0x0, 0x15, 0x411111f0), - /* Pin widget 0x16 - MONO-OUT */ - AZALIA_PIN_CFG(0x0, 0x16, 0x411111f0), - /* Pin widget 0x18 - MIC1 (Port-B) */ - AZALIA_PIN_CFG(0x0, 0x18, 0x411111f0), - /* Pin widget 0x19 - MIC2 (Port-F) */ - AZALIA_PIN_CFG(0x0, 0x19, 0x02a19130), - /* Pin widget 0x1A - LINE1 (Port-C) */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x01813140), - /* Pin widget 0x1B - LINE2 (Port-E) */ - AZALIA_PIN_CFG(0x0, 0x1b, 0x411111f0), - /* Pin widget 0x1C - CD-IN */ - AZALIA_PIN_CFG(0x0, 0x1c, 0x411111f0), - /* Pin widget 0x1D - BEEP-IN */ - AZALIA_PIN_CFG(0x0, 0x1d, 0x40354629), - /* Pin widget 0x1E - S/PDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x18561120), - /* Pin widget 0x1F - S/PDIF-IN */ - AZALIA_PIN_CFG(0x0, 0x1f, 0x411111f0), -}; diff --git a/src/mainboard/dmp/vortex86ex/mainboard.c b/src/mainboard/dmp/vortex86ex/mainboard.c index edf18c27a0..2761035231 100644 --- a/src/mainboard/dmp/vortex86ex/mainboard.c +++ b/src/mainboard/dmp/vortex86ex/mainboard.c @@ -23,18 +23,10 @@ #include #include #include -#include -#include "hda_verb.h" -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/emulation/qemu-q35/hda_verb.c b/src/mainboard/emulation/qemu-q35/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/emulation/qemu-q35/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/getac/p470/hda_verb.c b/src/mainboard/getac/p470/hda_verb.c new file mode 100644 index 0000000000..2a753421bb --- /dev/null +++ b/src/mainboard/getac/p470/hda_verb.c @@ -0,0 +1,72 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * + * 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 */ + 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 + 0x10714700, // Subsystem ID + 0x0000000d, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0000 */ + AZALIA_SUBVENDOR(0x0, 0x10EC0000), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x12), DMIC */ + AZALIA_PIN_CFG(0x0, 0x12, 0x411111F0), + + /* Pin Complex (NID 0x14), LINE_OUT (port D) */ + AZALIA_PIN_CFG(0x0, 0x14, 0x99130110), + + /* Pin Complex (NID 0x15), HP_OUT (port A) */ + AZALIA_PIN_CFG(0x0, 0x15, 0x01214020), + + /* Pin Complex (NID 0x16), MONO-OUT */ + AZALIA_PIN_CFG(0x0, 0x16, 0x411111F0), + + /* Pin Complex (NID 0x18), MIC1 (port B) */ + AZALIA_PIN_CFG(0x0, 0x18, 0x01A19830), + + /* Pin Complex (NID 0x19), MIC2 (port F) */ + AZALIA_PIN_CFG(0x0, 0x19, 0x99A30931), + + /* Pin Complex (NID 0x1A), LINE1 (port C) */ + AZALIA_PIN_CFG(0x0, 0x1A, 0x02A1983F), + + /* Pin Complex (NID 0x1B), LINE2 (port E) */ + AZALIA_PIN_CFG(0x0, 0x1B, 0x0221401F), + + /* Pin Complex (NID 0x1C), CD_IN */ + AZALIA_PIN_CFG(0x0, 0x1C, 0x411111F0), + + /* Pin Complex (NID 0x1D), PCBEEP */ + AZALIA_PIN_CFG(0x0, 0x1D, 0x411111F0), + + /* Pin Complex (NID 0x1E), S/PDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), + + /* Pin Complex (NID 0x1F), S/PDIF-IN */ + AZALIA_PIN_CFG(0x0, 0x1F, 0x411111F0), +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/getac/p470/hda_verb.h b/src/mainboard/getac/p470/hda_verb.h deleted file mode 100644 index 280d6f2604..0000000000 --- a/src/mainboard/getac/p470/hda_verb.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007-2009 coresystems GmbH - * - * 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 */ - 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 - 0x10714700, // Subsystem ID - 0x0000000d, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10ec0000 */ - AZALIA_SUBVENDOR(0x0, 0x10EC0000), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x12), DMIC */ - AZALIA_PIN_CFG(0x0, 0x12, 0x411111F0), - - /* Pin Complex (NID 0x14), LINE_OUT (port D) */ - AZALIA_PIN_CFG(0x0, 0x14, 0x99130110), - - /* Pin Complex (NID 0x15), HP_OUT (port A) */ - AZALIA_PIN_CFG(0x0, 0x15, 0x01214020), - - /* Pin Complex (NID 0x16), MONO-OUT */ - AZALIA_PIN_CFG(0x0, 0x16, 0x411111F0), - - /* Pin Complex (NID 0x18), MIC1 (port B) */ - AZALIA_PIN_CFG(0x0, 0x18, 0x01A19830), - - /* Pin Complex (NID 0x19), MIC2 (port F) */ - AZALIA_PIN_CFG(0x0, 0x19, 0x99A30931), - - /* Pin Complex (NID 0x1A), LINE1 (port C) */ - AZALIA_PIN_CFG(0x0, 0x1A, 0x02A1983F), - - /* Pin Complex (NID 0x1B), LINE2 (port E) */ - AZALIA_PIN_CFG(0x0, 0x1B, 0x0221401F), - - /* Pin Complex (NID 0x1C), CD_IN */ - AZALIA_PIN_CFG(0x0, 0x1C, 0x411111F0), - - /* Pin Complex (NID 0x1D), PCBEEP */ - AZALIA_PIN_CFG(0x0, 0x1D, 0x411111F0), - - /* Pin Complex (NID 0x1E), S/PDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), - - /* Pin Complex (NID 0x1F), S/PDIF-IN */ - AZALIA_PIN_CFG(0x0, 0x1F, 0x411111F0), -}; diff --git a/src/mainboard/getac/p470/mainboard.c b/src/mainboard/getac/p470/mainboard.c index ac235d3b1f..5dcdb39c5a 100644 --- a/src/mainboard/getac/p470/mainboard.c +++ b/src/mainboard/getac/p470/mainboard.c @@ -24,9 +24,7 @@ #include #include #include -#include -#include "hda_verb.h" #include "ec_oem.c" @@ -78,11 +76,6 @@ static void pcie_limit_power(void) #endif } -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) { @@ -95,7 +88,6 @@ static void mainboard_enable(device_t dev) { dev->ops->init = mainboard_init; pcie_limit_power(); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/gigabyte/m57sli/mainboard.c b/src/mainboard/gigabyte/m57sli/mainboard.c index 3fe4106288..291d4f7b20 100644 --- a/src/mainboard/gigabyte/m57sli/mainboard.c +++ b/src/mainboard/gigabyte/m57sli/mainboard.c @@ -24,18 +24,10 @@ #include #include #include -// #include "hda_verb.h" -static void verb_setup(void) -{ - /* TODO: Add a correct hda_verb.h file for this board. */ - // cim_verb_data = mainboard_cim_verb_data; - // cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { 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 = { diff --git a/src/mainboard/ibase/mb899/hda_verb.c b/src/mainboard/ibase/mb899/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/ibase/mb899/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/ibase/mb899/mainboard.c b/src/mainboard/ibase/mb899/mainboard.c index 6c80b426cf..a2a10a17c1 100644 --- a/src/mainboard/ibase/mb899/mainboard.c +++ b/src/mainboard/ibase/mb899/mainboard.c @@ -24,17 +24,9 @@ #include #include #include -#include #include "superio_hwm.h" -/* Audio Setup */ -static void verb_setup(void) -{ - // Default VERB is fine on this mainboard. - cim_verb_data = NULL; - cim_verb_data_size = 0; -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -42,7 +34,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3); - verb_setup(); hwm_setup(); } diff --git a/src/mainboard/intel/baskingridge/hda_verb.c b/src/mainboard/intel/baskingridge/hda_verb.c new file mode 100644 index 0000000000..96770de362 --- /dev/null +++ b/src/mainboard/intel/baskingridge/hda_verb.c @@ -0,0 +1,71 @@ +/* + * 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 */ + 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 + 0x10134210, // Subsystem ID + 0x00000007, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ + AZALIA_SUBVENDOR(0x0, 0x10134210), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), + + /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ + AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), + + /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), + + /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), + + /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), + + /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ + AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), + + /* coreboot specific header */ + 0x80862805, // 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(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[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/intel/baskingridge/hda_verb.h b/src/mainboard/intel/baskingridge/hda_verb.h deleted file mode 100644 index 2796e92682..0000000000 --- a/src/mainboard/intel/baskingridge/hda_verb.h +++ /dev/null @@ -1,65 +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 */ - 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 - 0x10134210, // Subsystem ID - 0x00000007, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ - AZALIA_SUBVENDOR(0x0, 0x10134210), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), - - /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ - AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), - - /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), - - /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), - - /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), - - /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ - AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), - - /* coreboot specific header */ - 0x80862805, // 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(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) -}; diff --git a/src/mainboard/intel/baskingridge/mainboard.c b/src/mainboard/intel/baskingridge/mainboard.c index b4982f8625..a6839fc343 100644 --- a/src/mainboard/intel/baskingridge/mainboard.c +++ b/src/mainboard/intel/baskingridge/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -41,13 +39,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); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -55,7 +47,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { 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/intel/cougar_canyon2/hda_verb.c b/src/mainboard/intel/cougar_canyon2/hda_verb.c new file mode 100644 index 0000000000..c518b781bd --- /dev/null +++ b/src/mainboard/intel/cougar_canyon2/hda_verb.c @@ -0,0 +1,40 @@ +/* + * 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 */ + 0x80862805, // 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(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) +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/intel/cougar_canyon2/hda_verb.h b/src/mainboard/intel/cougar_canyon2/hda_verb.h deleted file mode 100644 index 381e338c45..0000000000 --- a/src/mainboard/intel/cougar_canyon2/hda_verb.h +++ /dev/null @@ -1,37 +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 */ - 0x80862805, // 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(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) -}; diff --git a/src/mainboard/intel/cougar_canyon2/mainboard.c b/src/mainboard/intel/cougar_canyon2/mainboard.c index bb4806a8f3..0ea03d3cf3 100644 --- a/src/mainboard/intel/cougar_canyon2/mainboard.c +++ b/src/mainboard/intel/cougar_canyon2/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" #if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) void mainboard_suspend_resume(void) @@ -43,13 +41,7 @@ void mainboard_suspend_resume(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); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -57,7 +49,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { 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/intel/d945gclf/hda_verb.c b/src/mainboard/intel/d945gclf/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/intel/d945gclf/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/intel/emeraldlake2/hda_verb.c b/src/mainboard/intel/emeraldlake2/hda_verb.c new file mode 100644 index 0000000000..96770de362 --- /dev/null +++ b/src/mainboard/intel/emeraldlake2/hda_verb.c @@ -0,0 +1,71 @@ +/* + * 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 */ + 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 + 0x10134210, // Subsystem ID + 0x00000007, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ + AZALIA_SUBVENDOR(0x0, 0x10134210), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), + + /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ + AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), + + /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), + + /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), + + /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), + + /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ + AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), + + /* coreboot specific header */ + 0x80862805, // 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(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[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/intel/emeraldlake2/hda_verb.h b/src/mainboard/intel/emeraldlake2/hda_verb.h deleted file mode 100644 index 2796e92682..0000000000 --- a/src/mainboard/intel/emeraldlake2/hda_verb.h +++ /dev/null @@ -1,65 +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 */ - 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 - 0x10134210, // Subsystem ID - 0x00000007, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ - AZALIA_SUBVENDOR(0x0, 0x10134210), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), - - /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ - AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), - - /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), - - /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), - - /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), - - /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ - AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), - - /* coreboot specific header */ - 0x80862805, // 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(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) -}; diff --git a/src/mainboard/intel/emeraldlake2/mainboard.c b/src/mainboard/intel/emeraldlake2/mainboard.c index 3dc859415c..347ce8a910 100644 --- a/src/mainboard/intel/emeraldlake2/mainboard.c +++ b/src/mainboard/intel/emeraldlake2/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -41,13 +39,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); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -55,7 +47,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { 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/intel/wtm2/hda_verb.c b/src/mainboard/intel/wtm2/hda_verb.c new file mode 100644 index 0000000000..c18e79b1af --- /dev/null +++ b/src/mainboard/intel/wtm2/hda_verb.c @@ -0,0 +1,71 @@ +/* + * 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 */ + 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 + 0x10134210, // Subsystem ID + 0x00000007, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ + AZALIA_SUBVENDOR(0x0, 0x10134210), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), + + /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ + AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), + + /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), + + /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), + + /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), + + /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ + AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), + + /* coreboot specific header */ + 0x80862805, // 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(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[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/intel/wtm2/hda_verb.h b/src/mainboard/intel/wtm2/hda_verb.h deleted file mode 100644 index 48750356c0..0000000000 --- a/src/mainboard/intel/wtm2/hda_verb.h +++ /dev/null @@ -1,65 +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 */ - 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 - 0x10134210, // Subsystem ID - 0x00000007, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ - AZALIA_SUBVENDOR(0x0, 0x10134210), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), - - /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ - AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), - - /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), - - /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), - - /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), - - /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ - AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), - - /* coreboot specific header */ - 0x80862805, // 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(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) -}; diff --git a/src/mainboard/intel/wtm2/mainboard.c b/src/mainboard/intel/wtm2/mainboard.c index b4982f8625..a6839fc343 100644 --- a/src/mainboard/intel/wtm2/mainboard.c +++ b/src/mainboard/intel/wtm2/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -41,13 +39,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); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -55,7 +47,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { 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/iwave/iWRainbowG6/hda_verb.c b/src/mainboard/iwave/iWRainbowG6/hda_verb.c new file mode 100644 index 0000000000..4cb2c9fcee --- /dev/null +++ b/src/mainboard/iwave/iWRainbowG6/hda_verb.c @@ -0,0 +1,92 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2009-2010 iWave Systems + * + * 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 u32 mainboard_cim_verb_data[] = { + /* coreboot specific header */ + 0x111d76d5, // Codec Vendor / Device ID: IDT 92HD81 + 0x00000000, // Subsystem ID + 0x0000000a, // Number of jacks + + /* NID 0x0a, Port A (capless headphone) */ + 0x0A71C40, + 0x0A71D10, + 0x0A71EA1, + 0x0A71F02, + + /* NID 0x0b, Port B (capless headphone) */ + 0x0B71C1F, + 0x0B71D10, + 0x0B71E21, + 0x0B71F02, + + /* + * NID 0x0c, Port C (Line IN/OUT+MIC for YD/UA revisions, and + * Line IN+MIC for TA revision) + */ + 0x0C71CF0, + 0x0C71D00, + 0x0C71E00, + 0x0C71F40, + + /* NID 0x0d, Port D (BTL output - EAPD control) */ + 0x0D71C10, + 0x0D71D41, + 0x0D71E10, + 0x0D71F10, + + /* NID 0x0e, Port E (Line IN/OUT) */ + 0x0E71CF0, + 0x0E71D00, + 0x0E71E00, + 0x0E71F40, + + /* NID 0x0f, Port F (Line IN/OUT, MIC) */ + 0x0F71CF0, + 0x0F71D00, + 0x0F71E00, + 0x0F71F40, + + /* NID 0x10, MonoOut (output-only) */ + 0x1071CF0, + 0x1071D00, + 0x1071EF0, + 0x1071F40, + + /* NID 0x10, DigMic0 (Digital Microphone 0) */ + 0x1171CF0, + 0x1171D00, + 0x1171E00, + 0x1171F40, + + /* NID 0x1f, Dig0Pin (First Digital Output Pin) */ + 0x1F71C50, + 0x1F71D21, + 0x1F71E40, + 0x1F71F10, + + /* NID 0x20, Dig1Pin (Second Digital Output Pin / DMIC Input Pin) */ + 0x2071CF0, + 0x2071D00, + 0x2071E00, + 0x2071F40, + + /* BTL Gain */ + 0x017F417, /* Gain = 16.79dB */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/iwave/iWRainbowG6/hda_verb.h b/src/mainboard/iwave/iWRainbowG6/hda_verb.h deleted file mode 100644 index 6799c12799..0000000000 --- a/src/mainboard/iwave/iWRainbowG6/hda_verb.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2009-2010 iWave Systems - * - * 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 u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x111d76d5, // Codec Vendor / Device ID: IDT 92HD81 - 0x00000000, // Subsystem ID - 0x0000000a, // Number of jacks - - /* NID 0x0a, Port A (capless headphone) */ - 0x0A71C40, - 0x0A71D10, - 0x0A71EA1, - 0x0A71F02, - - /* NID 0x0b, Port B (capless headphone) */ - 0x0B71C1F, - 0x0B71D10, - 0x0B71E21, - 0x0B71F02, - - /* - * NID 0x0c, Port C (Line IN/OUT+MIC for YD/UA revisions, and - * Line IN+MIC for TA revision) - */ - 0x0C71CF0, - 0x0C71D00, - 0x0C71E00, - 0x0C71F40, - - /* NID 0x0d, Port D (BTL output - EAPD control) */ - 0x0D71C10, - 0x0D71D41, - 0x0D71E10, - 0x0D71F10, - - /* NID 0x0e, Port E (Line IN/OUT) */ - 0x0E71CF0, - 0x0E71D00, - 0x0E71E00, - 0x0E71F40, - - /* NID 0x0f, Port F (Line IN/OUT, MIC) */ - 0x0F71CF0, - 0x0F71D00, - 0x0F71E00, - 0x0F71F40, - - /* NID 0x10, MonoOut (output-only) */ - 0x1071CF0, - 0x1071D00, - 0x1071EF0, - 0x1071F40, - - /* NID 0x10, DigMic0 (Digital Microphone 0) */ - 0x1171CF0, - 0x1171D00, - 0x1171E00, - 0x1171F40, - - /* NID 0x1f, Dig0Pin (First Digital Output Pin) */ - 0x1F71C50, - 0x1F71D21, - 0x1F71E40, - 0x1F71F10, - - /* NID 0x20, Dig1Pin (Second Digital Output Pin / DMIC Input Pin) */ - 0x2071CF0, - 0x2071D00, - 0x2071E00, - 0x2071F40, - - /* BTL Gain */ - 0x017F417, /* Gain = 16.79dB */ -}; diff --git a/src/mainboard/iwave/iWRainbowG6/mainboard.c b/src/mainboard/iwave/iWRainbowG6/mainboard.c index 0b84f6855b..dfc66363a0 100644 --- a/src/mainboard/iwave/iWRainbowG6/mainboard.c +++ b/src/mainboard/iwave/iWRainbowG6/mainboard.c @@ -20,18 +20,10 @@ #include #include -#include -#include "hda_verb.h" -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/kontron/986lcd-m/hda_verb.c b/src/mainboard/kontron/986lcd-m/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/kontron/986lcd-m/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/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c index 10bba69afd..afca796000 100644 --- a/src/mainboard/kontron/986lcd-m/mainboard.c +++ b/src/mainboard/kontron/986lcd-m/mainboard.c @@ -24,7 +24,6 @@ #include #include #include -#include /* Hardware Monitor */ @@ -160,14 +159,7 @@ static void hwm_setup(void) hwm_write(0x40, 0x01); // Init, but no SMI# } -/* Audio Setup */ -static void verb_setup(void) -{ - // Default VERB is fine on this mainboard. - cim_verb_data = NULL; - cim_verb_data_size = 0; -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -175,7 +167,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_DEFAULT, 3); - verb_setup(); hwm_setup(); } diff --git a/src/mainboard/kontron/ktqm77/hda_verb.c b/src/mainboard/kontron/ktqm77/hda_verb.c new file mode 100644 index 0000000000..c957c25fe1 --- /dev/null +++ b/src/mainboard/kontron/ktqm77/hda_verb.c @@ -0,0 +1,121 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2012-2013 secunet Security Networks AG + * Copyright (C) 2013 Nico Huber + * + * 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 */ + 0x11060397, // Codec Vendor / Device ID: Via VT1708S + 0x11060000, // Subsystem ID + 0x0000000c, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x11060000 */ + AZALIA_SUBVENDOR(0x0, 0x11060000), + + /* Pin Widget Verb Table */ + + /* + * NID 0x19 [Port A (SURR)]: + * Jack Internal Speaker N/A Black + */ + AZALIA_PIN_CFG(0, 0x19, 0x10101112), + + /* + * NID 0x1a [Port B (MIC1/2)]: + * Jack Rear Mic In 1/8" Pink + */ + AZALIA_PIN_CFG(0, 0x1a, 0x01a19036), + + /* + * NID 0x1b [Port C (LINEIN)]: + * Jack Rear Line In 1/8" Blue + */ + AZALIA_PIN_CFG(0, 0x1b, 0x0181303e), + + /* + * NID 0x1c [Port D (Front)]: + * Jack Rear Line Out 1/8" Green + */ + AZALIA_PIN_CFG(0, 0x1c, 0x01014010), + + /* + * NID 0x1d [Port E (Front HP/MIC)]: + * Jack Front HP Out 1/8" Green + */ + AZALIA_PIN_CFG(0, 0x1d, 0x022141f0), + + /* + * NID 0x1e [Port F (Front HP/MIC)]: + * Jack Front Mic In 1/8" Pink + */ + AZALIA_PIN_CFG(0, 0x1e, 0x02a19138), + + /* + * NID 0x1f [CD]: + * Jack Int.(ATAPI) CD ATAPI internal Black + */ + AZALIA_PIN_CFG(0, 0x1f, 0x19331137), + + /* + * NID 0x20 [N/A]: + * Jack Rear S/PDIF Out RCA Unknown + */ + AZALIA_PIN_CFG(0, 0x20, 0x014401f0), + + /* + * NID 0x21 [N/A]: + * None Internal S/PDIF Out Other Digital Unknown + */ + AZALIA_PIN_CFG(0, 0x21, 0x504600f0), + + /* + * NID 0x22 [Port G (C/LFE)]: + * Jack Internal Speaker Unknown Orange + */ + AZALIA_PIN_CFG(0, 0x22, 0x10106111), + + /* + * NID 0x23 [Port H (SSL/SSR)]: + * Jack Internal Speaker Unknown Grey + */ + AZALIA_PIN_CFG(0, 0x23, 0x10102114), + + + /* 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, 0x58560010), + + /* 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[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/kontron/ktqm77/hda_verb.h b/src/mainboard/kontron/ktqm77/hda_verb.h deleted file mode 100644 index ccec18c752..0000000000 --- a/src/mainboard/kontron/ktqm77/hda_verb.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2012-2013 secunet Security Networks AG - * Copyright (C) 2013 Nico Huber - * - * 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 */ - 0x11060397, // Codec Vendor / Device ID: Via VT1708S - 0x11060000, // Subsystem ID - 0x0000000c, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x11060000 */ - AZALIA_SUBVENDOR(0x0, 0x11060000), - - /* Pin Widget Verb Table */ - - /* - * NID 0x19 [Port A (SURR)]: - * Jack Internal Speaker N/A Black - */ - AZALIA_PIN_CFG(0, 0x19, 0x10101112), - - /* - * NID 0x1a [Port B (MIC1/2)]: - * Jack Rear Mic In 1/8" Pink - */ - AZALIA_PIN_CFG(0, 0x1a, 0x01a19036), - - /* - * NID 0x1b [Port C (LINEIN)]: - * Jack Rear Line In 1/8" Blue - */ - AZALIA_PIN_CFG(0, 0x1b, 0x0181303e), - - /* - * NID 0x1c [Port D (Front)]: - * Jack Rear Line Out 1/8" Green - */ - AZALIA_PIN_CFG(0, 0x1c, 0x01014010), - - /* - * NID 0x1d [Port E (Front HP/MIC)]: - * Jack Front HP Out 1/8" Green - */ - AZALIA_PIN_CFG(0, 0x1d, 0x022141f0), - - /* - * NID 0x1e [Port F (Front HP/MIC)]: - * Jack Front Mic In 1/8" Pink - */ - AZALIA_PIN_CFG(0, 0x1e, 0x02a19138), - - /* - * NID 0x1f [CD]: - * Jack Int.(ATAPI) CD ATAPI internal Black - */ - AZALIA_PIN_CFG(0, 0x1f, 0x19331137), - - /* - * NID 0x20 [N/A]: - * Jack Rear S/PDIF Out RCA Unknown - */ - AZALIA_PIN_CFG(0, 0x20, 0x014401f0), - - /* - * NID 0x21 [N/A]: - * None Internal S/PDIF Out Other Digital Unknown - */ - AZALIA_PIN_CFG(0, 0x21, 0x504600f0), - - /* - * NID 0x22 [Port G (C/LFE)]: - * Jack Internal Speaker Unknown Orange - */ - AZALIA_PIN_CFG(0, 0x22, 0x10106111), - - /* - * NID 0x23 [Port H (SSL/SSR)]: - * Jack Internal Speaker Unknown Grey - */ - AZALIA_PIN_CFG(0, 0x23, 0x10102114), - - - /* 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, 0x58560010), - - /* 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) -}; diff --git a/src/mainboard/kontron/ktqm77/mainboard.c b/src/mainboard/kontron/ktqm77/mainboard.c index c09082aa5a..715ec5621c 100644 --- a/src/mainboard/kontron/ktqm77/mainboard.c +++ b/src/mainboard/kontron/ktqm77/mainboard.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -169,13 +167,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); -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -186,7 +178,6 @@ static void mainboard_enable(device_t dev) /* Install custom int15 handler for VGA OPROM */ mainboard_interrupt_handlers(0x15, &int15_handler); #endif - verb_setup(); unsigned disable = 0; if ((get_option(&disable, "ethernet1") == CB_SUCCESS) && disable) { diff --git a/src/mainboard/lenovo/t520/hda_verb.c b/src/mainboard/lenovo/t520/hda_verb.c new file mode 100644 index 0000000000..dd776fc026 --- /dev/null +++ b/src/mainboard/lenovo/t520/hda_verb.c @@ -0,0 +1,190 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 : Conexant + * Vendor ID : 0x14f1506e + * Subsystem ID : 0x17aa21cf + * Revision ID : 0x100000 + */ + + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 - Schematic shows CX20672 + 0x17aa21cf, // Subsystem ID + 0x00000077, // 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, 0x17AA21CF), + + AZALIA_PIN_CFG(0x0, 0x19, 0x04211040), + AZALIA_PIN_CFG(0x0, 0x1A, 0x61A19050), + AZALIA_PIN_CFG(0x0, 0x1B, 0x04A11060), + AZALIA_PIN_CFG(0x0, 0x1C, 0x6121401F), + AZALIA_PIN_CFG(0x0, 0x1D, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x1F, 0x90170110), + AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x23, 0x90A60170), + + /* + * 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 */ +}; + +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/lenovo/t520/hda_verb.h b/src/mainboard/lenovo/t520/hda_verb.h deleted file mode 100644 index 19eac1bd67..0000000000 --- a/src/mainboard/lenovo/t520/hda_verb.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * Copyright (C) 2014 Vladimir Serbinenko - * - * 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 : Conexant - * Vendor ID : 0x14f1506e - * Subsystem ID : 0x17aa21cf - * Revision ID : 0x100000 - */ - - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 - Schematic shows CX20672 - 0x17aa21cf, // Subsystem ID - 0x00000077, // 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, 0x17AA21CF), - - AZALIA_PIN_CFG(0x0, 0x19, 0x04211040), - AZALIA_PIN_CFG(0x0, 0x1A, 0x61A19050), - AZALIA_PIN_CFG(0x0, 0x1B, 0x04A11060), - AZALIA_PIN_CFG(0x0, 0x1C, 0x6121401F), - AZALIA_PIN_CFG(0x0, 0x1D, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x1F, 0x90170110), - AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x23, 0x90A60170), - - /* - * 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 */ -}; - -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/lenovo/t520/mainboard.c b/src/mainboard/lenovo/t520/mainboard.c index afa0ecf2f7..387bbe0558 100644 --- a/src/mainboard/lenovo/t520/mainboard.c +++ b/src/mainboard/lenovo/t520/mainboard.c @@ -37,8 +37,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -46,16 +44,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) { @@ -80,7 +69,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(); } void h8_mainboard_init_dock (void) diff --git a/src/mainboard/lenovo/t530/hda_verb.c b/src/mainboard/lenovo/t530/hda_verb.c new file mode 100644 index 0000000000..29f8a4522b --- /dev/null +++ b/src/mainboard/lenovo/t530/hda_verb.c @@ -0,0 +1,252 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 : 0x10ec0269 + * Subsystem ID : 0x17aa21fa + * Revision ID : 0x100303 + */ + + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC + 0x17aa21fa, // Subsystem ID + 0x0000007d, // 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, 0x17AA21FA), + +/* 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), + AZALIA_PIN_CFG(0x0, 0x12, 0x90A60140), + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + AZALIA_PIN_CFG(0x0, 0x15, 0x03211020), + AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), + AZALIA_PIN_CFG(0x0, 0x19, 0x411111F0), + + 0x01970804, + 0x01870803, + 0x01470740, + 0x00970600, + + 0x00370600, + 0x00270600, + 0x00270600, + 0x00270600, + + AZALIA_PIN_CFG(0x0, 0x1A, 0x411111F0), + AZALIA_PIN_CFG(0x0, 0x1D, 0x40138205), + AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), + + /* + * 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/lenovo/t530/hda_verb.h b/src/mainboard/lenovo/t530/hda_verb.h deleted file mode 100644 index f04eae7e71..0000000000 --- a/src/mainboard/lenovo/t530/hda_verb.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * Copyright (C) 2014 Vladimir Serbinenko - * - * 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 : 0x10ec0269 - * Subsystem ID : 0x17aa21fa - * Revision ID : 0x100303 - */ - - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC - 0x17aa21fa, // Subsystem ID - 0x0000007d, // 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, 0x17AA21FA), - -/* 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), - AZALIA_PIN_CFG(0x0, 0x12, 0x90A60140), - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - AZALIA_PIN_CFG(0x0, 0x15, 0x03211020), - AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), - AZALIA_PIN_CFG(0x0, 0x19, 0x411111F0), - - 0x01970804, - 0x01870803, - 0x01470740, - 0x00970600, - - 0x00370600, - 0x00270600, - 0x00270600, - 0x00270600, - - AZALIA_PIN_CFG(0x0, 0x1A, 0x411111F0), - AZALIA_PIN_CFG(0x0, 0x1D, 0x40138205), - AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), - - /* - * 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/lenovo/t530/mainboard.c b/src/mainboard/lenovo/t530/mainboard.c index e21dc982f0..f8c9daee35 100644 --- a/src/mainboard/lenovo/t530/mainboard.c +++ b/src/mainboard/lenovo/t530/mainboard.c @@ -37,8 +37,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -46,16 +44,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) { @@ -85,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(); } void h8_mainboard_init_dock (void) diff --git a/src/mainboard/lenovo/t60/hda_verb.c b/src/mainboard/lenovo/t60/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/lenovo/t60/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/lenovo/x200/hda_verb.c b/src/mainboard/lenovo/x200/hda_verb.c new file mode 100644 index 0000000000..c1cd5422ee --- /dev/null +++ b/src/mainboard/lenovo/x200/hda_verb.c @@ -0,0 +1,51 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * 2012 secunet Security Networks AG + * + * 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 */ + 0x14f15051, // Conexant CX20561 (Hermosa) + 0x17aa20ff, // Subsystem ID + 0x00000008, // Number of entries + + /* Pin Widget Verb Table */ + + AZALIA_PIN_CFG(0, 0x16, 0x042140f0), + AZALIA_PIN_CFG(0, 0x17, 0x61a190f0), + AZALIA_PIN_CFG(0, 0x18, 0x04a190f0), + AZALIA_PIN_CFG(0, 0x19, 0x612140f0), + AZALIA_PIN_CFG(0, 0x1a, 0x901701f0), + AZALIA_PIN_CFG(0, 0x1b, 0x40f001f0), + AZALIA_PIN_CFG(0, 0x1c, 0x40f001f0), + AZALIA_PIN_CFG(0, 0x1d, 0x90a601f0) +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up codec */ + 0x01470500, /* power up speakers */ + 0x01470100, /* select lout1 (input 0x0) for speakers */ + 0x01470740, /* enable speakers output */ + 0x00b37517, /* unmute beep (mixer's input 0x5), set amp 0dB */ + 0x00c37100, /* unmute mixer in lout1 (lout1 input 0x1) */ + 0x00c3b015, /* set lout1 output volume -15dB */ + 0x0143b000, /* unmute speakers */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/lenovo/x200/hda_verb.h b/src/mainboard/lenovo/x200/hda_verb.h deleted file mode 100644 index 3d922589f8..0000000000 --- a/src/mainboard/lenovo/x200/hda_verb.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007-2009 coresystems GmbH - * 2012 secunet Security Networks AG - * - * 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 */ - 0x14f15051, // Conexant CX20561 (Hermosa) - 0x17aa20ff, // Subsystem ID - 0x00000008, // Number of entries - - /* Pin Widget Verb Table */ - - AZALIA_PIN_CFG(0, 0x16, 0x042140f0), - AZALIA_PIN_CFG(0, 0x17, 0x61a190f0), - AZALIA_PIN_CFG(0, 0x18, 0x04a190f0), - AZALIA_PIN_CFG(0, 0x19, 0x612140f0), - AZALIA_PIN_CFG(0, 0x1a, 0x901701f0), - AZALIA_PIN_CFG(0, 0x1b, 0x40f001f0), - AZALIA_PIN_CFG(0, 0x1c, 0x40f001f0), - AZALIA_PIN_CFG(0, 0x1d, 0x90a601f0) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up codec */ - 0x01470500, /* power up speakers */ - 0x01470100, /* select lout1 (input 0x0) for speakers */ - 0x01470740, /* enable speakers output */ - 0x00b37517, /* unmute beep (mixer's input 0x5), set amp 0dB */ - 0x00c37100, /* unmute mixer in lout1 (lout1 input 0x1) */ - 0x00c3b015, /* set lout1 output volume -15dB */ - 0x0143b000, /* unmute speakers */ -}; diff --git a/src/mainboard/lenovo/x200/mainboard.c b/src/mainboard/lenovo/x200/mainboard.c index 6c13eed84f..37bd152e27 100644 --- a/src/mainboard/lenovo/x200/mainboard.c +++ b/src/mainboard/lenovo/x200/mainboard.c @@ -32,23 +32,13 @@ #include #include #include -#include -#include "hda_verb.h" #if CONFIG_GENERATE_ACPI_TABLES #include "cstates.c" /* Include it, as the linker won't find the overloaded weak function in there. */ #endif -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 = ARRAY_SIZE(mainboard_pc_beep_verbs); -} - const char *smbios_mainboard_bios_version(void) { /* Satisfy thinkpad_acpi. */ @@ -68,7 +58,6 @@ static void mainboard_init(device_t dev) static void mainboard_enable(device_t dev) { - verb_setup(); install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_CENTERING, GMA_INT15_BOOT_DISPLAY_DEFAULT, 2); dev->ops->init = mainboard_init; diff --git a/src/mainboard/lenovo/x201/hda_verb.c b/src/mainboard/lenovo/x201/hda_verb.c new file mode 100644 index 0000000000..22634f05ff --- /dev/null +++ b/src/mainboard/lenovo/x201/hda_verb.c @@ -0,0 +1,81 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2014 Vladimir Serbinenko. + * + * 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, + * or (at your option) any later version. + * + * 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 */ + 0x14F15069, /* Codec Vendor / Device ID: Conexant CX20585 */ + 0x17AA2155, /* Subsystem ID */ + 0x0000000B, /* Number of 4 dword sets */ + + /* NID 0x01: Subsystem ID. */ + AZALIA_SUBVENDOR(0x0, 0x17AA2155), + + /* NID 0x19: Headphone jack. */ + AZALIA_PIN_CFG(0x0, 0x19, 0x042140F0), + + /* NID 0x1A: Dock mic jack. */ + AZALIA_PIN_CFG(0x0, 0x1A, 0x61A190F0), + + /* NID 0x1B: Mic jack. */ + AZALIA_PIN_CFG(0x0, 0x1B, 0x04A190F0), + + /* NID 0x1C: Dock headphone jack. */ + AZALIA_PIN_CFG(0x0, 0x1C, 0x612140F0), + + /* NID 0x1D: EAPD detect. */ + AZALIA_PIN_CFG(0x0, 0x1D, 0x601700F0), + + /* NID 0x1E */ + AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), + + /* NID 0x1F */ + AZALIA_PIN_CFG(0x0, 0x1F, 0x901701F0), + + /* NID 0x20 */ + AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), + + /* NID 0x22 */ + AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), + + /* NID 0x23: Internal mic boost volume. */ + AZALIA_PIN_CFG(0x0, 0x23, 0x90A601F0), + + 0x80862804, /* Codec Vendor / Device ID: Intel Ibexpeak HDMI. */ + 0x17aa21b5, /* Subsystem ID */ + 0x00000004, /* Number of 4 dword sets */ + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21b5 */ + AZALIA_SUBVENDOR(0x3, 0x17AA21B5), + + /* NID 0x04. */ + AZALIA_PIN_CFG(0x3, 0x04, 0x58560010), + + /* NID 0x05. */ + AZALIA_PIN_CFG(0x3, 0x05, 0x18560020), + + /* NID 0x06. */ + AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/lenovo/x201/hda_verb.h b/src/mainboard/lenovo/x201/hda_verb.h deleted file mode 100644 index 17069292af..0000000000 --- a/src/mainboard/lenovo/x201/hda_verb.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2014 Vladimir Serbinenko. - * - * 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, - * or (at your option) any later version. - * - * 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 */ - 0x14F15069, /* Codec Vendor / Device ID: Conexant CX20585 */ - 0x17AA2155, /* Subsystem ID */ - 0x0000000B, /* Number of 4 dword sets */ - - /* NID 0x01: Subsystem ID. */ - AZALIA_SUBVENDOR(0x0, 0x17AA2155), - - /* NID 0x19: Headphone jack. */ - AZALIA_PIN_CFG(0x0, 0x19, 0x042140F0), - - /* NID 0x1A: Dock mic jack. */ - AZALIA_PIN_CFG(0x0, 0x1A, 0x61A190F0), - - /* NID 0x1B: Mic jack. */ - AZALIA_PIN_CFG(0x0, 0x1B, 0x04A190F0), - - /* NID 0x1C: Dock headphone jack. */ - AZALIA_PIN_CFG(0x0, 0x1C, 0x612140F0), - - /* NID 0x1D: EAPD detect. */ - AZALIA_PIN_CFG(0x0, 0x1D, 0x601700F0), - - /* NID 0x1E */ - AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), - - /* NID 0x1F */ - AZALIA_PIN_CFG(0x0, 0x1F, 0x901701F0), - - /* NID 0x20 */ - AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), - - /* NID 0x22 */ - AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), - - /* NID 0x23: Internal mic boost volume. */ - AZALIA_PIN_CFG(0x0, 0x23, 0x90A601F0), - - 0x80862804, /* Codec Vendor / Device ID: Intel Ibexpeak HDMI. */ - 0x17aa21b5, /* Subsystem ID */ - 0x00000004, /* Number of 4 dword sets */ - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21b5 */ - AZALIA_SUBVENDOR(0x3, 0x17AA21B5), - - /* NID 0x04. */ - AZALIA_PIN_CFG(0x3, 0x04, 0x58560010), - - /* NID 0x05. */ - AZALIA_PIN_CFG(0x3, 0x05, 0x18560020), - - /* NID 0x06. */ - AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), -}; diff --git a/src/mainboard/lenovo/x201/mainboard.c b/src/mainboard/lenovo/x201/mainboard.c index fb8c1d5626..57ef86dd2a 100644 --- a/src/mainboard/lenovo/x201/mainboard.c +++ b/src/mainboard/lenovo/x201/mainboard.c @@ -35,11 +35,9 @@ #include #include #include -#include #include #include "dock.h" -#include "hda_verb.h" #include #include #include @@ -71,13 +69,7 @@ const char *smbios_mainboard_bios_version(void) return "CBET4000 " COREBOOT_VERSION; } -/* 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) { @@ -155,7 +147,6 @@ static void mainboard_enable(device_t dev) install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_INT_LVDS, GMA_INT15_PANEL_FIT_DEFAULT, GMA_INT15_BOOT_DISPLAY_LFP, 2); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/lenovo/x220/hda_verb.c b/src/mainboard/lenovo/x220/hda_verb.c new file mode 100644 index 0000000000..c3d1372da7 --- /dev/null +++ b/src/mainboard/lenovo/x220/hda_verb.c @@ -0,0 +1,214 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 : Conexant + * Vendor ID : 0x14f1506e + * Subsystem ID : 0x17aa21db + * Revision ID : 0x100002 + */ + + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 + 0x17aa21db, // Subsystem ID + 0x00000077, // 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, 0x17AA21DB), + + AZALIA_PIN_CFG(0x0, 0x19, 0x04211040), + AZALIA_PIN_CFG(0x0, 0x1A, 0x61A19050), + AZALIA_PIN_CFG(0x0, 0x1B, 0x04A11060), + AZALIA_PIN_CFG(0x0, 0x1C, 0x6121401F), + AZALIA_PIN_CFG(0x0, 0x1D, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x1F, 0x90170110), + AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), + AZALIA_PIN_CFG(0x0, 0x23, 0x90A60170), + + /* + * 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 */ + 0x80862805, // 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/lenovo/x220/hda_verb.h b/src/mainboard/lenovo/x220/hda_verb.h deleted file mode 100644 index ce980fc2a8..0000000000 --- a/src/mainboard/lenovo/x220/hda_verb.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * Copyright (C) 2014 Vladimir Serbinenko - * - * 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 : Conexant - * Vendor ID : 0x14f1506e - * Subsystem ID : 0x17aa21db - * Revision ID : 0x100002 - */ - - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 - 0x17aa21db, // Subsystem ID - 0x00000077, // 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, 0x17AA21DB), - - AZALIA_PIN_CFG(0x0, 0x19, 0x04211040), - AZALIA_PIN_CFG(0x0, 0x1A, 0x61A19050), - AZALIA_PIN_CFG(0x0, 0x1B, 0x04A11060), - AZALIA_PIN_CFG(0x0, 0x1C, 0x6121401F), - AZALIA_PIN_CFG(0x0, 0x1D, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x1E, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x1F, 0x90170110), - AZALIA_PIN_CFG(0x0, 0x20, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x22, 0x40F001F0), - AZALIA_PIN_CFG(0x0, 0x23, 0x90A60170), - - /* - * 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 */ - 0x80862805, // 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/lenovo/x220/mainboard.c b/src/mainboard/lenovo/x220/mainboard.c index ffc99bd4eb..87fedfe30a 100644 --- a/src/mainboard/lenovo/x220/mainboard.c +++ b/src/mainboard/lenovo/x220/mainboard.c @@ -38,8 +38,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -56,16 +54,7 @@ const char *smbios_mainboard_bios_version(void) return "CBET4000 " COREBOOT_VERSION; } -/* 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) { @@ -95,7 +84,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(); } void h8_mainboard_init_dock (void) diff --git a/src/mainboard/lenovo/x230/hda_verb.c b/src/mainboard/lenovo/x230/hda_verb.c new file mode 100644 index 0000000000..29f8a4522b --- /dev/null +++ b/src/mainboard/lenovo/x230/hda_verb.c @@ -0,0 +1,252 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. + * Copyright (C) 2014 Vladimir Serbinenko + * + * 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 : 0x10ec0269 + * Subsystem ID : 0x17aa21fa + * Revision ID : 0x100303 + */ + + +#include + +const u32 cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC + 0x17aa21fa, // Subsystem ID + 0x0000007d, // 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, 0x17AA21FA), + +/* 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), + AZALIA_PIN_CFG(0x0, 0x12, 0x90A60140), + AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), + AZALIA_PIN_CFG(0x0, 0x15, 0x03211020), + AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), + AZALIA_PIN_CFG(0x0, 0x19, 0x411111F0), + + 0x01970804, + 0x01870803, + 0x01470740, + 0x00970600, + + 0x00370600, + 0x00270600, + 0x00270600, + 0x00270600, + + AZALIA_PIN_CFG(0x0, 0x1A, 0x411111F0), + AZALIA_PIN_CFG(0x0, 0x1D, 0x40138205), + AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), + + /* + * 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/lenovo/x230/hda_verb.h b/src/mainboard/lenovo/x230/hda_verb.h deleted file mode 100644 index f04eae7e71..0000000000 --- a/src/mainboard/lenovo/x230/hda_verb.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved. - * Copyright (C) 2014 Vladimir Serbinenko - * - * 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 : 0x10ec0269 - * Subsystem ID : 0x17aa21fa - * Revision ID : 0x100303 - */ - - -static const u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC - 0x17aa21fa, // Subsystem ID - 0x0000007d, // 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, 0x17AA21FA), - -/* 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), - AZALIA_PIN_CFG(0x0, 0x12, 0x90A60140), - AZALIA_PIN_CFG(0x0, 0x14, 0x90170110), - AZALIA_PIN_CFG(0x0, 0x15, 0x03211020), - AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), - AZALIA_PIN_CFG(0x0, 0x19, 0x411111F0), - - 0x01970804, - 0x01870803, - 0x01470740, - 0x00970600, - - 0x00370600, - 0x00270600, - 0x00270600, - 0x00270600, - - AZALIA_PIN_CFG(0x0, 0x1A, 0x411111F0), - AZALIA_PIN_CFG(0x0, 0x1D, 0x40138205), - AZALIA_PIN_CFG(0x0, 0x1E, 0x411111F0), - - /* - * 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/lenovo/x230/mainboard.c b/src/mainboard/lenovo/x230/mainboard.c index 5da7480492..7d9c4568e2 100644 --- a/src/mainboard/lenovo/x230/mainboard.c +++ b/src/mainboard/lenovo/x230/mainboard.c @@ -38,8 +38,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -56,16 +54,7 @@ const char *smbios_mainboard_bios_version(void) return "CBET4000 " COREBOOT_VERSION; } -/* 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) { @@ -95,7 +84,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(); } void h8_mainboard_init_dock (void) diff --git a/src/mainboard/lenovo/x60/hda_verb.c b/src/mainboard/lenovo/x60/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/lenovo/x60/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/msi/ms7260/mainboard.c b/src/mainboard/msi/ms7260/mainboard.c index 226925fd83..492693adc1 100644 --- a/src/mainboard/msi/ms7260/mainboard.c +++ b/src/mainboard/msi/ms7260/mainboard.c @@ -19,20 +19,12 @@ */ #include -#include #if 0 -#include "hda_verb.h" -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } #endif diff --git a/src/mainboard/msi/ms9282/mainboard.c b/src/mainboard/msi/ms9282/mainboard.c index 5d80b8aad8..c7e459a35d 100644 --- a/src/mainboard/msi/ms9282/mainboard.c +++ b/src/mainboard/msi/ms9282/mainboard.c @@ -24,18 +24,10 @@ #include #include #include -// #include "hda_verb.h" -static void verb_setup(void) -{ - /* TODO: Add a correct hda_verb.h file for this board. */ - // cim_verb_data = mainboard_cim_verb_data; - // cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/msi/ms9652_fam10/mainboard.c b/src/mainboard/msi/ms9652_fam10/mainboard.c index 316a962de5..96760d6577 100644 --- a/src/mainboard/msi/ms9652_fam10/mainboard.c +++ b/src/mainboard/msi/ms9652_fam10/mainboard.c @@ -24,19 +24,10 @@ #include #include #include -#include -// #include "hda_verb.h" -static void verb_setup(void) -{ - /* TODO: Add a correct hda_verb.h file for this board. */ - // cim_verb_data = mainboard_cim_verb_data; - // cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/nvidia/l1_2pvv/hda_verb.c b/src/mainboard/nvidia/l1_2pvv/hda_verb.c new file mode 100644 index 0000000000..780167af29 --- /dev/null +++ b/src/mainboard/nvidia/l1_2pvv/hda_verb.c @@ -0,0 +1,67 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2004 Tyan Computer + * Copyright (C) 2006-2007 AMD + * Copyright (C) 2007-2009 coresystems GmbH + * + * 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 u32 mainboard_cim_verb_data[] = { + /* coreboot specific header */ + 0x10ec0880, // Codec Vendor / Device ID: Realtek ALC880 + 0x00000000, // Subsystem ID + 0x0000000d, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x0000e601 */ + AZALIA_SUBVENDOR(0x0, 0x0000e601), + + /* NID 0x14, FRONT-OUT-L/R */ + AZALIA_PIN_CFG(0x0, 0x14, 0x01014410), + + /* NID 0x15, SURR-OUT-L/R */ + AZALIA_PIN_CFG(0x0, 0x15, 0x01011412), + + /* NID 0x16, CEN/LFE-OUT */ + AZALIA_PIN_CFG(0x0, 0x16, 0x01016011), + + /* NID 0x17, SIDE-SURR-L/R */ + AZALIA_PIN_CFG(0x0, 0x17, 0x01012014), + + /* NID 0x18, MIC1-L/R, VREFO */ + AZALIA_PIN_CFG(0x0, 0x18, 0x01a19c30), + + /* NID 0x19, MIC2-L/R, VREFO */ + AZALIA_PIN_CFG(0x0, 0x19, 0x02a19c40), + + /* NID 0x1a, LINE1-L/R, VREFO */ + AZALIA_PIN_CFG(0x0, 0x1a, 0x01813431), + + /* NID 0x1b, LINE2-L/R, VREFO */ + AZALIA_PIN_CFG(0x0, 0x1b, 0x0221441f), + + /* NID 0x1c, CD-L/R / GND */ + AZALIA_PIN_CFG(0x0, 0x1c, 0x411111f0), + + /* NID 0x1d, PCBEEP */ + AZALIA_PIN_CFG(0x0, 0x1d, 0x9983013e), + + /* NID 0x1e, S/PDIF-OUT */ + AZALIA_PIN_CFG(0x0, 0x1e, 0x01454120), + + /* NID 0x1f, S/PDIF-IN */ + AZALIA_PIN_CFG(0x0, 0x1f, 0x01c59150), +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/nvidia/l1_2pvv/hda_verb.h b/src/mainboard/nvidia/l1_2pvv/hda_verb.h deleted file mode 100644 index ea3159e53d..0000000000 --- a/src/mainboard/nvidia/l1_2pvv/hda_verb.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2004 Tyan Computer - * Copyright (C) 2006-2007 AMD - * Copyright (C) 2007-2009 coresystems GmbH - * - * 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 u32 mainboard_cim_verb_data[] = { - /* coreboot specific header */ - 0x10ec0880, // Codec Vendor / Device ID: Realtek ALC880 - 0x00000000, // Subsystem ID - 0x0000000d, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x0000e601 */ - AZALIA_SUBVENDOR(0x0, 0x0000e601), - - /* NID 0x14, FRONT-OUT-L/R */ - AZALIA_PIN_CFG(0x0, 0x14, 0x01014410), - - /* NID 0x15, SURR-OUT-L/R */ - AZALIA_PIN_CFG(0x0, 0x15, 0x01011412), - - /* NID 0x16, CEN/LFE-OUT */ - AZALIA_PIN_CFG(0x0, 0x16, 0x01016011), - - /* NID 0x17, SIDE-SURR-L/R */ - AZALIA_PIN_CFG(0x0, 0x17, 0x01012014), - - /* NID 0x18, MIC1-L/R, VREFO */ - AZALIA_PIN_CFG(0x0, 0x18, 0x01a19c30), - - /* NID 0x19, MIC2-L/R, VREFO */ - AZALIA_PIN_CFG(0x0, 0x19, 0x02a19c40), - - /* NID 0x1a, LINE1-L/R, VREFO */ - AZALIA_PIN_CFG(0x0, 0x1a, 0x01813431), - - /* NID 0x1b, LINE2-L/R, VREFO */ - AZALIA_PIN_CFG(0x0, 0x1b, 0x0221441f), - - /* NID 0x1c, CD-L/R / GND */ - AZALIA_PIN_CFG(0x0, 0x1c, 0x411111f0), - - /* NID 0x1d, PCBEEP */ - AZALIA_PIN_CFG(0x0, 0x1d, 0x9983013e), - - /* NID 0x1e, S/PDIF-OUT */ - AZALIA_PIN_CFG(0x0, 0x1e, 0x01454120), - - /* NID 0x1f, S/PDIF-IN */ - AZALIA_PIN_CFG(0x0, 0x1f, 0x01c59150), -}; diff --git a/src/mainboard/nvidia/l1_2pvv/mainboard.c b/src/mainboard/nvidia/l1_2pvv/mainboard.c index fb7317b3dd..291d4f7b20 100644 --- a/src/mainboard/nvidia/l1_2pvv/mainboard.c +++ b/src/mainboard/nvidia/l1_2pvv/mainboard.c @@ -24,18 +24,10 @@ #include #include #include -#include -#include "hda_verb.h" -static void verb_setup(void) -{ - cim_verb_data = mainboard_cim_verb_data; - cim_verb_data_size = sizeof(mainboard_cim_verb_data); -} static void mainboard_enable(device_t dev) { - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/packardbell/ms2290/hda_verb.c b/src/mainboard/packardbell/ms2290/hda_verb.c new file mode 100644 index 0000000000..4ec3b3601c --- /dev/null +++ b/src/mainboard/packardbell/ms2290/hda_verb.c @@ -0,0 +1,66 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2014 Vladimir Serbinenko. + * + * 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, + * or (at your option) any later version. + * + * 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 */ + 0x10ec0272, /* Codec Vendor / Device ID: Realtek ALC272X */ + 0x10250379, /* Subsystem ID */ + 0x00000006, /* Number of 4 dword sets */ + + /* NID 0x01: Subsystem ID. */ + AZALIA_SUBVENDOR(0x0, 0x10250379), + + /* NID 0x14. */ + AZALIA_PIN_CFG(0x0, 0x14, 0x99130110), + + /* NID 0x18. */ + AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), + + /* NID 0x19. */ + AZALIA_PIN_CFG(0x0, 0x19, 0x99A30920), + + /* NID 0x1D. */ + AZALIA_PIN_CFG(0x0, 0x1D, 0x4017992D), + + /* NID 0x21. */ + AZALIA_PIN_CFG(0x0, 0x21, 0x0321101F), + + 0x80862804, /* Codec Vendor / Device ID: Intel Ibexpeak HDMI. */ + 0x80860101, /* Subsystem ID */ + 0x00000004, /* Number of 4 dword sets */ + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21b5 */ + AZALIA_SUBVENDOR(0x3, 0x80860101), + + /* NID 0x04. */ + AZALIA_PIN_CFG(0x3, 0x04, 0x18560010), + + /* NID 0x05. */ + AZALIA_PIN_CFG(0x3, 0x05, 0x58560020), + + /* NID 0x06. */ + AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), +}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/packardbell/ms2290/hda_verb.h b/src/mainboard/packardbell/ms2290/hda_verb.h deleted file mode 100644 index 3cc00dbe9c..0000000000 --- a/src/mainboard/packardbell/ms2290/hda_verb.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2014 Vladimir Serbinenko. - * - * 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, - * or (at your option) any later version. - * - * 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 */ - 0x10ec0272, /* Codec Vendor / Device ID: Realtek ALC272X */ - 0x10250379, /* Subsystem ID */ - 0x00000006, /* Number of 4 dword sets */ - - /* NID 0x01: Subsystem ID. */ - AZALIA_SUBVENDOR(0x0, 0x10250379), - - /* NID 0x14. */ - AZALIA_PIN_CFG(0x0, 0x14, 0x99130110), - - /* NID 0x18. */ - AZALIA_PIN_CFG(0x0, 0x18, 0x03A11830), - - /* NID 0x19. */ - AZALIA_PIN_CFG(0x0, 0x19, 0x99A30920), - - /* NID 0x1D. */ - AZALIA_PIN_CFG(0x0, 0x1D, 0x4017992D), - - /* NID 0x21. */ - AZALIA_PIN_CFG(0x0, 0x21, 0x0321101F), - - 0x80862804, /* Codec Vendor / Device ID: Intel Ibexpeak HDMI. */ - 0x80860101, /* Subsystem ID */ - 0x00000004, /* Number of 4 dword sets */ - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x17aa21b5 */ - AZALIA_SUBVENDOR(0x3, 0x80860101), - - /* NID 0x04. */ - AZALIA_PIN_CFG(0x3, 0x04, 0x18560010), - - /* NID 0x05. */ - AZALIA_PIN_CFG(0x3, 0x05, 0x58560020), - - /* NID 0x06. */ - AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), -}; diff --git a/src/mainboard/packardbell/ms2290/mainboard.c b/src/mainboard/packardbell/ms2290/mainboard.c index 5fff98d5c1..c14e9b7b3d 100644 --- a/src/mainboard/packardbell/ms2290/mainboard.c +++ b/src/mainboard/packardbell/ms2290/mainboard.c @@ -43,8 +43,6 @@ #include #include #include -#include -#include "hda_verb.h" static acpi_cstate_t cst_entries[] = { {1, 1, 1000, {0x7f, 1, 2, {0}, 1, 0}}, @@ -58,13 +56,7 @@ int get_cst_entries(acpi_cstate_t ** entries) return ARRAY_SIZE(cst_entries); } -/* 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_enable(device_t dev) { @@ -137,7 +129,6 @@ static void mainboard_enable(device_t dev) /* This sneaked in here, because EasyNote has no SuperIO chip. */ pc_keyboard_init(); - verb_setup(); } struct chip_operations mainboard_ops = { diff --git a/src/mainboard/roda/rk886ex/hda_verb.c b/src/mainboard/roda/rk886ex/hda_verb.c new file mode 100644 index 0000000000..072a306131 --- /dev/null +++ b/src/mainboard/roda/rk886ex/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/roda/rk9/hda_verb.c b/src/mainboard/roda/rk9/hda_verb.c new file mode 100644 index 0000000000..8960232089 --- /dev/null +++ b/src/mainboard/roda/rk9/hda_verb.c @@ -0,0 +1,67 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2007-2009 coresystems GmbH + * 2012 secunet Security Networks AG + * + * 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 */ + 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 + 0x43528986, // Subsystem ID + 0x0000000c, // Number of entries + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x11), S/PDIF-OUT2: not connected */ + AZALIA_PIN_CFG(0, 0x11, 0x411111f0), + /* Pin Complex (NID 0x14), LINE_OUT (port D): Speakers */ + AZALIA_PIN_CFG(0, 0x14, 0x99130110), + /* Pin Complex (NID 0x15), HP_OUT (port A): Head phones */ + AZALIA_PIN_CFG(0, 0x15, 0x0121411f), + /* Pin Complex (NID 0x16), MONO-OUT: not connected */ + AZALIA_PIN_CFG(0, 0x16, 0x411111f0), + /* Pin Complex (NID 0x18), MIC1 (port B): Microphone */ + AZALIA_PIN_CFG(0, 0x18, 0x01a19920), + /* Pin Complex (NID 0x19), MIC2 (port F): not connected */ + AZALIA_PIN_CFG(0, 0x19, 0x411111f0), + /* Pin Complex (NID 0x1a), LINE1 (port C): Line-In */ + AZALIA_PIN_CFG(0, 0x1a, 0x01813121), + /* Pin Complex (NID 0x1b), LINE2 (port E): MDC */ + AZALIA_PIN_CFG(0, 0x1b, 0x9983012f), + /* Pin Complex (NID 0x1c), CD_IN */ + AZALIA_PIN_CFG(0, 0x1c, 0x593301f0), + /* Pin Complex (NID 0x1d), PCBEEP */ + AZALIA_PIN_CFG(0, 0x1d, 0x4014022d), + /* Pin Complex (NID 0x1e), S/PDIF-OUT: not connected */ + AZALIA_PIN_CFG(0, 0x1e, 0x411111f0), + /* Pin Complex (NID 0x1f), S/PDIF-IN: not connected */ + AZALIA_PIN_CFG(0, 0x1f, 0x411111f0) +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up codec */ + 0x01470500, /* power up speakers */ + 0x01470100, /* select lout1 (input 0x0) for speakers */ + 0x01470740, /* enable speakers output */ + 0x00b37517, /* unmute beep (mixer's input 0x5), set amp 0dB */ + 0x00c37100, /* unmute mixer in lout1 (lout1 input 0x1) */ + 0x00c3b015, /* set lout1 output volume -15dB */ + 0x0143b000, /* unmute speakers */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/roda/rk9/hda_verb.h b/src/mainboard/roda/rk9/hda_verb.h deleted file mode 100644 index 64a3c8eec4..0000000000 --- a/src/mainboard/roda/rk9/hda_verb.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2007-2009 coresystems GmbH - * 2012 secunet Security Networks AG - * - * 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 */ - 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 - 0x43528986, // Subsystem ID - 0x0000000c, // Number of entries - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x11), S/PDIF-OUT2: not connected */ - AZALIA_PIN_CFG(0, 0x11, 0x411111f0), - /* Pin Complex (NID 0x14), LINE_OUT (port D): Speakers */ - AZALIA_PIN_CFG(0, 0x14, 0x99130110), - /* Pin Complex (NID 0x15), HP_OUT (port A): Head phones */ - AZALIA_PIN_CFG(0, 0x15, 0x0121411f), - /* Pin Complex (NID 0x16), MONO-OUT: not connected */ - AZALIA_PIN_CFG(0, 0x16, 0x411111f0), - /* Pin Complex (NID 0x18), MIC1 (port B): Microphone */ - AZALIA_PIN_CFG(0, 0x18, 0x01a19920), - /* Pin Complex (NID 0x19), MIC2 (port F): not connected */ - AZALIA_PIN_CFG(0, 0x19, 0x411111f0), - /* Pin Complex (NID 0x1a), LINE1 (port C): Line-In */ - AZALIA_PIN_CFG(0, 0x1a, 0x01813121), - /* Pin Complex (NID 0x1b), LINE2 (port E): MDC */ - AZALIA_PIN_CFG(0, 0x1b, 0x9983012f), - /* Pin Complex (NID 0x1c), CD_IN */ - AZALIA_PIN_CFG(0, 0x1c, 0x593301f0), - /* Pin Complex (NID 0x1d), PCBEEP */ - AZALIA_PIN_CFG(0, 0x1d, 0x4014022d), - /* Pin Complex (NID 0x1e), S/PDIF-OUT: not connected */ - AZALIA_PIN_CFG(0, 0x1e, 0x411111f0), - /* Pin Complex (NID 0x1f), S/PDIF-IN: not connected */ - AZALIA_PIN_CFG(0, 0x1f, 0x411111f0) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up codec */ - 0x01470500, /* power up speakers */ - 0x01470100, /* select lout1 (input 0x0) for speakers */ - 0x01470740, /* enable speakers output */ - 0x00b37517, /* unmute beep (mixer's input 0x5), set amp 0dB */ - 0x00c37100, /* unmute mixer in lout1 (lout1 input 0x1) */ - 0x00c3b015, /* set lout1 output volume -15dB */ - 0x0143b000, /* unmute speakers */ -}; diff --git a/src/mainboard/roda/rk9/mainboard.c b/src/mainboard/roda/rk9/mainboard.c index 49db15f2e4..d5d02bf2e4 100644 --- a/src/mainboard/roda/rk9/mainboard.c +++ b/src/mainboard/roda/rk9/mainboard.c @@ -26,22 +26,12 @@ #include #include #include -#include -#include "hda_verb.h" #if CONFIG_GENERATE_ACPI_TABLES #include "cstates.c" /* Include it, as the linker won't find the overloaded weak function in there. */ #endif -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 = ARRAY_SIZE(mainboard_pc_beep_verbs); -} - static void ec_setup(void) { /* Thermal limits? Values are from ectool's ram dump. */ @@ -59,7 +49,6 @@ static void ec_setup(void) static void mainboard_enable(device_t dev) { ec_setup(); - verb_setup(); /* LCD panel type is SIO GPIO40-43. It's controlled by a DIP switch but was always set to 4 while only values of 5 and 6 worked. */ diff --git a/src/mainboard/samsung/lumpy/hda_verb.c b/src/mainboard/samsung/lumpy/hda_verb.c new file mode 100644 index 0000000000..7ee254b10c --- /dev/null +++ b/src/mainboard/samsung/lumpy/hda_verb.c @@ -0,0 +1,61 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (c) 2011 The Chromium OS 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 */ + 0x10134210, // Codec Vendor / Device ID: Realtek ALC262 + 0x144db082, // Subsystem ID + 0x00000007, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x144dc0c2 */ + AZALIA_SUBVENDOR(0x0, 0x144db082), + + 0x00170500, + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x05) */ + AZALIA_PIN_CFG(0x0, 0x05, 0x022110f0), + + /* Pin Complex (NID 0x06) */ + AZALIA_PIN_CFG(0x0, 0x06, 0x901700f0), + + /* Pin Complex (NID 0x07) */ + AZALIA_PIN_CFG(0x0, 0x07, 0x02a110f0), + + /* Pin Complex (NID 0x08) */ + AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), + + /* Pin Complex (NID 0x09) */ + AZALIA_PIN_CFG(0x0, 0x09, 0xb7a6003e), + + /* Pin Complex (NID 0x0a) */ + AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0) +}; + +const u32 pc_beep_verbs[] = { + 0x00170500, /* power up codec */ + 0x00270500, /* power up DAC */ + 0x00670500, /* power up speaker */ + 0x00670740, /* enable speaker output */ + 0x0023B04B, /* set DAC gain */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/samsung/lumpy/hda_verb.h b/src/mainboard/samsung/lumpy/hda_verb.h deleted file mode 100644 index 4806b75f5b..0000000000 --- a/src/mainboard/samsung/lumpy/hda_verb.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (c) 2011 The Chromium OS 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 */ - 0x10134210, // Codec Vendor / Device ID: Realtek ALC262 - 0x144db082, // Subsystem ID - 0x00000007, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x144dc0c2 */ - AZALIA_SUBVENDOR(0x0, 0x144db082), - - 0x00170500, - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x05) */ - AZALIA_PIN_CFG(0x0, 0x05, 0x022110f0), - - /* Pin Complex (NID 0x06) */ - AZALIA_PIN_CFG(0x0, 0x06, 0x901700f0), - - /* Pin Complex (NID 0x07) */ - AZALIA_PIN_CFG(0x0, 0x07, 0x02a110f0), - - /* Pin Complex (NID 0x08) */ - AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), - - /* Pin Complex (NID 0x09) */ - AZALIA_PIN_CFG(0x0, 0x09, 0xb7a6003e), - - /* Pin Complex (NID 0x0a) */ - AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0) -}; - -static const u32 mainboard_pc_beep_verbs[] = { - 0x00170500, /* power up codec */ - 0x00270500, /* power up DAC */ - 0x00670500, /* power up speaker */ - 0x00670740, /* enable speaker output */ - 0x0023B04B, /* set DAC gain */ -}; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/samsung/lumpy/mainboard.c b/src/mainboard/samsung/lumpy/mainboard.c index 803761c60a..3bdd4d9815 100644 --- a/src/mainboard/samsung/lumpy/mainboard.c +++ b/src/mainboard/samsung/lumpy/mainboard.c @@ -35,8 +35,6 @@ #include "onboard.h" #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -48,15 +46,7 @@ void mainboard_suspend_resume(void) send_ec_command(EC_ACPI_ENABLE); } -/* 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) { @@ -116,7 +106,6 @@ static void mainboard_enable(device_t dev) dev->ops->init = mainboard_init; dev->ops->get_smbios_data = lumpy_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/samsung/stumpy/hda_verb.c b/src/mainboard/samsung/stumpy/hda_verb.c new file mode 100644 index 0000000000..1949aaa0f5 --- /dev/null +++ b/src/mainboard/samsung/stumpy/hda_verb.c @@ -0,0 +1,76 @@ +/* + * 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 */ + 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 + 0x10134210, // Subsystem ID + 0x00000007, // Number of jacks + + /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ + AZALIA_SUBVENDOR(0x0, 0x10134210), + + /* Pin Widget Verb Table */ + + /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), + + /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ + AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), + + /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ + AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), + + /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), + + /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ + AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), + + /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ + AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), + + /* coreboot specific header */ + 0x80862805, // 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(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 codec */ + 0x00270500, /* power up DAC */ + 0x00670500, /* power up speaker */ + 0x00670740, /* enable speaker output */ + 0x0023B04B, /* set DAC gain */ +}; +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/samsung/stumpy/hda_verb.h b/src/mainboard/samsung/stumpy/hda_verb.h deleted file mode 100644 index 3992eeec04..0000000000 --- a/src/mainboard/samsung/stumpy/hda_verb.h +++ /dev/null @@ -1,75 +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 */ - 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 - 0x10134210, // Subsystem ID - 0x00000007, // Number of jacks - - /* NID 0x01, HDA Codec Subsystem ID Verb Table: 0x10134210 */ - AZALIA_SUBVENDOR(0x0, 0x10134210), - - /* Pin Widget Verb Table */ - - /* Pin Complex (NID 0x05) 1/8 Gray HP Out at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x05, 0x022120f0), - - /* Pin Complex (NID 0x06) Analog Unknown Speaker at Int N/A */ - AZALIA_PIN_CFG(0x0, 0x06, 0x90170010), - - /* Pin Complex (NID 0x07) 1/8 Grey Line In at Ext Front */ - AZALIA_PIN_CFG(0x0, 0x07, 0x02a120f0), - - /* Pin Complex (NID 0x08) Analog Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x08, 0x77a70037), - - /* Pin Complex (NID 0x09) Digital Unknown Mic at Oth Mobile-In */ - AZALIA_PIN_CFG(0x0, 0x09, 0x77a6003e), - - /* Pin Complex (NID 0x0a) Optical Black SPDIF Out at Ext N/A */ - AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0), - - /* coreboot specific header */ - 0x80862805, // 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(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 codec */ - 0x00270500, /* power up DAC */ - 0x00670500, /* power up speaker */ - 0x00670740, /* enable speaker output */ - 0x0023B04B, /* set DAC gain */ -}; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c index d61b808794..347ce8a910 100644 --- a/src/mainboard/samsung/stumpy/mainboard.c +++ b/src/mainboard/samsung/stumpy/mainboard.c @@ -32,8 +32,6 @@ #include #include #include -#include -#include "hda_verb.h" void mainboard_suspend_resume(void) { @@ -41,15 +39,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; -} // mainboard_enable is executed as first thing after // enumerate_buses(). @@ -57,7 +47,6 @@ static void verb_setup(void) static void mainboard_enable(device_t dev) { 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/southbridge/intel/bd82x6x/Makefile.inc b/src/southbridge/intel/bd82x6x/Makefile.inc index def9cd2aa2..b79b85a0a9 100644 --- a/src/southbridge/intel/bd82x6x/Makefile.inc +++ b/src/southbridge/intel/bd82x6x/Makefile.inc @@ -34,6 +34,8 @@ ramstage-y += me.c ramstage-y += me_8.x.c ramstage-y += smbus.c +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c + ramstage-y += me_status.c ramstage-y += reset.c ramstage-y += watchdog.c diff --git a/src/southbridge/intel/bd82x6x/azalia.c b/src/southbridge/intel/bd82x6x/azalia.c index fed6f745be..bef88abea4 100644 --- a/src/southbridge/intel/bd82x6x/azalia.c +++ b/src/southbridge/intel/bd82x6x/azalia.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "pch.h" #define HDA_ICII_REG 0x68 @@ -90,11 +91,6 @@ no_codec: return 0; } -const u32 * cim_verb_data = NULL; -u32 cim_verb_data_size = 0; -const u32 * pc_beep_verbs = NULL; -u32 pc_beep_verbs_size = 0; - static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) { int idx=0; diff --git a/src/southbridge/intel/i82801gx/Makefile.inc b/src/southbridge/intel/i82801gx/Makefile.inc index 94c84ed23e..6e4d42e519 100644 --- a/src/southbridge/intel/i82801gx/Makefile.inc +++ b/src/southbridge/intel/i82801gx/Makefile.inc @@ -30,6 +30,8 @@ ramstage-y += smbus.c ramstage-y += usb.c ramstage-y += usb_ehci.c +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c + ramstage-y += reset.c ramstage-y += watchdog.c diff --git a/src/southbridge/intel/i82801gx/azalia.c b/src/southbridge/intel/i82801gx/azalia.c index 59d812327c..f6628e7c95 100644 --- a/src/southbridge/intel/i82801gx/azalia.c +++ b/src/southbridge/intel/i82801gx/azalia.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "i82801gx.h" #define HDA_ICII_REG 0x68 @@ -90,9 +91,6 @@ no_codec: return 0; } -const u32 * cim_verb_data = NULL; -u32 cim_verb_data_size = 0; - static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) { int idx=0; diff --git a/src/southbridge/intel/i82801ix/Makefile.inc b/src/southbridge/intel/i82801ix/Makefile.inc index 096533c992..4117263ee7 100644 --- a/src/southbridge/intel/i82801ix/Makefile.inc +++ b/src/southbridge/intel/i82801ix/Makefile.inc @@ -28,6 +28,8 @@ ramstage-y += hdaudio.c ramstage-y += thermal.c ramstage-y += smbus.c +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c + ramstage-y += ../i82801gx/reset.c ramstage-y += ../i82801gx/watchdog.c diff --git a/src/southbridge/intel/i82801ix/hdaudio.c b/src/southbridge/intel/i82801ix/hdaudio.c index 407c0a795f..dd817b9b08 100644 --- a/src/southbridge/intel/i82801ix/hdaudio.c +++ b/src/southbridge/intel/i82801ix/hdaudio.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "i82801ix.h" #define HDA_ICII_REG 0x68 @@ -91,11 +92,6 @@ no_codec: return 0; } -const u32 * cim_verb_data = NULL; -u32 cim_verb_data_size = 0; -const u32 * pc_beep_verbs = NULL; -u32 pc_beep_verbs_size = 0; - static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) { int idx=0; diff --git a/src/southbridge/intel/ibexpeak/Makefile.inc b/src/southbridge/intel/ibexpeak/Makefile.inc index da9f34a8c8..24cbe454a1 100644 --- a/src/southbridge/intel/ibexpeak/Makefile.inc +++ b/src/southbridge/intel/ibexpeak/Makefile.inc @@ -34,6 +34,8 @@ ramstage-y += ../bd82x6x/me_8.x.c ramstage-y += smbus.c ramstage-y += thermal.c +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c + ramstage-y += ../bd82x6x/me_status.c ramstage-y += ../bd82x6x/reset.c ramstage-y += ../bd82x6x/watchdog.c diff --git a/src/southbridge/intel/ibexpeak/azalia.c b/src/southbridge/intel/ibexpeak/azalia.c index 046d2b68e8..314a1b1d19 100644 --- a/src/southbridge/intel/ibexpeak/azalia.c +++ b/src/southbridge/intel/ibexpeak/azalia.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "pch.h" #define HDA_ICII_REG 0x68 @@ -88,11 +89,6 @@ no_codec: return 0; } -const u32 * cim_verb_data = NULL; -u32 cim_verb_data_size = 0; -const u32 * pc_beep_verbs = NULL; -u32 pc_beep_verbs_size = 0; - static u32 find_verb(struct device *dev, u32 viddid, const u32 ** verb) { int idx=0; diff --git a/src/southbridge/intel/lynxpoint/Makefile.inc b/src/southbridge/intel/lynxpoint/Makefile.inc index e504db09b7..3b7663ea04 100644 --- a/src/southbridge/intel/lynxpoint/Makefile.inc +++ b/src/southbridge/intel/lynxpoint/Makefile.inc @@ -35,6 +35,8 @@ ramstage-y += smbus.c ramstage-y += hda_verb.c ramstage-$(CONFIG_INTEL_LYNXPOINT_LP) += serialio.c +ramstage-srcs += src/mainboard/$(MAINBOARDDIR)/hda_verb.c + ramstage-y += rcba.c ramstage-y += me_status.c ramstage-y += reset.c diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c index 24c6702c3b..be056be493 100644 --- a/src/southbridge/intel/lynxpoint/azalia.c +++ b/src/southbridge/intel/lynxpoint/azalia.c @@ -26,14 +26,10 @@ #include #include #include +#include #include "pch.h" #include "hda_verb.h" -const u32 * cim_verb_data = NULL; -u32 cim_verb_data_size = 0; -const u32 * pc_beep_verbs = NULL; -u32 pc_beep_verbs_size = 0; - static void codecs_init(u32 base, u32 codec_mask) { int i; @@ -46,7 +42,7 @@ static void codecs_init(u32 base, u32 codec_mask) cim_verb_data); } - if (pc_beep_verbs_size && pc_beep_verbs) + if (pc_beep_verbs_size) hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs); } -- cgit v1.2.3