Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Remove VR41xx support

No (active) developer owns this hardware, so let's remove Linux support.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

+1 -4068
-1
arch/mips/Kbuild.platforms
··· 33 33 platform-$(CONFIG_SIBYTE_BCM1x80) += sibyte/ 34 34 platform-$(CONFIG_SNI_RM) += sni/ 35 35 platform-$(CONFIG_MACH_TX49XX) += txx9/ 36 - platform-$(CONFIG_MACH_VR41XX) += vr41xx/ 37 36 38 37 # include the platform specific files 39 38 include $(patsubst %/, $(srctree)/arch/mips/%/Platform, $(platform-y))
-23
arch/mips/Kconfig
··· 588 588 Microchip PIC32 is a family of general-purpose 32 bit MIPS core 589 589 microcontrollers. 590 590 591 - config MACH_VR41XX 592 - bool "NEC VR4100 series based machines" 593 - select CEVT_R4K 594 - select CSRC_R4K 595 - select SYS_HAS_CPU_VR41XX 596 - select SYS_SUPPORTS_MIPS16 597 - select GPIOLIB 598 - 599 591 config MACH_NINTENDO64 600 592 bool "Nintendo 64 console" 601 593 select CEVT_R4K ··· 1004 1012 source "arch/mips/sgi-ip27/Kconfig" 1005 1013 source "arch/mips/sibyte/Kconfig" 1006 1014 source "arch/mips/txx9/Kconfig" 1007 - source "arch/mips/vr41xx/Kconfig" 1008 1015 source "arch/mips/cavium-octeon/Kconfig" 1009 1016 source "arch/mips/loongson2ef/Kconfig" 1010 1017 source "arch/mips/loongson32/Kconfig" ··· 1570 1579 might be a safe bet. If the resulting kernel does not work, 1571 1580 try to recompile with R3000. 1572 1581 1573 - config CPU_VR41XX 1574 - bool "R41xx" 1575 - depends on SYS_HAS_CPU_VR41XX 1576 - select CPU_SUPPORTS_32BIT_KERNEL 1577 - select CPU_SUPPORTS_64BIT_KERNEL 1578 - help 1579 - The options selects support for the NEC VR4100 series of processors. 1580 - Only choose this option if you have one of these processors as a 1581 - kernel built with this option will not run on any other type of 1582 - processor or vice versa. 1583 - 1584 1582 config CPU_R4300 1585 1583 bool "R4300" 1586 1584 depends on SYS_HAS_CPU_R4300 ··· 1883 1903 select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT 1884 1904 1885 1905 config SYS_HAS_CPU_R3000 1886 - bool 1887 - 1888 - config SYS_HAS_CPU_VR41XX 1889 1906 bool 1890 1907 1891 1908 config SYS_HAS_CPU_R4300
-1
arch/mips/Makefile
··· 159 159 # 160 160 cflags-$(CONFIG_CPU_R3000) += -march=r3000 161 161 cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap 162 - cflags-$(CONFIG_CPU_VR41XX) += -march=r4100 -Wa,--trap 163 162 cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap 164 163 cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap 165 164 cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap
-91
arch/mips/configs/capcella_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_ZAO_CAPCELLA=y 7 - CONFIG_MODULES=y 8 - CONFIG_MODULE_UNLOAD=y 9 - CONFIG_MODULE_FORCE_UNLOAD=y 10 - CONFIG_MODVERSIONS=y 11 - CONFIG_MODULE_SRCVERSION_ALL=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_NET=y 14 - CONFIG_PACKET=y 15 - CONFIG_UNIX=y 16 - CONFIG_XFRM_USER=m 17 - CONFIG_NET_KEY=y 18 - CONFIG_NET_KEY_MIGRATE=y 19 - CONFIG_INET=y 20 - CONFIG_IP_MULTICAST=y 21 - CONFIG_IP_PNP=y 22 - CONFIG_IP_PNP_BOOTP=y 23 - CONFIG_INET_XFRM_MODE_TRANSPORT=m 24 - CONFIG_INET_XFRM_MODE_TUNNEL=m 25 - CONFIG_INET_XFRM_MODE_BEET=m 26 - CONFIG_TCP_MD5SIG=y 27 - # CONFIG_IPV6 is not set 28 - CONFIG_NETWORK_SECMARK=y 29 - CONFIG_IP_SCTP=m 30 - CONFIG_FW_LOADER=m 31 - CONFIG_BLK_DEV_RAM=y 32 - CONFIG_BLK_DEV_SD=y 33 - CONFIG_ATA=y 34 - CONFIG_PATA_LEGACY=y 35 - CONFIG_NETDEVICES=y 36 - CONFIG_8139TOO=y 37 - CONFIG_PHYLIB=m 38 - CONFIG_CICADA_PHY=m 39 - CONFIG_DAVICOM_PHY=m 40 - CONFIG_LXT_PHY=m 41 - CONFIG_MARVELL_PHY=m 42 - CONFIG_QSEMI_PHY=m 43 - CONFIG_SMSC_PHY=m 44 - CONFIG_VITESSE_PHY=m 45 - # CONFIG_INPUT_KEYBOARD is not set 46 - # CONFIG_INPUT_MOUSE is not set 47 - # CONFIG_SERIO is not set 48 - CONFIG_VT_HW_CONSOLE_BINDING=y 49 - CONFIG_SERIAL_VR41XX=y 50 - CONFIG_SERIAL_VR41XX_CONSOLE=y 51 - # CONFIG_HW_RANDOM is not set 52 - CONFIG_GPIO_VR41XX=y 53 - # CONFIG_HWMON is not set 54 - # CONFIG_VGA_CONSOLE is not set 55 - # CONFIG_USB_SUPPORT is not set 56 - CONFIG_RTC_CLASS=y 57 - CONFIG_RTC_DRV_VR41XX=y 58 - CONFIG_EXT2_FS=y 59 - CONFIG_EXT3_FS=y 60 - CONFIG_AUTOFS4_FS=y 61 - CONFIG_PROC_KCORE=y 62 - CONFIG_TMPFS=y 63 - CONFIG_TMPFS_POSIX_ACL=y 64 - CONFIG_NFS_FS=y 65 - CONFIG_ROOT_NFS=y 66 - CONFIG_CRYPTO_CBC=m 67 - CONFIG_CRYPTO_ECB=m 68 - CONFIG_CRYPTO_LRW=m 69 - CONFIG_CRYPTO_PCBC=m 70 - CONFIG_CRYPTO_XCBC=m 71 - CONFIG_CRYPTO_MD4=m 72 - CONFIG_CRYPTO_MICHAEL_MIC=m 73 - CONFIG_CRYPTO_SHA512=m 74 - CONFIG_CRYPTO_TGR192=m 75 - CONFIG_CRYPTO_WP512=m 76 - CONFIG_CRYPTO_ANUBIS=m 77 - CONFIG_CRYPTO_ARC4=m 78 - CONFIG_CRYPTO_BLOWFISH=m 79 - CONFIG_CRYPTO_CAMELLIA=m 80 - CONFIG_CRYPTO_CAST5=m 81 - CONFIG_CRYPTO_CAST6=m 82 - CONFIG_CRYPTO_DES=m 83 - CONFIG_CRYPTO_FCRYPT=m 84 - CONFIG_CRYPTO_KHAZAD=m 85 - CONFIG_CRYPTO_SERPENT=m 86 - CONFIG_CRYPTO_TEA=m 87 - CONFIG_CRYPTO_TWOFISH=m 88 - CONFIG_CRYPTO_DEFLATE=m 89 - # CONFIG_CRYPTO_HW is not set 90 - CONFIG_CMDLINE_BOOL=y 91 - CONFIG_CMDLINE="mem=32M console=ttyVR0,38400"
-37
arch/mips/configs/e55_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_CASIO_E55=y 7 - CONFIG_MODULES=y 8 - CONFIG_MODULE_UNLOAD=y 9 - CONFIG_MODULE_FORCE_UNLOAD=y 10 - CONFIG_MODVERSIONS=y 11 - CONFIG_MODULE_SRCVERSION_ALL=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_BLK_DEV_RAM=y 14 - CONFIG_BLK_DEV_SD=y 15 - CONFIG_ATA=y 16 - CONFIG_PATA_LEGACY=y 17 - # CONFIG_INPUT_KEYBOARD is not set 18 - # CONFIG_INPUT_MOUSE is not set 19 - # CONFIG_SERIO is not set 20 - CONFIG_VT_HW_CONSOLE_BINDING=y 21 - CONFIG_SERIAL_VR41XX=y 22 - CONFIG_SERIAL_VR41XX_CONSOLE=y 23 - # CONFIG_HW_RANDOM is not set 24 - CONFIG_GPIO_VR41XX=y 25 - # CONFIG_HWMON is not set 26 - # CONFIG_VGA_CONSOLE is not set 27 - # CONFIG_USB_SUPPORT is not set 28 - CONFIG_RTC_CLASS=y 29 - CONFIG_RTC_DRV_VR41XX=y 30 - CONFIG_EXT2_FS=y 31 - CONFIG_EXT3_FS=y 32 - CONFIG_AUTOFS4_FS=y 33 - CONFIG_PROC_KCORE=y 34 - CONFIG_TMPFS=y 35 - CONFIG_TMPFS_POSIX_ACL=y 36 - CONFIG_CMDLINE_BOOL=y 37 - CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x1f0,0x3f6,40 mem=8M"
-53
arch/mips/configs/mpc30x_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_RELAY=y 4 - CONFIG_EXPERT=y 5 - CONFIG_SLAB=y 6 - CONFIG_MACH_VR41XX=y 7 - CONFIG_VICTOR_MPC30X=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - CONFIG_MODVERSIONS=y 11 - CONFIG_MODULE_SRCVERSION_ALL=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_NET=y 14 - CONFIG_PACKET=y 15 - CONFIG_UNIX=y 16 - CONFIG_XFRM_USER=m 17 - CONFIG_NET_KEY=y 18 - CONFIG_NET_KEY_MIGRATE=y 19 - CONFIG_INET=y 20 - CONFIG_IP_MULTICAST=y 21 - CONFIG_INET_XFRM_MODE_TRANSPORT=m 22 - CONFIG_INET_XFRM_MODE_TUNNEL=m 23 - CONFIG_INET_XFRM_MODE_BEET=m 24 - # CONFIG_IPV6 is not set 25 - CONFIG_NETWORK_SECMARK=y 26 - CONFIG_CONNECTOR=m 27 - CONFIG_ATA_OVER_ETH=m 28 - CONFIG_BLK_DEV_SD=y 29 - CONFIG_ATA=y 30 - CONFIG_PATA_LEGACY=y 31 - CONFIG_NETDEVICES=y 32 - CONFIG_USB_PEGASUS=m 33 - # CONFIG_INPUT_KEYBOARD is not set 34 - # CONFIG_INPUT_MOUSE is not set 35 - # CONFIG_SERIO is not set 36 - CONFIG_VT_HW_CONSOLE_BINDING=y 37 - CONFIG_SERIAL_VR41XX=y 38 - CONFIG_SERIAL_VR41XX_CONSOLE=y 39 - # CONFIG_HW_RANDOM is not set 40 - CONFIG_GPIO_VR41XX=y 41 - # CONFIG_HWMON is not set 42 - # CONFIG_VGA_CONSOLE is not set 43 - CONFIG_USB=m 44 - CONFIG_USB_OHCI_HCD=m 45 - CONFIG_RTC_CLASS=y 46 - CONFIG_RTC_DRV_VR41XX=y 47 - CONFIG_EXT2_FS=y 48 - CONFIG_AUTOFS4_FS=y 49 - CONFIG_PROC_KCORE=y 50 - CONFIG_CONFIGFS_FS=m 51 - CONFIG_NFS_FS=y 52 - CONFIG_CMDLINE_BOOL=y 53 - CONFIG_CMDLINE="mem=32M console=ttyVR0,19200 ide0=0x170,0x376,73"
-76
arch/mips/configs/tb0219_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_TANBAC_TB0219=y 7 - CONFIG_MODULES=y 8 - CONFIG_MODULE_UNLOAD=y 9 - CONFIG_MODULE_FORCE_UNLOAD=y 10 - CONFIG_MODVERSIONS=y 11 - CONFIG_MODULE_SRCVERSION_ALL=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_NET=y 14 - CONFIG_PACKET=y 15 - CONFIG_UNIX=y 16 - CONFIG_INET=y 17 - CONFIG_IP_MULTICAST=y 18 - CONFIG_IP_ADVANCED_ROUTER=y 19 - CONFIG_IP_MULTIPLE_TABLES=y 20 - CONFIG_IP_ROUTE_MULTIPATH=y 21 - CONFIG_IP_ROUTE_VERBOSE=y 22 - CONFIG_IP_PNP=y 23 - CONFIG_IP_PNP_BOOTP=y 24 - CONFIG_NET_IPIP=m 25 - CONFIG_SYN_COOKIES=y 26 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 27 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 28 - # CONFIG_INET_XFRM_MODE_BEET is not set 29 - # CONFIG_IPV6 is not set 30 - CONFIG_NETWORK_SECMARK=y 31 - CONFIG_BLK_DEV_LOOP=m 32 - CONFIG_BLK_DEV_NBD=m 33 - CONFIG_BLK_DEV_RAM=y 34 - CONFIG_NETDEVICES=y 35 - CONFIG_8139TOO=y 36 - CONFIG_R8169=y 37 - CONFIG_VIA_RHINE=y 38 - CONFIG_VIA_RHINE_MMIO=y 39 - CONFIG_VIA_VELOCITY=y 40 - CONFIG_CICADA_PHY=m 41 - CONFIG_DAVICOM_PHY=m 42 - CONFIG_LXT_PHY=m 43 - CONFIG_MARVELL_PHY=m 44 - CONFIG_QSEMI_PHY=m 45 - CONFIG_SMSC_PHY=m 46 - CONFIG_VITESSE_PHY=m 47 - # CONFIG_INPUT_KEYBOARD is not set 48 - # CONFIG_INPUT_MOUSE is not set 49 - # CONFIG_SERIO is not set 50 - CONFIG_VT_HW_CONSOLE_BINDING=y 51 - CONFIG_SERIAL_VR41XX=y 52 - CONFIG_SERIAL_VR41XX_CONSOLE=y 53 - # CONFIG_HW_RANDOM is not set 54 - CONFIG_GPIO_TB0219=y 55 - # CONFIG_HWMON is not set 56 - # CONFIG_VGA_CONSOLE is not set 57 - CONFIG_USB=m 58 - CONFIG_USB_MON=m 59 - CONFIG_USB_EHCI_HCD=m 60 - # CONFIG_USB_EHCI_TT_NEWSCHED is not set 61 - CONFIG_USB_OHCI_HCD=m 62 - CONFIG_RTC_CLASS=y 63 - CONFIG_RTC_DRV_VR41XX=y 64 - CONFIG_EXT2_FS=y 65 - CONFIG_EXT3_FS=y 66 - CONFIG_AUTOFS4_FS=y 67 - CONFIG_PROC_KCORE=y 68 - CONFIG_TMPFS=y 69 - CONFIG_TMPFS_POSIX_ACL=y 70 - CONFIG_CRAMFS=m 71 - CONFIG_ROMFS_FS=m 72 - CONFIG_NFS_FS=y 73 - CONFIG_ROOT_NFS=y 74 - CONFIG_NFSD=y 75 - CONFIG_CMDLINE_BOOL=y 76 - CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
-71
arch/mips/configs/tb0226_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_TANBAC_TB0226=y 7 - CONFIG_MODULES=y 8 - CONFIG_MODULE_UNLOAD=y 9 - CONFIG_MODULE_FORCE_UNLOAD=y 10 - CONFIG_MODVERSIONS=y 11 - CONFIG_MODULE_SRCVERSION_ALL=y 12 - CONFIG_NET=y 13 - CONFIG_PACKET=y 14 - CONFIG_UNIX=y 15 - CONFIG_INET=y 16 - CONFIG_IP_MULTICAST=y 17 - CONFIG_IP_ADVANCED_ROUTER=y 18 - CONFIG_IP_MULTIPLE_TABLES=y 19 - CONFIG_IP_ROUTE_MULTIPATH=y 20 - CONFIG_IP_ROUTE_VERBOSE=y 21 - CONFIG_IP_PNP=y 22 - CONFIG_IP_PNP_BOOTP=y 23 - CONFIG_SYN_COOKIES=y 24 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 25 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 26 - # CONFIG_INET_XFRM_MODE_BEET is not set 27 - # CONFIG_IPV6 is not set 28 - CONFIG_NETWORK_SECMARK=y 29 - CONFIG_BLK_DEV_LOOP=m 30 - CONFIG_BLK_DEV_NBD=m 31 - CONFIG_BLK_DEV_RAM=y 32 - CONFIG_SCSI=y 33 - CONFIG_BLK_DEV_SD=y 34 - CONFIG_SCSI_SCAN_ASYNC=y 35 - CONFIG_SCSI_SAS_LIBSAS=m 36 - # CONFIG_SCSI_LOWLEVEL is not set 37 - CONFIG_NETDEVICES=y 38 - CONFIG_E100=y 39 - CONFIG_USB_CATC=m 40 - CONFIG_USB_KAWETH=m 41 - CONFIG_USB_PEGASUS=m 42 - CONFIG_USB_RTL8150=m 43 - # CONFIG_INPUT_KEYBOARD is not set 44 - # CONFIG_INPUT_MOUSE is not set 45 - # CONFIG_SERIO is not set 46 - CONFIG_VT_HW_CONSOLE_BINDING=y 47 - CONFIG_SERIAL_VR41XX=y 48 - CONFIG_SERIAL_VR41XX_CONSOLE=y 49 - # CONFIG_HW_RANDOM is not set 50 - # CONFIG_HWMON is not set 51 - # CONFIG_VGA_CONSOLE is not set 52 - CONFIG_USB=y 53 - CONFIG_USB_EHCI_HCD=y 54 - # CONFIG_USB_EHCI_TT_NEWSCHED is not set 55 - CONFIG_USB_OHCI_HCD=y 56 - CONFIG_USB_ACM=y 57 - CONFIG_USB_STORAGE=y 58 - CONFIG_RTC_CLASS=y 59 - CONFIG_RTC_DRV_VR41XX=y 60 - CONFIG_EXT2_FS=y 61 - CONFIG_AUTOFS4_FS=y 62 - CONFIG_PROC_KCORE=y 63 - CONFIG_TMPFS=y 64 - CONFIG_TMPFS_POSIX_ACL=y 65 - CONFIG_CRAMFS=m 66 - CONFIG_ROMFS_FS=m 67 - CONFIG_NFS_FS=y 68 - CONFIG_ROOT_NFS=y 69 - CONFIG_NFSD=m 70 - CONFIG_CMDLINE_BOOL=y 71 - CONFIG_CMDLINE="cca=3 mem=32M console=ttyVR0,115200"
-84
arch/mips/configs/tb0287_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_MODULES=y 7 - CONFIG_MODULE_UNLOAD=y 8 - CONFIG_MODULE_FORCE_UNLOAD=y 9 - CONFIG_MODVERSIONS=y 10 - CONFIG_MODULE_SRCVERSION_ALL=y 11 - # CONFIG_BLK_DEV_BSG is not set 12 - CONFIG_NET=y 13 - CONFIG_PACKET=y 14 - CONFIG_UNIX=y 15 - CONFIG_INET=y 16 - CONFIG_IP_MULTICAST=y 17 - CONFIG_IP_ADVANCED_ROUTER=y 18 - CONFIG_IP_MULTIPLE_TABLES=y 19 - CONFIG_IP_ROUTE_MULTIPATH=y 20 - CONFIG_IP_ROUTE_VERBOSE=y 21 - CONFIG_IP_PNP=y 22 - CONFIG_IP_PNP_BOOTP=y 23 - CONFIG_NET_IPIP=m 24 - CONFIG_SYN_COOKIES=y 25 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 26 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 27 - # CONFIG_INET_XFRM_MODE_BEET is not set 28 - CONFIG_TCP_CONG_ADVANCED=y 29 - CONFIG_TCP_CONG_BIC=y 30 - CONFIG_TCP_CONG_CUBIC=m 31 - # CONFIG_IPV6 is not set 32 - CONFIG_NETWORK_SECMARK=y 33 - CONFIG_BLK_DEV_LOOP=m 34 - CONFIG_BLK_DEV_NBD=m 35 - CONFIG_BLK_DEV_RAM=y 36 - CONFIG_BLK_DEV_SD=y 37 - CONFIG_SCSI_SCAN_ASYNC=y 38 - # CONFIG_SCSI_LOWLEVEL is not set 39 - CONFIG_ATA=y 40 - CONFIG_PATA_SIL680=y 41 - CONFIG_NETDEVICES=y 42 - CONFIG_8139TOO=y 43 - CONFIG_R8169=y 44 - CONFIG_VIA_RHINE=y 45 - CONFIG_VIA_RHINE_MMIO=y 46 - CONFIG_VIA_VELOCITY=y 47 - # CONFIG_INPUT_KEYBOARD is not set 48 - # CONFIG_INPUT_MOUSE is not set 49 - # CONFIG_SERIO is not set 50 - CONFIG_SERIAL_VR41XX=y 51 - CONFIG_SERIAL_VR41XX_CONSOLE=y 52 - # CONFIG_HW_RANDOM is not set 53 - CONFIG_GPIO_VR41XX=y 54 - # CONFIG_HWMON is not set 55 - CONFIG_MFD_SM501=y 56 - CONFIG_FB=y 57 - CONFIG_FB_SM501=y 58 - # CONFIG_VGA_CONSOLE is not set 59 - CONFIG_FRAMEBUFFER_CONSOLE=y 60 - CONFIG_USB=m 61 - CONFIG_USB_MON=m 62 - CONFIG_USB_EHCI_HCD=m 63 - # CONFIG_USB_EHCI_TT_NEWSCHED is not set 64 - CONFIG_USB_OHCI_HCD=m 65 - CONFIG_USB_STORAGE=m 66 - CONFIG_EXT2_FS=y 67 - CONFIG_EXT3_FS=y 68 - CONFIG_XFS_FS=y 69 - CONFIG_XFS_QUOTA=y 70 - CONFIG_XFS_POSIX_ACL=y 71 - CONFIG_AUTOFS4_FS=y 72 - CONFIG_PROC_KCORE=y 73 - CONFIG_TMPFS=y 74 - CONFIG_TMPFS_POSIX_ACL=y 75 - CONFIG_CRAMFS=m 76 - CONFIG_ROMFS_FS=m 77 - CONFIG_NFS_FS=y 78 - CONFIG_ROOT_NFS=y 79 - CONFIG_NFSD=m 80 - CONFIG_FONTS=y 81 - CONFIG_FONT_8x8=y 82 - CONFIG_FONT_8x16=y 83 - CONFIG_CMDLINE_BOOL=y 84 - CONFIG_CMDLINE="cca=3 mem=64M console=ttyVR0,115200 ip=any root=/dev/nfs"
-67
arch/mips/configs/workpad_defconfig
··· 1 - CONFIG_SYSVIPC=y 2 - CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_EXPERT=y 4 - CONFIG_SLAB=y 5 - CONFIG_MACH_VR41XX=y 6 - CONFIG_IBM_WORKPAD=y 7 - CONFIG_PCCARD=y 8 - CONFIG_PCMCIA_VRC4171=y 9 - CONFIG_MODULES=y 10 - CONFIG_MODULE_UNLOAD=y 11 - CONFIG_MODULE_FORCE_UNLOAD=y 12 - CONFIG_MODVERSIONS=y 13 - CONFIG_MODULE_SRCVERSION_ALL=y 14 - # CONFIG_BLK_DEV_BSG is not set 15 - CONFIG_NET=y 16 - CONFIG_PACKET=y 17 - CONFIG_UNIX=y 18 - CONFIG_XFRM_USER=m 19 - CONFIG_NET_KEY=y 20 - CONFIG_NET_KEY_MIGRATE=y 21 - CONFIG_INET=y 22 - CONFIG_IP_MULTICAST=y 23 - # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 24 - # CONFIG_INET_XFRM_MODE_TUNNEL is not set 25 - # CONFIG_INET_XFRM_MODE_BEET is not set 26 - # CONFIG_IPV6 is not set 27 - CONFIG_NETWORK_SECMARK=y 28 - CONFIG_BLK_DEV_RAM=m 29 - # CONFIG_SCSI_PROC_FS is not set 30 - # CONFIG_SCSI_LOWLEVEL is not set 31 - CONFIG_ATA=y 32 - # CONFIG_ATA_VERBOSE_ERROR is not set 33 - # CONFIG_ATA_FORCE is not set 34 - # CONFIG_ATA_BMDMA is not set 35 - CONFIG_NETDEVICES=y 36 - CONFIG_PCMCIA_3C574=m 37 - CONFIG_PCMCIA_3C589=m 38 - CONFIG_PCMCIA_NMCLAN=m 39 - CONFIG_PCMCIA_FMVJ18X=m 40 - CONFIG_PCMCIA_AXNET=m 41 - CONFIG_PCMCIA_PCNET=m 42 - CONFIG_PCMCIA_SMC91C92=m 43 - CONFIG_PCMCIA_XIRC2PS=m 44 - # CONFIG_INPUT_KEYBOARD is not set 45 - # CONFIG_INPUT_MOUSE is not set 46 - # CONFIG_SERIO is not set 47 - CONFIG_VT_HW_CONSOLE_BINDING=y 48 - CONFIG_SERIAL_VR41XX=y 49 - CONFIG_SERIAL_VR41XX_CONSOLE=y 50 - # CONFIG_HW_RANDOM is not set 51 - CONFIG_GPIO_VR41XX=y 52 - # CONFIG_HWMON is not set 53 - # CONFIG_VGA_CONSOLE is not set 54 - # CONFIG_USB_SUPPORT is not set 55 - CONFIG_RTC_CLASS=y 56 - CONFIG_RTC_DRV_VR41XX=y 57 - CONFIG_EXT2_FS=y 58 - CONFIG_EXT2_FS_XATTR=y 59 - CONFIG_EXT3_FS=y 60 - CONFIG_AUTOFS4_FS=y 61 - CONFIG_PROC_KCORE=y 62 - CONFIG_TMPFS=y 63 - CONFIG_TMPFS_POSIX_ACL=y 64 - CONFIG_NFS_FS=m 65 - CONFIG_NFSD=m 66 - CONFIG_CMDLINE_BOOL=y 67 - CONFIG_CMDLINE="console=ttyVR0,19200 ide0=0x170,0x376,49 mem=16M"
-11
arch/mips/include/asm/cpu-type.h
··· 105 105 case CPU_R3081E: 106 106 #endif 107 107 108 - #ifdef CONFIG_SYS_HAS_CPU_VR41XX 109 - case CPU_VR41XX: 110 - case CPU_VR4111: 111 - case CPU_VR4121: 112 - case CPU_VR4122: 113 - case CPU_VR4131: 114 - case CPU_VR4133: 115 - case CPU_VR4181: 116 - case CPU_VR4181A: 117 - #endif 118 - 119 108 #ifdef CONFIG_SYS_HAS_CPU_R4300 120 109 case CPU_R4300: 121 110 case CPU_R4310:
+1 -2
arch/mips/include/asm/cpu.h
··· 305 305 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310, 306 306 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650, 307 307 CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R10000, 308 - CPU_R12000, CPU_R14000, CPU_R16000, CPU_VR41XX, CPU_VR4111, CPU_VR4121, 309 - CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000, 308 + CPU_R12000, CPU_R14000, CPU_R16000, CPU_RM7000, 310 309 CPU_SR71000, CPU_TX49XX, 311 310 312 311 /*
-9
arch/mips/include/asm/mach-vr41xx/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __ASM_MACH_VR41XX_IRQ_H 3 - #define __ASM_MACH_VR41XX_IRQ_H 4 - 5 - #include <asm/vr41xx/irq.h> /* for MIPS_CPU_IRQ_BASE */ 6 - 7 - #include <asm/mach-generic/irq.h> 8 - 9 - #endif /* __ASM_MACH_VR41XX_IRQ_H */
-14
arch/mips/include/asm/mipsregs.h
··· 164 164 /* 165 165 * Values for PageMask register 166 166 */ 167 - #ifdef CONFIG_CPU_VR41XX 168 - 169 - /* Why doesn't stupidity hurt ... */ 170 - 171 - #define PM_1K 0x00000000 172 - #define PM_4K 0x00001800 173 - #define PM_16K 0x00007800 174 - #define PM_64K 0x0001f800 175 - #define PM_256K 0x0007f800 176 - 177 - #else 178 - 179 167 #define PM_4K 0x00000000 180 168 #define PM_8K 0x00002000 181 169 #define PM_16K 0x00006000 ··· 181 193 #define PM_64M 0x07ffe000 182 194 #define PM_256M 0x1fffe000 183 195 #define PM_1G 0x7fffe000 184 - 185 - #endif 186 196 187 197 /* 188 198 * Default page size for a given kernel configuration
-5
arch/mips/include/asm/pgtable-32.h
··· 185 185 #else 186 186 187 187 #define MAX_POSSIBLE_PHYSMEM_BITS 32 188 - #ifdef CONFIG_CPU_VR41XX 189 - #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) 190 - #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 191 - #else 192 188 #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT)) 193 189 #define pfn_pte(pfn, prot) __pte(((unsigned long long)(pfn) << _PFN_SHIFT) | pgprot_val(prot)) 194 190 #define pfn_pmd(pfn, prot) __pmd(((unsigned long long)(pfn) << _PFN_SHIFT) | pgprot_val(prot)) 195 - #endif 196 191 #endif /* defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) */ 197 192 198 193 #define pte_page(x) pfn_to_page(pte_pfn(x))
-5
arch/mips/include/asm/pgtable-64.h
··· 303 303 304 304 #define pte_page(x) pfn_to_page(pte_pfn(x)) 305 305 306 - #ifdef CONFIG_CPU_VR41XX 307 - #define pte_pfn(x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2))) 308 - #define pfn_pte(pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot)) 309 - #else 310 306 #define pte_pfn(x) ((unsigned long)((x).pte >> _PFN_SHIFT)) 311 307 #define pfn_pte(pfn, prot) __pte(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) 312 308 #define pfn_pmd(pfn, prot) __pmd(((pfn) << _PFN_SHIFT) | pgprot_val(prot)) 313 - #endif 314 309 315 310 #ifndef __PAGETABLE_PMD_FOLDED 316 311 static inline pmd_t *pud_pgtable(pud_t pud)
-2
arch/mips/include/asm/vermagic.h
··· 22 22 #define MODULE_PROC_FAMILY "MIPS64_R6 " 23 23 #elif defined CONFIG_CPU_R3000 24 24 #define MODULE_PROC_FAMILY "R3000 " 25 - #elif defined CONFIG_CPU_VR41XX 26 - #define MODULE_PROC_FAMILY "VR41XX " 27 25 #elif defined CONFIG_CPU_R4300 28 26 #define MODULE_PROC_FAMILY "R4300 " 29 27 #elif defined CONFIG_CPU_R4X00
-30
arch/mips/include/asm/vr41xx/capcella.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * capcella.h, Include file for ZAO Networks Capcella. 4 - * 5 - * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __ZAO_CAPCELLA_H 8 - #define __ZAO_CAPCELLA_H 9 - 10 - #include <asm/vr41xx/irq.h> 11 - 12 - /* 13 - * General-Purpose I/O Pin Number 14 - */ 15 - #define PC104PLUS_INTA_PIN 2 16 - #define PC104PLUS_INTB_PIN 3 17 - #define PC104PLUS_INTC_PIN 4 18 - #define PC104PLUS_INTD_PIN 5 19 - 20 - /* 21 - * Interrupt Number 22 - */ 23 - #define RTL8139_1_IRQ GIU_IRQ(PC104PLUS_INTC_PIN) 24 - #define RTL8139_2_IRQ GIU_IRQ(PC104PLUS_INTD_PIN) 25 - #define PC104PLUS_INTA_IRQ GIU_IRQ(PC104PLUS_INTA_PIN) 26 - #define PC104PLUS_INTB_IRQ GIU_IRQ(PC104PLUS_INTB_PIN) 27 - #define PC104PLUS_INTC_IRQ GIU_IRQ(PC104PLUS_INTC_PIN) 28 - #define PC104PLUS_INTD_IRQ GIU_IRQ(PC104PLUS_INTD_PIN) 29 - 30 - #endif /* __ZAO_CAPCELLA_H */
-41
arch/mips/include/asm/vr41xx/giu.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Include file for NEC VR4100 series General-purpose I/O Unit. 4 - * 5 - * Copyright (C) 2005-2009 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __NEC_VR41XX_GIU_H 8 - #define __NEC_VR41XX_GIU_H 9 - 10 - /* 11 - * NEC VR4100 series GIU platform device IDs. 12 - */ 13 - enum { 14 - GPIO_50PINS_PULLUPDOWN, 15 - GPIO_36PINS, 16 - GPIO_48PINS_EDGE_SELECT, 17 - }; 18 - 19 - typedef enum { 20 - IRQ_TRIGGER_LEVEL, 21 - IRQ_TRIGGER_EDGE, 22 - IRQ_TRIGGER_EDGE_FALLING, 23 - IRQ_TRIGGER_EDGE_RISING, 24 - } irq_trigger_t; 25 - 26 - typedef enum { 27 - IRQ_SIGNAL_THROUGH, 28 - IRQ_SIGNAL_HOLD, 29 - } irq_signal_t; 30 - 31 - extern void vr41xx_set_irq_trigger(unsigned int pin, irq_trigger_t trigger, 32 - irq_signal_t signal); 33 - 34 - typedef enum { 35 - IRQ_LEVEL_LOW, 36 - IRQ_LEVEL_HIGH, 37 - } irq_level_t; 38 - 39 - extern void vr41xx_set_irq_level(unsigned int pin, irq_level_t level); 40 - 41 - #endif /* __NEC_VR41XX_GIU_H */
-97
arch/mips/include/asm/vr41xx/irq.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * include/asm-mips/vr41xx/irq.h 4 - * 5 - * Interrupt numbers for NEC VR4100 series. 6 - * 7 - * Copyright (C) 1999 Michael Klar 8 - * Copyright (C) 2001, 2002 Paul Mundt 9 - * Copyright (C) 2002 MontaVista Software, Inc. 10 - * Copyright (C) 2002 TimeSys Corp. 11 - * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org> 12 - */ 13 - #ifndef __NEC_VR41XX_IRQ_H 14 - #define __NEC_VR41XX_IRQ_H 15 - 16 - /* 17 - * CPU core Interrupt Numbers 18 - */ 19 - #define MIPS_CPU_IRQ_BASE 0 20 - #define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) 21 - #define MIPS_SOFTINT0_IRQ MIPS_CPU_IRQ(0) 22 - #define MIPS_SOFTINT1_IRQ MIPS_CPU_IRQ(1) 23 - #define INT0_IRQ MIPS_CPU_IRQ(2) 24 - #define INT1_IRQ MIPS_CPU_IRQ(3) 25 - #define INT2_IRQ MIPS_CPU_IRQ(4) 26 - #define INT3_IRQ MIPS_CPU_IRQ(5) 27 - #define INT4_IRQ MIPS_CPU_IRQ(6) 28 - #define TIMER_IRQ MIPS_CPU_IRQ(7) 29 - 30 - /* 31 - * SYINT1 Interrupt Numbers 32 - */ 33 - #define SYSINT1_IRQ_BASE 8 34 - #define SYSINT1_IRQ(x) (SYSINT1_IRQ_BASE + (x)) 35 - #define BATTRY_IRQ SYSINT1_IRQ(0) 36 - #define POWER_IRQ SYSINT1_IRQ(1) 37 - #define RTCLONG1_IRQ SYSINT1_IRQ(2) 38 - #define ELAPSEDTIME_IRQ SYSINT1_IRQ(3) 39 - /* RFU */ 40 - #define PIU_IRQ SYSINT1_IRQ(5) 41 - #define AIU_IRQ SYSINT1_IRQ(6) 42 - #define KIU_IRQ SYSINT1_IRQ(7) 43 - #define GIUINT_IRQ SYSINT1_IRQ(8) 44 - #define SIU_IRQ SYSINT1_IRQ(9) 45 - #define BUSERR_IRQ SYSINT1_IRQ(10) 46 - #define SOFTINT_IRQ SYSINT1_IRQ(11) 47 - #define CLKRUN_IRQ SYSINT1_IRQ(12) 48 - #define DOZEPIU_IRQ SYSINT1_IRQ(13) 49 - #define SYSINT1_IRQ_LAST DOZEPIU_IRQ 50 - 51 - /* 52 - * SYSINT2 Interrupt Numbers 53 - */ 54 - #define SYSINT2_IRQ_BASE 24 55 - #define SYSINT2_IRQ(x) (SYSINT2_IRQ_BASE + (x)) 56 - #define RTCLONG2_IRQ SYSINT2_IRQ(0) 57 - #define LED_IRQ SYSINT2_IRQ(1) 58 - #define HSP_IRQ SYSINT2_IRQ(2) 59 - #define TCLOCK_IRQ SYSINT2_IRQ(3) 60 - #define FIR_IRQ SYSINT2_IRQ(4) 61 - #define CEU_IRQ SYSINT2_IRQ(4) /* same number as FIR_IRQ */ 62 - #define DSIU_IRQ SYSINT2_IRQ(5) 63 - #define PCI_IRQ SYSINT2_IRQ(6) 64 - #define SCU_IRQ SYSINT2_IRQ(7) 65 - #define CSI_IRQ SYSINT2_IRQ(8) 66 - #define BCU_IRQ SYSINT2_IRQ(9) 67 - #define ETHERNET_IRQ SYSINT2_IRQ(10) 68 - #define SYSINT2_IRQ_LAST ETHERNET_IRQ 69 - 70 - /* 71 - * GIU Interrupt Numbers 72 - */ 73 - #define GIU_IRQ_BASE 40 74 - #define GIU_IRQ(x) (GIU_IRQ_BASE + (x)) /* IRQ 40-71 */ 75 - #define GIU_IRQ_LAST GIU_IRQ(31) 76 - 77 - /* 78 - * VRC4173 Interrupt Numbers 79 - */ 80 - #define VRC4173_IRQ_BASE 72 81 - #define VRC4173_IRQ(x) (VRC4173_IRQ_BASE + (x)) 82 - #define VRC4173_USB_IRQ VRC4173_IRQ(0) 83 - #define VRC4173_PCMCIA2_IRQ VRC4173_IRQ(1) 84 - #define VRC4173_PCMCIA1_IRQ VRC4173_IRQ(2) 85 - #define VRC4173_PS2CH2_IRQ VRC4173_IRQ(3) 86 - #define VRC4173_PS2CH1_IRQ VRC4173_IRQ(4) 87 - #define VRC4173_PIU_IRQ VRC4173_IRQ(5) 88 - #define VRC4173_AIU_IRQ VRC4173_IRQ(6) 89 - #define VRC4173_KIU_IRQ VRC4173_IRQ(7) 90 - #define VRC4173_GIU_IRQ VRC4173_IRQ(8) 91 - #define VRC4173_AC97_IRQ VRC4173_IRQ(9) 92 - #define VRC4173_AC97INT1_IRQ VRC4173_IRQ(10) 93 - /* RFU */ 94 - #define VRC4173_DOZEPIU_IRQ VRC4173_IRQ(13) 95 - #define VRC4173_IRQ_LAST VRC4173_DOZEPIU_IRQ 96 - 97 - #endif /* __NEC_VR41XX_IRQ_H */
-24
arch/mips/include/asm/vr41xx/mpc30x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * mpc30x.h, Include file for Victor MP-C303/304. 4 - * 5 - * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __VICTOR_MPC30X_H 8 - #define __VICTOR_MPC30X_H 9 - 10 - #include <asm/vr41xx/irq.h> 11 - 12 - /* 13 - * General-Purpose I/O Pin Number 14 - */ 15 - #define VRC4173_PIN 1 16 - #define MQ200_PIN 4 17 - 18 - /* 19 - * Interrupt Number 20 - */ 21 - #define VRC4173_CASCADE_IRQ GIU_IRQ(VRC4173_PIN) 22 - #define MQ200_IRQ GIU_IRQ(MQ200_PIN) 23 - 24 - #endif /* __VICTOR_MPC30X_H */
-77
arch/mips/include/asm/vr41xx/pci.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Include file for NEC VR4100 series PCI Control Unit. 4 - * 5 - * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __NEC_VR41XX_PCI_H 8 - #define __NEC_VR41XX_PCI_H 9 - 10 - #define PCI_MASTER_ADDRESS_MASK 0x7fffffffU 11 - 12 - struct pci_master_address_conversion { 13 - uint32_t bus_base_address; 14 - uint32_t address_mask; 15 - uint32_t pci_base_address; 16 - }; 17 - 18 - struct pci_target_address_conversion { 19 - uint32_t address_mask; 20 - uint32_t bus_base_address; 21 - }; 22 - 23 - typedef enum { 24 - CANNOT_LOCK_FROM_DEVICE, 25 - CAN_LOCK_FROM_DEVICE, 26 - } pci_exclusive_access_t; 27 - 28 - struct pci_mailbox_address { 29 - uint32_t base_address; 30 - }; 31 - 32 - struct pci_target_address_window { 33 - uint32_t base_address; 34 - }; 35 - 36 - typedef enum { 37 - PCI_ARBITRATION_MODE_FAIR, 38 - PCI_ARBITRATION_MODE_ALTERNATE_0, 39 - PCI_ARBITRATION_MODE_ALTERNATE_B, 40 - } pci_arbiter_priority_control_t; 41 - 42 - typedef enum { 43 - PCI_TAKE_AWAY_GNT_DISABLE, 44 - PCI_TAKE_AWAY_GNT_ENABLE, 45 - } pci_take_away_gnt_mode_t; 46 - 47 - struct pci_controller_unit_setup { 48 - struct pci_master_address_conversion *master_memory1; 49 - struct pci_master_address_conversion *master_memory2; 50 - 51 - struct pci_target_address_conversion *target_memory1; 52 - struct pci_target_address_conversion *target_memory2; 53 - 54 - struct pci_master_address_conversion *master_io; 55 - 56 - pci_exclusive_access_t exclusive_access; 57 - 58 - uint32_t pci_clock_max; 59 - uint8_t wait_time_limit_from_irdy_to_trdy; /* Only VR4122 is supported */ 60 - 61 - struct pci_mailbox_address *mailbox; 62 - struct pci_target_address_window *target_window1; 63 - struct pci_target_address_window *target_window2; 64 - 65 - uint8_t master_latency_timer; 66 - uint8_t retry_limit; 67 - 68 - pci_arbiter_priority_control_t arbiter_priority_control; 69 - pci_take_away_gnt_mode_t take_away_gnt_mode; 70 - 71 - struct resource *mem_resource; 72 - struct resource *io_resource; 73 - }; 74 - 75 - extern void vr41xx_pciu_setup(struct pci_controller_unit_setup *setup); 76 - 77 - #endif /* __NEC_VR41XX_PCI_H */
-45
arch/mips/include/asm/vr41xx/siu.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Include file for NEC VR4100 series Serial Interface Unit. 4 - * 5 - * Copyright (C) 2005-2008 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __NEC_VR41XX_SIU_H 8 - #define __NEC_VR41XX_SIU_H 9 - 10 - #define SIU_PORTS_MAX 2 11 - 12 - typedef enum { 13 - SIU_INTERFACE_RS232C, 14 - SIU_INTERFACE_IRDA, 15 - } siu_interface_t; 16 - 17 - extern void vr41xx_select_siu_interface(siu_interface_t interface); 18 - 19 - typedef enum { 20 - SIU_USE_IRDA, 21 - FIR_USE_IRDA, 22 - } irda_use_t; 23 - 24 - extern void vr41xx_use_irda(irda_use_t use); 25 - 26 - typedef enum { 27 - SHARP_IRDA, 28 - TEMIC_IRDA, 29 - HP_IRDA, 30 - } irda_module_t; 31 - 32 - typedef enum { 33 - IRDA_TX_1_5MBPS, 34 - IRDA_TX_4MBPS, 35 - } irda_speed_t; 36 - 37 - extern void vr41xx_select_irda_module(irda_module_t module, irda_speed_t speed); 38 - 39 - #ifdef CONFIG_SERIAL_VR41XX_CONSOLE 40 - extern void vr41xx_siu_early_setup(struct uart_port *port); 41 - #else 42 - static inline void vr41xx_siu_early_setup(struct uart_port *port) {} 43 - #endif 44 - 45 - #endif /* __NEC_VR41XX_SIU_H */
-29
arch/mips/include/asm/vr41xx/tb0219.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * tb0219.h, Include file for TANBAC TB0219. 4 - * 5 - * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - * 7 - * Modified for TANBAC TB0219: 8 - * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 9 - */ 10 - #ifndef __TANBAC_TB0219_H 11 - #define __TANBAC_TB0219_H 12 - 13 - #include <asm/vr41xx/irq.h> 14 - 15 - /* 16 - * General-Purpose I/O Pin Number 17 - */ 18 - #define TB0219_PCI_SLOT1_PIN 2 19 - #define TB0219_PCI_SLOT2_PIN 3 20 - #define TB0219_PCI_SLOT3_PIN 4 21 - 22 - /* 23 - * Interrupt Number 24 - */ 25 - #define TB0219_PCI_SLOT1_IRQ GIU_IRQ(TB0219_PCI_SLOT1_PIN) 26 - #define TB0219_PCI_SLOT2_IRQ GIU_IRQ(TB0219_PCI_SLOT2_PIN) 27 - #define TB0219_PCI_SLOT3_IRQ GIU_IRQ(TB0219_PCI_SLOT3_PIN) 28 - 29 - #endif /* __TANBAC_TB0219_H */
-30
arch/mips/include/asm/vr41xx/tb0226.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * tb0226.h, Include file for TANBAC TB0226. 4 - * 5 - * Copyright (C) 2002-2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #ifndef __TANBAC_TB0226_H 8 - #define __TANBAC_TB0226_H 9 - 10 - #include <asm/vr41xx/irq.h> 11 - 12 - /* 13 - * General-Purpose I/O Pin Number 14 - */ 15 - #define GD82559_1_PIN 2 16 - #define GD82559_2_PIN 3 17 - #define UPD720100_INTA_PIN 4 18 - #define UPD720100_INTB_PIN 8 19 - #define UPD720100_INTC_PIN 13 20 - 21 - /* 22 - * Interrupt Number 23 - */ 24 - #define GD82559_1_IRQ GIU_IRQ(GD82559_1_PIN) 25 - #define GD82559_2_IRQ GIU_IRQ(GD82559_2_PIN) 26 - #define UPD720100_INTA_IRQ GIU_IRQ(UPD720100_INTA_PIN) 27 - #define UPD720100_INTB_IRQ GIU_IRQ(UPD720100_INTB_PIN) 28 - #define UPD720100_INTC_IRQ GIU_IRQ(UPD720100_INTC_PIN) 29 - 30 - #endif /* __TANBAC_TB0226_H */
-30
arch/mips/include/asm/vr41xx/tb0287.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * tb0287.h, Include file for TANBAC TB0287 mini-ITX board. 4 - * 5 - * Copyright (C) 2005 Media Lab Inc. <ito@mlb.co.jp> 6 - * 7 - * This code is largely based on tb0219.h. 8 - */ 9 - #ifndef __TANBAC_TB0287_H 10 - #define __TANBAC_TB0287_H 11 - 12 - #include <asm/vr41xx/irq.h> 13 - 14 - /* 15 - * General-Purpose I/O Pin Number 16 - */ 17 - #define TB0287_PCI_SLOT_PIN 2 18 - #define TB0287_SM501_PIN 3 19 - #define TB0287_SIL680A_PIN 8 20 - #define TB0287_RTL8110_PIN 13 21 - 22 - /* 23 - * Interrupt Number 24 - */ 25 - #define TB0287_PCI_SLOT_IRQ GIU_IRQ(TB0287_PCI_SLOT_PIN) 26 - #define TB0287_SM501_IRQ GIU_IRQ(TB0287_SM501_PIN) 27 - #define TB0287_SIL680A_IRQ GIU_IRQ(TB0287_SIL680A_PIN) 28 - #define TB0287_RTL8110_IRQ GIU_IRQ(TB0287_RTL8110_PIN) 29 - 30 - #endif /* __TANBAC_TB0287_H */
-148
arch/mips/include/asm/vr41xx/vr41xx.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * include/asm-mips/vr41xx/vr41xx.h 4 - * 5 - * Include file for NEC VR4100 series. 6 - * 7 - * Copyright (C) 1999 Michael Klar 8 - * Copyright (C) 2001, 2002 Paul Mundt 9 - * Copyright (C) 2002 MontaVista Software, Inc. 10 - * Copyright (C) 2002 TimeSys Corp. 11 - * Copyright (C) 2003-2008 Yoichi Yuasa <yuasa@linux-mips.org> 12 - */ 13 - #ifndef __NEC_VR41XX_H 14 - #define __NEC_VR41XX_H 15 - 16 - #include <linux/interrupt.h> 17 - 18 - /* 19 - * CPU Revision 20 - */ 21 - /* VR4122 0x00000c70-0x00000c72 */ 22 - #define PRID_VR4122_REV1_0 0x00000c70 23 - #define PRID_VR4122_REV2_0 0x00000c70 24 - #define PRID_VR4122_REV2_1 0x00000c70 25 - #define PRID_VR4122_REV3_0 0x00000c71 26 - #define PRID_VR4122_REV3_1 0x00000c72 27 - 28 - /* VR4181A 0x00000c73-0x00000c7f */ 29 - #define PRID_VR4181A_REV1_0 0x00000c73 30 - #define PRID_VR4181A_REV1_1 0x00000c74 31 - 32 - /* VR4131 0x00000c80-0x00000c83 */ 33 - #define PRID_VR4131_REV1_2 0x00000c80 34 - #define PRID_VR4131_REV2_0 0x00000c81 35 - #define PRID_VR4131_REV2_1 0x00000c82 36 - #define PRID_VR4131_REV2_2 0x00000c83 37 - 38 - /* VR4133 0x00000c84- */ 39 - #define PRID_VR4133 0x00000c84 40 - 41 - /* 42 - * Bus Control Uint 43 - */ 44 - extern unsigned long vr41xx_calculate_clock_frequency(void); 45 - extern unsigned long vr41xx_get_vtclock_frequency(void); 46 - extern unsigned long vr41xx_get_tclock_frequency(void); 47 - 48 - /* 49 - * Clock Mask Unit 50 - */ 51 - typedef enum { 52 - PIU_CLOCK, 53 - SIU_CLOCK, 54 - AIU_CLOCK, 55 - KIU_CLOCK, 56 - FIR_CLOCK, 57 - DSIU_CLOCK, 58 - CSI_CLOCK, 59 - PCIU_CLOCK, 60 - HSP_CLOCK, 61 - PCI_CLOCK, 62 - CEU_CLOCK, 63 - ETHER0_CLOCK, 64 - ETHER1_CLOCK 65 - } vr41xx_clock_t; 66 - 67 - extern void vr41xx_supply_clock(vr41xx_clock_t clock); 68 - extern void vr41xx_mask_clock(vr41xx_clock_t clock); 69 - 70 - /* 71 - * Interrupt Control Unit 72 - */ 73 - extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign); 74 - extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)); 75 - 76 - #define PIUINT_COMMAND 0x0040 77 - #define PIUINT_DATA 0x0020 78 - #define PIUINT_PAGE1 0x0010 79 - #define PIUINT_PAGE0 0x0008 80 - #define PIUINT_DATALOST 0x0004 81 - #define PIUINT_STATUSCHANGE 0x0001 82 - 83 - extern void vr41xx_enable_piuint(uint16_t mask); 84 - extern void vr41xx_disable_piuint(uint16_t mask); 85 - 86 - #define AIUINT_INPUT_DMAEND 0x0800 87 - #define AIUINT_INPUT_DMAHALT 0x0400 88 - #define AIUINT_INPUT_DATALOST 0x0200 89 - #define AIUINT_INPUT_DATA 0x0100 90 - #define AIUINT_OUTPUT_DMAEND 0x0008 91 - #define AIUINT_OUTPUT_DMAHALT 0x0004 92 - #define AIUINT_OUTPUT_NODATA 0x0002 93 - 94 - extern void vr41xx_enable_aiuint(uint16_t mask); 95 - extern void vr41xx_disable_aiuint(uint16_t mask); 96 - 97 - #define KIUINT_DATALOST 0x0004 98 - #define KIUINT_DATAREADY 0x0002 99 - #define KIUINT_SCAN 0x0001 100 - 101 - extern void vr41xx_enable_kiuint(uint16_t mask); 102 - extern void vr41xx_disable_kiuint(uint16_t mask); 103 - 104 - #define DSIUINT_CTS 0x0800 105 - #define DSIUINT_RXERR 0x0400 106 - #define DSIUINT_RX 0x0200 107 - #define DSIUINT_TX 0x0100 108 - #define DSIUINT_ALL 0x0f00 109 - 110 - extern void vr41xx_enable_dsiuint(uint16_t mask); 111 - extern void vr41xx_disable_dsiuint(uint16_t mask); 112 - 113 - #define FIRINT_UNIT 0x0010 114 - #define FIRINT_RX_DMAEND 0x0008 115 - #define FIRINT_RX_DMAHALT 0x0004 116 - #define FIRINT_TX_DMAEND 0x0002 117 - #define FIRINT_TX_DMAHALT 0x0001 118 - 119 - extern void vr41xx_enable_firint(uint16_t mask); 120 - extern void vr41xx_disable_firint(uint16_t mask); 121 - 122 - extern void vr41xx_enable_pciint(void); 123 - extern void vr41xx_disable_pciint(void); 124 - 125 - extern void vr41xx_enable_scuint(void); 126 - extern void vr41xx_disable_scuint(void); 127 - 128 - #define CSIINT_TX_DMAEND 0x0040 129 - #define CSIINT_TX_DMAHALT 0x0020 130 - #define CSIINT_TX_DATA 0x0010 131 - #define CSIINT_TX_FIFOEMPTY 0x0008 132 - #define CSIINT_RX_DMAEND 0x0004 133 - #define CSIINT_RX_DMAHALT 0x0002 134 - #define CSIINT_RX_FIFOEMPTY 0x0001 135 - 136 - extern void vr41xx_enable_csiint(uint16_t mask); 137 - extern void vr41xx_disable_csiint(uint16_t mask); 138 - 139 - extern void vr41xx_enable_bcuint(void); 140 - extern void vr41xx_disable_bcuint(void); 141 - 142 - #ifdef CONFIG_SERIAL_VR41XX_CONSOLE 143 - extern void vr41xx_siu_setup(void); 144 - #else 145 - static inline void vr41xx_siu_setup(void) {} 146 - #endif 147 - 148 - #endif /* __NEC_VR41XX_H */
-40
arch/mips/kernel/cpu-probe.c
··· 1115 1115 MIPS_CPU_LLSC; 1116 1116 c->tlbsize = 48; 1117 1117 break; 1118 - case PRID_IMP_VR41XX: 1119 - set_isa(c, MIPS_CPU_ISA_III); 1120 - c->fpu_msk31 |= FPU_CSR_CONDX; 1121 - c->options = R4K_OPTS; 1122 - c->tlbsize = 32; 1123 - switch (c->processor_id & 0xf0) { 1124 - case PRID_REV_VR4111: 1125 - c->cputype = CPU_VR4111; 1126 - __cpu_name[cpu] = "NEC VR4111"; 1127 - break; 1128 - case PRID_REV_VR4121: 1129 - c->cputype = CPU_VR4121; 1130 - __cpu_name[cpu] = "NEC VR4121"; 1131 - break; 1132 - case PRID_REV_VR4122: 1133 - if ((c->processor_id & 0xf) < 0x3) { 1134 - c->cputype = CPU_VR4122; 1135 - __cpu_name[cpu] = "NEC VR4122"; 1136 - } else { 1137 - c->cputype = CPU_VR4181A; 1138 - __cpu_name[cpu] = "NEC VR4181A"; 1139 - } 1140 - break; 1141 - case PRID_REV_VR4130: 1142 - if ((c->processor_id & 0xf) < 0x4) { 1143 - c->cputype = CPU_VR4131; 1144 - __cpu_name[cpu] = "NEC VR4131"; 1145 - } else { 1146 - c->cputype = CPU_VR4133; 1147 - c->options |= MIPS_CPU_LLSC; 1148 - __cpu_name[cpu] = "NEC VR4133"; 1149 - } 1150 - break; 1151 - default: 1152 - printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 1153 - c->cputype = CPU_VR41XX; 1154 - __cpu_name[cpu] = "NEC Vr41xx"; 1155 - break; 1156 - } 1157 - break; 1158 1118 case PRID_IMP_R4300: 1159 1119 c->cputype = CPU_R4300; 1160 1120 __cpu_name[cpu] = "R4300";
-8
arch/mips/lib/dump_tlb.c
··· 59 59 case PM_8M: return "8Mb"; 60 60 case PM_32M: return "32Mb"; 61 61 #endif 62 - #ifndef CONFIG_CPU_VR41XX 63 - case PM_1M: return "1Mb"; 64 - case PM_4M: return "4Mb"; 65 - case PM_16M: return "16Mb"; 66 - case PM_64M: return "64Mb"; 67 - case PM_256M: return "256Mb"; 68 - case PM_1G: return "1Gb"; 69 - #endif 70 62 } 71 63 return ""; 72 64 }
-44
arch/mips/mm/c-r4k.c
··· 1194 1194 c->options |= MIPS_CPU_PREFETCH; 1195 1195 break; 1196 1196 1197 - case CPU_VR4133: 1198 - write_c0_config(config & ~VR41_CONF_P4K); 1199 - fallthrough; 1200 - case CPU_VR4131: 1201 - /* Workaround for cache instruction bug of VR4131 */ 1202 - if (c->processor_id == 0x0c80U || c->processor_id == 0x0c81U || 1203 - c->processor_id == 0x0c82U) { 1204 - config |= 0x00400000U; 1205 - if (c->processor_id == 0x0c80U) 1206 - config |= VR41_CONF_BP; 1207 - write_c0_config(config); 1208 - } else 1209 - c->options |= MIPS_CPU_CACHE_CDEX_P; 1210 - 1211 - icache_size = 1 << (10 + ((config & CONF_IC) >> 9)); 1212 - c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 1213 - c->icache.ways = 2; 1214 - c->icache.waybit = __ffs(icache_size/2); 1215 - 1216 - dcache_size = 1 << (10 + ((config & CONF_DC) >> 6)); 1217 - c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 1218 - c->dcache.ways = 2; 1219 - c->dcache.waybit = __ffs(dcache_size/2); 1220 - break; 1221 - 1222 - case CPU_VR41XX: 1223 - case CPU_VR4111: 1224 - case CPU_VR4121: 1225 - case CPU_VR4122: 1226 - case CPU_VR4181: 1227 - case CPU_VR4181A: 1228 - icache_size = 1 << (10 + ((config & CONF_IC) >> 9)); 1229 - c->icache.linesz = 16 << ((config & CONF_IB) >> 5); 1230 - c->icache.ways = 1; 1231 - c->icache.waybit = 0; /* doesn't matter */ 1232 - 1233 - dcache_size = 1 << (10 + ((config & CONF_DC) >> 6)); 1234 - c->dcache.linesz = 16 << ((config & CONF_DB) >> 4); 1235 - c->dcache.ways = 1; 1236 - c->dcache.waybit = 0; /* does not matter */ 1237 - 1238 - c->options |= MIPS_CPU_CACHE_CDEX_P; 1239 - break; 1240 - 1241 1197 case CPU_RM7000: 1242 1198 rm7k_erratum31(); 1243 1199
-35
arch/mips/mm/tlbex.c
··· 586 586 tlbw(p); 587 587 break; 588 588 589 - case CPU_VR4111: 590 - case CPU_VR4121: 591 - case CPU_VR4122: 592 - case CPU_VR4181: 593 - case CPU_VR4181A: 594 - uasm_i_nop(p); 595 - uasm_i_nop(p); 596 - tlbw(p); 597 - uasm_i_nop(p); 598 - uasm_i_nop(p); 599 - break; 600 - 601 - case CPU_VR4131: 602 - case CPU_VR4133: 603 - uasm_i_nop(p); 604 - uasm_i_nop(p); 605 - tlbw(p); 606 - break; 607 - 608 589 case CPU_XBURST: 609 590 tlbw(p); 610 591 uasm_i_nop(p); ··· 975 994 { 976 995 unsigned int shift = 4 - (PTE_T_LOG2 + 1) + PAGE_SHIFT - 12; 977 996 unsigned int mask = (PTRS_PER_PTE / 2 - 1) << (PTE_T_LOG2 + 1); 978 - 979 - switch (current_cpu_type()) { 980 - case CPU_VR41XX: 981 - case CPU_VR4111: 982 - case CPU_VR4121: 983 - case CPU_VR4122: 984 - case CPU_VR4131: 985 - case CPU_VR4181: 986 - case CPU_VR4181A: 987 - case CPU_VR4133: 988 - shift += 2; 989 - break; 990 - 991 - default: 992 - break; 993 - } 994 997 995 998 if (shift) 996 999 UASM_i_SRL(p, ctx, ctx, shift);
-6
arch/mips/pci/Makefile
··· 13 13 obj-$(CONFIG_MIPS_BONITO64) += ops-bonito64.o 14 14 obj-$(CONFIG_PCI_GT64XXX_PCI0) += ops-gt64xxx_pci0.o 15 15 obj-$(CONFIG_MIPS_MSC) += ops-msc.o 16 - obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o 17 16 obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o 18 17 obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o 19 18 obj-$(CONFIG_BCM63XX) += pci-bcm63xx.o fixup-bcm63xx.o \ ··· 41 42 obj-$(CONFIG_SOC_MT7620) += pci-mt7620.o 42 43 obj-$(CONFIG_SOC_RT288X) += pci-rt2880.o 43 44 obj-$(CONFIG_SOC_RT3883) += pci-rt3883.o 44 - obj-$(CONFIG_TANBAC_TB0219) += fixup-tb0219.o 45 - obj-$(CONFIG_TANBAC_TB0226) += fixup-tb0226.o 46 - obj-$(CONFIG_TANBAC_TB0287) += fixup-tb0287.o 47 45 obj-$(CONFIG_SOC_TX4927) += pci-tx4927.o 48 46 obj-$(CONFIG_SOC_TX4938) += pci-tx4938.o 49 47 obj-$(CONFIG_TOSHIBA_RBTX4927) += fixup-rbtx4927.o 50 - obj-$(CONFIG_VICTOR_MPC30X) += fixup-mpc30x.o 51 - obj-$(CONFIG_ZAO_CAPCELLA) += fixup-capcella.o 52 48 obj-$(CONFIG_MIKROTIK_RB532) += pci-rc32434.o ops-rc32434.o fixup-rc32434.o 53 49 obj-$(CONFIG_CAVIUM_OCTEON_SOC) += pci-octeon.o pcie-octeon.o 54 50
-37
arch/mips/pci/fixup-capcella.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * fixup-cappcela.c, The ZAO Networks Capcella specific PCI fixups. 4 - * 5 - * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/pci.h> 9 - 10 - #include <asm/vr41xx/capcella.h> 11 - 12 - /* 13 - * Shortcuts 14 - */ 15 - #define INT1 RTL8139_1_IRQ 16 - #define INT2 RTL8139_2_IRQ 17 - #define INTA PC104PLUS_INTA_IRQ 18 - #define INTB PC104PLUS_INTB_IRQ 19 - #define INTC PC104PLUS_INTC_IRQ 20 - #define INTD PC104PLUS_INTD_IRQ 21 - 22 - static char irq_tab_capcella[][5] = { 23 - [11] = { -1, INT1, INT1, INT1, INT1 }, 24 - [12] = { -1, INT2, INT2, INT2, INT2 }, 25 - [14] = { -1, INTA, INTB, INTC, INTD } 26 - }; 27 - 28 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 29 - { 30 - return irq_tab_capcella[slot][pin]; 31 - } 32 - 33 - /* Do platform specific device initialization at pci_enable_device() time */ 34 - int pcibios_plat_dev_init(struct pci_dev *dev) 35 - { 36 - return 0; 37 - }
-36
arch/mips/pci/fixup-mpc30x.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * fixup-mpc30x.c, The Victor MP-C303/304 specific PCI fixups. 4 - * 5 - * Copyright (C) 2002,2004 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/pci.h> 9 - 10 - #include <asm/vr41xx/mpc30x.h> 11 - 12 - static const int internal_func_irqs[] = { 13 - VRC4173_CASCADE_IRQ, 14 - VRC4173_AC97_IRQ, 15 - VRC4173_USB_IRQ, 16 - }; 17 - 18 - static const int irq_tab_mpc30x[] = { 19 - [12] = VRC4173_PCMCIA1_IRQ, 20 - [13] = VRC4173_PCMCIA2_IRQ, 21 - [29] = MQ200_IRQ, 22 - }; 23 - 24 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 25 - { 26 - if (slot == 30) 27 - return internal_func_irqs[PCI_FUNC(dev->devfn)]; 28 - 29 - return irq_tab_mpc30x[slot]; 30 - } 31 - 32 - /* Do platform specific device initialization at pci_enable_device() time */ 33 - int pcibios_plat_dev_init(struct pci_dev *dev) 34 - { 35 - return 0; 36 - }
-38
arch/mips/pci/fixup-tb0219.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups. 4 - * 5 - * Copyright (C) 2003 Megasolution Inc. <matsu@megasolution.jp> 6 - * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> 7 - */ 8 - #include <linux/init.h> 9 - #include <linux/pci.h> 10 - 11 - #include <asm/vr41xx/tb0219.h> 12 - 13 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 14 - { 15 - int irq = -1; 16 - 17 - switch (slot) { 18 - case 12: 19 - irq = TB0219_PCI_SLOT1_IRQ; 20 - break; 21 - case 13: 22 - irq = TB0219_PCI_SLOT2_IRQ; 23 - break; 24 - case 14: 25 - irq = TB0219_PCI_SLOT3_IRQ; 26 - break; 27 - default: 28 - break; 29 - } 30 - 31 - return irq; 32 - } 33 - 34 - /* Do platform specific device initialization at pci_enable_device() time */ 35 - int pcibios_plat_dev_init(struct pci_dev *dev) 36 - { 37 - return 0; 38 - }
-73
arch/mips/pci/fixup-tb0226.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * fixup-tb0226.c, The TANBAC TB0226 specific PCI fixups. 4 - * 5 - * Copyright (C) 2002-2005 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/pci.h> 9 - 10 - #include <asm/vr41xx/giu.h> 11 - #include <asm/vr41xx/tb0226.h> 12 - 13 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 14 - { 15 - int irq = -1; 16 - 17 - switch (slot) { 18 - case 12: 19 - vr41xx_set_irq_trigger(GD82559_1_PIN, 20 - IRQ_TRIGGER_LEVEL, 21 - IRQ_SIGNAL_THROUGH); 22 - vr41xx_set_irq_level(GD82559_1_PIN, IRQ_LEVEL_LOW); 23 - irq = GD82559_1_IRQ; 24 - break; 25 - case 13: 26 - vr41xx_set_irq_trigger(GD82559_2_PIN, 27 - IRQ_TRIGGER_LEVEL, 28 - IRQ_SIGNAL_THROUGH); 29 - vr41xx_set_irq_level(GD82559_2_PIN, IRQ_LEVEL_LOW); 30 - irq = GD82559_2_IRQ; 31 - break; 32 - case 14: 33 - switch (pin) { 34 - case 1: 35 - vr41xx_set_irq_trigger(UPD720100_INTA_PIN, 36 - IRQ_TRIGGER_LEVEL, 37 - IRQ_SIGNAL_THROUGH); 38 - vr41xx_set_irq_level(UPD720100_INTA_PIN, 39 - IRQ_LEVEL_LOW); 40 - irq = UPD720100_INTA_IRQ; 41 - break; 42 - case 2: 43 - vr41xx_set_irq_trigger(UPD720100_INTB_PIN, 44 - IRQ_TRIGGER_LEVEL, 45 - IRQ_SIGNAL_THROUGH); 46 - vr41xx_set_irq_level(UPD720100_INTB_PIN, 47 - IRQ_LEVEL_LOW); 48 - irq = UPD720100_INTB_IRQ; 49 - break; 50 - case 3: 51 - vr41xx_set_irq_trigger(UPD720100_INTC_PIN, 52 - IRQ_TRIGGER_LEVEL, 53 - IRQ_SIGNAL_THROUGH); 54 - vr41xx_set_irq_level(UPD720100_INTC_PIN, 55 - IRQ_LEVEL_LOW); 56 - irq = UPD720100_INTC_IRQ; 57 - break; 58 - default: 59 - break; 60 - } 61 - break; 62 - default: 63 - break; 64 - } 65 - 66 - return irq; 67 - } 68 - 69 - /* Do platform specific device initialization at pci_enable_device() time */ 70 - int pcibios_plat_dev_init(struct pci_dev *dev) 71 - { 72 - return 0; 73 - }
-52
arch/mips/pci/fixup-tb0287.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * fixup-tb0287.c, The TANBAC TB0287 specific PCI fixups. 4 - * 5 - * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/pci.h> 9 - 10 - #include <asm/vr41xx/tb0287.h> 11 - 12 - int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 13 - { 14 - unsigned char bus; 15 - int irq = -1; 16 - 17 - bus = dev->bus->number; 18 - if (bus == 0) { 19 - switch (slot) { 20 - case 16: 21 - irq = TB0287_SM501_IRQ; 22 - break; 23 - case 17: 24 - irq = TB0287_SIL680A_IRQ; 25 - break; 26 - default: 27 - break; 28 - } 29 - } else if (bus == 1) { 30 - switch (PCI_SLOT(dev->devfn)) { 31 - case 0: 32 - irq = TB0287_PCI_SLOT_IRQ; 33 - break; 34 - case 2: 35 - case 3: 36 - irq = TB0287_RTL8110_IRQ; 37 - break; 38 - default: 39 - break; 40 - } 41 - } else if (bus > 1) { 42 - irq = TB0287_PCI_SLOT_IRQ; 43 - } 44 - 45 - return irq; 46 - } 47 - 48 - /* Do platform specific device initialization at pci_enable_device() time */ 49 - int pcibios_plat_dev_init(struct pci_dev *dev) 50 - { 51 - return 0; 52 - }
-113
arch/mips/pci/ops-vr41xx.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * ops-vr41xx.c, PCI configuration routines for the PCIU of NEC VR4100 series. 4 - * 5 - * Copyright (C) 2001-2003 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> 8 - */ 9 - /* 10 - * Changes: 11 - * MontaVista Software Inc. <source@mvista.com> 12 - * - New creation, NEC VR4122 and VR4131 are supported. 13 - */ 14 - #include <linux/pci.h> 15 - #include <linux/types.h> 16 - 17 - #include <asm/io.h> 18 - 19 - #define PCICONFDREG (void __iomem *)KSEG1ADDR(0x0f000c14) 20 - #define PCICONFAREG (void __iomem *)KSEG1ADDR(0x0f000c18) 21 - 22 - static inline int set_pci_configuration_address(unsigned char number, 23 - unsigned int devfn, int where) 24 - { 25 - if (number == 0) { 26 - /* 27 - * Type 0 configuration 28 - */ 29 - if (PCI_SLOT(devfn) < 11 || where > 0xff) 30 - return -EINVAL; 31 - 32 - writel((1U << PCI_SLOT(devfn)) | (PCI_FUNC(devfn) << 8) | 33 - (where & 0xfc), PCICONFAREG); 34 - } else { 35 - /* 36 - * Type 1 configuration 37 - */ 38 - if (where > 0xff) 39 - return -EINVAL; 40 - 41 - writel(((uint32_t)number << 16) | ((devfn & 0xff) << 8) | 42 - (where & 0xfc) | 1U, PCICONFAREG); 43 - } 44 - 45 - return 0; 46 - } 47 - 48 - static int pci_config_read(struct pci_bus *bus, unsigned int devfn, int where, 49 - int size, uint32_t *val) 50 - { 51 - uint32_t data; 52 - 53 - *val = 0xffffffffU; 54 - if (set_pci_configuration_address(bus->number, devfn, where) < 0) 55 - return PCIBIOS_DEVICE_NOT_FOUND; 56 - 57 - data = readl(PCICONFDREG); 58 - 59 - switch (size) { 60 - case 1: 61 - *val = (data >> ((where & 3) << 3)) & 0xffU; 62 - break; 63 - case 2: 64 - *val = (data >> ((where & 2) << 3)) & 0xffffU; 65 - break; 66 - case 4: 67 - *val = data; 68 - break; 69 - default: 70 - return PCIBIOS_FUNC_NOT_SUPPORTED; 71 - } 72 - 73 - return PCIBIOS_SUCCESSFUL; 74 - } 75 - 76 - static int pci_config_write(struct pci_bus *bus, unsigned int devfn, int where, 77 - int size, uint32_t val) 78 - { 79 - uint32_t data; 80 - int shift; 81 - 82 - if (set_pci_configuration_address(bus->number, devfn, where) < 0) 83 - return PCIBIOS_DEVICE_NOT_FOUND; 84 - 85 - data = readl(PCICONFDREG); 86 - 87 - switch (size) { 88 - case 1: 89 - shift = (where & 3) << 3; 90 - data &= ~(0xffU << shift); 91 - data |= ((val & 0xffU) << shift); 92 - break; 93 - case 2: 94 - shift = (where & 2) << 3; 95 - data &= ~(0xffffU << shift); 96 - data |= ((val & 0xffffU) << shift); 97 - break; 98 - case 4: 99 - data = val; 100 - break; 101 - default: 102 - return PCIBIOS_FUNC_NOT_SUPPORTED; 103 - } 104 - 105 - writel(data, PCICONFDREG); 106 - 107 - return PCIBIOS_SUCCESSFUL; 108 - } 109 - 110 - struct pci_ops vr41xx_pci_ops = { 111 - .read = pci_config_read, 112 - .write = pci_config_write, 113 - };
-309
arch/mips/pci/pci-vr41xx.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * pci-vr41xx.c, PCI Control Unit routines for the NEC VR4100 series. 4 - * 5 - * Copyright (C) 2001-2003 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2004-2008 Yoichi Yuasa <yuasa@linux-mips.org> 8 - * Copyright (C) 2004 by Ralf Baechle (ralf@linux-mips.org) 9 - */ 10 - /* 11 - * Changes: 12 - * MontaVista Software Inc. <source@mvista.com> 13 - * - New creation, NEC VR4122 and VR4131 are supported. 14 - */ 15 - #include <linux/init.h> 16 - #include <linux/pci.h> 17 - #include <linux/types.h> 18 - 19 - #include <asm/cpu.h> 20 - #include <asm/io.h> 21 - #include <asm/vr41xx/pci.h> 22 - #include <asm/vr41xx/vr41xx.h> 23 - 24 - #include "pci-vr41xx.h" 25 - 26 - extern struct pci_ops vr41xx_pci_ops; 27 - 28 - static void __iomem *pciu_base; 29 - 30 - #define pciu_read(offset) readl(pciu_base + (offset)) 31 - #define pciu_write(offset, value) writel((value), pciu_base + (offset)) 32 - 33 - static struct pci_master_address_conversion pci_master_memory1 = { 34 - .bus_base_address = PCI_MASTER_MEM1_BUS_BASE_ADDRESS, 35 - .address_mask = PCI_MASTER_MEM1_ADDRESS_MASK, 36 - .pci_base_address = PCI_MASTER_MEM1_PCI_BASE_ADDRESS, 37 - }; 38 - 39 - static struct pci_target_address_conversion pci_target_memory1 = { 40 - .address_mask = PCI_TARGET_MEM1_ADDRESS_MASK, 41 - .bus_base_address = PCI_TARGET_MEM1_BUS_BASE_ADDRESS, 42 - }; 43 - 44 - static struct pci_master_address_conversion pci_master_io = { 45 - .bus_base_address = PCI_MASTER_IO_BUS_BASE_ADDRESS, 46 - .address_mask = PCI_MASTER_IO_ADDRESS_MASK, 47 - .pci_base_address = PCI_MASTER_IO_PCI_BASE_ADDRESS, 48 - }; 49 - 50 - static struct pci_mailbox_address pci_mailbox = { 51 - .base_address = PCI_MAILBOX_BASE_ADDRESS, 52 - }; 53 - 54 - static struct pci_target_address_window pci_target_window1 = { 55 - .base_address = PCI_TARGET_WINDOW1_BASE_ADDRESS, 56 - }; 57 - 58 - static struct resource pci_mem_resource = { 59 - .name = "PCI Memory resources", 60 - .start = PCI_MEM_RESOURCE_START, 61 - .end = PCI_MEM_RESOURCE_END, 62 - .flags = IORESOURCE_MEM, 63 - }; 64 - 65 - static struct resource pci_io_resource = { 66 - .name = "PCI I/O resources", 67 - .start = PCI_IO_RESOURCE_START, 68 - .end = PCI_IO_RESOURCE_END, 69 - .flags = IORESOURCE_IO, 70 - }; 71 - 72 - static struct pci_controller_unit_setup vr41xx_pci_controller_unit_setup = { 73 - .master_memory1 = &pci_master_memory1, 74 - .target_memory1 = &pci_target_memory1, 75 - .master_io = &pci_master_io, 76 - .exclusive_access = CANNOT_LOCK_FROM_DEVICE, 77 - .wait_time_limit_from_irdy_to_trdy = 0, 78 - .mailbox = &pci_mailbox, 79 - .target_window1 = &pci_target_window1, 80 - .master_latency_timer = 0x80, 81 - .retry_limit = 0, 82 - .arbiter_priority_control = PCI_ARBITRATION_MODE_FAIR, 83 - .take_away_gnt_mode = PCI_TAKE_AWAY_GNT_DISABLE, 84 - }; 85 - 86 - static struct pci_controller vr41xx_pci_controller = { 87 - .pci_ops = &vr41xx_pci_ops, 88 - .mem_resource = &pci_mem_resource, 89 - .io_resource = &pci_io_resource, 90 - }; 91 - 92 - void __init vr41xx_pciu_setup(struct pci_controller_unit_setup *setup) 93 - { 94 - vr41xx_pci_controller_unit_setup = *setup; 95 - } 96 - 97 - static int __init vr41xx_pciu_init(void) 98 - { 99 - struct pci_controller_unit_setup *setup; 100 - struct pci_master_address_conversion *master; 101 - struct pci_target_address_conversion *target; 102 - struct pci_mailbox_address *mailbox; 103 - struct pci_target_address_window *window; 104 - unsigned long vtclock, pci_clock_max; 105 - uint32_t val; 106 - 107 - setup = &vr41xx_pci_controller_unit_setup; 108 - 109 - if (request_mem_region(PCIU_BASE, PCIU_SIZE, "PCIU") == NULL) 110 - return -EBUSY; 111 - 112 - pciu_base = ioremap(PCIU_BASE, PCIU_SIZE); 113 - if (pciu_base == NULL) { 114 - release_mem_region(PCIU_BASE, PCIU_SIZE); 115 - return -EBUSY; 116 - } 117 - 118 - /* Disable PCI interrupt */ 119 - vr41xx_disable_pciint(); 120 - 121 - /* Supply VTClock to PCIU */ 122 - vr41xx_supply_clock(PCIU_CLOCK); 123 - 124 - /* Dummy write, waiting for supply of VTClock. */ 125 - vr41xx_disable_pciint(); 126 - 127 - /* Select PCI clock */ 128 - if (setup->pci_clock_max != 0) 129 - pci_clock_max = setup->pci_clock_max; 130 - else 131 - pci_clock_max = PCI_CLOCK_MAX; 132 - vtclock = vr41xx_get_vtclock_frequency(); 133 - if (vtclock < pci_clock_max) 134 - pciu_write(PCICLKSELREG, EQUAL_VTCLOCK); 135 - else if ((vtclock / 2) < pci_clock_max) 136 - pciu_write(PCICLKSELREG, HALF_VTCLOCK); 137 - else if (current_cpu_data.processor_id >= PRID_VR4131_REV2_1 && 138 - (vtclock / 3) < pci_clock_max) 139 - pciu_write(PCICLKSELREG, ONE_THIRD_VTCLOCK); 140 - else if ((vtclock / 4) < pci_clock_max) 141 - pciu_write(PCICLKSELREG, QUARTER_VTCLOCK); 142 - else { 143 - printk(KERN_ERR "PCI Clock is over 33MHz.\n"); 144 - iounmap(pciu_base); 145 - return -EINVAL; 146 - } 147 - 148 - /* Supply PCI clock by PCI bus */ 149 - vr41xx_supply_clock(PCI_CLOCK); 150 - 151 - if (setup->master_memory1 != NULL) { 152 - master = setup->master_memory1; 153 - val = IBA(master->bus_base_address) | 154 - MASTER_MSK(master->address_mask) | 155 - WINEN | 156 - PCIA(master->pci_base_address); 157 - pciu_write(PCIMMAW1REG, val); 158 - } else { 159 - val = pciu_read(PCIMMAW1REG); 160 - val &= ~WINEN; 161 - pciu_write(PCIMMAW1REG, val); 162 - } 163 - 164 - if (setup->master_memory2 != NULL) { 165 - master = setup->master_memory2; 166 - val = IBA(master->bus_base_address) | 167 - MASTER_MSK(master->address_mask) | 168 - WINEN | 169 - PCIA(master->pci_base_address); 170 - pciu_write(PCIMMAW2REG, val); 171 - } else { 172 - val = pciu_read(PCIMMAW2REG); 173 - val &= ~WINEN; 174 - pciu_write(PCIMMAW2REG, val); 175 - } 176 - 177 - if (setup->target_memory1 != NULL) { 178 - target = setup->target_memory1; 179 - val = TARGET_MSK(target->address_mask) | 180 - WINEN | 181 - ITA(target->bus_base_address); 182 - pciu_write(PCITAW1REG, val); 183 - } else { 184 - val = pciu_read(PCITAW1REG); 185 - val &= ~WINEN; 186 - pciu_write(PCITAW1REG, val); 187 - } 188 - 189 - if (setup->target_memory2 != NULL) { 190 - target = setup->target_memory2; 191 - val = TARGET_MSK(target->address_mask) | 192 - WINEN | 193 - ITA(target->bus_base_address); 194 - pciu_write(PCITAW2REG, val); 195 - } else { 196 - val = pciu_read(PCITAW2REG); 197 - val &= ~WINEN; 198 - pciu_write(PCITAW2REG, val); 199 - } 200 - 201 - if (setup->master_io != NULL) { 202 - master = setup->master_io; 203 - val = IBA(master->bus_base_address) | 204 - MASTER_MSK(master->address_mask) | 205 - WINEN | 206 - PCIIA(master->pci_base_address); 207 - pciu_write(PCIMIOAWREG, val); 208 - } else { 209 - val = pciu_read(PCIMIOAWREG); 210 - val &= ~WINEN; 211 - pciu_write(PCIMIOAWREG, val); 212 - } 213 - 214 - if (setup->exclusive_access == CANNOT_LOCK_FROM_DEVICE) 215 - pciu_write(PCIEXACCREG, UNLOCK); 216 - else 217 - pciu_write(PCIEXACCREG, 0); 218 - 219 - if (current_cpu_type() == CPU_VR4122) 220 - pciu_write(PCITRDYVREG, TRDYV(setup->wait_time_limit_from_irdy_to_trdy)); 221 - 222 - pciu_write(LATTIMEREG, MLTIM(setup->master_latency_timer)); 223 - 224 - if (setup->mailbox != NULL) { 225 - mailbox = setup->mailbox; 226 - val = MBADD(mailbox->base_address) | TYPE_32BITSPACE | 227 - MSI_MEMORY | PREF_APPROVAL; 228 - pciu_write(MAILBAREG, val); 229 - } 230 - 231 - if (setup->target_window1) { 232 - window = setup->target_window1; 233 - val = PMBA(window->base_address) | TYPE_32BITSPACE | 234 - MSI_MEMORY | PREF_APPROVAL; 235 - pciu_write(PCIMBA1REG, val); 236 - } 237 - 238 - if (setup->target_window2) { 239 - window = setup->target_window2; 240 - val = PMBA(window->base_address) | TYPE_32BITSPACE | 241 - MSI_MEMORY | PREF_APPROVAL; 242 - pciu_write(PCIMBA2REG, val); 243 - } 244 - 245 - val = pciu_read(RETVALREG); 246 - val &= ~RTYVAL_MASK; 247 - val |= RTYVAL(setup->retry_limit); 248 - pciu_write(RETVALREG, val); 249 - 250 - val = pciu_read(PCIAPCNTREG); 251 - val &= ~(TKYGNT | PAPC); 252 - 253 - switch (setup->arbiter_priority_control) { 254 - case PCI_ARBITRATION_MODE_ALTERNATE_0: 255 - val |= PAPC_ALTERNATE_0; 256 - break; 257 - case PCI_ARBITRATION_MODE_ALTERNATE_B: 258 - val |= PAPC_ALTERNATE_B; 259 - break; 260 - default: 261 - val |= PAPC_FAIR; 262 - break; 263 - } 264 - 265 - if (setup->take_away_gnt_mode == PCI_TAKE_AWAY_GNT_ENABLE) 266 - val |= TKYGNT_ENABLE; 267 - 268 - pciu_write(PCIAPCNTREG, val); 269 - 270 - pciu_write(COMMANDREG, PCI_COMMAND_IO | PCI_COMMAND_MEMORY | 271 - PCI_COMMAND_MASTER | PCI_COMMAND_PARITY | 272 - PCI_COMMAND_SERR); 273 - 274 - /* Clear bus error */ 275 - pciu_read(BUSERRADREG); 276 - 277 - pciu_write(PCIENREG, PCIU_CONFIG_DONE); 278 - 279 - if (setup->mem_resource != NULL) 280 - vr41xx_pci_controller.mem_resource = setup->mem_resource; 281 - 282 - if (setup->io_resource != NULL) { 283 - vr41xx_pci_controller.io_resource = setup->io_resource; 284 - } else { 285 - set_io_port_base(IO_PORT_BASE); 286 - ioport_resource.start = IO_PORT_RESOURCE_START; 287 - ioport_resource.end = IO_PORT_RESOURCE_END; 288 - } 289 - 290 - if (setup->master_io) { 291 - void __iomem *io_map_base; 292 - struct resource *res = vr41xx_pci_controller.io_resource; 293 - master = setup->master_io; 294 - io_map_base = ioremap(master->bus_base_address, 295 - resource_size(res)); 296 - if (!io_map_base) { 297 - iounmap(pciu_base); 298 - return -EBUSY; 299 - } 300 - 301 - vr41xx_pci_controller.io_map_base = (unsigned long)io_map_base; 302 - } 303 - 304 - register_pci_controller(&vr41xx_pci_controller); 305 - 306 - return 0; 307 - } 308 - 309 - arch_initcall(vr41xx_pciu_init);
-141
arch/mips/pci/pci-vr41xx.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series. 4 - * 5 - * Copyright (C) 2002 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org> 8 - */ 9 - #ifndef __PCI_VR41XX_H 10 - #define __PCI_VR41XX_H 11 - 12 - #define PCIU_BASE 0x0f000c00UL 13 - #define PCIU_SIZE 0x200UL 14 - 15 - #define PCIMMAW1REG 0x00 16 - #define PCIMMAW2REG 0x04 17 - #define PCITAW1REG 0x08 18 - #define PCITAW2REG 0x0c 19 - #define PCIMIOAWREG 0x10 20 - #define IBA(addr) ((addr) & 0xff000000U) 21 - #define MASTER_MSK(mask) (((mask) >> 11) & 0x000fe000U) 22 - #define PCIA(addr) (((addr) >> 24) & 0x000000ffU) 23 - #define TARGET_MSK(mask) (((mask) >> 8) & 0x000fe000U) 24 - #define ITA(addr) (((addr) >> 24) & 0x000000ffU) 25 - #define PCIIA(addr) (((addr) >> 24) & 0x000000ffU) 26 - #define WINEN 0x1000U 27 - #define PCICONFDREG 0x14 28 - #define PCICONFAREG 0x18 29 - #define PCIMAILREG 0x1c 30 - #define BUSERRADREG 0x24 31 - #define EA(reg) ((reg) &0xfffffffc) 32 - 33 - #define INTCNTSTAREG 0x28 34 - #define MABTCLR 0x80000000U 35 - #define TRDYCLR 0x40000000U 36 - #define PARCLR 0x20000000U 37 - #define MBCLR 0x10000000U 38 - #define SERRCLR 0x08000000U 39 - #define RTYCLR 0x04000000U 40 - #define MABCLR 0x02000000U 41 - #define TABCLR 0x01000000U 42 - /* RFU */ 43 - #define MABTMSK 0x00008000U 44 - #define TRDYMSK 0x00004000U 45 - #define PARMSK 0x00002000U 46 - #define MBMSK 0x00001000U 47 - #define SERRMSK 0x00000800U 48 - #define RTYMSK 0x00000400U 49 - #define MABMSK 0x00000200U 50 - #define TABMSK 0x00000100U 51 - #define IBAMABT 0x00000080U 52 - #define TRDYRCH 0x00000040U 53 - #define PAR 0x00000020U 54 - #define MB 0x00000010U 55 - #define PCISERR 0x00000008U 56 - #define RTYRCH 0x00000004U 57 - #define MABORT 0x00000002U 58 - #define TABORT 0x00000001U 59 - 60 - #define PCIEXACCREG 0x2c 61 - #define UNLOCK 0x2U 62 - #define EAREQ 0x1U 63 - #define PCIRECONTREG 0x30 64 - #define RTRYCNT(reg) ((reg) & 0x000000ffU) 65 - #define PCIENREG 0x34 66 - #define PCIU_CONFIG_DONE 0x4U 67 - #define PCICLKSELREG 0x38 68 - #define EQUAL_VTCLOCK 0x2U 69 - #define HALF_VTCLOCK 0x0U 70 - #define ONE_THIRD_VTCLOCK 0x3U 71 - #define QUARTER_VTCLOCK 0x1U 72 - #define PCITRDYVREG 0x3c 73 - #define TRDYV(val) ((uint32_t)(val) & 0xffU) 74 - #define PCICLKRUNREG 0x60 75 - 76 - #define VENDORIDREG 0x100 77 - #define DEVICEIDREG 0x100 78 - #define COMMANDREG 0x104 79 - #define STATUSREG 0x104 80 - #define REVIDREG 0x108 81 - #define CLASSREG 0x108 82 - #define CACHELSREG 0x10c 83 - #define LATTIMEREG 0x10c 84 - #define MLTIM(val) (((uint32_t)(val) << 7) & 0xff00U) 85 - #define MAILBAREG 0x110 86 - #define PCIMBA1REG 0x114 87 - #define PCIMBA2REG 0x118 88 - #define MBADD(base) ((base) & 0xfffff800U) 89 - #define PMBA(base) ((base) & 0xffe00000U) 90 - #define PREF 0x8U 91 - #define PREF_APPROVAL 0x8U 92 - #define PREF_DISAPPROVAL 0x0U 93 - #define TYPE 0x6U 94 - #define TYPE_32BITSPACE 0x0U 95 - #define MSI 0x1U 96 - #define MSI_MEMORY 0x0U 97 - #define INTLINEREG 0x13c 98 - #define INTPINREG 0x13c 99 - #define RETVALREG 0x140 100 - #define PCIAPCNTREG 0x140 101 - #define TKYGNT 0x04000000U 102 - #define TKYGNT_ENABLE 0x04000000U 103 - #define TKYGNT_DISABLE 0x00000000U 104 - #define PAPC 0x03000000U 105 - #define PAPC_ALTERNATE_B 0x02000000U 106 - #define PAPC_ALTERNATE_0 0x01000000U 107 - #define PAPC_FAIR 0x00000000U 108 - #define RTYVAL(val) (((uint32_t)(val) << 7) & 0xff00U) 109 - #define RTYVAL_MASK 0xff00U 110 - 111 - #define PCI_CLOCK_MAX 33333333U 112 - 113 - /* 114 - * Default setup 115 - */ 116 - #define PCI_MASTER_MEM1_BUS_BASE_ADDRESS 0x10000000U 117 - #define PCI_MASTER_MEM1_ADDRESS_MASK 0x7c000000U 118 - #define PCI_MASTER_MEM1_PCI_BASE_ADDRESS 0x10000000U 119 - 120 - #define PCI_TARGET_MEM1_ADDRESS_MASK 0x08000000U 121 - #define PCI_TARGET_MEM1_BUS_BASE_ADDRESS 0x00000000U 122 - 123 - #define PCI_MASTER_IO_BUS_BASE_ADDRESS 0x16000000U 124 - #define PCI_MASTER_IO_ADDRESS_MASK 0x7e000000U 125 - #define PCI_MASTER_IO_PCI_BASE_ADDRESS 0x00000000U 126 - 127 - #define PCI_MAILBOX_BASE_ADDRESS 0x00000000U 128 - 129 - #define PCI_TARGET_WINDOW1_BASE_ADDRESS 0x00000000U 130 - 131 - #define IO_PORT_BASE KSEG1ADDR(PCI_MASTER_IO_BUS_BASE_ADDRESS) 132 - #define IO_PORT_RESOURCE_START PCI_MASTER_IO_PCI_BASE_ADDRESS 133 - #define IO_PORT_RESOURCE_END (~PCI_MASTER_IO_ADDRESS_MASK & PCI_MASTER_ADDRESS_MASK) 134 - 135 - #define PCI_IO_RESOURCE_START 0x01000000UL 136 - #define PCI_IO_RESOURCE_END 0x01ffffffUL 137 - 138 - #define PCI_MEM_RESOURCE_START 0x11000000UL 139 - #define PCI_MEM_RESOURCE_END 0x13ffffffUL 140 - 141 - #endif /* __PCI_VR41XX_H */
-104
arch/mips/vr41xx/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - choice 3 - prompt "Machine type" 4 - depends on MACH_VR41XX 5 - default TANBAC_TB022X 6 - 7 - config CASIO_E55 8 - bool "CASIO CASSIOPEIA E-10/15/55/65" 9 - select CEVT_R4K 10 - select CSRC_R4K 11 - select DMA_NONCOHERENT 12 - select IRQ_MIPS_CPU 13 - select ISA 14 - select SYS_SUPPORTS_32BIT_KERNEL 15 - select SYS_SUPPORTS_LITTLE_ENDIAN 16 - 17 - config IBM_WORKPAD 18 - bool "IBM WorkPad z50" 19 - select CEVT_R4K 20 - select CSRC_R4K 21 - select DMA_NONCOHERENT 22 - select IRQ_MIPS_CPU 23 - select ISA 24 - select SYS_SUPPORTS_32BIT_KERNEL 25 - select SYS_SUPPORTS_LITTLE_ENDIAN 26 - 27 - config TANBAC_TB022X 28 - bool "TANBAC VR4131 multichip module and TANBAC VR4131DIMM" 29 - select CEVT_R4K 30 - select CSRC_R4K 31 - select DMA_NONCOHERENT 32 - select IRQ_MIPS_CPU 33 - select HAVE_PCI 34 - select SYS_SUPPORTS_32BIT_KERNEL 35 - select SYS_SUPPORTS_LITTLE_ENDIAN 36 - help 37 - The TANBAC VR4131 multichip module(TB0225) and 38 - the TANBAC VR4131DIMM(TB0229) are MIPS-based platforms 39 - manufactured by TANBAC. 40 - Please refer to <http://www.tanbac.co.jp/> 41 - about VR4131 multichip module and VR4131DIMM. 42 - 43 - config VICTOR_MPC30X 44 - bool "Victor MP-C303/304" 45 - select CEVT_R4K 46 - select CSRC_R4K 47 - select DMA_NONCOHERENT 48 - select IRQ_MIPS_CPU 49 - select HAVE_PCI 50 - select PCI_VR41XX 51 - select SYS_SUPPORTS_32BIT_KERNEL 52 - select SYS_SUPPORTS_LITTLE_ENDIAN 53 - 54 - config ZAO_CAPCELLA 55 - bool "ZAO Networks Capcella" 56 - select CEVT_R4K 57 - select CSRC_R4K 58 - select DMA_NONCOHERENT 59 - select IRQ_MIPS_CPU 60 - select HAVE_PCI 61 - select PCI_VR41XX 62 - select SYS_SUPPORTS_32BIT_KERNEL 63 - select SYS_SUPPORTS_LITTLE_ENDIAN 64 - 65 - endchoice 66 - 67 - choice 68 - prompt "Base board type" 69 - depends on TANBAC_TB022X 70 - default TANBAC_TB0287 71 - 72 - config TANBAC_TB0219 73 - bool "TANBAC DIMM Evaluation Kit(TB0219)" 74 - select GPIO_VR41XX 75 - select PCI_VR41XX 76 - help 77 - The TANBAC DIMM Evaluation Kit(TB0219) is a MIPS-based platform 78 - manufactured by TANBAC. 79 - Please refer to <http://www.tanbac.co.jp/> about DIMM Evaluation Kit. 80 - 81 - config TANBAC_TB0226 82 - bool "TANBAC Mbase(TB0226)" 83 - select GPIO_VR41XX 84 - select PCI_VR41XX 85 - help 86 - The TANBAC Mbase(TB0226) is a MIPS-based platform 87 - manufactured by TANBAC. 88 - Please refer to <http://www.tanbac.co.jp/> about Mbase. 89 - 90 - config TANBAC_TB0287 91 - bool "TANBAC Mini-ITX DIMM base(TB0287)" 92 - select PCI_VR41XX 93 - help 94 - The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform 95 - manufactured by TANBAC. 96 - Please refer to <http://www.tanbac.co.jp/> about Mini-ITX DIMM base. 97 - 98 - endchoice 99 - 100 - config PCI_VR41XX 101 - bool "Add PCI control unit support of NEC VR4100 series" 102 - depends on MACH_VR41XX && HAVE_PCI 103 - default y 104 - select PCI
-5
arch/mips/vr41xx/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - # 3 - obj-$(CONFIG_MACH_VR41XX) += common/ 4 - obj-$(CONFIG_CASIO_E55) += casio-e55/ 5 - obj-$(CONFIG_IBM_WORKPAD) += ibm-workpad/
-29
arch/mips/vr41xx/Platform
··· 1 - # 2 - # NEC VR4100 series based machines 3 - # 4 - cflags-$(CONFIG_MACH_VR41XX) += -I$(srctree)/arch/mips/include/asm/mach-vr41xx 5 - 6 - # 7 - # CASIO CASSIPEIA E-55/65 (VR4111) 8 - # 9 - load-$(CONFIG_CASIO_E55) += 0xffffffff80004000 10 - 11 - # 12 - # IBM WorkPad z50 (VR4121) 13 - # 14 - load-$(CONFIG_IBM_WORKPAD) += 0xffffffff80004000 15 - 16 - # 17 - # TANBAC VR4131 multichip module(TB0225) and TANBAC VR4131DIMM(TB0229) (VR4131) 18 - # 19 - load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000 20 - 21 - # 22 - # Victor MP-C303/304 (VR4122) 23 - # 24 - load-$(CONFIG_VICTOR_MPC30X) += 0xffffffff80001000 25 - 26 - # 27 - # ZAO Networks Capcella (VR4131) 28 - # 29 - load-$(CONFIG_ZAO_CAPCELLA) += 0xffffffff80000000
-6
arch/mips/vr41xx/casio-e55/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for the CASIO CASSIOPEIA E-55/65 specific parts of the kernel 4 - # 5 - 6 - obj-y += setup.o
-27
arch/mips/vr41xx/casio-e55/setup.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * setup.c, Setup for the CASIO CASSIOPEIA E-11/15/55/65. 4 - * 5 - * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/ioport.h> 9 - 10 - #include <asm/io.h> 11 - 12 - #define E55_ISA_IO_BASE 0x1400c000 13 - #define E55_ISA_IO_SIZE 0x03ff4000 14 - #define E55_ISA_IO_START 0 15 - #define E55_ISA_IO_END (E55_ISA_IO_SIZE - 1) 16 - #define E55_IO_PORT_BASE KSEG1ADDR(E55_ISA_IO_BASE) 17 - 18 - static int __init casio_e55_setup(void) 19 - { 20 - set_io_port_base(E55_IO_PORT_BASE); 21 - ioport_resource.start = E55_ISA_IO_START; 22 - ioport_resource.end = E55_ISA_IO_END; 23 - 24 - return 0; 25 - } 26 - 27 - arch_initcall(casio_e55_setup);
-6
arch/mips/vr41xx/common/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for common code of the NEC VR4100 series. 4 - # 5 - 6 - obj-y += bcu.o cmu.o giu.o icu.o init.o irq.o pmu.o rtc.o siu.o type.o
-210
arch/mips/vr41xx/common/bcu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * bcu.c, Bus Control Unit routines for the NEC VR4100 series. 4 - * 5 - * Copyright (C) 2002 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org> 8 - */ 9 - /* 10 - * Changes: 11 - * MontaVista Software Inc. <source@mvista.com> 12 - * - New creation, NEC VR4122 and VR4131 are supported. 13 - * - Added support for NEC VR4111 and VR4121. 14 - * 15 - * Yoichi Yuasa <yuasa@linux-mips.org> 16 - * - Added support for NEC VR4133. 17 - */ 18 - #include <linux/export.h> 19 - #include <linux/kernel.h> 20 - #include <linux/smp.h> 21 - #include <linux/types.h> 22 - 23 - #include <asm/cpu-type.h> 24 - #include <asm/cpu.h> 25 - #include <asm/io.h> 26 - 27 - #define CLKSPEEDREG_TYPE1 (void __iomem *)KSEG1ADDR(0x0b000014) 28 - #define CLKSPEEDREG_TYPE2 (void __iomem *)KSEG1ADDR(0x0f000014) 29 - #define CLKSP(x) ((x) & 0x001f) 30 - #define CLKSP_VR4133(x) ((x) & 0x0007) 31 - 32 - #define DIV2B 0x8000 33 - #define DIV3B 0x4000 34 - #define DIV4B 0x2000 35 - 36 - #define DIVT(x) (((x) & 0xf000) >> 12) 37 - #define DIVVT(x) (((x) & 0x0f00) >> 8) 38 - 39 - #define TDIVMODE(x) (2 << (((x) & 0x1000) >> 12)) 40 - #define VTDIVMODE(x) (((x) & 0x0700) >> 8) 41 - 42 - static unsigned long vr41xx_vtclock; 43 - static unsigned long vr41xx_tclock; 44 - 45 - unsigned long vr41xx_get_vtclock_frequency(void) 46 - { 47 - return vr41xx_vtclock; 48 - } 49 - 50 - EXPORT_SYMBOL_GPL(vr41xx_get_vtclock_frequency); 51 - 52 - unsigned long vr41xx_get_tclock_frequency(void) 53 - { 54 - return vr41xx_tclock; 55 - } 56 - 57 - EXPORT_SYMBOL_GPL(vr41xx_get_tclock_frequency); 58 - 59 - static inline uint16_t read_clkspeed(void) 60 - { 61 - switch (current_cpu_type()) { 62 - case CPU_VR4111: 63 - case CPU_VR4121: return readw(CLKSPEEDREG_TYPE1); 64 - case CPU_VR4122: 65 - case CPU_VR4131: 66 - case CPU_VR4133: return readw(CLKSPEEDREG_TYPE2); 67 - default: 68 - printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 69 - break; 70 - } 71 - 72 - return 0; 73 - } 74 - 75 - static inline unsigned long calculate_pclock(uint16_t clkspeed) 76 - { 77 - unsigned long pclock = 0; 78 - 79 - switch (current_cpu_type()) { 80 - case CPU_VR4111: 81 - case CPU_VR4121: 82 - pclock = 18432000 * 64; 83 - pclock /= CLKSP(clkspeed); 84 - break; 85 - case CPU_VR4122: 86 - pclock = 18432000 * 98; 87 - pclock /= CLKSP(clkspeed); 88 - break; 89 - case CPU_VR4131: 90 - pclock = 18432000 * 108; 91 - pclock /= CLKSP(clkspeed); 92 - break; 93 - case CPU_VR4133: 94 - switch (CLKSP_VR4133(clkspeed)) { 95 - case 0: 96 - pclock = 133000000; 97 - break; 98 - case 1: 99 - pclock = 149000000; 100 - break; 101 - case 2: 102 - pclock = 165900000; 103 - break; 104 - case 3: 105 - pclock = 199100000; 106 - break; 107 - case 4: 108 - pclock = 265900000; 109 - break; 110 - default: 111 - printk(KERN_INFO "Unknown PClock speed for NEC VR4133\n"); 112 - break; 113 - } 114 - break; 115 - default: 116 - printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 117 - break; 118 - } 119 - 120 - printk(KERN_INFO "PClock: %ldHz\n", pclock); 121 - 122 - return pclock; 123 - } 124 - 125 - static inline unsigned long calculate_vtclock(uint16_t clkspeed, unsigned long pclock) 126 - { 127 - unsigned long vtclock = 0; 128 - 129 - switch (current_cpu_type()) { 130 - case CPU_VR4111: 131 - /* The NEC VR4111 doesn't have the VTClock. */ 132 - break; 133 - case CPU_VR4121: 134 - vtclock = pclock; 135 - /* DIVVT == 9 Divide by 1.5 . VTClock = (PClock * 6) / 9 */ 136 - if (DIVVT(clkspeed) == 9) 137 - vtclock = pclock * 6; 138 - /* DIVVT == 10 Divide by 2.5 . VTClock = (PClock * 4) / 10 */ 139 - else if (DIVVT(clkspeed) == 10) 140 - vtclock = pclock * 4; 141 - vtclock /= DIVVT(clkspeed); 142 - printk(KERN_INFO "VTClock: %ldHz\n", vtclock); 143 - break; 144 - case CPU_VR4122: 145 - if(VTDIVMODE(clkspeed) == 7) 146 - vtclock = pclock / 1; 147 - else if(VTDIVMODE(clkspeed) == 1) 148 - vtclock = pclock / 2; 149 - else 150 - vtclock = pclock / VTDIVMODE(clkspeed); 151 - printk(KERN_INFO "VTClock: %ldHz\n", vtclock); 152 - break; 153 - case CPU_VR4131: 154 - case CPU_VR4133: 155 - vtclock = pclock / VTDIVMODE(clkspeed); 156 - printk(KERN_INFO "VTClock: %ldHz\n", vtclock); 157 - break; 158 - default: 159 - printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 160 - break; 161 - } 162 - 163 - return vtclock; 164 - } 165 - 166 - static inline unsigned long calculate_tclock(uint16_t clkspeed, unsigned long pclock, 167 - unsigned long vtclock) 168 - { 169 - unsigned long tclock = 0; 170 - 171 - switch (current_cpu_type()) { 172 - case CPU_VR4111: 173 - if (!(clkspeed & DIV2B)) 174 - tclock = pclock / 2; 175 - else if (!(clkspeed & DIV3B)) 176 - tclock = pclock / 3; 177 - else if (!(clkspeed & DIV4B)) 178 - tclock = pclock / 4; 179 - break; 180 - case CPU_VR4121: 181 - tclock = pclock / DIVT(clkspeed); 182 - break; 183 - case CPU_VR4122: 184 - case CPU_VR4131: 185 - case CPU_VR4133: 186 - tclock = vtclock / TDIVMODE(clkspeed); 187 - break; 188 - default: 189 - printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n"); 190 - break; 191 - } 192 - 193 - printk(KERN_INFO "TClock: %ldHz\n", tclock); 194 - 195 - return tclock; 196 - } 197 - 198 - void vr41xx_calculate_clock_frequency(void) 199 - { 200 - unsigned long pclock; 201 - uint16_t clkspeed; 202 - 203 - clkspeed = read_clkspeed(); 204 - 205 - pclock = calculate_pclock(clkspeed); 206 - vr41xx_vtclock = calculate_vtclock(clkspeed, pclock); 207 - vr41xx_tclock = calculate_tclock(clkspeed, pclock, vr41xx_vtclock); 208 - } 209 - 210 - EXPORT_SYMBOL_GPL(vr41xx_calculate_clock_frequency);
-242
arch/mips/vr41xx/common/cmu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * cmu.c, Clock Mask Unit routines for the NEC VR4100 series. 4 - * 5 - * Copyright (C) 2001-2002 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2003-2005 Yoichi Yuasa <yuasa@linux-mips.org> 8 - */ 9 - /* 10 - * Changes: 11 - * MontaVista Software Inc. <source@mvista.com> 12 - * - New creation, NEC VR4122 and VR4131 are supported. 13 - * - Added support for NEC VR4111 and VR4121. 14 - * 15 - * Yoichi Yuasa <yuasa@linux-mips.org> 16 - * - Added support for NEC VR4133. 17 - */ 18 - #include <linux/export.h> 19 - #include <linux/init.h> 20 - #include <linux/ioport.h> 21 - #include <linux/smp.h> 22 - #include <linux/spinlock.h> 23 - #include <linux/types.h> 24 - 25 - #include <asm/cpu.h> 26 - #include <asm/io.h> 27 - #include <asm/vr41xx/vr41xx.h> 28 - 29 - #define CMU_TYPE1_BASE 0x0b000060UL 30 - #define CMU_TYPE1_SIZE 0x4 31 - 32 - #define CMU_TYPE2_BASE 0x0f000060UL 33 - #define CMU_TYPE2_SIZE 0x4 34 - 35 - #define CMU_TYPE3_BASE 0x0f000060UL 36 - #define CMU_TYPE3_SIZE 0x8 37 - 38 - #define CMUCLKMSK 0x0 39 - #define MSKPIU 0x0001 40 - #define MSKSIU 0x0002 41 - #define MSKAIU 0x0004 42 - #define MSKKIU 0x0008 43 - #define MSKFIR 0x0010 44 - #define MSKDSIU 0x0820 45 - #define MSKCSI 0x0040 46 - #define MSKPCIU 0x0080 47 - #define MSKSSIU 0x0100 48 - #define MSKSHSP 0x0200 49 - #define MSKFFIR 0x0400 50 - #define MSKSCSI 0x1000 51 - #define MSKPPCIU 0x2000 52 - #define CMUCLKMSK2 0x4 53 - #define MSKCEU 0x0001 54 - #define MSKMAC0 0x0002 55 - #define MSKMAC1 0x0004 56 - 57 - static void __iomem *cmu_base; 58 - static uint16_t cmuclkmsk, cmuclkmsk2; 59 - static DEFINE_SPINLOCK(cmu_lock); 60 - 61 - #define cmu_read(offset) readw(cmu_base + (offset)) 62 - #define cmu_write(offset, value) writew((value), cmu_base + (offset)) 63 - 64 - void vr41xx_supply_clock(vr41xx_clock_t clock) 65 - { 66 - spin_lock_irq(&cmu_lock); 67 - 68 - switch (clock) { 69 - case PIU_CLOCK: 70 - cmuclkmsk |= MSKPIU; 71 - break; 72 - case SIU_CLOCK: 73 - cmuclkmsk |= MSKSIU | MSKSSIU; 74 - break; 75 - case AIU_CLOCK: 76 - cmuclkmsk |= MSKAIU; 77 - break; 78 - case KIU_CLOCK: 79 - cmuclkmsk |= MSKKIU; 80 - break; 81 - case FIR_CLOCK: 82 - cmuclkmsk |= MSKFIR | MSKFFIR; 83 - break; 84 - case DSIU_CLOCK: 85 - if (current_cpu_type() == CPU_VR4111 || 86 - current_cpu_type() == CPU_VR4121) 87 - cmuclkmsk |= MSKDSIU; 88 - else 89 - cmuclkmsk |= MSKSIU | MSKDSIU; 90 - break; 91 - case CSI_CLOCK: 92 - cmuclkmsk |= MSKCSI | MSKSCSI; 93 - break; 94 - case PCIU_CLOCK: 95 - cmuclkmsk |= MSKPCIU; 96 - break; 97 - case HSP_CLOCK: 98 - cmuclkmsk |= MSKSHSP; 99 - break; 100 - case PCI_CLOCK: 101 - cmuclkmsk |= MSKPPCIU; 102 - break; 103 - case CEU_CLOCK: 104 - cmuclkmsk2 |= MSKCEU; 105 - break; 106 - case ETHER0_CLOCK: 107 - cmuclkmsk2 |= MSKMAC0; 108 - break; 109 - case ETHER1_CLOCK: 110 - cmuclkmsk2 |= MSKMAC1; 111 - break; 112 - default: 113 - break; 114 - } 115 - 116 - if (clock == CEU_CLOCK || clock == ETHER0_CLOCK || 117 - clock == ETHER1_CLOCK) 118 - cmu_write(CMUCLKMSK2, cmuclkmsk2); 119 - else 120 - cmu_write(CMUCLKMSK, cmuclkmsk); 121 - 122 - spin_unlock_irq(&cmu_lock); 123 - } 124 - 125 - EXPORT_SYMBOL_GPL(vr41xx_supply_clock); 126 - 127 - void vr41xx_mask_clock(vr41xx_clock_t clock) 128 - { 129 - spin_lock_irq(&cmu_lock); 130 - 131 - switch (clock) { 132 - case PIU_CLOCK: 133 - cmuclkmsk &= ~MSKPIU; 134 - break; 135 - case SIU_CLOCK: 136 - if (current_cpu_type() == CPU_VR4111 || 137 - current_cpu_type() == CPU_VR4121) { 138 - cmuclkmsk &= ~(MSKSIU | MSKSSIU); 139 - } else { 140 - if (cmuclkmsk & MSKDSIU) 141 - cmuclkmsk &= ~MSKSSIU; 142 - else 143 - cmuclkmsk &= ~(MSKSIU | MSKSSIU); 144 - } 145 - break; 146 - case AIU_CLOCK: 147 - cmuclkmsk &= ~MSKAIU; 148 - break; 149 - case KIU_CLOCK: 150 - cmuclkmsk &= ~MSKKIU; 151 - break; 152 - case FIR_CLOCK: 153 - cmuclkmsk &= ~(MSKFIR | MSKFFIR); 154 - break; 155 - case DSIU_CLOCK: 156 - if (current_cpu_type() == CPU_VR4111 || 157 - current_cpu_type() == CPU_VR4121) { 158 - cmuclkmsk &= ~MSKDSIU; 159 - } else { 160 - if (cmuclkmsk & MSKSSIU) 161 - cmuclkmsk &= ~MSKDSIU; 162 - else 163 - cmuclkmsk &= ~(MSKSIU | MSKDSIU); 164 - } 165 - break; 166 - case CSI_CLOCK: 167 - cmuclkmsk &= ~(MSKCSI | MSKSCSI); 168 - break; 169 - case PCIU_CLOCK: 170 - cmuclkmsk &= ~MSKPCIU; 171 - break; 172 - case HSP_CLOCK: 173 - cmuclkmsk &= ~MSKSHSP; 174 - break; 175 - case PCI_CLOCK: 176 - cmuclkmsk &= ~MSKPPCIU; 177 - break; 178 - case CEU_CLOCK: 179 - cmuclkmsk2 &= ~MSKCEU; 180 - break; 181 - case ETHER0_CLOCK: 182 - cmuclkmsk2 &= ~MSKMAC0; 183 - break; 184 - case ETHER1_CLOCK: 185 - cmuclkmsk2 &= ~MSKMAC1; 186 - break; 187 - default: 188 - break; 189 - } 190 - 191 - if (clock == CEU_CLOCK || clock == ETHER0_CLOCK || 192 - clock == ETHER1_CLOCK) 193 - cmu_write(CMUCLKMSK2, cmuclkmsk2); 194 - else 195 - cmu_write(CMUCLKMSK, cmuclkmsk); 196 - 197 - spin_unlock_irq(&cmu_lock); 198 - } 199 - 200 - EXPORT_SYMBOL_GPL(vr41xx_mask_clock); 201 - 202 - static int __init vr41xx_cmu_init(void) 203 - { 204 - unsigned long start, size; 205 - 206 - switch (current_cpu_type()) { 207 - case CPU_VR4111: 208 - case CPU_VR4121: 209 - start = CMU_TYPE1_BASE; 210 - size = CMU_TYPE1_SIZE; 211 - break; 212 - case CPU_VR4122: 213 - case CPU_VR4131: 214 - start = CMU_TYPE2_BASE; 215 - size = CMU_TYPE2_SIZE; 216 - break; 217 - case CPU_VR4133: 218 - start = CMU_TYPE3_BASE; 219 - size = CMU_TYPE3_SIZE; 220 - break; 221 - default: 222 - panic("Unexpected CPU of NEC VR4100 series"); 223 - break; 224 - } 225 - 226 - if (request_mem_region(start, size, "CMU") == NULL) 227 - return -EBUSY; 228 - 229 - cmu_base = ioremap(start, size); 230 - if (cmu_base == NULL) { 231 - release_mem_region(start, size); 232 - return -EBUSY; 233 - } 234 - 235 - cmuclkmsk = cmu_read(CMUCLKMSK); 236 - if (current_cpu_type() == CPU_VR4133) 237 - cmuclkmsk2 = cmu_read(CMUCLKMSK2); 238 - 239 - return 0; 240 - } 241 - 242 - core_initcall(vr41xx_cmu_init);
-110
arch/mips/vr41xx/common/giu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * NEC VR4100 series GIU platform device. 4 - * 5 - * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/errno.h> 8 - #include <linux/init.h> 9 - #include <linux/smp.h> 10 - #include <linux/ioport.h> 11 - #include <linux/platform_device.h> 12 - 13 - #include <asm/cpu.h> 14 - #include <asm/vr41xx/giu.h> 15 - #include <asm/vr41xx/irq.h> 16 - 17 - static struct resource giu_50pins_pullupdown_resource[] __initdata = { 18 - { 19 - .start = 0x0b000100, 20 - .end = 0x0b00011f, 21 - .flags = IORESOURCE_MEM, 22 - }, 23 - { 24 - .start = 0x0b0002e0, 25 - .end = 0x0b0002e3, 26 - .flags = IORESOURCE_MEM, 27 - }, 28 - { 29 - .start = GIUINT_IRQ, 30 - .end = GIUINT_IRQ, 31 - .flags = IORESOURCE_IRQ, 32 - }, 33 - }; 34 - 35 - static struct resource giu_36pins_resource[] __initdata = { 36 - { 37 - .start = 0x0f000140, 38 - .end = 0x0f00015f, 39 - .flags = IORESOURCE_MEM, 40 - }, 41 - { 42 - .start = GIUINT_IRQ, 43 - .end = GIUINT_IRQ, 44 - .flags = IORESOURCE_IRQ, 45 - }, 46 - }; 47 - 48 - static struct resource giu_48pins_resource[] __initdata = { 49 - { 50 - .start = 0x0f000140, 51 - .end = 0x0f000167, 52 - .flags = IORESOURCE_MEM, 53 - }, 54 - { 55 - .start = GIUINT_IRQ, 56 - .end = GIUINT_IRQ, 57 - .flags = IORESOURCE_IRQ, 58 - }, 59 - }; 60 - 61 - static int __init vr41xx_giu_add(void) 62 - { 63 - struct platform_device *pdev; 64 - struct resource *res; 65 - unsigned int num; 66 - int retval; 67 - 68 - pdev = platform_device_alloc("GIU", -1); 69 - if (!pdev) 70 - return -ENOMEM; 71 - 72 - switch (current_cpu_type()) { 73 - case CPU_VR4111: 74 - case CPU_VR4121: 75 - pdev->id = GPIO_50PINS_PULLUPDOWN; 76 - res = giu_50pins_pullupdown_resource; 77 - num = ARRAY_SIZE(giu_50pins_pullupdown_resource); 78 - break; 79 - case CPU_VR4122: 80 - case CPU_VR4131: 81 - pdev->id = GPIO_36PINS; 82 - res = giu_36pins_resource; 83 - num = ARRAY_SIZE(giu_36pins_resource); 84 - break; 85 - case CPU_VR4133: 86 - pdev->id = GPIO_48PINS_EDGE_SELECT; 87 - res = giu_48pins_resource; 88 - num = ARRAY_SIZE(giu_48pins_resource); 89 - break; 90 - default: 91 - retval = -ENODEV; 92 - goto err_free_device; 93 - } 94 - 95 - retval = platform_device_add_resources(pdev, res, num); 96 - if (retval) 97 - goto err_free_device; 98 - 99 - retval = platform_device_add(pdev); 100 - if (retval) 101 - goto err_free_device; 102 - 103 - return 0; 104 - 105 - err_free_device: 106 - platform_device_put(pdev); 107 - 108 - return retval; 109 - } 110 - device_initcall(vr41xx_giu_add);
-714
arch/mips/vr41xx/common/icu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * icu.c, Interrupt Control Unit routines for the NEC VR4100 series. 4 - * 5 - * Copyright (C) 2001-2002 MontaVista Software Inc. 6 - * Author: Yoichi Yuasa <source@mvista.com> 7 - * Copyright (C) 2003-2006 Yoichi Yuasa <yuasa@linux-mips.org> 8 - */ 9 - /* 10 - * Changes: 11 - * MontaVista Software Inc. <source@mvista.com> 12 - * - New creation, NEC VR4122 and VR4131 are supported. 13 - * - Added support for NEC VR4111 and VR4121. 14 - * 15 - * Yoichi Yuasa <yuasa@linux-mips.org> 16 - * - Coped with INTASSIGN of NEC VR4133. 17 - */ 18 - #include <linux/errno.h> 19 - #include <linux/export.h> 20 - #include <linux/init.h> 21 - #include <linux/ioport.h> 22 - #include <linux/irq.h> 23 - #include <linux/smp.h> 24 - #include <linux/types.h> 25 - 26 - #include <asm/cpu.h> 27 - #include <asm/io.h> 28 - #include <asm/vr41xx/irq.h> 29 - #include <asm/vr41xx/vr41xx.h> 30 - 31 - static void __iomem *icu1_base; 32 - static void __iomem *icu2_base; 33 - 34 - static unsigned char sysint1_assign[16] = { 35 - 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 36 - static unsigned char sysint2_assign[16] = { 37 - 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; 38 - 39 - #define ICU1_TYPE1_BASE 0x0b000080UL 40 - #define ICU2_TYPE1_BASE 0x0b000200UL 41 - 42 - #define ICU1_TYPE2_BASE 0x0f000080UL 43 - #define ICU2_TYPE2_BASE 0x0f0000a0UL 44 - 45 - #define ICU1_SIZE 0x20 46 - #define ICU2_SIZE 0x1c 47 - 48 - #define SYSINT1REG 0x00 49 - #define PIUINTREG 0x02 50 - #define INTASSIGN0 0x04 51 - #define INTASSIGN1 0x06 52 - #define GIUINTLREG 0x08 53 - #define DSIUINTREG 0x0a 54 - #define MSYSINT1REG 0x0c 55 - #define MPIUINTREG 0x0e 56 - #define MAIUINTREG 0x10 57 - #define MKIUINTREG 0x12 58 - #define MMACINTREG 0x12 59 - #define MGIUINTLREG 0x14 60 - #define MDSIUINTREG 0x16 61 - #define NMIREG 0x18 62 - #define SOFTREG 0x1a 63 - #define INTASSIGN2 0x1c 64 - #define INTASSIGN3 0x1e 65 - 66 - #define SYSINT2REG 0x00 67 - #define GIUINTHREG 0x02 68 - #define FIRINTREG 0x04 69 - #define MSYSINT2REG 0x06 70 - #define MGIUINTHREG 0x08 71 - #define MFIRINTREG 0x0a 72 - #define PCIINTREG 0x0c 73 - #define PCIINT0 0x0001 74 - #define SCUINTREG 0x0e 75 - #define SCUINT0 0x0001 76 - #define CSIINTREG 0x10 77 - #define MPCIINTREG 0x12 78 - #define MSCUINTREG 0x14 79 - #define MCSIINTREG 0x16 80 - #define BCUINTREG 0x18 81 - #define BCUINTR 0x0001 82 - #define MBCUINTREG 0x1a 83 - 84 - #define SYSINT1_IRQ_TO_PIN(x) ((x) - SYSINT1_IRQ_BASE) /* Pin 0-15 */ 85 - #define SYSINT2_IRQ_TO_PIN(x) ((x) - SYSINT2_IRQ_BASE) /* Pin 0-15 */ 86 - 87 - #define INT_TO_IRQ(x) ((x) + 2) /* Int0-4 -> IRQ2-6 */ 88 - 89 - #define icu1_read(offset) readw(icu1_base + (offset)) 90 - #define icu1_write(offset, value) writew((value), icu1_base + (offset)) 91 - 92 - #define icu2_read(offset) readw(icu2_base + (offset)) 93 - #define icu2_write(offset, value) writew((value), icu2_base + (offset)) 94 - 95 - #define INTASSIGN_MAX 4 96 - #define INTASSIGN_MASK 0x0007 97 - 98 - static inline uint16_t icu1_set(uint8_t offset, uint16_t set) 99 - { 100 - uint16_t data; 101 - 102 - data = icu1_read(offset); 103 - data |= set; 104 - icu1_write(offset, data); 105 - 106 - return data; 107 - } 108 - 109 - static inline uint16_t icu1_clear(uint8_t offset, uint16_t clear) 110 - { 111 - uint16_t data; 112 - 113 - data = icu1_read(offset); 114 - data &= ~clear; 115 - icu1_write(offset, data); 116 - 117 - return data; 118 - } 119 - 120 - static inline uint16_t icu2_set(uint8_t offset, uint16_t set) 121 - { 122 - uint16_t data; 123 - 124 - data = icu2_read(offset); 125 - data |= set; 126 - icu2_write(offset, data); 127 - 128 - return data; 129 - } 130 - 131 - static inline uint16_t icu2_clear(uint8_t offset, uint16_t clear) 132 - { 133 - uint16_t data; 134 - 135 - data = icu2_read(offset); 136 - data &= ~clear; 137 - icu2_write(offset, data); 138 - 139 - return data; 140 - } 141 - 142 - void vr41xx_enable_piuint(uint16_t mask) 143 - { 144 - struct irq_desc *desc = irq_to_desc(PIU_IRQ); 145 - unsigned long flags; 146 - 147 - if (current_cpu_type() == CPU_VR4111 || 148 - current_cpu_type() == CPU_VR4121) { 149 - raw_spin_lock_irqsave(&desc->lock, flags); 150 - icu1_set(MPIUINTREG, mask); 151 - raw_spin_unlock_irqrestore(&desc->lock, flags); 152 - } 153 - } 154 - 155 - EXPORT_SYMBOL(vr41xx_enable_piuint); 156 - 157 - void vr41xx_disable_piuint(uint16_t mask) 158 - { 159 - struct irq_desc *desc = irq_to_desc(PIU_IRQ); 160 - unsigned long flags; 161 - 162 - if (current_cpu_type() == CPU_VR4111 || 163 - current_cpu_type() == CPU_VR4121) { 164 - raw_spin_lock_irqsave(&desc->lock, flags); 165 - icu1_clear(MPIUINTREG, mask); 166 - raw_spin_unlock_irqrestore(&desc->lock, flags); 167 - } 168 - } 169 - 170 - EXPORT_SYMBOL(vr41xx_disable_piuint); 171 - 172 - void vr41xx_enable_aiuint(uint16_t mask) 173 - { 174 - struct irq_desc *desc = irq_to_desc(AIU_IRQ); 175 - unsigned long flags; 176 - 177 - if (current_cpu_type() == CPU_VR4111 || 178 - current_cpu_type() == CPU_VR4121) { 179 - raw_spin_lock_irqsave(&desc->lock, flags); 180 - icu1_set(MAIUINTREG, mask); 181 - raw_spin_unlock_irqrestore(&desc->lock, flags); 182 - } 183 - } 184 - 185 - EXPORT_SYMBOL(vr41xx_enable_aiuint); 186 - 187 - void vr41xx_disable_aiuint(uint16_t mask) 188 - { 189 - struct irq_desc *desc = irq_to_desc(AIU_IRQ); 190 - unsigned long flags; 191 - 192 - if (current_cpu_type() == CPU_VR4111 || 193 - current_cpu_type() == CPU_VR4121) { 194 - raw_spin_lock_irqsave(&desc->lock, flags); 195 - icu1_clear(MAIUINTREG, mask); 196 - raw_spin_unlock_irqrestore(&desc->lock, flags); 197 - } 198 - } 199 - 200 - EXPORT_SYMBOL(vr41xx_disable_aiuint); 201 - 202 - void vr41xx_enable_kiuint(uint16_t mask) 203 - { 204 - struct irq_desc *desc = irq_to_desc(KIU_IRQ); 205 - unsigned long flags; 206 - 207 - if (current_cpu_type() == CPU_VR4111 || 208 - current_cpu_type() == CPU_VR4121) { 209 - raw_spin_lock_irqsave(&desc->lock, flags); 210 - icu1_set(MKIUINTREG, mask); 211 - raw_spin_unlock_irqrestore(&desc->lock, flags); 212 - } 213 - } 214 - 215 - EXPORT_SYMBOL(vr41xx_enable_kiuint); 216 - 217 - void vr41xx_disable_kiuint(uint16_t mask) 218 - { 219 - struct irq_desc *desc = irq_to_desc(KIU_IRQ); 220 - unsigned long flags; 221 - 222 - if (current_cpu_type() == CPU_VR4111 || 223 - current_cpu_type() == CPU_VR4121) { 224 - raw_spin_lock_irqsave(&desc->lock, flags); 225 - icu1_clear(MKIUINTREG, mask); 226 - raw_spin_unlock_irqrestore(&desc->lock, flags); 227 - } 228 - } 229 - 230 - EXPORT_SYMBOL(vr41xx_disable_kiuint); 231 - 232 - void vr41xx_enable_macint(uint16_t mask) 233 - { 234 - struct irq_desc *desc = irq_to_desc(ETHERNET_IRQ); 235 - unsigned long flags; 236 - 237 - raw_spin_lock_irqsave(&desc->lock, flags); 238 - icu1_set(MMACINTREG, mask); 239 - raw_spin_unlock_irqrestore(&desc->lock, flags); 240 - } 241 - 242 - EXPORT_SYMBOL(vr41xx_enable_macint); 243 - 244 - void vr41xx_disable_macint(uint16_t mask) 245 - { 246 - struct irq_desc *desc = irq_to_desc(ETHERNET_IRQ); 247 - unsigned long flags; 248 - 249 - raw_spin_lock_irqsave(&desc->lock, flags); 250 - icu1_clear(MMACINTREG, mask); 251 - raw_spin_unlock_irqrestore(&desc->lock, flags); 252 - } 253 - 254 - EXPORT_SYMBOL(vr41xx_disable_macint); 255 - 256 - void vr41xx_enable_dsiuint(uint16_t mask) 257 - { 258 - struct irq_desc *desc = irq_to_desc(DSIU_IRQ); 259 - unsigned long flags; 260 - 261 - raw_spin_lock_irqsave(&desc->lock, flags); 262 - icu1_set(MDSIUINTREG, mask); 263 - raw_spin_unlock_irqrestore(&desc->lock, flags); 264 - } 265 - 266 - EXPORT_SYMBOL(vr41xx_enable_dsiuint); 267 - 268 - void vr41xx_disable_dsiuint(uint16_t mask) 269 - { 270 - struct irq_desc *desc = irq_to_desc(DSIU_IRQ); 271 - unsigned long flags; 272 - 273 - raw_spin_lock_irqsave(&desc->lock, flags); 274 - icu1_clear(MDSIUINTREG, mask); 275 - raw_spin_unlock_irqrestore(&desc->lock, flags); 276 - } 277 - 278 - EXPORT_SYMBOL(vr41xx_disable_dsiuint); 279 - 280 - void vr41xx_enable_firint(uint16_t mask) 281 - { 282 - struct irq_desc *desc = irq_to_desc(FIR_IRQ); 283 - unsigned long flags; 284 - 285 - raw_spin_lock_irqsave(&desc->lock, flags); 286 - icu2_set(MFIRINTREG, mask); 287 - raw_spin_unlock_irqrestore(&desc->lock, flags); 288 - } 289 - 290 - EXPORT_SYMBOL(vr41xx_enable_firint); 291 - 292 - void vr41xx_disable_firint(uint16_t mask) 293 - { 294 - struct irq_desc *desc = irq_to_desc(FIR_IRQ); 295 - unsigned long flags; 296 - 297 - raw_spin_lock_irqsave(&desc->lock, flags); 298 - icu2_clear(MFIRINTREG, mask); 299 - raw_spin_unlock_irqrestore(&desc->lock, flags); 300 - } 301 - 302 - EXPORT_SYMBOL(vr41xx_disable_firint); 303 - 304 - void vr41xx_enable_pciint(void) 305 - { 306 - struct irq_desc *desc = irq_to_desc(PCI_IRQ); 307 - unsigned long flags; 308 - 309 - if (current_cpu_type() == CPU_VR4122 || 310 - current_cpu_type() == CPU_VR4131 || 311 - current_cpu_type() == CPU_VR4133) { 312 - raw_spin_lock_irqsave(&desc->lock, flags); 313 - icu2_write(MPCIINTREG, PCIINT0); 314 - raw_spin_unlock_irqrestore(&desc->lock, flags); 315 - } 316 - } 317 - 318 - EXPORT_SYMBOL(vr41xx_enable_pciint); 319 - 320 - void vr41xx_disable_pciint(void) 321 - { 322 - struct irq_desc *desc = irq_to_desc(PCI_IRQ); 323 - unsigned long flags; 324 - 325 - if (current_cpu_type() == CPU_VR4122 || 326 - current_cpu_type() == CPU_VR4131 || 327 - current_cpu_type() == CPU_VR4133) { 328 - raw_spin_lock_irqsave(&desc->lock, flags); 329 - icu2_write(MPCIINTREG, 0); 330 - raw_spin_unlock_irqrestore(&desc->lock, flags); 331 - } 332 - } 333 - 334 - EXPORT_SYMBOL(vr41xx_disable_pciint); 335 - 336 - void vr41xx_enable_scuint(void) 337 - { 338 - struct irq_desc *desc = irq_to_desc(SCU_IRQ); 339 - unsigned long flags; 340 - 341 - if (current_cpu_type() == CPU_VR4122 || 342 - current_cpu_type() == CPU_VR4131 || 343 - current_cpu_type() == CPU_VR4133) { 344 - raw_spin_lock_irqsave(&desc->lock, flags); 345 - icu2_write(MSCUINTREG, SCUINT0); 346 - raw_spin_unlock_irqrestore(&desc->lock, flags); 347 - } 348 - } 349 - 350 - EXPORT_SYMBOL(vr41xx_enable_scuint); 351 - 352 - void vr41xx_disable_scuint(void) 353 - { 354 - struct irq_desc *desc = irq_to_desc(SCU_IRQ); 355 - unsigned long flags; 356 - 357 - if (current_cpu_type() == CPU_VR4122 || 358 - current_cpu_type() == CPU_VR4131 || 359 - current_cpu_type() == CPU_VR4133) { 360 - raw_spin_lock_irqsave(&desc->lock, flags); 361 - icu2_write(MSCUINTREG, 0); 362 - raw_spin_unlock_irqrestore(&desc->lock, flags); 363 - } 364 - } 365 - 366 - EXPORT_SYMBOL(vr41xx_disable_scuint); 367 - 368 - void vr41xx_enable_csiint(uint16_t mask) 369 - { 370 - struct irq_desc *desc = irq_to_desc(CSI_IRQ); 371 - unsigned long flags; 372 - 373 - if (current_cpu_type() == CPU_VR4122 || 374 - current_cpu_type() == CPU_VR4131 || 375 - current_cpu_type() == CPU_VR4133) { 376 - raw_spin_lock_irqsave(&desc->lock, flags); 377 - icu2_set(MCSIINTREG, mask); 378 - raw_spin_unlock_irqrestore(&desc->lock, flags); 379 - } 380 - } 381 - 382 - EXPORT_SYMBOL(vr41xx_enable_csiint); 383 - 384 - void vr41xx_disable_csiint(uint16_t mask) 385 - { 386 - struct irq_desc *desc = irq_to_desc(CSI_IRQ); 387 - unsigned long flags; 388 - 389 - if (current_cpu_type() == CPU_VR4122 || 390 - current_cpu_type() == CPU_VR4131 || 391 - current_cpu_type() == CPU_VR4133) { 392 - raw_spin_lock_irqsave(&desc->lock, flags); 393 - icu2_clear(MCSIINTREG, mask); 394 - raw_spin_unlock_irqrestore(&desc->lock, flags); 395 - } 396 - } 397 - 398 - EXPORT_SYMBOL(vr41xx_disable_csiint); 399 - 400 - void vr41xx_enable_bcuint(void) 401 - { 402 - struct irq_desc *desc = irq_to_desc(BCU_IRQ); 403 - unsigned long flags; 404 - 405 - if (current_cpu_type() == CPU_VR4122 || 406 - current_cpu_type() == CPU_VR4131 || 407 - current_cpu_type() == CPU_VR4133) { 408 - raw_spin_lock_irqsave(&desc->lock, flags); 409 - icu2_write(MBCUINTREG, BCUINTR); 410 - raw_spin_unlock_irqrestore(&desc->lock, flags); 411 - } 412 - } 413 - 414 - EXPORT_SYMBOL(vr41xx_enable_bcuint); 415 - 416 - void vr41xx_disable_bcuint(void) 417 - { 418 - struct irq_desc *desc = irq_to_desc(BCU_IRQ); 419 - unsigned long flags; 420 - 421 - if (current_cpu_type() == CPU_VR4122 || 422 - current_cpu_type() == CPU_VR4131 || 423 - current_cpu_type() == CPU_VR4133) { 424 - raw_spin_lock_irqsave(&desc->lock, flags); 425 - icu2_write(MBCUINTREG, 0); 426 - raw_spin_unlock_irqrestore(&desc->lock, flags); 427 - } 428 - } 429 - 430 - EXPORT_SYMBOL(vr41xx_disable_bcuint); 431 - 432 - static void disable_sysint1_irq(struct irq_data *d) 433 - { 434 - icu1_clear(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(d->irq)); 435 - } 436 - 437 - static void enable_sysint1_irq(struct irq_data *d) 438 - { 439 - icu1_set(MSYSINT1REG, 1 << SYSINT1_IRQ_TO_PIN(d->irq)); 440 - } 441 - 442 - static struct irq_chip sysint1_irq_type = { 443 - .name = "SYSINT1", 444 - .irq_mask = disable_sysint1_irq, 445 - .irq_unmask = enable_sysint1_irq, 446 - }; 447 - 448 - static void disable_sysint2_irq(struct irq_data *d) 449 - { 450 - icu2_clear(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(d->irq)); 451 - } 452 - 453 - static void enable_sysint2_irq(struct irq_data *d) 454 - { 455 - icu2_set(MSYSINT2REG, 1 << SYSINT2_IRQ_TO_PIN(d->irq)); 456 - } 457 - 458 - static struct irq_chip sysint2_irq_type = { 459 - .name = "SYSINT2", 460 - .irq_mask = disable_sysint2_irq, 461 - .irq_unmask = enable_sysint2_irq, 462 - }; 463 - 464 - static inline int set_sysint1_assign(unsigned int irq, unsigned char assign) 465 - { 466 - struct irq_desc *desc = irq_to_desc(irq); 467 - uint16_t intassign0, intassign1; 468 - unsigned int pin; 469 - 470 - pin = SYSINT1_IRQ_TO_PIN(irq); 471 - 472 - raw_spin_lock_irq(&desc->lock); 473 - 474 - intassign0 = icu1_read(INTASSIGN0); 475 - intassign1 = icu1_read(INTASSIGN1); 476 - 477 - switch (pin) { 478 - case 0: 479 - intassign0 &= ~INTASSIGN_MASK; 480 - intassign0 |= (uint16_t)assign; 481 - break; 482 - case 1: 483 - intassign0 &= ~(INTASSIGN_MASK << 3); 484 - intassign0 |= (uint16_t)assign << 3; 485 - break; 486 - case 2: 487 - intassign0 &= ~(INTASSIGN_MASK << 6); 488 - intassign0 |= (uint16_t)assign << 6; 489 - break; 490 - case 3: 491 - intassign0 &= ~(INTASSIGN_MASK << 9); 492 - intassign0 |= (uint16_t)assign << 9; 493 - break; 494 - case 8: 495 - intassign0 &= ~(INTASSIGN_MASK << 12); 496 - intassign0 |= (uint16_t)assign << 12; 497 - break; 498 - case 9: 499 - intassign1 &= ~INTASSIGN_MASK; 500 - intassign1 |= (uint16_t)assign; 501 - break; 502 - case 11: 503 - intassign1 &= ~(INTASSIGN_MASK << 6); 504 - intassign1 |= (uint16_t)assign << 6; 505 - break; 506 - case 12: 507 - intassign1 &= ~(INTASSIGN_MASK << 9); 508 - intassign1 |= (uint16_t)assign << 9; 509 - break; 510 - default: 511 - raw_spin_unlock_irq(&desc->lock); 512 - return -EINVAL; 513 - } 514 - 515 - sysint1_assign[pin] = assign; 516 - icu1_write(INTASSIGN0, intassign0); 517 - icu1_write(INTASSIGN1, intassign1); 518 - 519 - raw_spin_unlock_irq(&desc->lock); 520 - 521 - return 0; 522 - } 523 - 524 - static inline int set_sysint2_assign(unsigned int irq, unsigned char assign) 525 - { 526 - struct irq_desc *desc = irq_to_desc(irq); 527 - uint16_t intassign2, intassign3; 528 - unsigned int pin; 529 - 530 - pin = SYSINT2_IRQ_TO_PIN(irq); 531 - 532 - raw_spin_lock_irq(&desc->lock); 533 - 534 - intassign2 = icu1_read(INTASSIGN2); 535 - intassign3 = icu1_read(INTASSIGN3); 536 - 537 - switch (pin) { 538 - case 0: 539 - intassign2 &= ~INTASSIGN_MASK; 540 - intassign2 |= (uint16_t)assign; 541 - break; 542 - case 1: 543 - intassign2 &= ~(INTASSIGN_MASK << 3); 544 - intassign2 |= (uint16_t)assign << 3; 545 - break; 546 - case 3: 547 - intassign2 &= ~(INTASSIGN_MASK << 6); 548 - intassign2 |= (uint16_t)assign << 6; 549 - break; 550 - case 4: 551 - intassign2 &= ~(INTASSIGN_MASK << 9); 552 - intassign2 |= (uint16_t)assign << 9; 553 - break; 554 - case 5: 555 - intassign2 &= ~(INTASSIGN_MASK << 12); 556 - intassign2 |= (uint16_t)assign << 12; 557 - break; 558 - case 6: 559 - intassign3 &= ~INTASSIGN_MASK; 560 - intassign3 |= (uint16_t)assign; 561 - break; 562 - case 7: 563 - intassign3 &= ~(INTASSIGN_MASK << 3); 564 - intassign3 |= (uint16_t)assign << 3; 565 - break; 566 - case 8: 567 - intassign3 &= ~(INTASSIGN_MASK << 6); 568 - intassign3 |= (uint16_t)assign << 6; 569 - break; 570 - case 9: 571 - intassign3 &= ~(INTASSIGN_MASK << 9); 572 - intassign3 |= (uint16_t)assign << 9; 573 - break; 574 - case 10: 575 - intassign3 &= ~(INTASSIGN_MASK << 12); 576 - intassign3 |= (uint16_t)assign << 12; 577 - break; 578 - default: 579 - raw_spin_unlock_irq(&desc->lock); 580 - return -EINVAL; 581 - } 582 - 583 - sysint2_assign[pin] = assign; 584 - icu1_write(INTASSIGN2, intassign2); 585 - icu1_write(INTASSIGN3, intassign3); 586 - 587 - raw_spin_unlock_irq(&desc->lock); 588 - 589 - return 0; 590 - } 591 - 592 - int vr41xx_set_intassign(unsigned int irq, unsigned char intassign) 593 - { 594 - int retval = -EINVAL; 595 - 596 - if (current_cpu_type() != CPU_VR4133) 597 - return -EINVAL; 598 - 599 - if (intassign > INTASSIGN_MAX) 600 - return -EINVAL; 601 - 602 - if (irq >= SYSINT1_IRQ_BASE && irq <= SYSINT1_IRQ_LAST) 603 - retval = set_sysint1_assign(irq, intassign); 604 - else if (irq >= SYSINT2_IRQ_BASE && irq <= SYSINT2_IRQ_LAST) 605 - retval = set_sysint2_assign(irq, intassign); 606 - 607 - return retval; 608 - } 609 - 610 - EXPORT_SYMBOL(vr41xx_set_intassign); 611 - 612 - static int icu_get_irq(unsigned int irq) 613 - { 614 - uint16_t pend1, pend2; 615 - uint16_t mask1, mask2; 616 - int i; 617 - 618 - pend1 = icu1_read(SYSINT1REG); 619 - mask1 = icu1_read(MSYSINT1REG); 620 - 621 - pend2 = icu2_read(SYSINT2REG); 622 - mask2 = icu2_read(MSYSINT2REG); 623 - 624 - mask1 &= pend1; 625 - mask2 &= pend2; 626 - 627 - if (mask1) { 628 - for (i = 0; i < 16; i++) { 629 - if (irq == INT_TO_IRQ(sysint1_assign[i]) && (mask1 & (1 << i))) 630 - return SYSINT1_IRQ(i); 631 - } 632 - } 633 - 634 - if (mask2) { 635 - for (i = 0; i < 16; i++) { 636 - if (irq == INT_TO_IRQ(sysint2_assign[i]) && (mask2 & (1 << i))) 637 - return SYSINT2_IRQ(i); 638 - } 639 - } 640 - 641 - printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2); 642 - 643 - return -1; 644 - } 645 - 646 - static int __init vr41xx_icu_init(void) 647 - { 648 - unsigned long icu1_start, icu2_start; 649 - int i; 650 - 651 - switch (current_cpu_type()) { 652 - case CPU_VR4111: 653 - case CPU_VR4121: 654 - icu1_start = ICU1_TYPE1_BASE; 655 - icu2_start = ICU2_TYPE1_BASE; 656 - break; 657 - case CPU_VR4122: 658 - case CPU_VR4131: 659 - case CPU_VR4133: 660 - icu1_start = ICU1_TYPE2_BASE; 661 - icu2_start = ICU2_TYPE2_BASE; 662 - break; 663 - default: 664 - printk(KERN_ERR "ICU: Unexpected CPU of NEC VR4100 series\n"); 665 - return -ENODEV; 666 - } 667 - 668 - if (request_mem_region(icu1_start, ICU1_SIZE, "ICU") == NULL) 669 - return -EBUSY; 670 - 671 - if (request_mem_region(icu2_start, ICU2_SIZE, "ICU") == NULL) { 672 - release_mem_region(icu1_start, ICU1_SIZE); 673 - return -EBUSY; 674 - } 675 - 676 - icu1_base = ioremap(icu1_start, ICU1_SIZE); 677 - if (icu1_base == NULL) { 678 - release_mem_region(icu1_start, ICU1_SIZE); 679 - release_mem_region(icu2_start, ICU2_SIZE); 680 - return -ENOMEM; 681 - } 682 - 683 - icu2_base = ioremap(icu2_start, ICU2_SIZE); 684 - if (icu2_base == NULL) { 685 - iounmap(icu1_base); 686 - release_mem_region(icu1_start, ICU1_SIZE); 687 - release_mem_region(icu2_start, ICU2_SIZE); 688 - return -ENOMEM; 689 - } 690 - 691 - icu1_write(MSYSINT1REG, 0); 692 - icu1_write(MGIUINTLREG, 0xffff); 693 - 694 - icu2_write(MSYSINT2REG, 0); 695 - icu2_write(MGIUINTHREG, 0xffff); 696 - 697 - for (i = SYSINT1_IRQ_BASE; i <= SYSINT1_IRQ_LAST; i++) 698 - irq_set_chip_and_handler(i, &sysint1_irq_type, 699 - handle_level_irq); 700 - 701 - for (i = SYSINT2_IRQ_BASE; i <= SYSINT2_IRQ_LAST; i++) 702 - irq_set_chip_and_handler(i, &sysint2_irq_type, 703 - handle_level_irq); 704 - 705 - cascade_irq(INT0_IRQ, icu_get_irq); 706 - cascade_irq(INT1_IRQ, icu_get_irq); 707 - cascade_irq(INT2_IRQ, icu_get_irq); 708 - cascade_irq(INT3_IRQ, icu_get_irq); 709 - cascade_irq(INT4_IRQ, icu_get_irq); 710 - 711 - return 0; 712 - } 713 - 714 - core_initcall(vr41xx_icu_init);
-60
arch/mips/vr41xx/common/init.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * init.c, Common initialization routines for NEC VR4100 series. 4 - * 5 - * Copyright (C) 2003-2009 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/ioport.h> 9 - #include <linux/irq.h> 10 - #include <linux/string.h> 11 - 12 - #include <asm/bootinfo.h> 13 - #include <asm/time.h> 14 - #include <asm/vr41xx/irq.h> 15 - #include <asm/vr41xx/vr41xx.h> 16 - 17 - #define IO_MEM_RESOURCE_START 0UL 18 - #define IO_MEM_RESOURCE_END 0x1fffffffUL 19 - 20 - static void __init iomem_resource_init(void) 21 - { 22 - iomem_resource.start = IO_MEM_RESOURCE_START; 23 - iomem_resource.end = IO_MEM_RESOURCE_END; 24 - } 25 - 26 - void __init plat_time_init(void) 27 - { 28 - unsigned long tclock; 29 - 30 - vr41xx_calculate_clock_frequency(); 31 - 32 - tclock = vr41xx_get_tclock_frequency(); 33 - if (current_cpu_data.processor_id == PRID_VR4131_REV2_0 || 34 - current_cpu_data.processor_id == PRID_VR4131_REV2_1) 35 - mips_hpt_frequency = tclock / 2; 36 - else 37 - mips_hpt_frequency = tclock / 4; 38 - } 39 - 40 - void __init plat_mem_setup(void) 41 - { 42 - iomem_resource_init(); 43 - 44 - vr41xx_siu_setup(); 45 - } 46 - 47 - void __init prom_init(void) 48 - { 49 - int argc, i; 50 - char **argv; 51 - 52 - argc = fw_arg0; 53 - argv = (char **)fw_arg1; 54 - 55 - for (i = 1; i < argc; i++) { 56 - strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE); 57 - if (i < (argc - 1)) 58 - strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); 59 - } 60 - }
-106
arch/mips/vr41xx/common/irq.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Interrupt handing routines for NEC VR4100 series. 4 - * 5 - * Copyright (C) 2005-2007 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/export.h> 8 - #include <linux/interrupt.h> 9 - #include <linux/irq.h> 10 - 11 - #include <asm/irq_cpu.h> 12 - #include <asm/vr41xx/irq.h> 13 - 14 - typedef struct irq_cascade { 15 - int (*get_irq)(unsigned int); 16 - } irq_cascade_t; 17 - 18 - static irq_cascade_t irq_cascade[NR_IRQS] __cacheline_aligned; 19 - 20 - int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int)) 21 - { 22 - int retval = 0; 23 - 24 - if (irq >= NR_IRQS) 25 - return -EINVAL; 26 - 27 - if (irq_cascade[irq].get_irq != NULL) 28 - free_irq(irq, NULL); 29 - 30 - irq_cascade[irq].get_irq = get_irq; 31 - 32 - if (get_irq != NULL) { 33 - retval = request_irq(irq, no_action, IRQF_NO_THREAD, 34 - "cascade", NULL); 35 - if (retval < 0) 36 - irq_cascade[irq].get_irq = NULL; 37 - } 38 - 39 - return retval; 40 - } 41 - 42 - EXPORT_SYMBOL_GPL(cascade_irq); 43 - 44 - static void irq_dispatch(unsigned int irq) 45 - { 46 - irq_cascade_t *cascade; 47 - 48 - if (irq >= NR_IRQS) { 49 - atomic_inc(&irq_err_count); 50 - return; 51 - } 52 - 53 - cascade = irq_cascade + irq; 54 - if (cascade->get_irq != NULL) { 55 - struct irq_desc *desc = irq_to_desc(irq); 56 - struct irq_data *idata = irq_desc_get_irq_data(desc); 57 - struct irq_chip *chip = irq_desc_get_chip(desc); 58 - int ret; 59 - 60 - if (chip->irq_mask_ack) 61 - chip->irq_mask_ack(idata); 62 - else { 63 - chip->irq_mask(idata); 64 - chip->irq_ack(idata); 65 - } 66 - ret = cascade->get_irq(irq); 67 - irq = ret; 68 - if (ret < 0) 69 - atomic_inc(&irq_err_count); 70 - else 71 - irq_dispatch(irq); 72 - if (!irqd_irq_disabled(idata) && chip->irq_unmask) 73 - chip->irq_unmask(idata); 74 - } else 75 - do_IRQ(irq); 76 - } 77 - 78 - asmlinkage void plat_irq_dispatch(void) 79 - { 80 - unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; 81 - 82 - if (pending & CAUSEF_IP7) 83 - do_IRQ(TIMER_IRQ); 84 - else if (pending & 0x7800) { 85 - if (pending & CAUSEF_IP3) 86 - irq_dispatch(INT1_IRQ); 87 - else if (pending & CAUSEF_IP4) 88 - irq_dispatch(INT2_IRQ); 89 - else if (pending & CAUSEF_IP5) 90 - irq_dispatch(INT3_IRQ); 91 - else if (pending & CAUSEF_IP6) 92 - irq_dispatch(INT4_IRQ); 93 - } else if (pending & CAUSEF_IP2) 94 - irq_dispatch(INT0_IRQ); 95 - else if (pending & CAUSEF_IP0) 96 - do_IRQ(MIPS_SOFTINT0_IRQ); 97 - else if (pending & CAUSEF_IP1) 98 - do_IRQ(MIPS_SOFTINT1_IRQ); 99 - else 100 - spurious_interrupt(); 101 - } 102 - 103 - void __init arch_init_irq(void) 104 - { 105 - mips_cpu_irq_init(); 106 - }
-123
arch/mips/vr41xx/common/pmu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * pmu.c, Power Management Unit routines for NEC VR4100 series. 4 - * 5 - * Copyright (C) 2003-2007 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/cpu.h> 8 - #include <linux/errno.h> 9 - #include <linux/init.h> 10 - #include <linux/ioport.h> 11 - #include <linux/kernel.h> 12 - #include <linux/pm.h> 13 - #include <linux/sched.h> 14 - #include <linux/types.h> 15 - 16 - #include <asm/cacheflush.h> 17 - #include <asm/cpu.h> 18 - #include <asm/idle.h> 19 - #include <asm/io.h> 20 - #include <asm/processor.h> 21 - #include <asm/reboot.h> 22 - 23 - #define PMU_TYPE1_BASE 0x0b0000a0UL 24 - #define PMU_TYPE1_SIZE 0x0eUL 25 - 26 - #define PMU_TYPE2_BASE 0x0f0000c0UL 27 - #define PMU_TYPE2_SIZE 0x10UL 28 - 29 - #define PMUCNT2REG 0x06 30 - #define SOFTRST 0x0010 31 - 32 - static void __iomem *pmu_base; 33 - 34 - #define pmu_read(offset) readw(pmu_base + (offset)) 35 - #define pmu_write(offset, value) writew((value), pmu_base + (offset)) 36 - 37 - static void __cpuidle vr41xx_cpu_wait(void) 38 - { 39 - local_irq_disable(); 40 - if (!need_resched()) 41 - /* 42 - * "standby" sets IE bit of the CP0_STATUS to 1. 43 - */ 44 - __asm__("standby;\n"); 45 - else 46 - local_irq_enable(); 47 - } 48 - 49 - static inline void software_reset(void) 50 - { 51 - uint16_t pmucnt2; 52 - 53 - switch (current_cpu_type()) { 54 - case CPU_VR4122: 55 - case CPU_VR4131: 56 - case CPU_VR4133: 57 - pmucnt2 = pmu_read(PMUCNT2REG); 58 - pmucnt2 |= SOFTRST; 59 - pmu_write(PMUCNT2REG, pmucnt2); 60 - break; 61 - default: 62 - set_c0_status(ST0_BEV | ST0_ERL); 63 - change_c0_config(CONF_CM_CMASK, CONF_CM_UNCACHED); 64 - __flush_cache_all(); 65 - write_c0_wired(0); 66 - __asm__("jr %0"::"r"(0xbfc00000)); 67 - break; 68 - } 69 - } 70 - 71 - static void vr41xx_restart(char *command) 72 - { 73 - local_irq_disable(); 74 - software_reset(); 75 - while (1) ; 76 - } 77 - 78 - static void vr41xx_halt(void) 79 - { 80 - local_irq_disable(); 81 - printk(KERN_NOTICE "\nYou can turn off the power supply\n"); 82 - __asm__("hibernate;\n"); 83 - } 84 - 85 - static int __init vr41xx_pmu_init(void) 86 - { 87 - unsigned long start, size; 88 - 89 - switch (current_cpu_type()) { 90 - case CPU_VR4111: 91 - case CPU_VR4121: 92 - start = PMU_TYPE1_BASE; 93 - size = PMU_TYPE1_SIZE; 94 - break; 95 - case CPU_VR4122: 96 - case CPU_VR4131: 97 - case CPU_VR4133: 98 - start = PMU_TYPE2_BASE; 99 - size = PMU_TYPE2_SIZE; 100 - break; 101 - default: 102 - printk("Unexpected CPU of NEC VR4100 series\n"); 103 - return -ENODEV; 104 - } 105 - 106 - if (request_mem_region(start, size, "PMU") == NULL) 107 - return -EBUSY; 108 - 109 - pmu_base = ioremap(start, size); 110 - if (pmu_base == NULL) { 111 - release_mem_region(start, size); 112 - return -EBUSY; 113 - } 114 - 115 - cpu_wait = vr41xx_cpu_wait; 116 - _machine_restart = vr41xx_restart; 117 - _machine_halt = vr41xx_halt; 118 - pm_power_off = vr41xx_halt; 119 - 120 - return 0; 121 - } 122 - 123 - core_initcall(vr41xx_pmu_init);
-105
arch/mips/vr41xx/common/rtc.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * NEC VR4100 series RTC platform device. 4 - * 5 - * Copyright (C) 2007 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/errno.h> 8 - #include <linux/init.h> 9 - #include <linux/smp.h> 10 - #include <linux/ioport.h> 11 - #include <linux/platform_device.h> 12 - 13 - #include <asm/cpu.h> 14 - #include <asm/vr41xx/irq.h> 15 - 16 - static struct resource rtc_type1_resource[] __initdata = { 17 - { 18 - .start = 0x0b0000c0, 19 - .end = 0x0b0000df, 20 - .flags = IORESOURCE_MEM, 21 - }, 22 - { 23 - .start = 0x0b0001c0, 24 - .end = 0x0b0001df, 25 - .flags = IORESOURCE_MEM, 26 - }, 27 - { 28 - .start = ELAPSEDTIME_IRQ, 29 - .end = ELAPSEDTIME_IRQ, 30 - .flags = IORESOURCE_IRQ, 31 - }, 32 - { 33 - .start = RTCLONG1_IRQ, 34 - .end = RTCLONG1_IRQ, 35 - .flags = IORESOURCE_IRQ, 36 - }, 37 - }; 38 - 39 - static struct resource rtc_type2_resource[] __initdata = { 40 - { 41 - .start = 0x0f000100, 42 - .end = 0x0f00011f, 43 - .flags = IORESOURCE_MEM, 44 - }, 45 - { 46 - .start = 0x0f000120, 47 - .end = 0x0f00013f, 48 - .flags = IORESOURCE_MEM, 49 - }, 50 - { 51 - .start = ELAPSEDTIME_IRQ, 52 - .end = ELAPSEDTIME_IRQ, 53 - .flags = IORESOURCE_IRQ, 54 - }, 55 - { 56 - .start = RTCLONG1_IRQ, 57 - .end = RTCLONG1_IRQ, 58 - .flags = IORESOURCE_IRQ, 59 - }, 60 - }; 61 - 62 - static int __init vr41xx_rtc_add(void) 63 - { 64 - struct platform_device *pdev; 65 - struct resource *res; 66 - unsigned int num; 67 - int retval; 68 - 69 - pdev = platform_device_alloc("RTC", -1); 70 - if (!pdev) 71 - return -ENOMEM; 72 - 73 - switch (current_cpu_type()) { 74 - case CPU_VR4111: 75 - case CPU_VR4121: 76 - res = rtc_type1_resource; 77 - num = ARRAY_SIZE(rtc_type1_resource); 78 - break; 79 - case CPU_VR4122: 80 - case CPU_VR4131: 81 - case CPU_VR4133: 82 - res = rtc_type2_resource; 83 - num = ARRAY_SIZE(rtc_type2_resource); 84 - break; 85 - default: 86 - retval = -ENODEV; 87 - goto err_free_device; 88 - } 89 - 90 - retval = platform_device_add_resources(pdev, res, num); 91 - if (retval) 92 - goto err_free_device; 93 - 94 - retval = platform_device_add(pdev); 95 - if (retval) 96 - goto err_free_device; 97 - 98 - return 0; 99 - 100 - err_free_device: 101 - platform_device_put(pdev); 102 - 103 - return retval; 104 - } 105 - device_initcall(vr41xx_rtc_add);
-142
arch/mips/vr41xx/common/siu.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * NEC VR4100 series SIU platform device. 4 - * 5 - * Copyright (C) 2007-2008 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/errno.h> 8 - #include <linux/init.h> 9 - #include <linux/ioport.h> 10 - #include <linux/platform_device.h> 11 - #include <linux/serial_core.h> 12 - #include <linux/irq.h> 13 - 14 - #include <asm/cpu.h> 15 - #include <asm/vr41xx/siu.h> 16 - 17 - static unsigned int siu_type1_ports[SIU_PORTS_MAX] __initdata = { 18 - PORT_VR41XX_SIU, 19 - PORT_UNKNOWN, 20 - }; 21 - 22 - static struct resource siu_type1_resource[] __initdata = { 23 - { 24 - .start = 0x0c000000, 25 - .end = 0x0c00000a, 26 - .flags = IORESOURCE_MEM, 27 - }, 28 - { 29 - .start = SIU_IRQ, 30 - .end = SIU_IRQ, 31 - .flags = IORESOURCE_IRQ, 32 - }, 33 - }; 34 - 35 - static unsigned int siu_type2_ports[SIU_PORTS_MAX] __initdata = { 36 - PORT_VR41XX_SIU, 37 - PORT_VR41XX_DSIU, 38 - }; 39 - 40 - static struct resource siu_type2_resource[] __initdata = { 41 - { 42 - .start = 0x0f000800, 43 - .end = 0x0f00080a, 44 - .flags = IORESOURCE_MEM, 45 - }, 46 - { 47 - .start = 0x0f000820, 48 - .end = 0x0f000829, 49 - .flags = IORESOURCE_MEM, 50 - }, 51 - { 52 - .start = SIU_IRQ, 53 - .end = SIU_IRQ, 54 - .flags = IORESOURCE_IRQ, 55 - }, 56 - { 57 - .start = DSIU_IRQ, 58 - .end = DSIU_IRQ, 59 - .flags = IORESOURCE_IRQ, 60 - }, 61 - }; 62 - 63 - static int __init vr41xx_siu_add(void) 64 - { 65 - struct platform_device *pdev; 66 - struct resource *res; 67 - unsigned int num; 68 - int retval; 69 - 70 - pdev = platform_device_alloc("SIU", -1); 71 - if (!pdev) 72 - return -ENOMEM; 73 - 74 - switch (current_cpu_type()) { 75 - case CPU_VR4111: 76 - case CPU_VR4121: 77 - pdev->dev.platform_data = siu_type1_ports; 78 - res = siu_type1_resource; 79 - num = ARRAY_SIZE(siu_type1_resource); 80 - break; 81 - case CPU_VR4122: 82 - case CPU_VR4131: 83 - case CPU_VR4133: 84 - pdev->dev.platform_data = siu_type2_ports; 85 - res = siu_type2_resource; 86 - num = ARRAY_SIZE(siu_type2_resource); 87 - break; 88 - default: 89 - retval = -ENODEV; 90 - goto err_free_device; 91 - } 92 - 93 - retval = platform_device_add_resources(pdev, res, num); 94 - if (retval) 95 - goto err_free_device; 96 - 97 - retval = platform_device_add(pdev); 98 - if (retval) 99 - goto err_free_device; 100 - 101 - return 0; 102 - 103 - err_free_device: 104 - platform_device_put(pdev); 105 - 106 - return retval; 107 - } 108 - device_initcall(vr41xx_siu_add); 109 - 110 - void __init vr41xx_siu_setup(void) 111 - { 112 - struct uart_port port; 113 - struct resource *res; 114 - unsigned int *type; 115 - int i; 116 - 117 - switch (current_cpu_type()) { 118 - case CPU_VR4111: 119 - case CPU_VR4121: 120 - type = siu_type1_ports; 121 - res = siu_type1_resource; 122 - break; 123 - case CPU_VR4122: 124 - case CPU_VR4131: 125 - case CPU_VR4133: 126 - type = siu_type2_ports; 127 - res = siu_type2_resource; 128 - break; 129 - default: 130 - return; 131 - } 132 - 133 - for (i = 0; i < SIU_PORTS_MAX; i++) { 134 - port.line = i; 135 - port.type = type[i]; 136 - if (port.type == PORT_UNKNOWN) 137 - break; 138 - port.mapbase = res[i].start; 139 - port.membase = (unsigned char __iomem *)KSEG1ADDR(res[i].start); 140 - vr41xx_siu_early_setup(&port); 141 - } 142 - }
-11
arch/mips/vr41xx/common/type.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * type.c, System type for NEC VR4100 series. 4 - * 5 - * Copyright (C) 2005 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - 8 - const char *get_system_type(void) 9 - { 10 - return "NEC VR4100 series"; 11 - }
-6
arch/mips/vr41xx/ibm-workpad/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # 3 - # Makefile for the IBM WorkPad z50 specific parts of the kernel 4 - # 5 - 6 - obj-y += setup.o
-27
arch/mips/vr41xx/ibm-workpad/setup.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * setup.c, Setup for the IBM WorkPad z50. 4 - * 5 - * Copyright (C) 2002-2006 Yoichi Yuasa <yuasa@linux-mips.org> 6 - */ 7 - #include <linux/init.h> 8 - #include <linux/ioport.h> 9 - 10 - #include <asm/io.h> 11 - 12 - #define WORKPAD_ISA_IO_BASE 0x15000000 13 - #define WORKPAD_ISA_IO_SIZE 0x03000000 14 - #define WORKPAD_ISA_IO_START 0 15 - #define WORKPAD_ISA_IO_END (WORKPAD_ISA_IO_SIZE - 1) 16 - #define WORKPAD_IO_PORT_BASE KSEG1ADDR(WORKPAD_ISA_IO_BASE) 17 - 18 - static int __init ibm_workpad_setup(void) 19 - { 20 - set_io_port_base(WORKPAD_IO_PORT_BASE); 21 - ioport_resource.start = WORKPAD_ISA_IO_START; 22 - ioport_resource.end = WORKPAD_ISA_IO_END; 23 - 24 - return 0; 25 - } 26 - 27 - arch_initcall(ibm_workpad_setup);