Skip to content

Commit a8b871d

Browse files
chleroygregkh
authored andcommitted
powerpc/8xx: Fix early debug when SMC1 is relocated
commit 1e78f72 upstream. When SMC1 is relocated and early debug is selected, the board hangs is ppc_md.setup_arch(). This is because ones the microcode has been loaded and SMC1 relocated, early debug writes in the weed. To allow smooth continuation, the SMC1 parameter RAM set up by the bootloader have to be copied into the new location. Fixes: 43db76f ("powerpc/8xx: Add microcode patch to move SMC parameter RAM.") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/b2f71f39eca543f1e4ec06596f09a8b12235c701.1607076683.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8bc125f commit a8b871d

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎arch/powerpc/include/asm/cpm1.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ extern void cpm_reset(void);
6868
#define PROFF_SPI ((uint)0x0180)
6969
#define PROFF_SCC3 ((uint)0x0200)
7070
#define PROFF_SMC1 ((uint)0x0280)
71+
#define PROFF_DSP1 ((uint)0x02c0)
7172
#define PROFF_SCC4 ((uint)0x0300)
7273
#define PROFF_SMC2 ((uint)0x0380)
7374

‎arch/powerpc/platforms/8xx/micropatch.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,17 @@ void __init cpm_load_patch(cpm8xx_t *cp)
360360
if (IS_ENABLED(CONFIG_SMC_UCODE_PATCH)) {
361361
smc_uart_t *smp;
362362

363+
if (IS_ENABLED(CONFIG_PPC_EARLY_DEBUG_CPM)) {
364+
int i;
365+
366+
for (i = 0; i < sizeof(*smp); i += 4) {
367+
u32 __iomem *src = (u32 __iomem *)&cp->cp_dparam[PROFF_SMC1 + i];
368+
u32 __iomem *dst = (u32 __iomem *)&cp->cp_dparam[PROFF_DSP1 + i];
369+
370+
out_be32(dst, in_be32(src));
371+
}
372+
}
373+
363374
smp = (smc_uart_t *)&cp->cp_dparam[PROFF_SMC1];
364375
out_be16(&smp->smc_rpbase, 0x1ec0);
365376
smp = (smc_uart_t *)&cp->cp_dparam[PROFF_SMC2];

0 commit comments

Comments
 (0)