From: Paul M. <le...@us...> - 2002-03-07 03:16:56
|
Update of /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4111/casio-e55 In directory usw-pr-cvs1:/tmp/cvs-serv28915/arch/mips/vr41xx/vr4111/casio-e55 Added Files: Makefile ide-e55.c init.c irq.c setup.c Log Message: Imported Yoichi-san's Vr41xx patch, with some minor modifications. --- NEW FILE: Makefile --- # # Makefile for the CASIO CASSIOPEIA E-55/65 specific parts of the kernel # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.s: $(CPP) $(AFLAGS) $< -o $@ .S.o: $(CC) $(AFLAGS) -c $< -o $@ O_TARGET := casio-e55.o all: casio-e55.o obj-y := init.o irq.o setup.o obj-$(CONFIG_IDE) += ide-e55.o include $(TOPDIR)/Rules.make --- NEW FILE: ide-e55.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. */ #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 e55_ide_default_irq(ide_ioreg_t base) { return 40; } static ide_ioreg_t e55_ide_default_io_base(int index) { switch (index) { case 0: return 0xc1f0; case 1: return 0xc170; case 2: return 0xc1e8; case 3: return 0xc168; case 4: return 0xc1e0; case 5: return 0xc160; } return 0; } static void e55_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 e55_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 e55_ide_free_irq(unsigned int irq, void *dev_id) { free_irq(irq, dev_id); } static int e55_ide_check_region(ide_ioreg_t from, unsigned int extent) { return check_region(from, extent); } static void e55_ide_request_region(ide_ioreg_t from, unsigned int extent, const char *name) { request_region(from, extent, name); } static void e55_ide_release_region(ide_ioreg_t from, unsigned int extent) { release_region(from, extent); } struct ide_ops e55_ide_ops = { &e55_ide_default_irq, &e55_ide_default_io_base, &e55_ide_init_hwif_ports, &e55_ide_request_irq, &e55_ide_free_irq, &e55_ide_check_region, &e55_ide_request_region, &e55_ide_release_region }; --- NEW FILE: init.c --- /* * FILE NAME * arch/mips/vr41xx/e55/init.c * * BRIEF MODULE DESCRIPTION * Initialisation code for the CASIO CASSIOPEIA E-55/65. * * Copyright 2002 Yoichi Yuasa * yu...@hh... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/string.h> #include <asm/bootinfo.h> char arcs_cmdline[CL_SIZE]; const char *get_system_type(void) { return "CASIO CASSIOPEIA E-55/65"; } void __init bus_error_init(void) { } void __init prom_init(int argc, char **argv, unsigned long magic, int *prom_vec) { int i; /* * collect args and prepare cmd_line */ for (i = 1; i < argc; i++) { strcat(arcs_cmdline, argv[i]); if (i < (argc - 1)) strcat(arcs_cmdline, " "); } #if defined(CONFIG_SERIAL_CONSOLE) /* to use 9600 ttyS0 serial console */ strcat(arcs_cmdline, " console=ttyS0,9600"); #endif #ifdef CONFIG_BLK_DEV_IDEDISK strcat(arcs_cmdline, " root=/dev/hdc1"); #endif mips_machgroup = MACH_GROUP_NEC_VR41XX; mips_machtype = MACH_CASIO_E55; /* Add memory region */ add_memory_region(0, 16 << 20, BOOT_MEM_RAM); } void __init prom_free_prom_memory (void) { } --- NEW FILE: irq.c --- /* * FILE NAME * arch/mips/vr41xx/e55/irq.c * * BRIEF MODULE DESCRIPTION * Interrupt routines for the CASIO CASSIOPEIA E-55/65. * * Copyright 2002 Yoichi Yuasa * yu...@hh... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/init.h> void __init vr41xx_board_irq_init(void) { } --- NEW FILE: setup.c --- /* * FILE NAME * arch/mips/vr41xx/e55/setup.c * * BRIEF MODULE DESCRIPTION * Setup for the CASIO CASSIOPEIA E-55/65. * * Copyright 2002 Yoichi Yuasa * yu...@hh... * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/config.h> #include <linux/init.h> #include <linux/console.h> #include <linux/ide.h> #include <linux/ioport.h> #include <asm/reboot.h> #include <asm/time.h> #include <asm/vr41xx/e55.h> #ifdef CONFIG_BLK_DEV_INITRD extern unsigned long initrd_start, initrd_end; extern void * __rd_start, * __rd_end; #endif #ifdef CONFIG_BLK_DEV_IDE extern struct ide_ops e55_ide_ops; #endif void __init nec_vr41xx_setup(void) { set_io_port_base(IO_PORT_BASE); ioport_resource.start = IO_PORT_RESOURCE_START; ioport_resource.end = IO_PORT_RESOURCE_END; iomem_resource.start = IO_MEM_RESOURCE_START; iomem_resource.end = IO_MEM_RESOURCE_END; #ifdef CONFIG_BLK_DEV_INITRD ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); initrd_start = (unsigned long)&__rd_start; initrd_end = (unsigned long)&__rd_end; #endif _machine_restart = vr41xx_restart; _machine_halt = vr41xx_halt; _machine_power_off = vr41xx_power_off; board_time_init = vr41xx_time_init; board_timer_setup = vr41xx_timer_setup; #ifdef CONFIG_FB conswitchp = &dummy_con; #endif #ifdef CONFIG_BLK_DEV_IDE ide_ops = &e55_ide_ops; #endif vr41xx_bcu_init(); vr41xx_siu_init(0, SIU_RS232C, 0); } |