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

MIPS: TXX9: Remove rbtx4939 board support

No active MIPS user own this board, so let's remove it.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>

-1132
-2
arch/mips/configs/rbtx49xx_defconfig
··· 10 10 CONFIG_SLAB=y 11 11 CONFIG_MACH_TX49XX=y 12 12 CONFIG_TOSHIBA_RBTX4927=y 13 - CONFIG_TOSHIBA_RBTX4939=y 14 13 # CONFIG_SECCOMP is not set 15 14 CONFIG_PCI=y 16 15 CONFIG_MODULES=y ··· 35 36 CONFIG_MTD_CFI_AMDSTD=y 36 37 CONFIG_MTD_COMPLEX_MAPPINGS=y 37 38 CONFIG_MTD_PHYSMAP=y 38 - CONFIG_MTD_RBTX4939=y 39 39 CONFIG_MTD_RAW_NAND=m 40 40 CONFIG_MTD_NAND_TXX9NDFMC=m 41 41 CONFIG_BLK_DEV_LOOP=y
-8
arch/mips/include/asm/mach-tx49xx/mangle-port.h
··· 9 9 10 10 #define ioswabb(a, x) (x) 11 11 #define __mem_ioswabb(a, x) (x) 12 - #if defined(CONFIG_TOSHIBA_RBTX4939) && \ 13 - IS_ENABLED(CONFIG_SMC91X) && \ 14 - defined(__BIG_ENDIAN) 15 - #define NEEDS_TXX9_IOSWABW 16 - extern u16 (*ioswabw)(volatile u16 *a, u16 x); 17 - extern u16 (*__mem_ioswabw)(volatile u16 *a, u16 x); 18 - #else 19 12 #define ioswabw(a, x) le16_to_cpu((__force __le16)(x)) 20 13 #define __mem_ioswabw(a, x) (x) 21 - #endif 22 14 #define ioswabl(a, x) le32_to_cpu((__force __le32)(x)) 23 15 #define __mem_ioswabl(a, x) (x) 24 16 #define ioswabq(a, x) le64_to_cpu((__force __le64)(x))
-3
arch/mips/include/asm/txx9/boards.h
··· 6 6 BOARD_VEC(rbtx4927_vec) 7 7 BOARD_VEC(rbtx4937_vec) 8 8 #endif 9 - #ifdef CONFIG_TOSHIBA_RBTX4939 10 - BOARD_VEC(rbtx4939_vec) 11 - #endif
-142
arch/mips/include/asm/txx9/rbtx4939.h
··· 1 - /* 2 - * Definitions for RBTX4939 3 - * 4 - * (C) Copyright TOSHIBA CORPORATION 2005-2006 5 - * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the 6 - * terms of the GNU General Public License version 2. This program is 7 - * licensed "as is" without any warranty of any kind, whether express 8 - * or implied. 9 - */ 10 - #ifndef __ASM_TXX9_RBTX4939_H 11 - #define __ASM_TXX9_RBTX4939_H 12 - 13 - #include <asm/addrspace.h> 14 - #include <asm/txx9irq.h> 15 - #include <asm/txx9/generic.h> 16 - #include <asm/txx9/tx4939.h> 17 - 18 - /* Address map */ 19 - #define RBTX4939_IOC_REG_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000) 20 - #define RBTX4939_BOARD_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000000) 21 - #define RBTX4939_IOC_REV_ADDR (IO_BASE + TXX9_CE(1) + 0x00000002) 22 - #define RBTX4939_CONFIG1_ADDR (IO_BASE + TXX9_CE(1) + 0x00000004) 23 - #define RBTX4939_CONFIG2_ADDR (IO_BASE + TXX9_CE(1) + 0x00000006) 24 - #define RBTX4939_CONFIG3_ADDR (IO_BASE + TXX9_CE(1) + 0x00000008) 25 - #define RBTX4939_CONFIG4_ADDR (IO_BASE + TXX9_CE(1) + 0x0000000a) 26 - #define RBTX4939_USTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00001000) 27 - #define RBTX4939_UDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001002) 28 - #define RBTX4939_BDIPSW_ADDR (IO_BASE + TXX9_CE(1) + 0x00001004) 29 - #define RBTX4939_IEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00002000) 30 - #define RBTX4939_IPOL_ADDR (IO_BASE + TXX9_CE(1) + 0x00002002) 31 - #define RBTX4939_IFAC1_ADDR (IO_BASE + TXX9_CE(1) + 0x00002004) 32 - #define RBTX4939_IFAC2_ADDR (IO_BASE + TXX9_CE(1) + 0x00002006) 33 - #define RBTX4939_SOFTINT_ADDR (IO_BASE + TXX9_CE(1) + 0x00003000) 34 - #define RBTX4939_ISASTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004000) 35 - #define RBTX4939_PCISTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00004002) 36 - #define RBTX4939_ROME_ADDR (IO_BASE + TXX9_CE(1) + 0x00004004) 37 - #define RBTX4939_SPICS_ADDR (IO_BASE + TXX9_CE(1) + 0x00004006) 38 - #define RBTX4939_AUDI_ADDR (IO_BASE + TXX9_CE(1) + 0x00004008) 39 - #define RBTX4939_ISAGPIO_ADDR (IO_BASE + TXX9_CE(1) + 0x0000400a) 40 - #define RBTX4939_PE1_ADDR (IO_BASE + TXX9_CE(1) + 0x00005000) 41 - #define RBTX4939_PE2_ADDR (IO_BASE + TXX9_CE(1) + 0x00005002) 42 - #define RBTX4939_PE3_ADDR (IO_BASE + TXX9_CE(1) + 0x00005004) 43 - #define RBTX4939_VP_ADDR (IO_BASE + TXX9_CE(1) + 0x00005006) 44 - #define RBTX4939_VPRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00005008) 45 - #define RBTX4939_VPSOUT_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500a) 46 - #define RBTX4939_VPSIN_ADDR (IO_BASE + TXX9_CE(1) + 0x0000500c) 47 - #define RBTX4939_7SEG_ADDR(s, ch) \ 48 - (IO_BASE + TXX9_CE(1) + 0x00006000 + (s) * 16 + ((ch) & 3) * 2) 49 - #define RBTX4939_SOFTRESET_ADDR (IO_BASE + TXX9_CE(1) + 0x00007000) 50 - #define RBTX4939_RESETEN_ADDR (IO_BASE + TXX9_CE(1) + 0x00007002) 51 - #define RBTX4939_RESETSTAT_ADDR (IO_BASE + TXX9_CE(1) + 0x00007004) 52 - #define RBTX4939_ETHER_BASE (IO_BASE + TXX9_CE(1) + 0x00020000) 53 - 54 - /* Ethernet port address */ 55 - #define RBTX4939_ETHER_ADDR (RBTX4939_ETHER_BASE + 0x300) 56 - 57 - /* bits for IEN/IPOL/IFAC */ 58 - #define RBTX4938_INTB_ISA0 0 59 - #define RBTX4938_INTB_ISA11 1 60 - #define RBTX4938_INTB_ISA12 2 61 - #define RBTX4938_INTB_ISA15 3 62 - #define RBTX4938_INTB_I2S 4 63 - #define RBTX4938_INTB_SW 5 64 - #define RBTX4938_INTF_ISA0 (1 << RBTX4938_INTB_ISA0) 65 - #define RBTX4938_INTF_ISA11 (1 << RBTX4938_INTB_ISA11) 66 - #define RBTX4938_INTF_ISA12 (1 << RBTX4938_INTB_ISA12) 67 - #define RBTX4938_INTF_ISA15 (1 << RBTX4938_INTB_ISA15) 68 - #define RBTX4938_INTF_I2S (1 << RBTX4938_INTB_I2S) 69 - #define RBTX4938_INTF_SW (1 << RBTX4938_INTB_SW) 70 - 71 - /* bits for PE1,PE2,PE3 */ 72 - #define RBTX4939_PE1_ATA(ch) (0x01 << (ch)) 73 - #define RBTX4939_PE1_RMII(ch) (0x04 << (ch)) 74 - #define RBTX4939_PE2_SIO0 0x01 75 - #define RBTX4939_PE2_SIO2 0x02 76 - #define RBTX4939_PE2_SIO3 0x04 77 - #define RBTX4939_PE2_CIR 0x08 78 - #define RBTX4939_PE2_SPI 0x10 79 - #define RBTX4939_PE2_GPIO 0x20 80 - #define RBTX4939_PE3_VP 0x01 81 - #define RBTX4939_PE3_VP_P 0x02 82 - #define RBTX4939_PE3_VP_S 0x04 83 - 84 - #define rbtx4939_board_rev_addr ((u8 __iomem *)RBTX4939_BOARD_REV_ADDR) 85 - #define rbtx4939_ioc_rev_addr ((u8 __iomem *)RBTX4939_IOC_REV_ADDR) 86 - #define rbtx4939_config1_addr ((u8 __iomem *)RBTX4939_CONFIG1_ADDR) 87 - #define rbtx4939_config2_addr ((u8 __iomem *)RBTX4939_CONFIG2_ADDR) 88 - #define rbtx4939_config3_addr ((u8 __iomem *)RBTX4939_CONFIG3_ADDR) 89 - #define rbtx4939_config4_addr ((u8 __iomem *)RBTX4939_CONFIG4_ADDR) 90 - #define rbtx4939_ustat_addr ((u8 __iomem *)RBTX4939_USTAT_ADDR) 91 - #define rbtx4939_udipsw_addr ((u8 __iomem *)RBTX4939_UDIPSW_ADDR) 92 - #define rbtx4939_bdipsw_addr ((u8 __iomem *)RBTX4939_BDIPSW_ADDR) 93 - #define rbtx4939_ien_addr ((u8 __iomem *)RBTX4939_IEN_ADDR) 94 - #define rbtx4939_ipol_addr ((u8 __iomem *)RBTX4939_IPOL_ADDR) 95 - #define rbtx4939_ifac1_addr ((u8 __iomem *)RBTX4939_IFAC1_ADDR) 96 - #define rbtx4939_ifac2_addr ((u8 __iomem *)RBTX4939_IFAC2_ADDR) 97 - #define rbtx4939_softint_addr ((u8 __iomem *)RBTX4939_SOFTINT_ADDR) 98 - #define rbtx4939_isastat_addr ((u8 __iomem *)RBTX4939_ISASTAT_ADDR) 99 - #define rbtx4939_pcistat_addr ((u8 __iomem *)RBTX4939_PCISTAT_ADDR) 100 - #define rbtx4939_rome_addr ((u8 __iomem *)RBTX4939_ROME_ADDR) 101 - #define rbtx4939_spics_addr ((u8 __iomem *)RBTX4939_SPICS_ADDR) 102 - #define rbtx4939_audi_addr ((u8 __iomem *)RBTX4939_AUDI_ADDR) 103 - #define rbtx4939_isagpio_addr ((u8 __iomem *)RBTX4939_ISAGPIO_ADDR) 104 - #define rbtx4939_pe1_addr ((u8 __iomem *)RBTX4939_PE1_ADDR) 105 - #define rbtx4939_pe2_addr ((u8 __iomem *)RBTX4939_PE2_ADDR) 106 - #define rbtx4939_pe3_addr ((u8 __iomem *)RBTX4939_PE3_ADDR) 107 - #define rbtx4939_vp_addr ((u8 __iomem *)RBTX4939_VP_ADDR) 108 - #define rbtx4939_vpreset_addr ((u8 __iomem *)RBTX4939_VPRESET_ADDR) 109 - #define rbtx4939_vpsout_addr ((u8 __iomem *)RBTX4939_VPSOUT_ADDR) 110 - #define rbtx4939_vpsin_addr ((u8 __iomem *)RBTX4939_VPSIN_ADDR) 111 - #define rbtx4939_7seg_addr(s, ch) \ 112 - ((u8 __iomem *)RBTX4939_7SEG_ADDR(s, ch)) 113 - #define rbtx4939_softreset_addr ((u8 __iomem *)RBTX4939_SOFTRESET_ADDR) 114 - #define rbtx4939_reseten_addr ((u8 __iomem *)RBTX4939_RESETEN_ADDR) 115 - #define rbtx4939_resetstat_addr ((u8 __iomem *)RBTX4939_RESETSTAT_ADDR) 116 - 117 - /* 118 - * IRQ mappings 119 - */ 120 - #define RBTX4939_NR_IRQ_IOC 8 121 - 122 - #define RBTX4939_IRQ_IOC (TXX9_IRQ_BASE + TX4939_NUM_IR) 123 - #define RBTX4939_IRQ_END (RBTX4939_IRQ_IOC + RBTX4939_NR_IRQ_IOC) 124 - 125 - /* IOC (ISA, etc) */ 126 - #define RBTX4939_IRQ_IOCINT (TXX9_IRQ_BASE + TX4939_IR_INT(0)) 127 - /* Onboard 10M Ether */ 128 - #define RBTX4939_IRQ_ETHER (TXX9_IRQ_BASE + TX4939_IR_INT(1)) 129 - 130 - void rbtx4939_prom_init(void); 131 - void rbtx4939_irq_setup(void); 132 - 133 - struct mtd_partition; 134 - struct map_info; 135 - struct rbtx4939_flash_data { 136 - unsigned int width; 137 - unsigned int nr_parts; 138 - struct mtd_partition *parts; 139 - void (*map_init)(struct map_info *map); 140 - }; 141 - 142 - #endif /* __ASM_TXX9_RBTX4939_H */
-12
arch/mips/txx9/Kconfig
··· 39 39 This Toshiba board is based on the TX4927 processor. Say Y here to 40 40 support this machine type 41 41 42 - config TOSHIBA_RBTX4939 43 - bool "Toshiba RBTX4939 board" 44 - depends on MACH_TX49XX 45 - select SOC_TX4939 46 - select TXX9_7SEGLED 47 - help 48 - This Toshiba board is based on the TX4939 processor. Say Y here to 49 - support this machine type 50 - 51 42 config SOC_TX3927 52 43 bool 53 44 select CEVT_TXX9 ··· 71 80 imply HAS_TXX9_SERIAL 72 81 select HAVE_PCI 73 82 select PCI_TX4927 74 - 75 - config TXX9_7SEGLED 76 - bool 77 83 78 84 config TOSHIBA_FPCIB0 79 85 bool "FPCIB0 Backplane Support"
-1
arch/mips/txx9/Makefile
··· 14 14 # Toshiba RBTX49XX boards 15 15 # 16 16 obj-$(CONFIG_TOSHIBA_RBTX4927) += rbtx4927/ 17 - obj-$(CONFIG_TOSHIBA_RBTX4939) += rbtx4939/
-123
arch/mips/txx9/generic/7segled.c
··· 1 - /* 2 - * 7 Segment LED routines 3 - * Based on RBTX49xx patch from CELF patch archive. 4 - * 5 - * This file is subject to the terms and conditions of the GNU General Public 6 - * License. See the file "COPYING" in the main directory of this archive 7 - * for more details. 8 - * 9 - * (C) Copyright TOSHIBA CORPORATION 2005-2007 10 - * All Rights Reserved. 11 - */ 12 - #include <linux/device.h> 13 - #include <linux/slab.h> 14 - #include <linux/map_to_7segment.h> 15 - #include <asm/txx9/generic.h> 16 - 17 - static unsigned int tx_7segled_num; 18 - static void (*tx_7segled_putc)(unsigned int pos, unsigned char val); 19 - 20 - void __init txx9_7segled_init(unsigned int num, 21 - void (*putc)(unsigned int pos, unsigned char val)) 22 - { 23 - tx_7segled_num = num; 24 - tx_7segled_putc = putc; 25 - } 26 - 27 - static SEG7_CONVERSION_MAP(txx9_seg7map, MAP_ASCII7SEG_ALPHANUM_LC); 28 - 29 - int txx9_7segled_putc(unsigned int pos, char c) 30 - { 31 - if (pos >= tx_7segled_num) 32 - return -EINVAL; 33 - c = map_to_seg7(&txx9_seg7map, c); 34 - if (c < 0) 35 - return c; 36 - tx_7segled_putc(pos, c); 37 - return 0; 38 - } 39 - 40 - static ssize_t ascii_store(struct device *dev, 41 - struct device_attribute *attr, 42 - const char *buf, size_t size) 43 - { 44 - unsigned int ch = dev->id; 45 - txx9_7segled_putc(ch, buf[0]); 46 - return size; 47 - } 48 - 49 - static ssize_t raw_store(struct device *dev, 50 - struct device_attribute *attr, 51 - const char *buf, size_t size) 52 - { 53 - unsigned int ch = dev->id; 54 - tx_7segled_putc(ch, buf[0]); 55 - return size; 56 - } 57 - 58 - static DEVICE_ATTR_WO(ascii); 59 - static DEVICE_ATTR_WO(raw); 60 - 61 - static ssize_t map_seg7_show(struct device *dev, 62 - struct device_attribute *attr, 63 - char *buf) 64 - { 65 - memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); 66 - return sizeof(txx9_seg7map); 67 - } 68 - 69 - static ssize_t map_seg7_store(struct device *dev, 70 - struct device_attribute *attr, 71 - const char *buf, size_t size) 72 - { 73 - if (size != sizeof(txx9_seg7map)) 74 - return -EINVAL; 75 - memcpy(&txx9_seg7map, buf, size); 76 - return size; 77 - } 78 - 79 - static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); 80 - 81 - static struct bus_type tx_7segled_subsys = { 82 - .name = "7segled", 83 - .dev_name = "7segled", 84 - }; 85 - 86 - static void tx_7segled_release(struct device *dev) 87 - { 88 - kfree(dev); 89 - } 90 - 91 - static int __init tx_7segled_init_sysfs(void) 92 - { 93 - int error, i; 94 - if (!tx_7segled_num) 95 - return -ENODEV; 96 - error = subsys_system_register(&tx_7segled_subsys, NULL); 97 - if (error) 98 - return error; 99 - error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7); 100 - if (error) 101 - return error; 102 - for (i = 0; i < tx_7segled_num; i++) { 103 - struct device *dev; 104 - dev = kzalloc(sizeof(*dev), GFP_KERNEL); 105 - if (!dev) { 106 - error = -ENODEV; 107 - break; 108 - } 109 - dev->id = i; 110 - dev->bus = &tx_7segled_subsys; 111 - dev->release = &tx_7segled_release; 112 - error = device_register(dev); 113 - if (error) { 114 - put_device(dev); 115 - return error; 116 - } 117 - device_create_file(dev, &dev_attr_ascii); 118 - device_create_file(dev, &dev_attr_raw); 119 - } 120 - return error; 121 - } 122 - 123 - device_initcall(tx_7segled_init_sysfs);
-1
arch/mips/txx9/generic/Makefile
··· 10 10 obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o 11 11 obj-$(CONFIG_SOC_TX4939) += setup_tx4939.o irq_tx4939.o 12 12 obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o 13 - obj-$(CONFIG_TXX9_7SEGLED) += 7segled.o
-20
arch/mips/txx9/generic/setup.c
··· 315 315 txx9_board_vec = &rbtx4937_vec; 316 316 break; 317 317 #endif 318 - #ifdef CONFIG_TOSHIBA_RBTX4939 319 - case 0x4939: 320 - txx9_board_vec = &rbtx4939_vec; 321 - break; 322 - #endif 323 318 } 324 319 #endif 325 320 } ··· 578 583 } 579 584 unsigned long (*__swizzle_addr_b)(unsigned long port) = __swizzle_addr_none; 580 585 EXPORT_SYMBOL(__swizzle_addr_b); 581 - #endif 582 - 583 - #ifdef NEEDS_TXX9_IOSWABW 584 - static u16 ioswabw_default(volatile u16 *a, u16 x) 585 - { 586 - return le16_to_cpu(x); 587 - } 588 - static u16 __mem_ioswabw_default(volatile u16 *a, u16 x) 589 - { 590 - return x; 591 - } 592 - u16 (*ioswabw)(volatile u16 *a, u16 x) = ioswabw_default; 593 - EXPORT_SYMBOL(ioswabw); 594 - u16 (*__mem_ioswabw)(volatile u16 *a, u16 x) = __mem_ioswabw_default; 595 - EXPORT_SYMBOL(__mem_ioswabw); 596 586 #endif 597 587 598 588 void __init txx9_physmap_flash_init(int no, unsigned long addr,
-2
arch/mips/txx9/rbtx4939/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-y += irq.o setup.o prom.o
-95
arch/mips/txx9/rbtx4939/irq.c
··· 1 - /* 2 - * Toshiba RBTX4939 interrupt routines 3 - * Based on linux/arch/mips/txx9/rbtx4938/irq.c, 4 - * and RBTX49xx patch from CELF patch archive. 5 - * 6 - * Copyright (C) 2000-2001,2005-2006 Toshiba Corporation 7 - * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the 8 - * terms of the GNU General Public License version 2. This program is 9 - * licensed "as is" without any warranty of any kind, whether express 10 - * or implied. 11 - */ 12 - #include <linux/init.h> 13 - #include <linux/interrupt.h> 14 - #include <linux/irq.h> 15 - #include <asm/mipsregs.h> 16 - #include <asm/txx9/rbtx4939.h> 17 - 18 - /* 19 - * RBTX4939 IOC controller definition 20 - */ 21 - 22 - static void rbtx4939_ioc_irq_unmask(struct irq_data *d) 23 - { 24 - int ioc_nr = d->irq - RBTX4939_IRQ_IOC; 25 - 26 - writeb(readb(rbtx4939_ien_addr) | (1 << ioc_nr), rbtx4939_ien_addr); 27 - } 28 - 29 - static void rbtx4939_ioc_irq_mask(struct irq_data *d) 30 - { 31 - int ioc_nr = d->irq - RBTX4939_IRQ_IOC; 32 - 33 - writeb(readb(rbtx4939_ien_addr) & ~(1 << ioc_nr), rbtx4939_ien_addr); 34 - mmiowb(); 35 - } 36 - 37 - static struct irq_chip rbtx4939_ioc_irq_chip = { 38 - .name = "IOC", 39 - .irq_mask = rbtx4939_ioc_irq_mask, 40 - .irq_unmask = rbtx4939_ioc_irq_unmask, 41 - }; 42 - 43 - 44 - static inline int rbtx4939_ioc_irqroute(void) 45 - { 46 - unsigned char istat = readb(rbtx4939_ifac2_addr); 47 - 48 - if (unlikely(istat == 0)) 49 - return -1; 50 - return RBTX4939_IRQ_IOC + __fls8(istat); 51 - } 52 - 53 - static int rbtx4939_irq_dispatch(int pending) 54 - { 55 - int irq; 56 - 57 - if (pending & CAUSEF_IP7) 58 - return MIPS_CPU_IRQ_BASE + 7; 59 - irq = tx4939_irq(); 60 - if (likely(irq >= 0)) { 61 - /* redirect IOC interrupts */ 62 - switch (irq) { 63 - case RBTX4939_IRQ_IOCINT: 64 - irq = rbtx4939_ioc_irqroute(); 65 - break; 66 - } 67 - } else if (pending & CAUSEF_IP0) 68 - irq = MIPS_CPU_IRQ_BASE + 0; 69 - else if (pending & CAUSEF_IP1) 70 - irq = MIPS_CPU_IRQ_BASE + 1; 71 - else 72 - irq = -1; 73 - return irq; 74 - } 75 - 76 - void __init rbtx4939_irq_setup(void) 77 - { 78 - int i; 79 - 80 - /* mask all IOC interrupts */ 81 - writeb(0, rbtx4939_ien_addr); 82 - 83 - /* clear SoftInt interrupts */ 84 - writeb(0, rbtx4939_softint_addr); 85 - 86 - txx9_irq_dispatch = rbtx4939_irq_dispatch; 87 - 88 - tx4939_irq_init(); 89 - for (i = RBTX4939_IRQ_IOC; 90 - i < RBTX4939_IRQ_IOC + RBTX4939_NR_IRQ_IOC; i++) 91 - irq_set_chip_and_handler(i, &rbtx4939_ioc_irq_chip, 92 - handle_level_irq); 93 - 94 - irq_set_chained_handler(RBTX4939_IRQ_IOCINT, handle_simple_irq); 95 - }
-29
arch/mips/txx9/rbtx4939/prom.c
··· 1 - /* 2 - * rbtx4939 specific prom routines 3 - * 4 - * This file is subject to the terms and conditions of the GNU General Public 5 - * License. See the file "COPYING" in the main directory of this archive 6 - * for more details. 7 - */ 8 - 9 - #include <linux/init.h> 10 - #include <linux/memblock.h> 11 - #include <asm/txx9/generic.h> 12 - #include <asm/txx9/rbtx4939.h> 13 - 14 - void __init rbtx4939_prom_init(void) 15 - { 16 - unsigned long start, size; 17 - u64 win; 18 - int i; 19 - 20 - for (i = 0; i < 4; i++) { 21 - if (!((__u32)____raw_readq(&tx4939_ddrcptr->winen) & (1 << i))) 22 - continue; 23 - win = ____raw_readq(&tx4939_ddrcptr->win[i]); 24 - start = (unsigned long)(win >> 48); 25 - size = (((unsigned long)(win >> 32) & 0xffff) + 1) - start; 26 - memblock_add(start << 20, size << 20); 27 - } 28 - txx9_sio_putchar_init(TX4939_SIO_REG(0) & 0xfffffffffULL); 29 - }
-554
arch/mips/txx9/rbtx4939/setup.c
··· 1 - /* 2 - * Toshiba RBTX4939 setup routines. 3 - * Based on linux/arch/mips/txx9/rbtx4938/setup.c, 4 - * and RBTX49xx patch from CELF patch archive. 5 - * 6 - * Copyright (C) 2000-2001,2005-2007 Toshiba Corporation 7 - * 2003-2005 (c) MontaVista Software, Inc. This file is licensed under the 8 - * terms of the GNU General Public License version 2. This program is 9 - * licensed "as is" without any warranty of any kind, whether express 10 - * or implied. 11 - */ 12 - #include <linux/init.h> 13 - #include <linux/kernel.h> 14 - #include <linux/types.h> 15 - #include <linux/slab.h> 16 - #include <linux/export.h> 17 - #include <linux/platform_device.h> 18 - #include <linux/leds.h> 19 - #include <linux/interrupt.h> 20 - #include <linux/smc91x.h> 21 - #include <linux/mtd/mtd.h> 22 - #include <linux/mtd/partitions.h> 23 - #include <linux/mtd/map.h> 24 - #include <asm/reboot.h> 25 - #include <asm/txx9/generic.h> 26 - #include <asm/txx9/pci.h> 27 - #include <asm/txx9/rbtx4939.h> 28 - 29 - static void rbtx4939_machine_restart(char *command) 30 - { 31 - local_irq_disable(); 32 - writeb(1, rbtx4939_reseten_addr); 33 - writeb(1, rbtx4939_softreset_addr); 34 - while (1) 35 - ; 36 - } 37 - 38 - static void __init rbtx4939_time_init(void) 39 - { 40 - tx4939_time_init(0); 41 - } 42 - 43 - #if defined(__BIG_ENDIAN) && IS_ENABLED(CONFIG_SMC91X) 44 - #define HAVE_RBTX4939_IOSWAB 45 - #define IS_CE1_ADDR(addr) \ 46 - ((((unsigned long)(addr) - IO_BASE) & 0xfff00000) == TXX9_CE(1)) 47 - static u16 rbtx4939_ioswabw(volatile u16 *a, u16 x) 48 - { 49 - return IS_CE1_ADDR(a) ? x : le16_to_cpu(x); 50 - } 51 - static u16 rbtx4939_mem_ioswabw(volatile u16 *a, u16 x) 52 - { 53 - return !IS_CE1_ADDR(a) ? x : le16_to_cpu(x); 54 - } 55 - #endif /* __BIG_ENDIAN && CONFIG_SMC91X */ 56 - 57 - static void __init rbtx4939_pci_setup(void) 58 - { 59 - #ifdef CONFIG_PCI 60 - int extarb = !(__raw_readq(&tx4939_ccfgptr->ccfg) & TX4939_CCFG_PCIARB); 61 - struct pci_controller *c = &txx9_primary_pcic; 62 - 63 - register_pci_controller(c); 64 - 65 - tx4939_report_pciclk(); 66 - tx4927_pcic_setup(tx4939_pcicptr, c, extarb); 67 - if (!(__raw_readq(&tx4939_ccfgptr->pcfg) & TX4939_PCFG_ATA1MODE) && 68 - (__raw_readq(&tx4939_ccfgptr->pcfg) & 69 - (TX4939_PCFG_ET0MODE | TX4939_PCFG_ET1MODE))) { 70 - tx4939_report_pci1clk(); 71 - 72 - /* mem:64K(max), io:64K(max) (enough for ETH0,ETH1) */ 73 - c = txx9_alloc_pci_controller(NULL, 0, 0x10000, 0, 0x10000); 74 - register_pci_controller(c); 75 - tx4927_pcic_setup(tx4939_pcic1ptr, c, 0); 76 - } 77 - 78 - tx4939_setup_pcierr_irq(); 79 - #endif /* CONFIG_PCI */ 80 - } 81 - 82 - static unsigned long long default_ebccr[] __initdata = { 83 - 0x01c0000000007608ULL, /* 64M ROM */ 84 - 0x017f000000007049ULL, /* 1M IOC */ 85 - 0x0180000000408608ULL, /* ISA */ 86 - 0, 87 - }; 88 - 89 - static void __init rbtx4939_ebusc_setup(void) 90 - { 91 - int i; 92 - unsigned int sp; 93 - 94 - /* use user-configured speed */ 95 - sp = TX4939_EBUSC_CR(0) & 0x30; 96 - default_ebccr[0] |= sp; 97 - default_ebccr[1] |= sp; 98 - default_ebccr[2] |= sp; 99 - /* initialise by myself */ 100 - for (i = 0; i < ARRAY_SIZE(default_ebccr); i++) { 101 - if (default_ebccr[i]) 102 - ____raw_writeq(default_ebccr[i], 103 - &tx4939_ebuscptr->cr[i]); 104 - else 105 - ____raw_writeq(____raw_readq(&tx4939_ebuscptr->cr[i]) 106 - & ~8, 107 - &tx4939_ebuscptr->cr[i]); 108 - } 109 - } 110 - 111 - static void __init rbtx4939_update_ioc_pen(void) 112 - { 113 - __u64 pcfg = ____raw_readq(&tx4939_ccfgptr->pcfg); 114 - __u64 ccfg = ____raw_readq(&tx4939_ccfgptr->ccfg); 115 - __u8 pe1 = readb(rbtx4939_pe1_addr); 116 - __u8 pe2 = readb(rbtx4939_pe2_addr); 117 - __u8 pe3 = readb(rbtx4939_pe3_addr); 118 - if (pcfg & TX4939_PCFG_ATA0MODE) 119 - pe1 |= RBTX4939_PE1_ATA(0); 120 - else 121 - pe1 &= ~RBTX4939_PE1_ATA(0); 122 - if (pcfg & TX4939_PCFG_ATA1MODE) { 123 - pe1 |= RBTX4939_PE1_ATA(1); 124 - pe1 &= ~(RBTX4939_PE1_RMII(0) | RBTX4939_PE1_RMII(1)); 125 - } else { 126 - pe1 &= ~RBTX4939_PE1_ATA(1); 127 - if (pcfg & TX4939_PCFG_ET0MODE) 128 - pe1 |= RBTX4939_PE1_RMII(0); 129 - else 130 - pe1 &= ~RBTX4939_PE1_RMII(0); 131 - if (pcfg & TX4939_PCFG_ET1MODE) 132 - pe1 |= RBTX4939_PE1_RMII(1); 133 - else 134 - pe1 &= ~RBTX4939_PE1_RMII(1); 135 - } 136 - if (ccfg & TX4939_CCFG_PTSEL) 137 - pe3 &= ~(RBTX4939_PE3_VP | RBTX4939_PE3_VP_P | 138 - RBTX4939_PE3_VP_S); 139 - else { 140 - __u64 vmode = pcfg & 141 - (TX4939_PCFG_VSSMODE | TX4939_PCFG_VPSMODE); 142 - if (vmode == 0) 143 - pe3 &= ~(RBTX4939_PE3_VP | RBTX4939_PE3_VP_P | 144 - RBTX4939_PE3_VP_S); 145 - else if (vmode == TX4939_PCFG_VPSMODE) { 146 - pe3 |= RBTX4939_PE3_VP_P; 147 - pe3 &= ~(RBTX4939_PE3_VP | RBTX4939_PE3_VP_S); 148 - } else if (vmode == TX4939_PCFG_VSSMODE) { 149 - pe3 |= RBTX4939_PE3_VP | RBTX4939_PE3_VP_S; 150 - pe3 &= ~RBTX4939_PE3_VP_P; 151 - } else { 152 - pe3 |= RBTX4939_PE3_VP | RBTX4939_PE3_VP_P; 153 - pe3 &= ~RBTX4939_PE3_VP_S; 154 - } 155 - } 156 - if (pcfg & TX4939_PCFG_SPIMODE) { 157 - if (pcfg & TX4939_PCFG_SIO2MODE_GPIO) 158 - pe2 &= ~(RBTX4939_PE2_SIO2 | RBTX4939_PE2_SIO0); 159 - else { 160 - if (pcfg & TX4939_PCFG_SIO2MODE_SIO2) { 161 - pe2 |= RBTX4939_PE2_SIO2; 162 - pe2 &= ~RBTX4939_PE2_SIO0; 163 - } else { 164 - pe2 |= RBTX4939_PE2_SIO0; 165 - pe2 &= ~RBTX4939_PE2_SIO2; 166 - } 167 - } 168 - if (pcfg & TX4939_PCFG_SIO3MODE) 169 - pe2 |= RBTX4939_PE2_SIO3; 170 - else 171 - pe2 &= ~RBTX4939_PE2_SIO3; 172 - pe2 &= ~RBTX4939_PE2_SPI; 173 - } else { 174 - pe2 |= RBTX4939_PE2_SPI; 175 - pe2 &= ~(RBTX4939_PE2_SIO3 | RBTX4939_PE2_SIO2 | 176 - RBTX4939_PE2_SIO0); 177 - } 178 - if ((pcfg & TX4939_PCFG_I2SMODE_MASK) == TX4939_PCFG_I2SMODE_GPIO) 179 - pe2 |= RBTX4939_PE2_GPIO; 180 - else 181 - pe2 &= ~RBTX4939_PE2_GPIO; 182 - writeb(pe1, rbtx4939_pe1_addr); 183 - writeb(pe2, rbtx4939_pe2_addr); 184 - writeb(pe3, rbtx4939_pe3_addr); 185 - } 186 - 187 - #define RBTX4939_MAX_7SEGLEDS 8 188 - 189 - #if IS_BUILTIN(CONFIG_LEDS_CLASS) 190 - static u8 led_val[RBTX4939_MAX_7SEGLEDS]; 191 - struct rbtx4939_led_data { 192 - struct led_classdev cdev; 193 - char name[32]; 194 - unsigned int num; 195 - }; 196 - 197 - /* Use "dot" in 7seg LEDs */ 198 - static void rbtx4939_led_brightness_set(struct led_classdev *led_cdev, 199 - enum led_brightness value) 200 - { 201 - struct rbtx4939_led_data *led_dat = 202 - container_of(led_cdev, struct rbtx4939_led_data, cdev); 203 - unsigned int num = led_dat->num; 204 - unsigned long flags; 205 - 206 - local_irq_save(flags); 207 - led_val[num] = (led_val[num] & 0x7f) | (value ? 0x80 : 0); 208 - writeb(led_val[num], rbtx4939_7seg_addr(num / 4, num % 4)); 209 - local_irq_restore(flags); 210 - } 211 - 212 - static int __init rbtx4939_led_probe(struct platform_device *pdev) 213 - { 214 - struct rbtx4939_led_data *leds_data; 215 - int i; 216 - static char *default_triggers[] __initdata = { 217 - "heartbeat", 218 - "disk-activity", 219 - "nand-disk", 220 - }; 221 - 222 - leds_data = kcalloc(RBTX4939_MAX_7SEGLEDS, sizeof(*leds_data), 223 - GFP_KERNEL); 224 - if (!leds_data) 225 - return -ENOMEM; 226 - for (i = 0; i < RBTX4939_MAX_7SEGLEDS; i++) { 227 - int rc; 228 - struct rbtx4939_led_data *led_dat = &leds_data[i]; 229 - 230 - led_dat->num = i; 231 - led_dat->cdev.brightness_set = rbtx4939_led_brightness_set; 232 - sprintf(led_dat->name, "rbtx4939:amber:%u", i); 233 - led_dat->cdev.name = led_dat->name; 234 - if (i < ARRAY_SIZE(default_triggers)) 235 - led_dat->cdev.default_trigger = default_triggers[i]; 236 - rc = led_classdev_register(&pdev->dev, &led_dat->cdev); 237 - if (rc < 0) 238 - return rc; 239 - led_dat->cdev.brightness_set(&led_dat->cdev, 0); 240 - } 241 - return 0; 242 - 243 - } 244 - 245 - static struct platform_driver rbtx4939_led_driver = { 246 - .driver = { 247 - .name = "rbtx4939-led", 248 - }, 249 - }; 250 - 251 - static void __init rbtx4939_led_setup(void) 252 - { 253 - platform_device_register_simple("rbtx4939-led", -1, NULL, 0); 254 - platform_driver_probe(&rbtx4939_led_driver, rbtx4939_led_probe); 255 - } 256 - #else 257 - static inline void rbtx4939_led_setup(void) 258 - { 259 - } 260 - #endif 261 - 262 - static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val) 263 - { 264 - #if IS_BUILTIN(CONFIG_LEDS_CLASS) 265 - unsigned long flags; 266 - local_irq_save(flags); 267 - /* bit7: reserved for LED class */ 268 - led_val[pos] = (led_val[pos] & 0x80) | (val & 0x7f); 269 - val = led_val[pos]; 270 - local_irq_restore(flags); 271 - #endif 272 - writeb(val, rbtx4939_7seg_addr(pos / 4, pos % 4)); 273 - } 274 - 275 - static void rbtx4939_7segled_putc(unsigned int pos, unsigned char val) 276 - { 277 - /* convert from map_to_seg7() notation */ 278 - val = (val & 0x88) | 279 - ((val & 0x40) >> 6) | 280 - ((val & 0x20) >> 4) | 281 - ((val & 0x10) >> 2) | 282 - ((val & 0x04) << 2) | 283 - ((val & 0x02) << 4) | 284 - ((val & 0x01) << 6); 285 - __rbtx4939_7segled_putc(pos, val); 286 - } 287 - 288 - #if IS_ENABLED(CONFIG_MTD_RBTX4939) 289 - /* special mapping for boot rom */ 290 - static unsigned long rbtx4939_flash_fixup_ofs(unsigned long ofs) 291 - { 292 - u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f; 293 - unsigned char shift; 294 - 295 - if (bdipsw & 8) { 296 - /* BOOT Mode: USER ROM1 / USER ROM2 */ 297 - shift = bdipsw & 3; 298 - /* rotate A[23:22] */ 299 - return (ofs & ~0xc00000) | ((((ofs >> 22) + shift) & 3) << 22); 300 - } 301 - #ifdef __BIG_ENDIAN 302 - if (bdipsw == 0) 303 - /* BOOT Mode: Monitor ROM */ 304 - ofs ^= 0x400000; /* swap A[22] */ 305 - #endif 306 - return ofs; 307 - } 308 - 309 - static map_word rbtx4939_flash_read16(struct map_info *map, unsigned long ofs) 310 - { 311 - map_word r; 312 - 313 - ofs = rbtx4939_flash_fixup_ofs(ofs); 314 - r.x[0] = __raw_readw(map->virt + ofs); 315 - return r; 316 - } 317 - 318 - static void rbtx4939_flash_write16(struct map_info *map, const map_word datum, 319 - unsigned long ofs) 320 - { 321 - ofs = rbtx4939_flash_fixup_ofs(ofs); 322 - __raw_writew(datum.x[0], map->virt + ofs); 323 - mb(); /* see inline_map_write() in mtd/map.h */ 324 - } 325 - 326 - static void rbtx4939_flash_copy_from(struct map_info *map, void *to, 327 - unsigned long from, ssize_t len) 328 - { 329 - u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f; 330 - unsigned char shift; 331 - ssize_t curlen; 332 - 333 - from += (unsigned long)map->virt; 334 - if (bdipsw & 8) { 335 - /* BOOT Mode: USER ROM1 / USER ROM2 */ 336 - shift = bdipsw & 3; 337 - while (len) { 338 - curlen = min_t(unsigned long, len, 339 - 0x400000 - (from & (0x400000 - 1))); 340 - memcpy(to, 341 - (void *)((from & ~0xc00000) | 342 - ((((from >> 22) + shift) & 3) << 22)), 343 - curlen); 344 - len -= curlen; 345 - from += curlen; 346 - to += curlen; 347 - } 348 - return; 349 - } 350 - #ifdef __BIG_ENDIAN 351 - if (bdipsw == 0) { 352 - /* BOOT Mode: Monitor ROM */ 353 - while (len) { 354 - curlen = min_t(unsigned long, len, 355 - 0x400000 - (from & (0x400000 - 1))); 356 - memcpy(to, (void *)(from ^ 0x400000), curlen); 357 - len -= curlen; 358 - from += curlen; 359 - to += curlen; 360 - } 361 - return; 362 - } 363 - #endif 364 - memcpy(to, (void *)from, len); 365 - } 366 - 367 - static void rbtx4939_flash_map_init(struct map_info *map) 368 - { 369 - map->read = rbtx4939_flash_read16; 370 - map->write = rbtx4939_flash_write16; 371 - map->copy_from = rbtx4939_flash_copy_from; 372 - } 373 - 374 - static void __init rbtx4939_mtd_init(void) 375 - { 376 - static struct { 377 - struct platform_device dev; 378 - struct resource res; 379 - struct rbtx4939_flash_data data; 380 - } pdevs[4]; 381 - int i; 382 - static char names[4][8]; 383 - static struct mtd_partition parts[4]; 384 - struct rbtx4939_flash_data *boot_pdata = &pdevs[0].data; 385 - u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f; 386 - 387 - if (bdipsw & 8) { 388 - /* BOOT Mode: USER ROM1 / USER ROM2 */ 389 - boot_pdata->nr_parts = 4; 390 - for (i = 0; i < boot_pdata->nr_parts; i++) { 391 - sprintf(names[i], "img%d", 4 - i); 392 - parts[i].name = names[i]; 393 - parts[i].size = 0x400000; 394 - parts[i].offset = MTDPART_OFS_NXTBLK; 395 - } 396 - } else if (bdipsw == 0) { 397 - /* BOOT Mode: Monitor ROM */ 398 - boot_pdata->nr_parts = 2; 399 - strcpy(names[0], "big"); 400 - strcpy(names[1], "little"); 401 - for (i = 0; i < boot_pdata->nr_parts; i++) { 402 - parts[i].name = names[i]; 403 - parts[i].size = 0x400000; 404 - parts[i].offset = MTDPART_OFS_NXTBLK; 405 - } 406 - } else { 407 - /* BOOT Mode: ROM Emulator */ 408 - boot_pdata->nr_parts = 2; 409 - parts[0].name = "boot"; 410 - parts[0].offset = 0xc00000; 411 - parts[0].size = 0x400000; 412 - parts[1].name = "user"; 413 - parts[1].offset = 0; 414 - parts[1].size = 0xc00000; 415 - } 416 - boot_pdata->parts = parts; 417 - boot_pdata->map_init = rbtx4939_flash_map_init; 418 - 419 - for (i = 0; i < ARRAY_SIZE(pdevs); i++) { 420 - struct resource *r = &pdevs[i].res; 421 - struct platform_device *dev = &pdevs[i].dev; 422 - 423 - r->start = 0x1f000000 - i * 0x1000000; 424 - r->end = r->start + 0x1000000 - 1; 425 - r->flags = IORESOURCE_MEM; 426 - pdevs[i].data.width = 2; 427 - dev->num_resources = 1; 428 - dev->resource = r; 429 - dev->id = i; 430 - dev->name = "rbtx4939-flash"; 431 - dev->dev.platform_data = &pdevs[i].data; 432 - platform_device_register(dev); 433 - } 434 - } 435 - #else 436 - static void __init rbtx4939_mtd_init(void) 437 - { 438 - } 439 - #endif 440 - 441 - static void __init rbtx4939_arch_init(void) 442 - { 443 - rbtx4939_pci_setup(); 444 - } 445 - 446 - static void __init rbtx4939_device_init(void) 447 - { 448 - unsigned long smc_addr = RBTX4939_ETHER_ADDR - IO_BASE; 449 - struct resource smc_res[] = { 450 - { 451 - .start = smc_addr, 452 - .end = smc_addr + 0x10 - 1, 453 - .flags = IORESOURCE_MEM, 454 - }, { 455 - .start = RBTX4939_IRQ_ETHER, 456 - /* override default irq flag defined in smc91x.h */ 457 - .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 458 - }, 459 - }; 460 - struct smc91x_platdata smc_pdata = { 461 - .flags = SMC91X_USE_16BIT, 462 - }; 463 - struct platform_device *pdev; 464 - #if IS_ENABLED(CONFIG_TC35815) 465 - int i, j; 466 - unsigned char ethaddr[2][6]; 467 - u8 bdipsw = readb(rbtx4939_bdipsw_addr) & 0x0f; 468 - 469 - for (i = 0; i < 2; i++) { 470 - unsigned long area = CKSEG1 + 0x1fff0000 + (i * 0x10); 471 - if (bdipsw == 0) 472 - memcpy(ethaddr[i], (void *)area, 6); 473 - else { 474 - u16 buf[3]; 475 - if (bdipsw & 8) 476 - area -= 0x03000000; 477 - else 478 - area -= 0x01000000; 479 - for (j = 0; j < 3; j++) 480 - buf[j] = le16_to_cpup((u16 *)(area + j * 2)); 481 - memcpy(ethaddr[i], buf, 6); 482 - } 483 - } 484 - tx4939_ethaddr_init(ethaddr[0], ethaddr[1]); 485 - #endif 486 - pdev = platform_device_alloc("smc91x", -1); 487 - if (!pdev || 488 - platform_device_add_resources(pdev, smc_res, ARRAY_SIZE(smc_res)) || 489 - platform_device_add_data(pdev, &smc_pdata, sizeof(smc_pdata)) || 490 - platform_device_add(pdev)) 491 - platform_device_put(pdev); 492 - rbtx4939_mtd_init(); 493 - /* TC58DVM82A1FT: tDH=10ns, tWP=tRP=tREADID=35ns */ 494 - tx4939_ndfmc_init(10, 35, 495 - (1 << 1) | (1 << 2), 496 - (1 << 2)); /* ch1:8bit, ch2:16bit */ 497 - rbtx4939_led_setup(); 498 - tx4939_wdt_init(); 499 - tx4939_ata_init(); 500 - tx4939_rtc_init(); 501 - tx4939_dmac_init(0, 2); 502 - tx4939_aclc_init(); 503 - platform_device_register_simple("txx9aclc-generic", -1, NULL, 0); 504 - tx4939_sramc_init(); 505 - tx4939_rng_init(); 506 - } 507 - 508 - static void __init rbtx4939_setup(void) 509 - { 510 - int i; 511 - 512 - rbtx4939_ebusc_setup(); 513 - /* always enable ATA0 */ 514 - txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE); 515 - if (txx9_master_clock == 0) 516 - txx9_master_clock = 20000000; 517 - tx4939_setup(); 518 - rbtx4939_update_ioc_pen(); 519 - #ifdef HAVE_RBTX4939_IOSWAB 520 - ioswabw = rbtx4939_ioswabw; 521 - __mem_ioswabw = rbtx4939_mem_ioswabw; 522 - #endif 523 - 524 - _machine_restart = rbtx4939_machine_restart; 525 - 526 - txx9_7segled_init(RBTX4939_MAX_7SEGLEDS, rbtx4939_7segled_putc); 527 - for (i = 0; i < RBTX4939_MAX_7SEGLEDS; i++) 528 - txx9_7segled_putc(i, '-'); 529 - pr_info("RBTX4939 (Rev %02x) --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", 530 - readb(rbtx4939_board_rev_addr), readb(rbtx4939_ioc_rev_addr), 531 - readb(rbtx4939_udipsw_addr), readb(rbtx4939_bdipsw_addr)); 532 - 533 - #ifdef CONFIG_PCI 534 - txx9_alloc_pci_controller(&txx9_primary_pcic, 0, 0, 0, 0); 535 - txx9_board_pcibios_setup = tx4927_pcibios_setup; 536 - #else 537 - set_io_port_base(RBTX4939_ETHER_BASE); 538 - #endif 539 - 540 - tx4939_sio_init(TX4939_SCLK0(txx9_master_clock), 0); 541 - } 542 - 543 - struct txx9_board_vec rbtx4939_vec __initdata = { 544 - .system = "Toshiba RBTX4939", 545 - .prom_init = rbtx4939_prom_init, 546 - .mem_setup = rbtx4939_setup, 547 - .irq_setup = rbtx4939_irq_setup, 548 - .time_init = rbtx4939_time_init, 549 - .device_init = rbtx4939_device_init, 550 - .arch_init = rbtx4939_arch_init, 551 - #ifdef CONFIG_PCI 552 - .pci_map_irq = tx4939_pci_map_irq, 553 - #endif 554 - };
-6
drivers/mtd/maps/Kconfig
··· 357 357 Map driver for a NOR flash bank located on the Expansion Bus of the 358 358 Intel Vermilion Range chipset. 359 359 360 - config MTD_RBTX4939 361 - tristate "Map driver for RBTX4939 board" 362 - depends on TOSHIBA_RBTX4939 && MTD_CFI && MTD_COMPLEX_MAPPINGS 363 - help 364 - Map driver for NOR flash chips on RBTX4939 board. 365 - 366 360 config MTD_PLATRAM 367 361 tristate "Map driver for platform device RAM (mtd-ram)" 368 362 select MTD_RAM
-1
drivers/mtd/maps/Makefile
··· 42 42 obj-$(CONFIG_MTD_IXP4XX) += ixp4xx.o 43 43 obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o 44 44 obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o 45 - obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o 46 45 obj-$(CONFIG_MTD_VMU) += vmu-flash.o 47 46 obj-$(CONFIG_MTD_LANTIQ) += lantiq-flash.o
-133
drivers/mtd/maps/rbtx4939-flash.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * rbtx4939-flash (based on physmap.c) 4 - * 5 - * This is a simplified physmap driver with map_init callback function. 6 - * 7 - * Copyright (C) 2009 Atsushi Nemoto <anemo@mba.ocn.ne.jp> 8 - */ 9 - 10 - #include <linux/module.h> 11 - #include <linux/types.h> 12 - #include <linux/kernel.h> 13 - #include <linux/slab.h> 14 - #include <linux/device.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/mtd/mtd.h> 17 - #include <linux/mtd/map.h> 18 - #include <linux/mtd/partitions.h> 19 - #include <asm/txx9/rbtx4939.h> 20 - 21 - struct rbtx4939_flash_info { 22 - struct mtd_info *mtd; 23 - struct map_info map; 24 - }; 25 - 26 - static int rbtx4939_flash_remove(struct platform_device *dev) 27 - { 28 - struct rbtx4939_flash_info *info; 29 - 30 - info = platform_get_drvdata(dev); 31 - if (!info) 32 - return 0; 33 - 34 - if (info->mtd) { 35 - mtd_device_unregister(info->mtd); 36 - map_destroy(info->mtd); 37 - } 38 - return 0; 39 - } 40 - 41 - static const char * const rom_probe_types[] = { 42 - "cfi_probe", "jedec_probe", NULL }; 43 - 44 - static int rbtx4939_flash_probe(struct platform_device *dev) 45 - { 46 - struct rbtx4939_flash_data *pdata; 47 - struct rbtx4939_flash_info *info; 48 - struct resource *res; 49 - const char * const *probe_type; 50 - int err = 0; 51 - unsigned long size; 52 - 53 - pdata = dev_get_platdata(&dev->dev); 54 - if (!pdata) 55 - return -ENODEV; 56 - 57 - res = platform_get_resource(dev, IORESOURCE_MEM, 0); 58 - if (!res) 59 - return -ENODEV; 60 - info = devm_kzalloc(&dev->dev, sizeof(struct rbtx4939_flash_info), 61 - GFP_KERNEL); 62 - if (!info) 63 - return -ENOMEM; 64 - 65 - platform_set_drvdata(dev, info); 66 - 67 - size = resource_size(res); 68 - pr_notice("rbtx4939 platform flash device: %pR\n", res); 69 - 70 - if (!devm_request_mem_region(&dev->dev, res->start, size, 71 - dev_name(&dev->dev))) 72 - return -EBUSY; 73 - 74 - info->map.name = dev_name(&dev->dev); 75 - info->map.phys = res->start; 76 - info->map.size = size; 77 - info->map.bankwidth = pdata->width; 78 - 79 - info->map.virt = devm_ioremap(&dev->dev, info->map.phys, size); 80 - if (!info->map.virt) 81 - return -EBUSY; 82 - 83 - if (pdata->map_init) 84 - (*pdata->map_init)(&info->map); 85 - else 86 - simple_map_init(&info->map); 87 - 88 - probe_type = rom_probe_types; 89 - for (; !info->mtd && *probe_type; probe_type++) 90 - info->mtd = do_map_probe(*probe_type, &info->map); 91 - if (!info->mtd) { 92 - dev_err(&dev->dev, "map_probe failed\n"); 93 - err = -ENXIO; 94 - goto err_out; 95 - } 96 - info->mtd->dev.parent = &dev->dev; 97 - err = mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts); 98 - 99 - if (err) 100 - goto err_out; 101 - return 0; 102 - 103 - err_out: 104 - rbtx4939_flash_remove(dev); 105 - return err; 106 - } 107 - 108 - #ifdef CONFIG_PM 109 - static void rbtx4939_flash_shutdown(struct platform_device *dev) 110 - { 111 - struct rbtx4939_flash_info *info = platform_get_drvdata(dev); 112 - 113 - if (mtd_suspend(info->mtd) == 0) 114 - mtd_resume(info->mtd); 115 - } 116 - #else 117 - #define rbtx4939_flash_shutdown NULL 118 - #endif 119 - 120 - static struct platform_driver rbtx4939_flash_driver = { 121 - .probe = rbtx4939_flash_probe, 122 - .remove = rbtx4939_flash_remove, 123 - .shutdown = rbtx4939_flash_shutdown, 124 - .driver = { 125 - .name = "rbtx4939-flash", 126 - }, 127 - }; 128 - 129 - module_platform_driver(rbtx4939_flash_driver); 130 - 131 - MODULE_LICENSE("GPL"); 132 - MODULE_DESCRIPTION("RBTX4939 MTD map driver"); 133 - MODULE_ALIAS("platform:rbtx4939-flash");