summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-06-14 08:41:42 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2019-07-04 18:06:37 +0200
commit11597ff20b6b3cf039577e46e53bf1a94dda3098 (patch)
treeb7dcf2a5a7247f055bc382211c8ead4e10f6e220
parentpowerpc/8xx: refactor writing of CPM microcode arrays (diff)
downloadlinux-11597ff20b6b3cf039577e46e53bf1a94dda3098.tar.xz
linux-11597ff20b6b3cf039577e46e53bf1a94dda3098.zip
powerpc/8xx: Refactor microcode write
Add empty microcode tables so that all tables are defined all the time. Regroup the writing of the 3 tables regardless of the selected microcode. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/platforms/8xx/micropatch.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/8xx/micropatch.c b/arch/powerpc/platforms/8xx/micropatch.c
index 04ef0b48ab21..657fd35cf698 100644
--- a/arch/powerpc/platforms/8xx/micropatch.c
+++ b/arch/powerpc/platforms/8xx/micropatch.c
@@ -69,6 +69,8 @@ static uint patch_2f00[] __initdata = {
0x31497353, 0x76956D69, 0x7B9D9693, 0x13131979,
0x79376935
};
+
+static uint patch_2e00[] __initdata = {};
#endif
/*
@@ -202,6 +204,8 @@ static uint patch_2000[] __initdata = {
static uint patch_2f00[] __initdata = {
0x3030304c, 0xcab9e441, 0xa1aaf220
};
+
+static uint patch_2e00[] __initdata = {};
#endif
static void __init cpm_write_patch(cpm8xx_t *cp, int offset, uint *patch, int len)
@@ -224,12 +228,13 @@ void __init cpm_load_patch(cpm8xx_t *cp)
#endif
commproc = cp;
-#ifdef CONFIG_USB_SOF_UCODE_PATCH
commproc->cp_rccr = 0;
cpm_write_patch(cp, 0, patch_2000, sizeof(patch_2000));
cpm_write_patch(cp, 0xf00, patch_2f00, sizeof(patch_2f00));
+ cpm_write_patch(cp, 0xe00, patch_2e00, sizeof(patch_2e00));
+#ifdef CONFIG_USB_SOF_UCODE_PATCH
commproc->cp_rccr = 0x0009;
printk("USB SOF microcode patch installed\n");
@@ -238,11 +243,6 @@ void __init cpm_load_patch(cpm8xx_t *cp)
#if defined(CONFIG_I2C_SPI_UCODE_PATCH) || \
defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
- commproc->cp_rccr = 0;
-
- cpm_write_patch(cp, 0, patch_2000, sizeof(patch_2000));
- cpm_write_patch(cp, 0xf00, patch_2f00, sizeof(patch_2f00));
-
iip = (iic_t *)&commproc->cp_dparam[PROFF_IIC];
# define RPBASE 0x0500
iip->iic_rpbase = RPBASE;
@@ -263,9 +263,6 @@ void __init cpm_load_patch(cpm8xx_t *cp)
# endif /* CONFIG_I2C_SPI_UCODE_PATCH */
# if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
-
- cpm_write_patch(cp, 0xe00, patch_2e00, sizeof(patch_2e00));
-
commproc->cp_cpmcr1 = 0x8080;
commproc->cp_cpmcr2 = 0x808a;
commproc->cp_cpmcr3 = 0x8028;