Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0496d45 authored by Jack Miller's avatar Jack Miller Committed by Benjamin Herrenschmidt
Browse files

powerpc: Add early debug for WSP platforms

parent a1d0d98d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -267,6 +267,11 @@ config PPC_EARLY_DEBUG_USBGECKO
	  Select this to enable early debugging for Nintendo GameCube/Wii
	  consoles via an external USB Gecko adapter.

config PPC_EARLY_DEBUG_WSP
	bool "Early debugging via WSP's internal UART"
	depends on PPC_WSP
	select PPC_UDBG_16550

endchoice

config PPC_EARLY_DEBUG_44x_PHYSLOW
+9 −0
Original line number Diff line number Diff line
@@ -110,6 +110,15 @@
#define TLB1_UR			ASM_CONST(0x0000000000000002)
#define TLB1_SR			ASM_CONST(0x0000000000000001)

#ifdef CONFIG_PPC_EARLY_DEBUG_WSP
#define WSP_UART_PHYS	0xffc000c000
/* This needs to be careful chosen to hit a !0 congruence class
 * in the TLB since we bolt it in way 3, which is already occupied
 * by our linear mapping primary bolted entry in CC 0.
 */
#define WSP_UART_VIRT	0xf000000000001000
#endif

/* A2 erativax attributes definitions */
#define ERATIVAX_RS_IS_ALL		0x000
#define ERATIVAX_RS_IS_TID		0x040
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ extern void __init udbg_init_44x_as1(void);
extern void __init udbg_init_40x_realmode(void);
extern void __init udbg_init_cpm(void);
extern void __init udbg_init_usbgecko(void);
extern void __init udbg_init_wsp(void);

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_UDBG_H */
+17 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <asm/cputable.h>
#include <asm/setup.h>
#include <asm/thread_info.h>
#include <asm/reg_a2.h>
#include <asm/exception-64e.h>
#include <asm/bug.h>
#include <asm/irqflags.h>
@@ -951,6 +952,22 @@ a2_tlbinit_after_linear_map:
	.globl  a2_tlbinit_after_iprot_flush
a2_tlbinit_after_iprot_flush:

#ifdef CONFIG_PPC_EARLY_DEBUG_WSP
	/* Now establish early debug mappings if applicable */
	/* Restore the MAS0 we used for linear mapping load */
	mtspr	SPRN_MAS0,r11

	lis	r3,(MAS1_VALID | MAS1_IPROT)@h
	ori	r3,r3,(BOOK3E_PAGESZ_4K << MAS1_TSIZE_SHIFT)
	mtspr	SPRN_MAS1,r3
	LOAD_REG_IMMEDIATE(r3, WSP_UART_VIRT | MAS2_I | MAS2_G)
	mtspr	SPRN_MAS2,r3
	LOAD_REG_IMMEDIATE(r3, WSP_UART_PHYS | MAS3_SR | MAS3_SW)
	mtspr	SPRN_MAS7_MAS3,r3
	/* re-use the MAS8 value from the linear mapping */
	tlbwe
#endif /* CONFIG_PPC_EARLY_DEBUG_WSP */

	PPC_TLBILX(0,0,0)
	sync
	isync
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,8 @@ void __init udbg_early_init(void)
	udbg_init_cpm();
#elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
	udbg_init_usbgecko();
#elif defined(CONFIG_PPC_EARLY_DEBUG_WSP)
	udbg_init_wsp();
#endif

#ifdef CONFIG_PPC_EARLY_DEBUG
Loading