diff options
Diffstat (limited to 'src')
87 files changed, 251 insertions, 456 deletions
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 <types.h> +#include <string.h> +#include <console/console.h> +#include <arch/acpi.h> +#include <arch/io.h> +#include <arch/interrupt.h> +#include <build.h> + #include <device/device.h> 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.h b/src/mainboard/apple/macbook21/hda_verb.c index 07fa6bc81e..1fe188e357 100644 --- a/src/mainboard/apple/macbook21/hda_verb.h +++ b/src/mainboard/apple/macbook21/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x83847680, /* Codec Vendor / Device ID: SigmaTel STAC9221 A1 */ 0x106b2200, /* Subsystem ID */ @@ -58,3 +60,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x0, 0x1B, 0x400000FB), }; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; 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 <arch/x86/include/arch/acpigen.h> #include <smbios.h> #include <drivers/intel/gma/int15.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/asus/m2n-e/hda_verb.c index 9dd3d88ec9..2f8fe87941 100644 --- a/src/mainboard/asus/m2n-e/hda_verb.h +++ b/src/mainboard/asus/m2n-e/hda_verb.c @@ -24,7 +24,9 @@ * http://www.analog.com/static/imported-files/data_sheets/AD1988A_1988B.pdf */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x11d4198b, /* Codec Vendor / Device ID: Analog Devices AD1988B */ 0x104381f6, /* Subsystem ID (0x1043 == ASUS) */ @@ -76,3 +78,4 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x0, 0x25, 0x01012014), }; +AZALIA_ARRAY_SIZES; 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 <device/device.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/dmp/vortex86ex/hda_verb.c index 5402b621ef..79ee44ed15 100644 --- a/src/mainboard/dmp/vortex86ex/hda_verb.h +++ b/src/mainboard/dmp/vortex86ex/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 0x10714700, // Subsystem ID @@ -60,3 +62,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/io.h> #include <boot/tables.h> #include <device/pci_def.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +const u32 cim_verb_data[0] = {}; + +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.c index 280d6f2604..2a753421bb 100644 --- a/src/mainboard/getac/p470/hda_verb.h +++ b/src/mainboard/getac/p470/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 0x10714700, // Subsystem ID @@ -64,3 +66,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <device/pci_def.h> #include <arch/io.h> #include <delay.h> -#include <device/azalia_device.h> -#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 <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> -// #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.h b/src/mainboard/google/bolt/hda_verb.c index 54f27f13ae..b81da64014 100644 --- a/src/mainboard/google/bolt/hda_verb.h +++ b/src/mainboard/google/bolt/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 0x10ec0283, // Subsystem ID @@ -75,3 +77,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x0, 0x21, 0x0321101f), }; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; 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 <arch/io.h> #include <arch/interrupt.h> #include <boot/coreboot_tables.h> -#include <device/azalia_device.h> -#include "hda_verb.h" #include <southbridge/intel/lynxpoint/pch.h> #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.h b/src/mainboard/google/butterfly/hda_verb.c index e06a1bea49..97ff2f6e19 100644 --- a/src/mainboard/google/butterfly/hda_verb.h +++ b/src/mainboard/google/butterfly/hda_verb.c @@ -24,7 +24,9 @@ */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x111D76E5, // Codec Vendor / Device ID: IDT 92HD99 0x103C18F9, // Subsystem ID @@ -223,9 +225,8 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 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); +AZALIA_ARRAY_SIZES; 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 <smbios.h> #include <device/pci.h> #include <ec/quanta/ene_kb3940q/ec.h> -#include <device/azalia_device.h> -#include "hda_verb.h" #if CONFIG_CHROMEOS #include <vendorcode/google/chromeos/fmap.h> #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.h b/src/mainboard/google/falco/hda_verb.c index 5c37f510ea..5ea3c7bcca 100644 --- a/src/mainboard/google/falco/hda_verb.h +++ b/src/mainboard/google/falco/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 0x10ec0283, // Subsystem ID @@ -87,7 +89,7 @@ static const u32 mainboard_cim_verb_data[] = { 0x0204081b, }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -96,5 +98,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 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]); +AZALIA_ARRAY_SIZES; 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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/lynxpoint/pch.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/google/link/hda_verb.c index bb5ff106c5..87bcf30a98 100644 --- a/src/mainboard/google/link/hda_verb.h +++ b/src/mainboard/google/link/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x11020011, // Codec Vendor / Device ID: Creative CA0132 0x144dc0c2, // Subsystem ID @@ -126,7 +128,7 @@ static const u32 mainboard_cim_verb_data[] = { }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up codec */ 0x00270500, /* power up DAC */ 0x00b70500, /* power up speaker */ @@ -135,5 +137,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 0x00b70c02, /* set EAPD pin */ 0x0143b013, /* beep volume */ }; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); +AZALIA_ARRAY_SIZES; 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 <smbios.h> #include <device/pci.h> #include <ec/google/chromeec/ec.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/google/panther/hda_verb.c index 47311e308d..7de91d9f21 100644 --- a/src/mainboard/google/panther/hda_verb.h +++ b/src/mainboard/google/panther/hda_verb.c @@ -22,7 +22,9 @@ #include <stdlib.h> -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 0x10ec0283, // Subsystem ID @@ -83,7 +85,7 @@ static const u32 mainboard_cim_verb_data[] = { 0x0204081b, }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -92,7 +94,6 @@ static const u32 mainboard_pc_beep_verbs[] = { 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 */ +AZALIA_ARRAY_SIZES; 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 <device/pci_ops.h> #include <pc80/mc146818rtc.h> #include <southbridge/intel/lynxpoint/pch.h> -#include <device/azalia_device.h> #include <drivers/intel/gma/int15.h> -#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.h b/src/mainboard/google/parrot/hda_verb.c index dfa7a817a3..f79f69d8e3 100644 --- a/src/mainboard/google/parrot/hda_verb.h +++ b/src/mainboard/google/parrot/hda_verb.c @@ -32,7 +32,9 @@ * HDMI PatherPoint */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269 0x10250742, // Subsystem ID @@ -131,7 +133,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -140,5 +142,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 0x00b37410, /* unmute mixer nid 0xb beep input and set volume */ }; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); +AZALIA_ARRAY_SIZES; 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 <smbios.h> #include <device/pci.h> #include <ec/compal/ene932/ec.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/google/peppy/hda_verb.c index 9203522443..a88d9f8890 100644 --- a/src/mainboard/google/peppy/hda_verb.h +++ b/src/mainboard/google/peppy/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 0x10ec0283, // Subsystem ID @@ -91,7 +93,7 @@ static const u32 mainboard_cim_verb_data[] = { 0x0204081b, }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -100,5 +102,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 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]); +AZALIA_ARRAY_SIZES; 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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/lynxpoint/pch.h> -#include <device/azalia_device.h> #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 <device/azalia_device.h> + +const u32 cim_verb_data[0] = {}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/google/slippy/hda_verb.h b/src/mainboard/google/slippy/hda_verb.c index b1f1cb6bf9..68662c644f 100644 --- a/src/mainboard/google/slippy/hda_verb.h +++ b/src/mainboard/google/slippy/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0283, // Codec Vendor / Device ID: Realtek ALC283 0x10ec0283, // Subsystem ID @@ -82,7 +84,7 @@ static const u32 mainboard_cim_verb_data[] = { 0x0204081b, }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -91,5 +93,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 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]); +AZALIA_ARRAY_SIZES; 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 <southbridge/intel/lynxpoint/pch.h> #include "ec.h" #include "onboard.h" -#include <device/azalia_device.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/stout/hda_verb.h b/src/mainboard/google/stout/hda_verb.c index 43dae91f85..3fcd4f5c65 100644 --- a/src/mainboard/google/stout/hda_verb.h +++ b/src/mainboard/google/stout/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0269, // Codec Vendor / Device ID: Realtek 0x17aa21fe, // Subsystem ID @@ -82,7 +84,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x58560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up everything (codec, dac, adc, mixers) */ 0x01470740, /* enable speaker out */ 0x01470c02, /* set speaker EAPD pin */ @@ -90,5 +92,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 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); +AZALIA_ARRAY_SIZES; 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 <smbios.h> #include <device/pci.h> #include <ec/quanta/it8518/ec.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +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 <pc80/mc146818rtc.h> #include <arch/io.h> #include <arch/interrupt.h> -#include <device/azalia_device.h> #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/emeraldlake2/hda_verb.h b/src/mainboard/intel/baskingridge/hda_verb.c index 2796e92682..96770de362 100644 --- a/src/mainboard/intel/emeraldlake2/hda_verb.h +++ b/src/mainboard/intel/baskingridge/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 0x10134210, // Subsystem ID @@ -63,3 +65,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/lynxpoint/pch.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/intel/cougar_canyon2/hda_verb.c index 381e338c45..c518b781bd 100644 --- a/src/mainboard/intel/cougar_canyon2/hda_verb.h +++ b/src/mainboard/intel/cougar_canyon2/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x80862805, // Codec Vendor / Device ID: Intel CougarPoint HDMI 0x80860101, // Subsystem ID @@ -35,3 +37,4 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/fsp_bd82x6x/pch.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +const u32 cim_verb_data[0] = {}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/intel/baskingridge/hda_verb.h b/src/mainboard/intel/emeraldlake2/hda_verb.c index 2796e92682..96770de362 100644 --- a/src/mainboard/intel/baskingridge/hda_verb.h +++ b/src/mainboard/intel/emeraldlake2/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 0x10134210, // Subsystem ID @@ -63,3 +65,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/bd82x6x/pch.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/intel/wtm2/hda_verb.c index 48750356c0..c18e79b1af 100644 --- a/src/mainboard/intel/wtm2/hda_verb.h +++ b/src/mainboard/intel/wtm2/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 0x10134210, // Subsystem ID @@ -63,3 +65,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/lynxpoint/pch.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/iwave/iWRainbowG6/hda_verb.c index 6799c12799..4cb2c9fcee 100644 --- a/src/mainboard/iwave/iWRainbowG6/hda_verb.h +++ b/src/mainboard/iwave/iWRainbowG6/hda_verb.c @@ -89,3 +89,4 @@ static u32 mainboard_cim_verb_data[] = { /* BTL Gain */ 0x017F417, /* Gain = 16.79dB */ }; +AZALIA_ARRAY_SIZES; 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 <device/device.h> #include <console/console.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +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 <pc80/mc146818rtc.h> #include <arch/io.h> #include <arch/interrupt.h> -#include <device/azalia_device.h> /* 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.h b/src/mainboard/kontron/ktqm77/hda_verb.c index ccec18c752..c957c25fe1 100644 --- a/src/mainboard/kontron/ktqm77/hda_verb.h +++ b/src/mainboard/kontron/ktqm77/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x11060397, // Codec Vendor / Device ID: Via VT1708S 0x11060000, // Subsystem ID @@ -113,3 +115,7 @@ static const u32 mainboard_cim_verb_data[] = { /* 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/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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/bd82x6x/pch.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/lenovo/t520/hda_verb.c index 19eac1bd67..dd776fc026 100644 --- a/src/mainboard/lenovo/t520/hda_verb.h +++ b/src/mainboard/lenovo/t520/hda_verb.c @@ -25,7 +25,9 @@ */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 - Schematic shows CX20672 0x17aa21cf, // Subsystem ID @@ -181,9 +183,8 @@ static const u32 mainboard_cim_verb_data[] = { 0x00170500, /* Set power state to D0 */ }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 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); +AZALIA_ARRAY_SIZES; 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 <cbfs.h> #include <pc80/keyboard.h> #include <ec/lenovo/h8/h8.h> -#include <device/azalia_device.h> -#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/x230/hda_verb.h b/src/mainboard/lenovo/t530/hda_verb.c index f04eae7e71..29f8a4522b 100644 --- a/src/mainboard/lenovo/x230/hda_verb.h +++ b/src/mainboard/lenovo/t530/hda_verb.c @@ -25,7 +25,9 @@ */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC 0x17aa21fa, // Subsystem ID @@ -243,9 +245,8 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 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); +AZALIA_ARRAY_SIZES; 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 <cbfs.h> #include <pc80/keyboard.h> #include <ec/lenovo/h8/h8.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +const u32 cim_verb_data[0] = {}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/lenovo/x200/hda_verb.h b/src/mainboard/lenovo/x200/hda_verb.c index 3d922589f8..c1cd5422ee 100644 --- a/src/mainboard/lenovo/x200/hda_verb.h +++ b/src/mainboard/lenovo/x200/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x14f15051, // Conexant CX20561 (Hermosa) 0x17aa20ff, // Subsystem ID @@ -36,7 +38,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0, 0x1d, 0x90a601f0) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up codec */ 0x01470500, /* power up speakers */ 0x01470100, /* select lout1 (input 0x0) for speakers */ @@ -46,3 +48,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 0x00c3b015, /* set lout1 output volume -15dB */ 0x0143b000, /* unmute speakers */ }; +AZALIA_ARRAY_SIZES; 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 <ec/lenovo/pmh7/pmh7.h> #include <ec/acpi/ec.h> #include <ec/lenovo/h8/h8.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/lenovo/x201/hda_verb.c index 17069292af..22634f05ff 100644 --- a/src/mainboard/lenovo/x201/hda_verb.h +++ b/src/mainboard/lenovo/x201/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x14F15069, /* Codec Vendor / Device ID: Conexant CX20585 */ 0x17AA2155, /* Subsystem ID */ @@ -73,3 +75,7 @@ static const u32 mainboard_cim_verb_data[] = { /* NID 0x06. */ AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), }; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; 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 <ec/lenovo/h8/h8.h> #include <northbridge/intel/nehalem/nehalem.h> #include <southbridge/intel/bd82x6x/pch.h> -#include <device/azalia_device.h> #include <pc80/mc146818rtc.h> #include "dock.h" -#include "hda_verb.h" #include <arch/x86/include/arch/acpigen.h> #include <drivers/intel/gma/int15.h> #include <arch/interrupt.h> @@ -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.h b/src/mainboard/lenovo/x220/hda_verb.c index ce980fc2a8..c3d1372da7 100644 --- a/src/mainboard/lenovo/x220/hda_verb.h +++ b/src/mainboard/lenovo/x220/hda_verb.c @@ -25,7 +25,9 @@ */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x14f1506e, // Codec Vendor / Device ID: Conexant CX20590 0x17aa21db, // Subsystem ID @@ -205,9 +207,8 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 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); +AZALIA_ARRAY_SIZES; 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 <pc80/keyboard.h> #include <ec/lenovo/h8/h8.h> #include <build.h> -#include <device/azalia_device.h> -#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/t530/hda_verb.h b/src/mainboard/lenovo/x230/hda_verb.c index f04eae7e71..29f8a4522b 100644 --- a/src/mainboard/lenovo/t530/hda_verb.h +++ b/src/mainboard/lenovo/x230/hda_verb.c @@ -25,7 +25,9 @@ */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0269, // Codec Vendor / Device ID: Realtek ALC269VC 0x17aa21fa, // Subsystem ID @@ -243,9 +245,8 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 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); +AZALIA_ARRAY_SIZES; 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 <pc80/keyboard.h> #include <ec/lenovo/h8/h8.h> #include <build.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +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 <device/device.h> -#include <device/azalia_device.h> #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 <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> -// #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 <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> -#include <device/azalia_device.h> -// #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.h b/src/mainboard/nvidia/l1_2pvv/hda_verb.c index ea3159e53d..780167af29 100644 --- a/src/mainboard/nvidia/l1_2pvv/hda_verb.h +++ b/src/mainboard/nvidia/l1_2pvv/hda_verb.c @@ -64,3 +64,4 @@ static u32 mainboard_cim_verb_data[] = { /* NID 0x1f, S/PDIF-IN */ AZALIA_PIN_CFG(0x0, 0x1f, 0x01c59150), }; +AZALIA_ARRAY_SIZES; 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 <device/pci.h> #include <device/pci_ids.h> #include <device/pci_ops.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/packardbell/ms2290/hda_verb.c index 3cc00dbe9c..4ec3b3601c 100644 --- a/src/mainboard/packardbell/ms2290/hda_verb.h +++ b/src/mainboard/packardbell/ms2290/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0272, /* Codec Vendor / Device ID: Realtek ALC272X */ 0x10250379, /* Subsystem ID */ @@ -58,3 +60,7 @@ static const u32 mainboard_cim_verb_data[] = { /* NID 0x06. */ AZALIA_PIN_CFG(0x3, 0x06, 0x58560030), }; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; 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 <cpu/x86/lapic.h> #include <device/pci.h> #include <smbios.h> -#include <device/azalia_device.h> -#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 <device/azalia_device.h> + +const u32 cim_verb_data[0] = {}; + +const u32 pc_beep_verbs[0] = {}; + +AZALIA_ARRAY_SIZES; diff --git a/src/mainboard/roda/rk9/hda_verb.h b/src/mainboard/roda/rk9/hda_verb.c index 64a3c8eec4..8960232089 100644 --- a/src/mainboard/roda/rk9/hda_verb.h +++ b/src/mainboard/roda/rk9/hda_verb.c @@ -18,7 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10ec0262, // Codec Vendor / Device ID: Realtek ALC262 0x43528986, // Subsystem ID @@ -52,7 +54,7 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0, 0x1f, 0x411111f0) }; -static const u32 mainboard_pc_beep_verbs[] = { +const u32 pc_beep_verbs[] = { 0x00170500, /* power up codec */ 0x01470500, /* power up speakers */ 0x01470100, /* select lout1 (input 0x0) for speakers */ @@ -62,3 +64,4 @@ static const u32 mainboard_pc_beep_verbs[] = { 0x00c3b015, /* set lout1 output volume -15dB */ 0x0143b000, /* unmute speakers */ }; +AZALIA_ARRAY_SIZES; 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 <drivers/intel/gma/int15.h> #include <pc80/keyboard.h> #include <ec/acpi/ec.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/samsung/lumpy/hda_verb.c index 4806b75f5b..7ee254b10c 100644 --- a/src/mainboard/samsung/lumpy/hda_verb.h +++ b/src/mainboard/samsung/lumpy/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10134210, // Codec Vendor / Device ID: Realtek ALC262 0x144db082, // Subsystem ID @@ -49,12 +51,11 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x0, 0x0a, 0x434510f0) }; -static const u32 mainboard_pc_beep_verbs[] = { +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 */ }; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); +AZALIA_ARRAY_SIZES; 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 <southbridge/intel/bd82x6x/pch.h> #include <smbios.h> -#include <device/azalia_device.h> -#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.h b/src/mainboard/samsung/stumpy/hda_verb.c index 3992eeec04..1949aaa0f5 100644 --- a/src/mainboard/samsung/stumpy/hda_verb.h +++ b/src/mainboard/samsung/stumpy/hda_verb.c @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -static const u32 mainboard_cim_verb_data[] = { +#include <device/azalia_device.h> + +const u32 cim_verb_data[] = { /* coreboot specific header */ 0x10134210, // Codec Vendor / Device ID: Cirrus Logic CS4210 0x10134210, // Subsystem ID @@ -64,12 +66,11 @@ static const u32 mainboard_cim_verb_data[] = { AZALIA_PIN_CFG(0x3, 0x07, 0x18560030) }; -static const u32 mainboard_pc_beep_verbs[] = { +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 */ }; -static const u32 mainboard_pc_beep_verbs_size = - ARRAY_SIZE(mainboard_pc_beep_verbs); +AZALIA_ARRAY_SIZES; 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 <arch/interrupt.h> #include <boot/coreboot_tables.h> #include <southbridge/intel/bd82x6x/pch.h> -#include <device/azalia_device.h> -#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 <device/pci_ops.h> #include <arch/io.h> #include <delay.h> +#include <device/azalia_device.h> #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 <device/pci_ops.h> #include <arch/io.h> #include <delay.h> +#include <device/azalia_device.h> #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 <device/pci_ops.h> #include <arch/io.h> #include <delay.h> +#include <device/azalia_device.h> #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 <device/pci_ops.h> #include <arch/io.h> #include <delay.h> +#include <device/azalia_device.h> #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 <device/pci_ops.h> #include <arch/io.h> #include <delay.h> +#include <device/azalia_device.h> #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); } |