From: Albert H. <he...@us...> - 2007-11-14 23:09:15
|
Update of /cvsroot/gc-linux/linux/arch/ppc/platforms In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4431/arch/ppc/platforms Modified Files: gamecube.c gcn-con.c Log Message: Merged 2.6.22. Updated drivers to use in_be* and out_be* instead of read* and write* input/output instructions. Updated DI driver: - do not use debug extensions with unknown drive models - do not load custom firmware on xenogc/duoq - evict alien firmwares and load custom formware on known drive models Index: gamecube.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/ppc/platforms/gamecube.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- gamecube.c 18 Feb 2007 22:56:01 -0000 1.38 +++ gamecube.c 14 Nov 2007 23:08:47 -0000 1.39 @@ -26,6 +26,7 @@ #include "gamecube.h" +#if 0 /* * include/asm-ppc/io.h assumes everyone else that is not APUS provides * these. Since we don't have either PCI or ISA busses, these are only @@ -34,11 +35,12 @@ unsigned long isa_io_base = 0; unsigned long isa_mem_base = 0; unsigned long pci_dram_offset = 0; +#endif /* * These are used in setup_arch. * */ -#define CSR_REG ((void __iomem*)0xCC00500A) +#define CSR_REG ((void __iomem *)0xCC00500A) #define DSP_CSR_RES (1<<0) #define DSP_CSR_PIINT (1<<1) #define DSP_CSR_HALT (1<<2) @@ -51,9 +53,8 @@ #define DSP_CSR_DSPDMA (1<<9) #define DSP_CSR_RESETXXX (1<<11) -#define AUDIO_DMA_LENGTH *(volatile u_int16_t *)(0xCC005036) -#define AI_DCL_PLAY (1<<15) -#define StopSample() AUDIO_DMA_LENGTH &= ~AI_DCL_PLAY +#define AUDIO_DMA_LENGTH ((void __iomem *)0xCC005036) +#define AI_DCL_PLAY (1<<15) static unsigned long gamecube_find_end_of_memory(void) { @@ -62,8 +63,9 @@ static void gamecube_map_io(void) { - /* all RAM and more ??? */ +#ifdef CONFIG_GAMECUBE_DEBUG_CONSOLE io_block_mapping(0xd0000000, 0, 0x02000000, _PAGE_IO); +#endif /* access to hardware registers */ io_block_mapping(0xcc000000, 0x0c000000, 0x00100000, _PAGE_IO); @@ -72,7 +74,7 @@ static void gamecube_restart(char *cmd) { local_irq_disable(); - writeb(0x00, FLIPPER_RESET); + out_8(FLIPPER_RESET, 0x00); } static void gamecube_power_off(void) @@ -100,7 +102,7 @@ int irq; u32 irq_status; - irq_status = readl(FLIPPER_ICR) & readl(FLIPPER_IMR); + irq_status = in_be32(FLIPPER_ICR) & in_be32(FLIPPER_IMR); if (irq_status == 0) return -1; /* no more IRQs pending */ @@ -133,7 +135,7 @@ } static struct hw_interrupt_type flipper_pic = { - .typename = " FLIPPER-PIC ", + .typename = "flipper-pic", .enable = flipper_unmask_irq, .disable = flipper_mask_irq, .ack = flipper_mask_and_ack_irq, @@ -145,8 +147,8 @@ int i; /* mask and ack all IRQs */ - writel(0x00000000, FLIPPER_IMR); - writel(0xffffffff, FLIPPER_ICR); + out_be32(FLIPPER_IMR, 0x00000000); + out_be32(FLIPPER_ICR, 0xffffffff); for (i = 0; i < FLIPPER_NR_IRQS; i++) irq_desc[i].chip = &flipper_pic; @@ -169,13 +171,9 @@ static void gamecube_setup_arch(void) { #ifdef CONFIG_GAMECUBE_CONSOLE -#if (GCN_XFB_START <= 0x00fffe00) - #error Sorry, debug console needs the framebuffer at a higher address. -#endif - writel(0x10000000 | (GCN_XFB_START>>5), GCN_VI_TFBL); - writel(0x10000000 | ((GCN_XFB_START+2*640)>>5), GCN_VI_BFBL); gcn_con_init(); #endif + /* On my North American Launch cube booted * via PSO, I get a flooding of ARAM interrupts and audio MADNESS * when I first boot. By clearing the AI interrupts and stopping @@ -183,9 +181,11 @@ */ /* ack and clear the interrupts for the AI line */ - writew(DSP_CSR_PIINT | DSP_CSR_AIDINT | DSP_CSR_ARINT | DSP_CSR_DSPINT,CSR_REG); + out_be16(CSR_REG, + DSP_CSR_PIINT|DSP_CSR_AIDINT|DSP_CSR_ARINT|DSP_CSR_DSPINT); /* stop any audio */ - StopSample(); + out_be16(AUDIO_DMA_LENGTH, + in_be16(AUDIO_DMA_LENGTH) & ~AI_DCL_PLAY); } #ifdef CONFIG_KEXEC Index: gcn-con.c =================================================================== RCS file: /cvsroot/gc-linux/linux/arch/ppc/platforms/gcn-con.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gcn-con.c 18 Jan 2006 23:41:52 -0000 1.5 +++ gcn-con.c 14 Nov 2007 23:08:47 -0000 1.6 @@ -13,6 +13,7 @@ * */ +#include <linux/io.h> #include <linux/string.h> #include <linux/console.h> #include <linux/font.h> @@ -45,7 +46,7 @@ int scrolled_lines; }; -static struct console_data_s *default_console; +static struct console_data_s *default_console = NULL; #if 0 static int console_set_color(int background, int foreground) @@ -169,6 +170,10 @@ while (c--) *p++ = con->background; + flush_dcache_range((unsigned long)con->framebuffer, + (unsigned long)(con->framebuffer + + con->stride * con->yres)); + default_console = con; } @@ -217,8 +222,19 @@ */ void gcn_con_init(void) { - console_init(&gcn_con_data, (void *)(0xd0000000 | GCN_XFB_START), + unsigned long framebuffer = GCN_XFB_START; + unsigned long tfbl = 0x10000000 | (framebuffer>>5); + unsigned long bfbl = 0x10000000 | ((framebuffer+2*640)>>5); + +#if (GCN_XFB_START <= 0x00fffe00) + #error Sorry, debug console needs the framebuffer at a higher address. +#endif + + out_be32(GCN_VI_TFBL, tfbl); + out_be32(GCN_VI_BFBL, bfbl); + console_init(&gcn_con_data, (void *)(0xd0000000 | framebuffer), 640, GCN_VIDEO_LINES, 640 * 2); + gcn_con_puts("gcn-con: console initialized.\n"); gcn_con.write = gcn_con_write; |