[coreboot-gerrit] Change in coreboot[master]: mb/intel/kblrvp: Use common HDA code

Duncan Laurie (Code Review) gerrit at coreboot.org
Tue Jan 9 19:00:10 CET 2018


Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/23188


Change subject: mb/intel/kblrvp: Use common HDA code
......................................................................

mb/intel/kblrvp: Use common HDA code

Instead of duplicating code in each mainboard that supports HDA use
the common driver and provide the HDA verb table.

This was compile tested for both variants with "abuild -t intel/kblrvp"

Change-Id: Ie3bab7aabcfa040935062b7764853df8fb19b04d
Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
---
M src/mainboard/intel/kblrvp/Kconfig
M src/mainboard/intel/kblrvp/hda_verb.c
2 files changed, 1 insertion(+), 66 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/23188/1

diff --git a/src/mainboard/intel/kblrvp/Kconfig b/src/mainboard/intel/kblrvp/Kconfig
index 66087b9..b99a92b 100644
--- a/src/mainboard/intel/kblrvp/Kconfig
+++ b/src/mainboard/intel/kblrvp/Kconfig
@@ -11,6 +11,7 @@
 	select SOC_INTEL_SKYLAKE
 	select MAINBOARD_USES_FSP2_0
 	select MAINBOARD_HAS_CHROMEOS
+	select MAINBOARD_HAS_HDA_VERB_TABLE
 	select GENERIC_SPD_BIN
 
 config VBOOT
diff --git a/src/mainboard/intel/kblrvp/hda_verb.c b/src/mainboard/intel/kblrvp/hda_verb.c
index ba9cc46..b219987 100644
--- a/src/mainboard/intel/kblrvp/hda_verb.c
+++ b/src/mainboard/intel/kblrvp/hda_verb.c
@@ -14,70 +14,4 @@
  * GNU General Public License for more details.
  */
 
-#include <bootstate.h>
-#include <chip.h>
-#include <console/console.h>
-#include <device/azalia_device.h>
-#include <soc/intel/common/hda_verb.h>
-#include <soc/pci_devs.h>
-
 #include "variant/hda_verb.h"
-
-static void codecs_init(u8 *base, u32 codec_mask)
-{
-	int i;
-
-	/* Can support up to 4 codecs */
-	for (i = 3; i >= 0; i--) {
-		if (codec_mask & (1 << i))
-			hda_codec_init(base, i, cim_verb_data_size,
-					cim_verb_data);
-	}
-
-	if (pc_beep_verbs_size)
-		hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs);
-}
-
-static void mb_hda_codec_init(void *unused)
-{
-	static struct soc_intel_skylake_config *config;
-	u8 *base;
-	struct resource *res;
-	u32 codec_mask;
-	struct device *dev;
-
-	dev = SA_DEV_ROOT;
-	/* Check if HDA is enabled, else return */
-	if (dev == NULL || dev->chip_info == NULL)
-		return;
-
-	config = dev->chip_info;
-
-	/*
-	 * IoBufferOwnership 0:HD-A Link, 1:Shared HD-A Link and I2S Port,
-	 * 3:I2S Ports. In HDA mode where codec need to be programmed with
-	 * verb table
-	 */
-	if (config->IoBufferOwnership == 3)
-		return;
-
-	/* Find base address */
-	dev = dev_find_slot(0, PCH_DEVFN_HDA);
-	if (dev == NULL || dev->enabled == 0)
-		return;
-	res = find_resource(dev, PCI_BASE_ADDRESS_0);
-	if (!res)
-		return;
-
-	base = res2mmio(res, 0, 0);
-	printk(BIOS_DEBUG, "HDA: base = %p\n", base);
-
-	codec_mask = hda_codec_detect(base);
-
-	if (codec_mask) {
-		printk(BIOS_DEBUG, "HDA: codec_mask = %02x\n", codec_mask);
-		codecs_init(base, codec_mask);
-	}
-}
-
-BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, mb_hda_codec_init, NULL);

-- 
To view, visit https://review.coreboot.org/23188
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie3bab7aabcfa040935062b7764853df8fb19b04d
Gerrit-Change-Number: 23188
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180109/b1babb8e/attachment.html>


More information about the coreboot-gerrit mailing list