[RFC PATCH 10/19] powerpc: gamecube/wii: early debugging using usbgecko

Segher Boessenkool segher at kernel.crashing.org
Tue Nov 24 11:54:19 EST 2009


You set up DBAT1 here...

> +setup_usbgecko_bat:
> +	/* prepare a BAT for early io */
> +	lis	r8, 0x0c00
> +	ori	r8, r8, 0x002a	/* uncached, guarded ,rw */
> +	lis	r11, 0xcc00
> +	ori	r11, r11, 0x3	/* 128K */
> +#ifdef CONFIG_WII
> +	oris	r8, r8, 0x0100
> +	oris	r11, r11, 0x0100
> +#endif
> +	mtspr	SPRN_DBAT1L, r8
> +	mtspr	SPRN_DBAT1U, r11
> +	sync
> +	isync
> +	blr

... and again here:

> +void __init udbg_init_usbgecko(void)
> +{
> +	unsigned long vaddr, paddr;
> +
> +#if defined(CONFIG_GAMECUBE)
> +	paddr = 0x0c000000;
> +#elif defined(CONFIG_WII)
> +	paddr = 0x0d000000;
> +#else
> +#error Invalid platform for USB Gecko based early debugging.
> +#endif
> +
> +	vaddr = 0xc0000000 | paddr;
> +	setbat(1, vaddr, paddr, 128*1024, PAGE_KERNEL_NCG);

Do you need to do it twice?

> +	ug_io_base = (void __iomem *)(vaddr | 0x6814);

Oh, hardcoded slot2, now i'm confused which one should be it :-)


Segher



More information about the Linuxppc-dev mailing list