From: Leblanc f. <fle...@us...> - 2002-04-23 13:14:33
|
Update of /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4111/casio-e15 In directory usw-pr-cvs1:/tmp/cvs-serv14927/arch/mips/vr41xx/vr4111/casio-e15 Modified Files: Makefile setup.c Added Files: ide-e15.c Log Message: Casio e15 support improvement. --- NEW FILE: ide-e15.c --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * IDE routines for typical pc-like standard configurations * for the CASIO CASSIOPEIA E-55/65. * * Copyright (C) 1998, 1999, 2001 by Ralf Baechle */ /* * Changes: * Yoichi Yuasa <yu...@hh...> Sun, 24 Feb 2002 * - Added CASIO CASSIOPEIA E-55/65 support. * * Francois Leblanc <fra...@ce...> Mon, 25 Mar 2002 * - Just rename E55 en E15 for Casio E15 Support. * - Set only 0xc170 io base valid to start more quickly. */ #include <linux/sched.h> #include <linux/ide.h> #include <linux/ioport.h> #include <linux/hdreg.h> #include <asm/ptrace.h> #include <asm/hdreg.h> static int e15_ide_default_irq(ide_ioreg_t base) { return 40; } static ide_ioreg_t e15_ide_default_io_base(int index) { switch (index) { case 0: return 0xc170; case 1: return 0; case 2: return 0; case 3: return 0; case 4: return 0; case 5: return 0; } return 0; } static void e15_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) { ide_ioreg_t reg = data_port; int i; for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { hw->io_ports[i] = reg; reg += 1; } if (ctrl_port) { hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; } else { hw->io_ports[IDE_CONTROL_OFFSET] = hw->io_ports[IDE_DATA_OFFSET] + 0x206; } if (irq != NULL) *irq = 0; hw->io_ports[IDE_IRQ_OFFSET] = 0; } static int e15_ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *), unsigned long flags, const char *device, void *dev_id) { return request_irq(irq, handler, flags, device, dev_id); } static void e15_ide_free_irq(unsigned int irq, void *dev_id) { free_irq(irq, dev_id); } static int e15_ide_check_region(ide_ioreg_t from, unsigned int extent) { return check_region(from, extent); } static void e15_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) { request_region(from, extent, name); } static void e15_ide_release_region(ide_ioreg_t from, unsigned int extent) { release_region(from, extent); } struct ide_ops e15_ide_ops = { &e15_ide_default_irq, &e15_ide_default_io_base, &e15_ide_init_hwif_ports, &e15_ide_request_irq, &e15_ide_free_irq, &e15_ide_check_region, &e15_ide_request_region, &e15_ide_release_region }; Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4111/casio-e15/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 22 Mar 2002 10:22:43 -0000 1.3 +++ Makefile 23 Apr 2002 13:14:29 -0000 1.4 @@ -21,6 +21,7 @@ obj-y += setup.o prom.o obj-$(CONFIG_REMOTE_DEBUG) += gdb.o +obj-$(CONFIG_IDE) += ide-e15.o include $(TOPDIR)/Rules.make Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4111/casio-e15/setup.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- setup.c 22 Mar 2002 10:22:43 -0000 1.4 +++ setup.c 23 Apr 2002 13:14:29 -0000 1.5 @@ -16,8 +16,8 @@ */ /* * Changes: - * - Francois Leblanc <fra...@ce...> - * Copy from casio-e55/setup.c an update to casio-e15. + * Francois Leblanc <fra...@ce...> Wed, 26 Mar 2002 + * - Copy from casio-e55/setup.c an update to casio-e15. * */ #include <linux/config.h> @@ -42,7 +42,7 @@ #endif #ifdef CONFIG_BLK_DEV_IDE -extern struct ide_ops std_ide_ops; +extern struct ide_ops e15_ide_ops; #endif struct semaphore vr41xx_dma_sem; @@ -72,11 +72,11 @@ #endif #ifdef CONFIG_PM_SUSPEND_WAKEUP -#include <asm/vr41xx-platdep.h> #include <asm/gdb-stub.h> +extern asmlinkage void kernel_entry(void); + extern void breakpoint(void); -extern void kernel_entry(void); extern void DbgInitSerial(void); // Put contents of WINCE_SIGNATURE_CHECK1 & 2 at @@ -93,6 +93,7 @@ static unsigned int wince_signature_old2; static unsigned int wince_return_old; +/* avoid use of sp in this routine since sp isn't correctly set yet*/ static asmlinkage void casio_e15_wakeup(void) { write_32bit_cp0_register(CP0_STATUS, ST0_CU0); @@ -107,21 +108,29 @@ *WINCE_SIGNATURE_ADD2 = wince_signature_old2; *WINCE_RETURN_ADD = wince_return_old; -#ifdef CONFIG_REMOTE_DEBUG - //re-init serial - set_debug_traps(); - DbgInitSerial(); -#endif - - //try restore screen view - gpiolcd_lcdpower(1); - #ifdef CONFIG_VR41XX_LED - vr41xx_xblink_led(2, 12, 3); + if (*VR41XX_LEDCNTREG & 0x0001) + return; // Now blinking, so ignore this request + *VR41XX_LEDHTSREG = 12; // LED on time (1 = 0.0625 sec) + *VR41XX_LEDLTSREG = 3; // LED off time (1 = 0.0625 sec) + *VR41XX_LEDASTCREG = 2; // How many times blink + *VR41XX_LEDCNTREG = 0x0002; // Enable auto stop + *VR41XX_LEDCNTREG |= 0x0001; // Start blinking + // Wait for LEDINT + while ((*VR41XX_LEDINTREG & 0x0001) == 0); + // Clear LEDINT + *VR41XX_LEDINTREG = 0x0001; #endif // restart kernel - kernel_entry(); + asm volatile ( + " .set noreorder\n" + " j kernel_entry\n" + " nop\n" + " nop\n" + " nop\n" + " .set reorder\n" + ); } void vr41xx_extend_hibernate(void) @@ -162,7 +171,7 @@ board_timer_setup = vr41xx_timer_setup; #ifdef CONFIG_BLK_DEV_IDE - ide_ops = &std_ide_ops; + ide_ops = &e15_ide_ops; #endif #ifdef CONFIG_FB |