aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/octopus/variants/baseboard/include
diff options
context:
space:
mode:
authorMarco Chen <marcochen@google.com>2020-12-21 22:10:21 +0800
committerFurquan Shaikh <furquan@google.com>2021-01-08 14:29:31 +0000
commit07c80b2164ef924bdd158144e21cf4c2b5f3d22d (patch)
tree5dd842b902872e54a4e2725db72c89662fcba2b6 /src/mainboard/google/octopus/variants/baseboard/include
parent3f80a7aa6db62c16a724b86dfdcfe6202859e6e8 (diff)
mb/google/octopus: add audio codec into SSFC support for Bobba
BUG=b:174118027 BRANCH=octopus TEST=adjust SSFC value of CBI to select RT5682 or DA7219 then check whether device tree is updated correspondingly by disabling unselected one. Signed-off-by: Marco Chen <marcochen@google.com> Change-Id: Id37c4c5716ade0851cfcb24e12b390841e633ac9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48795 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'src/mainboard/google/octopus/variants/baseboard/include')
-rw-r--r--src/mainboard/google/octopus/variants/baseboard/include/baseboard/cbi_ssfc.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mainboard/google/octopus/variants/baseboard/include/baseboard/cbi_ssfc.h b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/cbi_ssfc.h
new file mode 100644
index 0000000000..84020d7eb3
--- /dev/null
+++ b/src/mainboard/google/octopus/variants/baseboard/include/baseboard/cbi_ssfc.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _OCTOPUS_CBI_SSFC__H_
+#define _OCTOPUS_CBI_SSFC__H_
+
+#include <inttypes.h>
+
+/****************************************************************************
+ * Octopus CBI Second Source Factory Cache
+ *
+ * SSFC was introduced after variants were MPed already so we can expect there
+ * can be devices in the field without SSFC field in the CBI. For devices
+ * without SSFC field in the CBI, the value of SSFC will be 0 set by get_ssfc()
+ * in the cbi_ssfc.c.
+ *
+ * On the other hand, taking audio codec as the example there are two sources -
+ * DA7219 and RT5682 used in the MPed devices before introducing SSFC. As a
+ * result, the value 0 of each bits group for a specific component is defined as
+ * DEFAULT and different variants should transform this DEFAULT to one of
+ * sources they used as the first sources. In the example here, either DA7219 or
+ * RT5682 should be transformed.
+ */
+
+/*
+ * Audio Codec (Bits 9-11)
+ *
+ */
+enum ssfc_audio_codec {
+ SSFC_AUDIO_CODEC_DEFAULT,
+ SSFC_AUDIO_CODEC_DA7219,
+ SSFC_AUDIO_CODEC_RT5682,
+};
+#define SSFC_AUDIO_CODEC_OFFSET 9
+#define SSFC_AUDIO_CODEC_MASK 0x7
+
+enum ssfc_audio_codec ssfc_get_audio_codec(void);
+
+#endif /* _OCTOPUS_CBI_SSFC__H_ */