Index: arch/mips/Kconfig-shared =================================================================== RCS file: /home/cvs/linux/arch/mips/Kconfig-shared,v retrieving revision 1.11 diff -u -r1.11 Kconfig-shared --- arch/mips/Kconfig-shared 21 Nov 2002 12:20:28 -0000 1.11 +++ arch/mips/Kconfig-shared 12 Dec 2002 01:11:02 -0000 @@ -521,6 +521,10 @@ depends on NEC_EAGLE || ZAO_CAPCELLA || VICTOR_MPC30X || IBM_WORKPAD || CASIO_E55 default y +config VRC4173 + tristate "NEC VRC4173 Support" + depends on NEC_EAGLE || VICTOR_MPC30X + config DDB5XXX_COMMON bool depends on DDB5074 || DDB5476 || DDB5477 Index: arch/mips/defconfig-eagle =================================================================== RCS file: /home/cvs/linux/arch/mips/defconfig-eagle,v retrieving revision 1.45 diff -u -r1.45 defconfig-eagle --- arch/mips/defconfig-eagle 12 Nov 2002 17:46:47 -0000 1.45 +++ arch/mips/defconfig-eagle 12 Dec 2002 01:11:02 -0000 @@ -72,6 +72,7 @@ CONFIG_VR41XX_TIME_C=y CONFIG_DUMMY_KEYB=y CONFIG_VR41XX_COMMON=y +CONFIG_VRC4173=y CONFIG_NEW_PCI=y # CONFIG_FB is not set @@ -598,7 +599,15 @@ # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TEST is not set # # Library routines Index: arch/mips/defconfig-mpc30x =================================================================== RCS file: /home/cvs/linux/arch/mips/defconfig-mpc30x,v retrieving revision 1.25 diff -u -r1.25 defconfig-mpc30x --- arch/mips/defconfig-mpc30x 12 Nov 2002 17:46:47 -0000 1.25 +++ arch/mips/defconfig-mpc30x 12 Dec 2002 01:11:02 -0000 @@ -72,6 +72,7 @@ CONFIG_VR41XX_TIME_C=y CONFIG_DUMMY_KEYB=y CONFIG_VR41XX_COMMON=y +CONFIG_VRC4173=y CONFIG_NEW_PCI=y # CONFIG_FB is not set @@ -499,7 +500,15 @@ # # Cryptographic options # -# CONFIG_CRYPTO is not set +CONFIG_CRYPTO=y +CONFIG_CRYPTO_HMAC=y +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_TEST is not set # # Library routines Index: arch/mips/vr41xx/common/Makefile =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/common/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- arch/mips/vr41xx/common/Makefile 7 Nov 2002 12:37:26 -0000 1.5 +++ arch/mips/vr41xx/common/Makefile 12 Dec 2002 01:11:02 -0000 @@ -4,9 +4,12 @@ obj-y := bcu.o cmu.o giu.o icu.o int-handler.o reset.o +export-objs := vrc4173.o + obj-$(CONFIG_PCI) += pciu.o obj-$(CONFIG_SERIAL_8250) += serial.o obj-$(CONFIG_VR41XX_TIME_C) += time.o +obj-$(CONFIG_VRC4173) += vrc4173.o EXTRA_AFLAGS := $(CFLAGS) Index: arch/mips/vr41xx/common/vrc4173.c =================================================================== RCS file: arch/mips/vr41xx/common/vrc4173.c diff -N arch/mips/vr41xx/common/vrc4173.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ arch/mips/vr41xx/common/vrc4173.c 12 Dec 2002 01:11:02 -0000 @@ -0,0 +1,279 @@ +/* + * FILE NAME + * drivers/char/vrc4173.c + * + * BRIEF MODULE DESCRIPTION + * NEC VRC4173 driver for NEC VR4122/VR4131. + * + * Author: Yoichi Yuasa + * yyuasa@mvista.com or source@mvista.com + * + * Copyright 2001,2002 MontaVista Software Inc. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +MODULE_DESCRIPTION("NEC VRC4173 driver for NEC VR4122/4131"); +MODULE_AUTHOR("Yoichi Yuasa "); +MODULE_LICENSE("GPL"); + +#define VRC4173_CMUCLKMSK 0x040 +#define VRC4173_CMUSRST 0x042 + +#define VRC4173_SELECTREG 0x09e + +#define VRC4173_SYSINT1REG 0x060 +#define VRC4173_MSYSINT1REG 0x06c + +static struct pci_device_id vrc4173_table[] __devinitdata = { + {PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_VRC4173, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0, } +}; + +unsigned long vrc4173_io_offset = 0; + +EXPORT_SYMBOL(vrc4173_io_offset); + +static u16 vrc4173_cmuclkmsk; +static int vrc4173_initialized; + +void vrc4173_clock_supply(u16 mask) +{ + if (vrc4173_initialized) { + vrc4173_cmuclkmsk |= mask; + vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK); + } +} + +void vrc4173_clock_mask(u16 mask) +{ + if (vrc4173_initialized) { + vrc4173_cmuclkmsk &= ~mask; + vrc4173_outw(vrc4173_cmuclkmsk, VRC4173_CMUCLKMSK); + } +} + +static inline void vrc4173_cmu_init(void) +{ + vrc4173_cmuclkmsk = vrc4173_inw(VRC4173_CMUCLKMSK); +} + +EXPORT_SYMBOL(vrc4173_clock_supply); +EXPORT_SYMBOL(vrc4173_clock_mask); + +void vrc4173_select_function(int func) +{ + u16 val; + + if (vrc4173_initialized) { + val = vrc4173_inw(VRC4173_SELECTREG); + switch(func) { + case PS2CH1_SELECT: + val |= 0x0004; + break; + case PS2CH2_SELECT: + val |= 0x0002; + break; + case TOUCHPANEL_SELECT: + val &= 0x0007; + break; + case KIU8_SELECT: + val &= 0x000e; + break; + case KIU10_SELECT: + val &= 0x000c; + break; + case KIU12_SELECT: + val &= 0x0008; + break; + case GPIO_SELECT: + val |= 0x0008; + break; + } + vrc4173_outw(val, VRC4173_SELECTREG); + } +} + +EXPORT_SYMBOL(vrc4173_select_function); + +static void enable_vrc4173_irq(unsigned int irq) +{ + u16 val; + + val = vrc4173_inw(VRC4173_MSYSINT1REG); + val |= (u16)1 << (irq - VRC4173_IRQ_BASE); + vrc4173_outw(val, VRC4173_MSYSINT1REG); +} + +static void disable_vrc4173_irq(unsigned int irq) +{ + u16 val; + + val = vrc4173_inw(VRC4173_MSYSINT1REG); + val &= ~((u16)1 << (irq - VRC4173_IRQ_BASE)); + vrc4173_outw(val, VRC4173_MSYSINT1REG); +} + +static unsigned int startup_vrc4173_irq(unsigned int irq) +{ + enable_vrc4173_irq(irq); + return 0; /* never anything pending */ +} + +#define shutdown_vrc4173_irq disable_vrc4173_irq +#define ack_vrc4173_irq disable_vrc4173_irq + +static void end_vrc4173_irq(unsigned int irq) +{ + if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) + enable_vrc4173_irq(irq); +} + +static struct hw_interrupt_type vrc4173_irq_type = { + "VRC4173", + startup_vrc4173_irq, + shutdown_vrc4173_irq, + enable_vrc4173_irq, + disable_vrc4173_irq, + ack_vrc4173_irq, + end_vrc4173_irq, + NULL +}; + +static int vrc4173_get_irq_number(int irq) +{ + u16 status, mask; + int i; + + status = vrc4173_inw(VRC4173_SYSINT1REG); + mask = vrc4173_inw(VRC4173_MSYSINT1REG); + + status &= mask; + if (status) { + for (i = 0; i < 16; i++) + if (status & (0x0001 << i)) + return VRC4173_IRQ_BASE + i; + } + + return -EINVAL; +} + +static inline void vrc4173_icu_init(int cascade_irq) +{ + int i; + + if (cascade_irq < GIU_IRQ(0) || cascade_irq > GIU_IRQ(15)) + return; + + vrc4173_outw(0, VRC4173_MSYSINT1REG); + + vr41xx_set_irq_trigger(cascade_irq - GIU_IRQ(0), TRIGGER_LEVEL, SIGNAL_THROUGH); + vr41xx_set_irq_level(cascade_irq - GIU_IRQ(0), LEVEL_LOW); + + for (i = VRC4173_IRQ_BASE; i <= VRC4173_IRQ_LAST; i++) + irq_desc[i].handler = &vrc4173_irq_type; +} + +static int __devinit vrc4173_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + unsigned long start, flags; + int err; + + if ((err = pci_enable_device(pdev)) < 0) { + printk(KERN_ERR "vrc4173: failed to enable device -- err=%d\n", err); + return err; + } + + pci_set_master(pdev); + + start = pci_resource_start(pdev, 0); + if (!start) { + printk(KERN_ERR "vrc4173:No PCI I/O resources, aborting\n"); + return -ENODEV; + } + + if (!start || (((flags = pci_resource_flags(pdev, 0)) & IORESOURCE_IO) == 0)) { + printk(KERN_ERR "vrc4173: No PCI I/O resources, aborting\n"); + return -ENODEV; + } + + if ((err = pci_request_regions(pdev, "NEC VRC4173")) < 0) { + printk(KERN_ERR "vrc4173: PCI resources are busy, aborting\n"); + return err; + } + + set_vrc4173_io_offset(start); + + vrc4173_cmu_init(); + + vrc4173_icu_init(pdev->irq); + + if ((err = vr41xx_cascade_irq(pdev->irq, vrc4173_get_irq_number)) < 0) { + printk(KERN_ERR + "vrc4173: IRQ resource %d is busy, aborting\n", pdev->irq); + return err; + } + + printk(KERN_INFO + "NEC VRC4173 at 0x%#08lx, IRQ is cascaded to %d\n", start, pdev->irq); + + return 0; +} + +static struct pci_driver vrc4173_driver = { + name: "NEC VRC4173", + probe: vrc4173_probe, + remove: NULL, + id_table: vrc4173_table, +}; + +static int __devinit vrc4173_init(void) +{ + int err; + + if ((err = pci_module_init(&vrc4173_driver)) < 0) + return err; + + vrc4173_initialized = 1; + + return 0; +} + +static void __devexit vrc4173_exit(void) +{ + vrc4173_initialized = 0; + + pci_unregister_driver(&vrc4173_driver); +} + +module_init(vrc4173_init); +module_exit(vrc4173_exit); Index: arch/mips/vr41xx/nec-eagle/Makefile =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/nec-eagle/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- arch/mips/vr41xx/nec-eagle/Makefile 1 Nov 2002 02:32:25 -0000 1.4 +++ arch/mips/vr41xx/nec-eagle/Makefile 12 Dec 2002 01:11:02 -0000 @@ -10,6 +10,6 @@ obj-y := init.o irq.o setup.o obj-$(CONFIG_IDE) += ide-eagle.o -obj-$(CONFIG_PCI) += pci_fixup.o +obj-$(CONFIG_PCI) += pci_fixup.o vrc4173.o include $(TOPDIR)/Rules.make Index: arch/mips/vr41xx/nec-eagle/irq.c =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/nec-eagle/irq.c,v retrieving revision 1.1 diff -u -r1.1 irq.c --- arch/mips/vr41xx/nec-eagle/irq.c 14 Jul 2002 23:47:57 -0000 1.1 +++ arch/mips/vr41xx/nec-eagle/irq.c 12 Dec 2002 01:11:02 -0000 @@ -164,9 +164,6 @@ writeb(0, NEC_EAGLE_SDBINTMSK); 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); Index: arch/mips/vr41xx/nec-eagle/pci_fixup.c =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/nec-eagle/pci_fixup.c,v retrieving revision 1.2 diff -u -r1.2 pci_fixup.c --- arch/mips/vr41xx/nec-eagle/pci_fixup.c 3 Oct 2002 16:57:50 -0000 1.2 +++ arch/mips/vr41xx/nec-eagle/pci_fixup.c 12 Dec 2002 01:11:02 -0000 @@ -47,9 +47,7 @@ #include #include -#ifdef CONFIG_VRC4173 #include -#endif void __init pcibios_fixup_resources(struct pci_dev *dev) { @@ -119,20 +117,12 @@ break; } break; -#ifdef CONFIG_VRC4173 case 12: - dev->irq = VRC4173_CARDU1_IRQ; + dev->irq = VRC4173_PCMCIA1_IRQ; break; case 13: - dev->irq = VRC4173_CARDU2_IRQ; + dev->irq = VRC4173_PCMCIA2_IRQ; break; - case 24: - dev->irq = VRC4173_CARDU1_IRQ; - break; - case 25: - dev->irq = VRC4173_CARDU2_IRQ; - break; -#endif case 28: dev->irq = LANINTA_IRQ; break; @@ -152,21 +142,19 @@ break; } break; -#ifdef CONFIG_VRC4173 case 30: switch (func) { case 0: - dev->irq = VRC4173_IRQ; + dev->irq = VRC4173_CASCADE_IRQ; break; case 1: - dev->irq = VRC4173_AC97U_IRQ; + dev->irq = VRC4173_AC97_IRQ; break; case 2: - dev->irq = VRC4173_USBU_IRQ; + dev->irq = VRC4173_USB_IRQ; break; } break; -#endif } pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); Index: arch/mips/vr41xx/nec-eagle/setup.c =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/nec-eagle/setup.c,v retrieving revision 1.3 diff -u -r1.3 setup.c --- arch/mips/vr41xx/nec-eagle/setup.c 7 Nov 2002 12:37:26 -0000 1.3 +++ arch/mips/vr41xx/nec-eagle/setup.c 12 Dec 2002 01:11:02 -0000 @@ -65,6 +65,9 @@ extern void eagle_irq_init(void); #ifdef CONFIG_PCI + +extern void vrc4173_preinit(void); + static struct resource vr41xx_pci_io_resource = { "PCI I/O space", VR41XX_PCI_IO_START, @@ -153,9 +156,7 @@ #ifdef CONFIG_PCI vr41xx_pciu_init(&pci_address_map); -#endif -#ifdef CONFIG_VRC4173 - vrc4173_init(); + vrc4173_preinit(); #endif } Index: arch/mips/vr41xx/nec-eagle/vrc4173.c =================================================================== RCS file: arch/mips/vr41xx/nec-eagle/vrc4173.c diff -N arch/mips/vr41xx/nec-eagle/vrc4173.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ arch/mips/vr41xx/nec-eagle/vrc4173.c 12 Dec 2002 01:11:02 -0000 @@ -0,0 +1,126 @@ +/* + * FILE NAME + * arch/mips/vr41xx/nec-eagle/vrc4173.c + * + * BRIEF MODULE DESCRIPTION + * Pre-setup for NEC VRC4173. + * + * Author: Yoichi Yuasa + * yyuasa@mvista.com or source@mvista.com + * + * Copyright 2001,2002 MontaVista Software Inc. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include + +#ifdef CONFIG_PCI +#include +#include +#include + +#include +#include +#include + +#define PCI_CONFIG_ADDR KSEG1ADDR(0x0f000c18) +#define PCI_CONFIG_DATA KSEG1ADDR(0x0f000c14) + +static inline void config_writeb(u8 reg, u8 val) +{ + u32 data; + int shift; + + writel((1UL << 0x1e) | (reg & 0xfc), PCI_CONFIG_ADDR); + data = readl(PCI_CONFIG_DATA); + + shift = (reg & 3) << 3; + data &= ~(0xff << shift); + data |= (((u32)val) << shift); + + writel(data, PCI_CONFIG_DATA); +} + +static inline u16 config_readw(u8 reg) +{ + u32 data; + + writel(((1UL << 30) | (reg & 0xfc)) , PCI_CONFIG_ADDR); + data = readl(PCI_CONFIG_DATA); + + return (u16)(data >> ((reg & 2) << 3)); +} + +static inline u32 config_readl(u8 reg) +{ + writel(((1UL << 30) | (reg & 0xfc)) , PCI_CONFIG_ADDR); + + return readl(PCI_CONFIG_DATA); +} + +static inline void config_writel(u8 reg, u32 val) +{ + writel((1UL << 0x1e) | (reg & 0xfc), PCI_CONFIG_ADDR); + writel(val, PCI_CONFIG_DATA); +} + +void __init vrc4173_preinit(void) +{ + u32 cmdsts, base; + u16 cmu_mask; + + + if ((config_readw(PCI_VENDOR_ID) == PCI_VENDOR_ID_NEC) && + (config_readw(PCI_DEVICE_ID) == PCI_DEVICE_ID_NEC_VRC4173)) { + /* + * Initialized NEC VRC4173 Bus Control Unit + */ + cmdsts = config_readl(PCI_COMMAND); + config_writel(PCI_COMMAND, + cmdsts | + PCI_COMMAND_IO | + PCI_COMMAND_MEMORY | + PCI_COMMAND_MASTER); + + config_writeb(PCI_LATENCY_TIMER, 0x80); + + config_writel(PCI_BASE_ADDRESS_0, VR41XX_PCI_IO_START); + base = config_readl(PCI_BASE_ADDRESS_0); + base &= PCI_BASE_ADDRESS_IO_MASK; + config_writeb(0x40, 0x01); + + /* CARDU1 IDSEL = AD12, CARDU2 IDSEL = AD13 */ + config_writeb(0x41, 0); + + cmu_mask = 0x1000; + outw(cmu_mask, base + 0x040); + cmu_mask |= 0x0800; + outw(cmu_mask, base + 0x040); + + outw(0x000f, base + 0x042); /* Soft reset of CMU */ + cmu_mask |= 0x05e0; + outw(cmu_mask, base + 0x040); + cmu_mask = inw(base + 0x040); /* dummy read */ + outw(0x0000, base + 0x042); + } +} + +#endif Index: arch/mips/vr41xx/victor-mpc30x/pci_fixup.c =================================================================== RCS file: /home/cvs/linux/arch/mips/vr41xx/victor-mpc30x/pci_fixup.c,v retrieving revision 1.1 diff -u -r1.1 pci_fixup.c --- arch/mips/vr41xx/victor-mpc30x/pci_fixup.c 3 Oct 2002 16:57:50 -0000 1.1 +++ arch/mips/vr41xx/victor-mpc30x/pci_fixup.c 12 Dec 2002 01:11:02 -0000 @@ -17,6 +17,7 @@ #include #include +#include #include void __init pcibios_fixup_resources(struct pci_dev *dev) @@ -38,32 +39,28 @@ dev->irq = 0; switch (slot) { -#ifdef CONFIG_VRC4173 case 12: /* NEC VRC4173 CARDU1 */ - dev->irq = PCMCIA1_IRQ; + dev->irq = VRC4173_PCMCIA1_IRQ; break; case 13: /* NEC VRC4173 CARDU2 */ - dev->irq = PCMCIA2_IRQ; + dev->irq = VRC4173_PCMCIA2_IRQ; break; -#endif case 29: /* mediaQ MQ-200 */ dev->irq = MQ200_IRQ; break; -#ifdef CONFIG_VRC4173 case 30: switch (func) { case 0: /* NEC VRC4173 */ dev->irq = VRC4173_CASCADE_IRQ; break; case 1: /* NEC VRC4173 AC97U */ - dev->irq = AC97_IRQ; + dev->irq = VRC4173_AC97_IRQ; break; case 2: /* NEC VRC4173 USBU */ - dev->irq = USB_IRQ; + dev->irq = VRC4173_USB_IRQ; break; } break; -#endif } pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); Index: drivers/pci/pci.ids =================================================================== RCS file: /home/cvs/linux/drivers/pci/pci.ids,v retrieving revision 1.51 diff -u -r1.51 pci.ids --- drivers/pci/pci.ids 12 Nov 2002 01:34:16 -0000 1.51 +++ drivers/pci/pci.ids 12 Dec 2002 01:11:07 -0000 @@ -1076,6 +1076,7 @@ 0074 56k Voice Modem 1033 8014 RCV56ACF 56k Voice Modem 009b Vrc5476 + 00a5 VRC4173 00a6 VRC5477 AC97 00cd IEEE 1394 [OrangeLink] Host Controller 12ee 8011 Root hub Index: include/asm-mips/vr41xx/vrc4173.h =================================================================== RCS file: include/asm-mips/vr41xx/vrc4173.h diff -N include/asm-mips/vr41xx/vrc4173.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ include/asm-mips/vr41xx/vrc4173.h 12 Dec 2002 01:11:08 -0000 @@ -0,0 +1,91 @@ +/* + * FILE NAME + * include/asm-mips/vr41xx/vrc4173.h + * + * BRIEF MODULE DESCRIPTION + * Include file for NEC VRC4173. + * + * 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. + * + * Copyright (C) 2000 by Michael R. McDonald + * + * Copyright 2001,2002 Montavista Software Inc. + * Author: Yoichi Yuasa + * yyuasa@mvista.com or source@mvista.com + */ +#ifndef __NEC_VRC4173_H +#define __NEC_VRC4173_H + +#include + +/* + * Interrupt Number + */ +#define VRC4173_IRQ_BASE 72 +#define VRC4173_USB_IRQ (VRC4173_IRQ_BASE + 0) +#define VRC4173_PCMCIA2_IRQ (VRC4173_IRQ_BASE + 1) +#define VRC4173_PCMCIA1_IRQ (VRC4173_IRQ_BASE + 2) +#define VRC4173_PS2CH2_IRQ (VRC4173_IRQ_BASE + 3) +#define VRC4173_PS2CH1_IRQ (VRC4173_IRQ_BASE + 4) +#define VRC4173_PIU_IRQ (VRC4173_IRQ_BASE + 5) +#define VRC4173_AIU_IRQ (VRC4173_IRQ_BASE + 6) +#define VRC4173_KIU_IRQ (VRC4173_IRQ_BASE + 7) +#define VRC4173_GIU_IRQ (VRC4173_IRQ_BASE + 8) +#define VRC4173_AC97_IRQ (VRC4173_IRQ_BASE + 9) +#define VRC4173_AC97INT1_IRQ (VRC4173_IRQ_BASE + 10) +#define VRC4173_DOZEPIU_IRQ (VRC4173_IRQ_BASE + 13) +#define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ + +/* + * PCI I/O accesses + */ +extern unsigned long vrc4173_io_offset; + +#define set_vrc4173_io_offset(offset) do { vrc4173_io_offset = (offset); } while (0) + +#define vrc4173_outb(val,port) outb((val), vrc4173_io_offset+(port)) +#define vrc4173_outw(val,port) outw((val), vrc4173_io_offset+(port)) +#define vrc4173_outl(val,port) outl((val), vrc4173_io_offset+(port)) +#define vrc4173_outb_p(val,port) outb_p((val), vrc4173_io_offset+(port)) +#define vrc4173_outw_p(val,port) outw_p((val), vrc4173_io_offset+(port)) +#define vrc4173_outl_p(val,port) outl_p((val), vrc4173_io_offset+(port)) + +#define vrc4173_inb(port) inb(vrc4173_io_offset+(port)) +#define vrc4173_inw(port) inw(vrc4173_io_offset+(port)) +#define vrc4173_inl(port) inl(vrc4173_io_offset+(port)) +#define vrc4173_inb_p(port) inb_p(vrc4173_io_offset+(port)) +#define vrc4173_inw_p(port) inw_p(vrc4173_io_offset+(port)) +#define vrc4173_inl_p(port) inl_p(vrc4173_io_offset+(port)) + +#define vrc4173_outsb(port,addr,count) outsb(vrc4173_io_offset+(port),(addr),(count)) +#define vrc4173_outsw(port,addr,count) outsw(vrc4173_io_offset+(port),(addr),(count)) +#define vrc4173_outsl(port,addr,count) outsl(vrc4173_io_offset+(port),(addr),(count)) + +#define vrc4173_insb(port,addr,count) insb(vrc4173_io_offset+(port),(addr),(count)) +#define vrc4173_insw(port,addr,count) insw(vrc4173_io_offset+(port),(addr),(count)) +#define vrc4173_insl(port,addr,count) insl(vrc4173_io_offset+(port),(addr),(count)) + +/* + * Clock Mask Unit + */ +extern void vrc4173_clock_supply(u16 mask); +extern void vrc4173_clock_mask(u16 mask); + +/* + * General-Purpose I/O Unit + */ +enum { + PS2CH1_SELECT, + PS2CH2_SELECT, + TOUCHPANEL_SELECT, + KIU8_SELECT, + KIU10_SELECT, + KIU12_SELECT, + GPIO_SELECT +}; + +extern void vrc4173_select_function(int func); + +#endif /* __NEC_VRC4173_H */ Index: include/linux/pci_ids.h =================================================================== RCS file: /home/cvs/linux/include/linux/pci_ids.h,v retrieving revision 1.77 diff -u -r1.77 pci_ids.h --- include/linux/pci_ids.h 12 Nov 2002 01:34:18 -0000 1.77 +++ include/linux/pci_ids.h 12 Dec 2002 01:11:09 -0000 @@ -459,6 +459,7 @@ #define PCI_DEVICE_ID_NEC_PCX2 0x0046 #define PCI_DEVICE_ID_NEC_NILE4 0x005a #define PCI_DEVICE_ID_NEC_VRC5476 0x009b +#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5 #define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6 #define PCI_VENDOR_ID_FD 0x1036