Merge "ipq40xx: Disable audio clock registers in u-boot"
diff --git a/board/qca/arm/common/board_init.c b/board/qca/arm/common/board_init.c
index 2c9ab0e..19f1bf6 100644
--- a/board/qca/arm/common/board_init.c
+++ b/board/qca/arm/common/board_init.c
@@ -65,6 +65,11 @@
{
return 0;
}
+__weak
+void disable_audio_clks(void)
+{
+ return 0;
+}
int board_init(void)
{
@@ -181,6 +186,7 @@
}
aquantia_phy_reset_init();
+ disable_audio_clks();
return 0;
}
diff --git a/board/qca/arm/ipq40xx/ipq40xx.c b/board/qca/arm/ipq40xx/ipq40xx.c
index c29dc3e..eb436f7 100644
--- a/board/qca/arm/ipq40xx/ipq40xx.c
+++ b/board/qca/arm/ipq40xx/ipq40xx.c
@@ -45,6 +45,15 @@
struct sdhci_host mmc_host;
#endif
+#define ADSS_AUDIO_RXM_CBCR_REG 0x0770012C
+#define ADSS_AUDIO_RXB_CBCR_REG 0x0770010C
+#define ADSS_AUDIO_TXB_CBCR_REG 0x0770014C
+#define ADSS_AUDIO_SPDIF_CBCR_REG 0x07700154
+#define ADSS_AUDIO_SPDIF_DIV2_CBCR_REG 0x0770015C
+#define ADSS_AUDIO_TXM_CBCR_REG 0x0770016C
+#define ADSS_AUDIO_PCM_CBCR_REG 0x077001AC
+#define ADSS_AUDIO_SPDIF_IN_FAST_CBCR_REG 0x077001EC
+
const char *rsvd_node = "/reserved-memory";
const char *del_node[] = {"rsvd1",
"rsvd2",
@@ -349,6 +358,25 @@
pcie_clock_disable(GCC_PCIE_AHB_CBCR);
}
+/*
+ * The audio block is out of reset by default due to which the
+ * audio clock blocks are also turned on. When audio TLMM is
+ * enabled in kernel, the clocks will also be available at the
+ * pins which causes pop noise during kernel bootup.
+ * To avoid this, the clocks are turned off in u-boot.
+ */
+void disable_audio_clks(void)
+{
+ writel(0, ADSS_AUDIO_RXM_CBCR_REG);
+ writel(0, ADSS_AUDIO_RXB_CBCR_REG);
+ writel(0, ADSS_AUDIO_TXB_CBCR_REG);
+ writel(0, ADSS_AUDIO_SPDIF_CBCR_REG);
+ writel(0, ADSS_AUDIO_SPDIF_DIV2_CBCR_REG);
+ writel(0, ADSS_AUDIO_TXM_CBCR_REG);
+ writel(0, ADSS_AUDIO_PCM_CBCR_REG);
+ writel(0, ADSS_AUDIO_SPDIF_IN_FAST_CBCR_REG);
+}
+
void ipq_fdt_fixup_socinfo(void *blob)
{
return;
diff --git a/board/qca/arm/ipq40xx/ipq40xx.h b/board/qca/arm/ipq40xx/ipq40xx.h
index a14231d..30aa757 100644
--- a/board/qca/arm/ipq40xx/ipq40xx.h
+++ b/board/qca/arm/ipq40xx/ipq40xx.h
@@ -81,6 +81,8 @@
return 1;
}
+void disable_audio_clks(void);
+
/* Board specific parameters */
typedef struct {
unsigned int machid;