From: Paul M. <le...@us...> - 2002-07-12 20:14:32
|
Update of /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle In directory usw-pr-cvs1:/tmp/cvs-serv32248/arch/mips/vr41xx/vr4122/eagle Modified Files: Makefile ide-eagle.c init.c irq.c pci_fixup.c setup.c Log Message: Merge yoichi-san's vr41xx patch. Still some cleanups needed.. Index: Makefile =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 7 Mar 2002 03:16:54 -0000 1.1 +++ Makefile 12 Jul 2002 20:14:28 -0000 1.2 @@ -1,5 +1,5 @@ # -# Makefile for the NEC Eagle specific parts of the kernel +# Makefile for the NEC Eagle/Hawk specific parts of the kernel # # Author: Yoichi Yuasa # yy...@mv... or so...@mv... Index: ide-eagle.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/ide-eagle.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ide-eagle.c 7 Mar 2002 03:16:54 -0000 1.1 +++ ide-eagle.c 12 Jul 2002 20:14:28 -0000 1.2 @@ -3,15 +3,20 @@ * 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 NEC Eagle board. + * IDE routines for typical pc-like standard configurations + * for the NEC Eagle/Hawk board. * * Copyright (C) 1998, 1999, 2001 by Ralf Baechle */ /* * Changes: * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> + * Fri, 5 Apr 2002 + * - Added support for NEC Hawk. + * + * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> * Fri, 1 Mar 2002 - * - Added NEC Eagle support. + * - Added support for NEC Eagle. */ #include <linux/sched.h> #include <linux/ide.h> Index: init.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/init.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- init.c 7 Mar 2002 03:16:54 -0000 1.1 +++ init.c 12 Jul 2002 20:14:28 -0000 1.2 @@ -1,9 +1,9 @@ /* * FILE NAME - * arch/mips/vr41xx/eagle/init.c + * arch/mips/vr41xx/vr4122/eagle/init.c * * BRIEF MODULE DESCRIPTION - * Initialisation code for the NEC Eagle board. + * Initialisation code for the NEC Eagle/Hawk board. * * Author: Yoichi Yuasa * yy...@mv... or so...@mv... @@ -33,6 +33,9 @@ /* * Changes: * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> + * - Added support for NEC Hawk. + * + * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> * - New creation, NEC Eagle is supported. */ #include <linux/config.h> @@ -46,7 +49,7 @@ const char *get_system_type(void) { - return "NEC Eagle"; + return "NEC Eagle/Hawk"; } void __init bus_error_init(void) @@ -67,11 +70,6 @@ strcat(arcs_cmdline, " "); } -#if defined(CONFIG_SERIAL_CONSOLE) - /* to use 38400 ttyS0 serial console */ - strcat(arcs_cmdline, " console=ttyS0,38400"); -#endif - mips_machgroup = MACH_GROUP_NEC_VR41XX; mips_machtype = MACH_NEC_EAGLE; @@ -88,6 +86,7 @@ break; default: panic("Memory size error"); + break; } } Index: irq.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/irq.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- irq.c 14 Jun 2002 15:02:15 -0000 1.2 +++ irq.c 12 Jul 2002 20:14:28 -0000 1.3 @@ -1,9 +1,9 @@ /* * FILE NAME - * arch/mips/vr41xx/eagle/irq.c + * arch/mips/vr41xx/vr4122/eagle/irq.c * * BRIEF MODULE DESCRIPTION - * Interrupt routines for the NEC Eagle board. + * Interrupt routines for the NEC Eagle/Hawk board. * * Author: Yoichi Yuasa * yy...@mv... or so...@mv... @@ -33,6 +33,9 @@ /* * Changes: * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> + * - Added support for NEC Hawk. + * + * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> * - New creation, NEC Eagle is supported. */ #include <linux/init.h> @@ -99,14 +102,26 @@ if (val & (0x01 << i)) return PCIINT_IRQ_BASE + i; - return -1; + return -EINVAL; } -void __init eagle_board_irq_init(void) +void __init eagle_irq_init(void) { int i; writeb(0, NEC_EAGLE_PCIINTMSKREG); + + vr41xx_set_irq_trigger(VRC4173_PIN, TRIGGER_LEVEL, SIGNAL_THROUGH); + vr41xx_set_irq_level(VRC4173_PIN, LEVEL_LOW); + + vr41xx_set_irq_trigger(PCISLOT_PIN, TRIGGER_LEVEL, SIGNAL_THROUGH); + vr41xx_set_irq_level(PCISLOT_PIN, LEVEL_HIGH); + + vr41xx_set_irq_trigger(PCIINT_PIN, TRIGGER_LEVEL, SIGNAL_THROUGH); + vr41xx_set_irq_level(PCIINT_PIN, LEVEL_HIGH); + + vr41xx_set_irq_trigger(DCD_PIN, TRIGGER_EDGE, SIGNAL_HOLD); + vr41xx_set_irq_level(DCD_PIN, LEVEL_LOW); for (i = PCIINT_IRQ_BASE; i <= PCIINT_IRQ_LAST; i++) irq_desc[i].handler = &pciint_irq_type; Index: pci_fixup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/pci_fixup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pci_fixup.c 12 Mar 2002 05:23:12 -0000 1.2 +++ pci_fixup.c 12 Jul 2002 20:14:28 -0000 1.3 @@ -1,9 +1,9 @@ /* * FILE NAME - * arch/mips/vr41xx/eagle/pci_fixup.c + * arch/mips/vr41xx/vr4122/eagle/pci_fixup.c * * BRIEF MODULE DESCRIPTION - * The NEC Eagle Board specific PCI fixups. + * The NEC Eagle/Hawk Board specific PCI fixups. * * Author: Yoichi Yuasa * yy...@mv... or so...@mv... @@ -32,6 +32,10 @@ */ /* * Changes: + * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> + * - Moved mips_pci_channels[] to arch/mips/vr41xx/vr4122/eagle/setup.c. + * - Added support for NEC Hawk. + * * Paul Mundt <le...@ch...> * - Fix empty break statements, remove useless CONFIG_PCI. * @@ -42,33 +46,11 @@ #include <linux/init.h> #include <linux/pci.h> -#include <asm/pci_channel.h> #include <asm/vr41xx/eagle.h> #ifdef CONFIG_VRC4173 #include <asm/vr41xx/vrc4173.h> #endif -static struct resource vr41xx_pci_io_resource = { - "PCI I/O space", - VR41XX_PCI_IO_START, - VR41XX_PCI_IO_END, - IORESOURCE_IO -}; - -static struct resource vr41xx_pci_mem_resource = { - "PCI memory space", - VR41XX_PCI_MEM_START, - VR41XX_PCI_MEM_END, - IORESOURCE_MEM -}; - -extern struct pci_ops vr41xx_pci_ops; - -struct pci_channel mips_pci_channels[] = { - {&vr41xx_pci_ops, &vr41xx_pci_io_resource, &vr41xx_pci_mem_resource, 0, 256}, - {NULL, NULL, NULL, 0, 0} -}; - void __init pcibios_fixup_resources(struct pci_dev *dev) { } @@ -85,15 +67,11 @@ pci_for_each_dev(dev) { slot = PCI_SLOT(dev->devfn); func = PCI_FUNC(dev->devfn); + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); dev->irq = 0; switch (slot) { - case 11: - case 12: - case 13: - case 14: - case 15: - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); + case 8: switch (pin) { case 1: dev->irq = CP_INTA_IRQ; @@ -109,7 +87,45 @@ break; } break; + case 9: + switch (pin) { + case 1: + dev->irq = CP_INTD_IRQ; + break; + case 2: + dev->irq = CP_INTA_IRQ; + break; + case 3: + dev->irq = CP_INTB_IRQ; + break; + case 4: + dev->irq = CP_INTC_IRQ; + break; + } + break; + case 10: + switch (pin) { + case 1: + dev->irq = CP_INTC_IRQ; + break; + case 2: + dev->irq = CP_INTD_IRQ; + break; + case 3: + dev->irq = CP_INTA_IRQ; + break; + case 4: + dev->irq = CP_INTB_IRQ; + break; + } + break; #ifdef CONFIG_VRC4173 + case 12: + dev->irq = VRC4173_CARDU1_IRQ; + break; + case 13: + dev->irq = VRC4173_CARDU2_IRQ; + break; case 24: dev->irq = VRC4173_CARDU1_IRQ; break; @@ -148,4 +164,3 @@ { return 0; } - Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/vr41xx/vr4122/eagle/setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- setup.c 14 Jun 2002 15:02:15 -0000 1.2 +++ setup.c 12 Jul 2002 20:14:28 -0000 1.3 @@ -1,9 +1,9 @@ /* * FILE NAME - * arch/mips/vr41xx/eagle/setup.c + * arch/mips/vr41xx/vr4122/eagle/setup.c * * BRIEF MODULE DESCRIPTION - * Setup for the NEC Eagle board. + * Setup for the NEC Eagle/Hawk board. * * Author: Yoichi Yuasa * yy...@mv... or so...@mv... @@ -33,6 +33,10 @@ /* * Changes: * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> + * - Moved mips_pci_channels[] from arch/mips/vr41xx/vr4122/eagle/setup.c. + * - Added support for NEC Hawk. + * + * MontaVista Software Inc. <yy...@mv...> or <so...@mv...> * - New creation, NEC Eagle is supported. */ #include <linux/config.h> @@ -41,6 +45,7 @@ #include <linux/ide.h> #include <linux/ioport.h> +#include <asm/pci_channel.h> #include <asm/reboot.h> #include <asm/time.h> #include <asm/vr41xx/eagle.h> @@ -54,13 +59,62 @@ extern struct ide_ops eagle_ide_ops; #endif +extern void eagle_irq_init(void); + +#ifdef CONFIG_PCI +static struct resource vr41xx_pci_io_resource = { + "PCI I/O space", + VR41XX_PCI_IO_START, + VR41XX_PCI_IO_END, + IORESOURCE_IO +}; + +static struct resource vr41xx_pci_mem_resource = { + "PCI memory space", + VR41XX_PCI_MEM_START, + VR41XX_PCI_MEM_END, + IORESOURCE_MEM +}; + +extern struct pci_ops vr41xx_pci_ops; + +struct pci_channel mips_pci_channels[] = { + {&vr41xx_pci_ops, &vr41xx_pci_io_resource, &vr41xx_pci_mem_resource, 0, 256}, + {NULL, NULL, NULL, 0, 0} +}; + +struct vr41xx_pci_address_space vr41xx_pci_mem1 = { + VR41XX_PCI_MEM1_BASE, + VR41XX_PCI_MEM1_MASK, + IO_MEM1_RESOURCE_START +}; + +struct vr41xx_pci_address_space vr41xx_pci_mem2 = { + VR41XX_PCI_MEM2_BASE, + VR41XX_PCI_MEM2_MASK, + IO_MEM2_RESOURCE_START +}; + +struct vr41xx_pci_address_space vr41xx_pci_io = { + VR41XX_PCI_IO_BASE, + VR41XX_PCI_IO_MASK, + IO_PORT_RESOURCE_START +}; + +static struct vr41xx_pci_address_map pci_address_map = { + &vr41xx_pci_mem1, + &vr41xx_pci_mem2, + &vr41xx_pci_io +}; +#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; + iomem_resource.start = IO_MEM1_RESOURCE_START; + iomem_resource.end = IO_MEM2_RESOURCE_END; #ifdef CONFIG_BLK_DEV_INITRD ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); @@ -72,11 +126,11 @@ _machine_halt = vr41xx_halt; _machine_power_off = vr41xx_power_off; - board_irq_init = eagle_board_irq_init; - board_time_init = vr41xx_time_init; board_timer_setup = vr41xx_timer_setup; + board_irq_init = eagle_irq_init; + #ifdef CONFIG_FB conswitchp = &dummy_con; #endif @@ -87,11 +141,13 @@ vr41xx_bcu_init(); - vr41xx_dsiu_init(0); - vr41xx_siu_init(1, SIU_RS232C, 0); + vr41xx_cmu_init(0); + + vr41xx_dsiu_init(); + vr41xx_siu_init(SIU_RS232C, 0); #ifdef CONFIG_PCI - vr41xx_pciu_init(); + vr41xx_pciu_init(&pci_address_map); #endif #ifdef CONFIG_VRC4173 |