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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (110 commits)
sh: i2c-sh7760: Replase from ctrl_* to __raw_*
sh: clkfwk: Shuffle around to match the intc split up.
sh: clkfwk: modify for_each_frequency end condition
sh: fix clk_get() error handling
sh: clkfwk: Fix fault in frequency iterator.
sh: clkfwk: Add a helper for rate rounding by divisor ranges.
sh: clkfwk: Abstract rate rounding helper.
sh: clkfwk: support clock remapping.
sh: pci: Convert to upper/lower_32_bits() helpers.
sh: mach-sdk7786: Add support for the FPGA SRAM.
sh: Provide a generic SRAM pool for tiny memories.
sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786.
sh: pci: Support slot 4 routing on SDK7786.
sh: Fix up PMB locking.
sh: mach-sdk7786: Add support for fpga gpios.
sh: use pr_fmt for clock framework, too.
sh: remove name and id from struct clk
sh: free-without-alloc fix for sh_mobile_lcdcfb
sh: perf: Set up perf_max_events.
sh: perf: Support SH-X3 hardware counters.
...

Fix up trivial conflicts (perf_max_events got removed) in arch/sh/kernel/perf_event.c

+7308 -3099
+4 -2
arch/sh/Kconfig
··· 24 24 select HAVE_KERNEL_LZMA 25 25 select HAVE_KERNEL_LZO 26 26 select HAVE_SYSCALL_TRACEPOINTS 27 + select HAVE_REGS_AND_STACK_ACCESS_API 27 28 select RTC_LIB 28 29 select GENERIC_ATOMIC64 29 30 help ··· 47 46 select HAVE_ARCH_KGDB 48 47 select HAVE_HW_BREAKPOINT 49 48 select HAVE_MIXED_BREAKPOINTS_REGS 50 - select PERF_EVENTS if HAVE_HW_BREAKPOINT 49 + select PERF_EVENTS 51 50 select ARCH_HIBERNATION_POSSIBLE if MMU 52 51 53 52 config SUPERH64 ··· 472 471 select CPU_SH4A 473 472 select CPU_SHX3 474 473 select GENERIC_CLOCKEVENTS_BROADCAST if SMP 474 + select ARCH_REQUIRE_GPIOLIB 475 475 476 476 # SH4AL-DSP Processor Support 477 477 ··· 577 575 config SH_CLK_CPG_LEGACY 578 576 depends on SH_CLK_CPG 579 577 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \ 580 - !CPU_SUBTYPE_SH7786 578 + !CPU_SHX3 && !CPU_SUBTYPE_SH7757 581 579 582 580 config SH_CLK_MD 583 581 int "CPU Mode Pin Setting"
+18
arch/sh/boards/Kconfig
··· 155 155 depends on CPU_SUBTYPE_SH7786 156 156 select SYS_SUPPORTS_PCI 157 157 select NO_IOPORT if !PCI 158 + select ARCH_WANT_OPTIONAL_GPIOLIB 159 + select HAVE_SRAM_POOL 158 160 help 159 161 Select SDK7786 if configuring for a Renesas Technology Europe 160 162 SH7786-65nm board. ··· 166 164 depends on CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7785 167 165 select SYS_SUPPORTS_PCI 168 166 select IO_TRAPPED if MMU 167 + 168 + config SH_SH7757LCR 169 + bool "SH7757LCR" 170 + depends on CPU_SUBTYPE_SH7757 171 + select ARCH_REQUIRE_GPIOLIB 169 172 170 173 config SH_SH7785LCR 171 174 bool "SH7785LCR" ··· 315 308 depends on CPU_SUBTYPE_SH7709 316 309 help 317 310 Select if configuring for an SMSC Polaris development board 311 + 312 + config SH_SH2007 313 + bool "SH-2007 board" 314 + select NO_IOPORT 315 + depends on CPU_SUBTYPE_SH7780 316 + help 317 + SH-2007 is a single-board computer based around SH7780 chip 318 + intended for embedded applications. 319 + It has an Ethernet interface (SMC9118), direct connected 320 + Compact Flash socket, two serial ports and PC-104 bus. 321 + More information at <http://sh2000.sh-linux.org>. 318 322 319 323 endmenu 320 324
+2
arch/sh/boards/Makefile
··· 2 2 # Specific board support, not covered by a mach group. 3 3 # 4 4 obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o 5 + obj-$(CONFIG_SH_SH2007) += board-sh2007.o 5 6 obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o 6 7 obj-$(CONFIG_SH_URQUELL) += board-urquell.o 7 8 obj-$(CONFIG_SH_SHMIN) += board-shmin.o ··· 10 9 obj-$(CONFIG_SH_ESPT) += board-espt.o 11 10 obj-$(CONFIG_SH_POLARIS) += board-polaris.o 12 11 obj-$(CONFIG_SH_TITAN) += board-titan.o 12 + obj-$(CONFIG_SH_SH7757LCR) += board-sh7757lcr.o
+133
arch/sh/boards/board-sh2007.c
··· 1 + /* 2 + * SH-2007 board support. 3 + * 4 + * Copyright (C) 2003, 2004 SUGIOKA Toshinobu 5 + * Copyright (C) 2010 Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> 6 + */ 7 + #include <linux/init.h> 8 + #include <linux/irq.h> 9 + #include <linux/smsc911x.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/ata_platform.h> 12 + #include <linux/io.h> 13 + #include <asm/machvec.h> 14 + #include <mach/sh2007.h> 15 + 16 + struct smsc911x_platform_config smc911x_info = { 17 + .flags = SMSC911X_USE_32BIT, 18 + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 19 + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, 20 + }; 21 + 22 + static struct resource smsc9118_0_resources[] = { 23 + [0] = { 24 + .start = SMC0_BASE, 25 + .end = SMC0_BASE + 0xff, 26 + .flags = IORESOURCE_MEM, 27 + }, 28 + [1] = { 29 + .start = evt2irq(0x240), 30 + .end = evt2irq(0x240), 31 + .flags = IORESOURCE_IRQ, 32 + } 33 + }; 34 + 35 + static struct resource smsc9118_1_resources[] = { 36 + [0] = { 37 + .start = SMC1_BASE, 38 + .end = SMC1_BASE + 0xff, 39 + .flags = IORESOURCE_MEM, 40 + }, 41 + [1] = { 42 + .start = evt2irq(0x280), 43 + .end = evt2irq(0x280), 44 + .flags = IORESOURCE_IRQ, 45 + } 46 + }; 47 + 48 + static struct platform_device smsc9118_0_device = { 49 + .name = "smsc911x", 50 + .id = 0, 51 + .num_resources = ARRAY_SIZE(smsc9118_0_resources), 52 + .resource = smsc9118_0_resources, 53 + .dev = { 54 + .platform_data = &smc911x_info, 55 + }, 56 + }; 57 + 58 + static struct platform_device smsc9118_1_device = { 59 + .name = "smsc911x", 60 + .id = 1, 61 + .num_resources = ARRAY_SIZE(smsc9118_1_resources), 62 + .resource = smsc9118_1_resources, 63 + .dev = { 64 + .platform_data = &smc911x_info, 65 + }, 66 + }; 67 + 68 + static struct resource cf_resources[] = { 69 + [0] = { 70 + .start = CF_BASE + CF_OFFSET, 71 + .end = CF_BASE + CF_OFFSET + 0x0f, 72 + .flags = IORESOURCE_MEM, 73 + }, 74 + [1] = { 75 + .start = CF_BASE + CF_OFFSET + 0x206, 76 + .end = CF_BASE + CF_OFFSET + 0x20f, 77 + .flags = IORESOURCE_MEM, 78 + }, 79 + [2] = { 80 + .start = evt2irq(0x2c0), 81 + .end = evt2irq(0x2c0), 82 + .flags = IORESOURCE_IRQ, 83 + }, 84 + }; 85 + 86 + static struct platform_device cf_device = { 87 + .name = "pata_platform", 88 + .id = 0, 89 + .num_resources = ARRAY_SIZE(cf_resources), 90 + .resource = cf_resources, 91 + }; 92 + 93 + static struct platform_device *sh2007_devices[] __initdata = { 94 + &smsc9118_0_device, 95 + &smsc9118_1_device, 96 + &cf_device, 97 + }; 98 + 99 + static int __init sh2007_io_init(void) 100 + { 101 + platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); 102 + return 0; 103 + } 104 + subsys_initcall(sh2007_io_init); 105 + 106 + static void __init sh2007_init_irq(void) 107 + { 108 + plat_irq_setup_pins(IRQ_MODE_IRQ); 109 + } 110 + 111 + /* 112 + * Initialize the board 113 + */ 114 + static void __init sh2007_setup(char **cmdline_p) 115 + { 116 + printk(KERN_INFO "SH-2007 Setup..."); 117 + 118 + /* setup wait control registers for area 5 */ 119 + __raw_writel(CS5BCR_D, CS5BCR); 120 + __raw_writel(CS5WCR_D, CS5WCR); 121 + __raw_writel(CS5PCR_D, CS5PCR); 122 + 123 + printk(KERN_INFO " done.\n"); 124 + } 125 + 126 + /* 127 + * The Machine Vector 128 + */ 129 + struct sh_machine_vector mv_sh2007 __initmv = { 130 + .mv_setup = sh2007_setup, 131 + .mv_name = "sh2007", 132 + .mv_init_irq = sh2007_init_irq, 133 + };
+374
arch/sh/boards/board-sh7757lcr.c
··· 1 + /* 2 + * Renesas R0P7757LC0012RL Support. 3 + * 4 + * Copyright (C) 2009 - 2010 Renesas Solutions Corp. 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + 11 + #include <linux/init.h> 12 + #include <linux/platform_device.h> 13 + #include <linux/gpio.h> 14 + #include <linux/irq.h> 15 + #include <linux/spi/spi.h> 16 + #include <linux/spi/flash.h> 17 + #include <linux/io.h> 18 + #include <cpu/sh7757.h> 19 + #include <asm/sh_eth.h> 20 + #include <asm/heartbeat.h> 21 + 22 + static struct resource heartbeat_resource = { 23 + .start = 0xffec005c, /* PUDR */ 24 + .end = 0xffec005c, 25 + .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 26 + }; 27 + 28 + static unsigned char heartbeat_bit_pos[] = { 0, 1, 2, 3 }; 29 + 30 + static struct heartbeat_data heartbeat_data = { 31 + .bit_pos = heartbeat_bit_pos, 32 + .nr_bits = ARRAY_SIZE(heartbeat_bit_pos), 33 + .flags = HEARTBEAT_INVERTED, 34 + }; 35 + 36 + static struct platform_device heartbeat_device = { 37 + .name = "heartbeat", 38 + .id = -1, 39 + .dev = { 40 + .platform_data = &heartbeat_data, 41 + }, 42 + .num_resources = 1, 43 + .resource = &heartbeat_resource, 44 + }; 45 + 46 + /* Fast Ethernet */ 47 + static struct resource sh_eth0_resources[] = { 48 + { 49 + .start = 0xfef00000, 50 + .end = 0xfef001ff, 51 + .flags = IORESOURCE_MEM, 52 + }, { 53 + .start = 84, 54 + .end = 84, 55 + .flags = IORESOURCE_IRQ, 56 + }, 57 + }; 58 + 59 + static struct sh_eth_plat_data sh7757_eth0_pdata = { 60 + .phy = 1, 61 + .edmac_endian = EDMAC_LITTLE_ENDIAN, 62 + }; 63 + 64 + static struct platform_device sh7757_eth0_device = { 65 + .name = "sh-eth", 66 + .resource = sh_eth0_resources, 67 + .id = 0, 68 + .num_resources = ARRAY_SIZE(sh_eth0_resources), 69 + .dev = { 70 + .platform_data = &sh7757_eth0_pdata, 71 + }, 72 + }; 73 + 74 + static struct resource sh_eth1_resources[] = { 75 + { 76 + .start = 0xfef00800, 77 + .end = 0xfef009ff, 78 + .flags = IORESOURCE_MEM, 79 + }, { 80 + .start = 84, 81 + .end = 84, 82 + .flags = IORESOURCE_IRQ, 83 + }, 84 + }; 85 + 86 + static struct sh_eth_plat_data sh7757_eth1_pdata = { 87 + .phy = 1, 88 + .edmac_endian = EDMAC_LITTLE_ENDIAN, 89 + }; 90 + 91 + static struct platform_device sh7757_eth1_device = { 92 + .name = "sh-eth", 93 + .resource = sh_eth1_resources, 94 + .id = 1, 95 + .num_resources = ARRAY_SIZE(sh_eth1_resources), 96 + .dev = { 97 + .platform_data = &sh7757_eth1_pdata, 98 + }, 99 + }; 100 + 101 + static struct platform_device *sh7757lcr_devices[] __initdata = { 102 + &heartbeat_device, 103 + &sh7757_eth0_device, 104 + &sh7757_eth1_device, 105 + }; 106 + 107 + static int __init sh7757lcr_devices_setup(void) 108 + { 109 + /* RGMII (PTA) */ 110 + gpio_request(GPIO_FN_ET0_MDC, NULL); 111 + gpio_request(GPIO_FN_ET0_MDIO, NULL); 112 + gpio_request(GPIO_FN_ET1_MDC, NULL); 113 + gpio_request(GPIO_FN_ET1_MDIO, NULL); 114 + 115 + /* ONFI (PTB, PTZ) */ 116 + gpio_request(GPIO_FN_ON_NRE, NULL); 117 + gpio_request(GPIO_FN_ON_NWE, NULL); 118 + gpio_request(GPIO_FN_ON_NWP, NULL); 119 + gpio_request(GPIO_FN_ON_NCE0, NULL); 120 + gpio_request(GPIO_FN_ON_R_B0, NULL); 121 + gpio_request(GPIO_FN_ON_ALE, NULL); 122 + gpio_request(GPIO_FN_ON_CLE, NULL); 123 + 124 + gpio_request(GPIO_FN_ON_DQ7, NULL); 125 + gpio_request(GPIO_FN_ON_DQ6, NULL); 126 + gpio_request(GPIO_FN_ON_DQ5, NULL); 127 + gpio_request(GPIO_FN_ON_DQ4, NULL); 128 + gpio_request(GPIO_FN_ON_DQ3, NULL); 129 + gpio_request(GPIO_FN_ON_DQ2, NULL); 130 + gpio_request(GPIO_FN_ON_DQ1, NULL); 131 + gpio_request(GPIO_FN_ON_DQ0, NULL); 132 + 133 + /* IRQ8 to 0 (PTB, PTC) */ 134 + gpio_request(GPIO_FN_IRQ8, NULL); 135 + gpio_request(GPIO_FN_IRQ7, NULL); 136 + gpio_request(GPIO_FN_IRQ6, NULL); 137 + gpio_request(GPIO_FN_IRQ5, NULL); 138 + gpio_request(GPIO_FN_IRQ4, NULL); 139 + gpio_request(GPIO_FN_IRQ3, NULL); 140 + gpio_request(GPIO_FN_IRQ2, NULL); 141 + gpio_request(GPIO_FN_IRQ1, NULL); 142 + gpio_request(GPIO_FN_IRQ0, NULL); 143 + 144 + /* SPI0 (PTD) */ 145 + gpio_request(GPIO_FN_SP0_MOSI, NULL); 146 + gpio_request(GPIO_FN_SP0_MISO, NULL); 147 + gpio_request(GPIO_FN_SP0_SCK, NULL); 148 + gpio_request(GPIO_FN_SP0_SCK_FB, NULL); 149 + gpio_request(GPIO_FN_SP0_SS0, NULL); 150 + gpio_request(GPIO_FN_SP0_SS1, NULL); 151 + gpio_request(GPIO_FN_SP0_SS2, NULL); 152 + gpio_request(GPIO_FN_SP0_SS3, NULL); 153 + 154 + /* RMII 0/1 (PTE, PTF) */ 155 + gpio_request(GPIO_FN_RMII0_CRS_DV, NULL); 156 + gpio_request(GPIO_FN_RMII0_TXD1, NULL); 157 + gpio_request(GPIO_FN_RMII0_TXD0, NULL); 158 + gpio_request(GPIO_FN_RMII0_TXEN, NULL); 159 + gpio_request(GPIO_FN_RMII0_REFCLK, NULL); 160 + gpio_request(GPIO_FN_RMII0_RXD1, NULL); 161 + gpio_request(GPIO_FN_RMII0_RXD0, NULL); 162 + gpio_request(GPIO_FN_RMII0_RX_ER, NULL); 163 + gpio_request(GPIO_FN_RMII1_CRS_DV, NULL); 164 + gpio_request(GPIO_FN_RMII1_TXD1, NULL); 165 + gpio_request(GPIO_FN_RMII1_TXD0, NULL); 166 + gpio_request(GPIO_FN_RMII1_TXEN, NULL); 167 + gpio_request(GPIO_FN_RMII1_REFCLK, NULL); 168 + gpio_request(GPIO_FN_RMII1_RXD1, NULL); 169 + gpio_request(GPIO_FN_RMII1_RXD0, NULL); 170 + gpio_request(GPIO_FN_RMII1_RX_ER, NULL); 171 + 172 + /* eMMC (PTG) */ 173 + gpio_request(GPIO_FN_MMCCLK, NULL); 174 + gpio_request(GPIO_FN_MMCCMD, NULL); 175 + gpio_request(GPIO_FN_MMCDAT7, NULL); 176 + gpio_request(GPIO_FN_MMCDAT6, NULL); 177 + gpio_request(GPIO_FN_MMCDAT5, NULL); 178 + gpio_request(GPIO_FN_MMCDAT4, NULL); 179 + gpio_request(GPIO_FN_MMCDAT3, NULL); 180 + gpio_request(GPIO_FN_MMCDAT2, NULL); 181 + gpio_request(GPIO_FN_MMCDAT1, NULL); 182 + gpio_request(GPIO_FN_MMCDAT0, NULL); 183 + 184 + /* LPC (PTG, PTH, PTQ, PTU) */ 185 + gpio_request(GPIO_FN_SERIRQ, NULL); 186 + gpio_request(GPIO_FN_LPCPD, NULL); 187 + gpio_request(GPIO_FN_LDRQ, NULL); 188 + gpio_request(GPIO_FN_WP, NULL); 189 + gpio_request(GPIO_FN_FMS0, NULL); 190 + gpio_request(GPIO_FN_LAD3, NULL); 191 + gpio_request(GPIO_FN_LAD2, NULL); 192 + gpio_request(GPIO_FN_LAD1, NULL); 193 + gpio_request(GPIO_FN_LAD0, NULL); 194 + gpio_request(GPIO_FN_LFRAME, NULL); 195 + gpio_request(GPIO_FN_LRESET, NULL); 196 + gpio_request(GPIO_FN_LCLK, NULL); 197 + gpio_request(GPIO_FN_LGPIO7, NULL); 198 + gpio_request(GPIO_FN_LGPIO6, NULL); 199 + gpio_request(GPIO_FN_LGPIO5, NULL); 200 + gpio_request(GPIO_FN_LGPIO4, NULL); 201 + 202 + /* SPI1 (PTH) */ 203 + gpio_request(GPIO_FN_SP1_MOSI, NULL); 204 + gpio_request(GPIO_FN_SP1_MISO, NULL); 205 + gpio_request(GPIO_FN_SP1_SCK, NULL); 206 + gpio_request(GPIO_FN_SP1_SCK_FB, NULL); 207 + gpio_request(GPIO_FN_SP1_SS0, NULL); 208 + gpio_request(GPIO_FN_SP1_SS1, NULL); 209 + 210 + /* SDHI (PTI) */ 211 + gpio_request(GPIO_FN_SD_WP, NULL); 212 + gpio_request(GPIO_FN_SD_CD, NULL); 213 + gpio_request(GPIO_FN_SD_CLK, NULL); 214 + gpio_request(GPIO_FN_SD_CMD, NULL); 215 + gpio_request(GPIO_FN_SD_D3, NULL); 216 + gpio_request(GPIO_FN_SD_D2, NULL); 217 + gpio_request(GPIO_FN_SD_D1, NULL); 218 + gpio_request(GPIO_FN_SD_D0, NULL); 219 + 220 + /* SCIF3/4 (PTJ, PTW) */ 221 + gpio_request(GPIO_FN_RTS3, NULL); 222 + gpio_request(GPIO_FN_CTS3, NULL); 223 + gpio_request(GPIO_FN_TXD3, NULL); 224 + gpio_request(GPIO_FN_RXD3, NULL); 225 + gpio_request(GPIO_FN_RTS4, NULL); 226 + gpio_request(GPIO_FN_RXD4, NULL); 227 + gpio_request(GPIO_FN_TXD4, NULL); 228 + gpio_request(GPIO_FN_CTS4, NULL); 229 + 230 + /* SERMUX (PTK, PTL, PTO, PTV) */ 231 + gpio_request(GPIO_FN_COM2_TXD, NULL); 232 + gpio_request(GPIO_FN_COM2_RXD, NULL); 233 + gpio_request(GPIO_FN_COM2_RTS, NULL); 234 + gpio_request(GPIO_FN_COM2_CTS, NULL); 235 + gpio_request(GPIO_FN_COM2_DTR, NULL); 236 + gpio_request(GPIO_FN_COM2_DSR, NULL); 237 + gpio_request(GPIO_FN_COM2_DCD, NULL); 238 + gpio_request(GPIO_FN_COM2_RI, NULL); 239 + gpio_request(GPIO_FN_RAC_RXD, NULL); 240 + gpio_request(GPIO_FN_RAC_RTS, NULL); 241 + gpio_request(GPIO_FN_RAC_CTS, NULL); 242 + gpio_request(GPIO_FN_RAC_DTR, NULL); 243 + gpio_request(GPIO_FN_RAC_DSR, NULL); 244 + gpio_request(GPIO_FN_RAC_DCD, NULL); 245 + gpio_request(GPIO_FN_RAC_TXD, NULL); 246 + gpio_request(GPIO_FN_COM1_TXD, NULL); 247 + gpio_request(GPIO_FN_COM1_RXD, NULL); 248 + gpio_request(GPIO_FN_COM1_RTS, NULL); 249 + gpio_request(GPIO_FN_COM1_CTS, NULL); 250 + 251 + writeb(0x10, 0xfe470000); /* SMR0: SerMux mode 0 */ 252 + 253 + /* IIC (PTM, PTR, PTS) */ 254 + gpio_request(GPIO_FN_SDA7, NULL); 255 + gpio_request(GPIO_FN_SCL7, NULL); 256 + gpio_request(GPIO_FN_SDA6, NULL); 257 + gpio_request(GPIO_FN_SCL6, NULL); 258 + gpio_request(GPIO_FN_SDA5, NULL); 259 + gpio_request(GPIO_FN_SCL5, NULL); 260 + gpio_request(GPIO_FN_SDA4, NULL); 261 + gpio_request(GPIO_FN_SCL4, NULL); 262 + gpio_request(GPIO_FN_SDA3, NULL); 263 + gpio_request(GPIO_FN_SCL3, NULL); 264 + gpio_request(GPIO_FN_SDA2, NULL); 265 + gpio_request(GPIO_FN_SCL2, NULL); 266 + gpio_request(GPIO_FN_SDA1, NULL); 267 + gpio_request(GPIO_FN_SCL1, NULL); 268 + gpio_request(GPIO_FN_SDA0, NULL); 269 + gpio_request(GPIO_FN_SCL0, NULL); 270 + 271 + /* USB (PTN) */ 272 + gpio_request(GPIO_FN_VBUS_EN, NULL); 273 + gpio_request(GPIO_FN_VBUS_OC, NULL); 274 + 275 + /* SGPIO1/0 (PTN, PTO) */ 276 + gpio_request(GPIO_FN_SGPIO1_CLK, NULL); 277 + gpio_request(GPIO_FN_SGPIO1_LOAD, NULL); 278 + gpio_request(GPIO_FN_SGPIO1_DI, NULL); 279 + gpio_request(GPIO_FN_SGPIO1_DO, NULL); 280 + gpio_request(GPIO_FN_SGPIO0_CLK, NULL); 281 + gpio_request(GPIO_FN_SGPIO0_LOAD, NULL); 282 + gpio_request(GPIO_FN_SGPIO0_DI, NULL); 283 + gpio_request(GPIO_FN_SGPIO0_DO, NULL); 284 + 285 + /* WDT (PTN) */ 286 + gpio_request(GPIO_FN_SUB_CLKIN, NULL); 287 + 288 + /* System (PTT) */ 289 + gpio_request(GPIO_FN_STATUS1, NULL); 290 + gpio_request(GPIO_FN_STATUS0, NULL); 291 + 292 + /* PWMX (PTT) */ 293 + gpio_request(GPIO_FN_PWMX1, NULL); 294 + gpio_request(GPIO_FN_PWMX0, NULL); 295 + 296 + /* R-SPI (PTV) */ 297 + gpio_request(GPIO_FN_R_SPI_MOSI, NULL); 298 + gpio_request(GPIO_FN_R_SPI_MISO, NULL); 299 + gpio_request(GPIO_FN_R_SPI_RSPCK, NULL); 300 + gpio_request(GPIO_FN_R_SPI_SSL0, NULL); 301 + gpio_request(GPIO_FN_R_SPI_SSL1, NULL); 302 + 303 + /* EVC (PTV, PTW) */ 304 + gpio_request(GPIO_FN_EVENT7, NULL); 305 + gpio_request(GPIO_FN_EVENT6, NULL); 306 + gpio_request(GPIO_FN_EVENT5, NULL); 307 + gpio_request(GPIO_FN_EVENT4, NULL); 308 + gpio_request(GPIO_FN_EVENT3, NULL); 309 + gpio_request(GPIO_FN_EVENT2, NULL); 310 + gpio_request(GPIO_FN_EVENT1, NULL); 311 + gpio_request(GPIO_FN_EVENT0, NULL); 312 + 313 + /* LED for heartbeat */ 314 + gpio_request(GPIO_PTU3, NULL); 315 + gpio_direction_output(GPIO_PTU3, 1); 316 + gpio_request(GPIO_PTU2, NULL); 317 + gpio_direction_output(GPIO_PTU2, 1); 318 + gpio_request(GPIO_PTU1, NULL); 319 + gpio_direction_output(GPIO_PTU1, 1); 320 + gpio_request(GPIO_PTU0, NULL); 321 + gpio_direction_output(GPIO_PTU0, 1); 322 + 323 + /* control for MDIO of Gigabit Ethernet */ 324 + gpio_request(GPIO_PTT4, NULL); 325 + gpio_direction_output(GPIO_PTT4, 1); 326 + 327 + /* control for eMMC */ 328 + gpio_request(GPIO_PTT7, NULL); /* eMMC_RST# */ 329 + gpio_direction_output(GPIO_PTT7, 0); 330 + gpio_request(GPIO_PTT6, NULL); /* eMMC_INDEX# */ 331 + gpio_direction_output(GPIO_PTT6, 0); 332 + gpio_request(GPIO_PTT5, NULL); /* eMMC_PRST# */ 333 + gpio_direction_output(GPIO_PTT5, 1); 334 + 335 + /* General platform */ 336 + return platform_add_devices(sh7757lcr_devices, 337 + ARRAY_SIZE(sh7757lcr_devices)); 338 + } 339 + arch_initcall(sh7757lcr_devices_setup); 340 + 341 + /* Initialize IRQ setting */ 342 + void __init init_sh7757lcr_IRQ(void) 343 + { 344 + plat_irq_setup_pins(IRQ_MODE_IRQ7654); 345 + plat_irq_setup_pins(IRQ_MODE_IRQ3210); 346 + } 347 + 348 + /* Initialize the board */ 349 + static void __init sh7757lcr_setup(char **cmdline_p) 350 + { 351 + printk(KERN_INFO "Renesas R0P7757LC0012RL support.\n"); 352 + } 353 + 354 + static int sh7757lcr_mode_pins(void) 355 + { 356 + int value = 0; 357 + 358 + /* These are the factory default settings of S3 (Low active). 359 + * If you change these dip switches then you will need to 360 + * adjust the values below as well. 361 + */ 362 + value |= MODE_PIN0; /* Clock Mode: 1 */ 363 + 364 + return value; 365 + } 366 + 367 + /* The Machine Vector */ 368 + static struct sh_machine_vector mv_sh7757lcr __initmv = { 369 + .mv_name = "SH7757LCR", 370 + .mv_setup = sh7757lcr_setup, 371 + .mv_init_irq = init_sh7757lcr_IRQ, 372 + .mv_mode_pins = sh7757lcr_mode_pins, 373 + }; 374 +
+3 -3
arch/sh/boards/mach-ecovec24/setup.c
··· 1248 1248 1249 1249 /* set SPU2 clock to 83.4 MHz */ 1250 1250 clk = clk_get(NULL, "spu_clk"); 1251 - if (clk) { 1251 + if (!IS_ERR(clk)) { 1252 1252 clk_set_rate(clk, clk_round_rate(clk, 83333333)); 1253 1253 clk_put(clk); 1254 1254 } 1255 1255 1256 1256 /* change parent of FSI B */ 1257 1257 clk = clk_get(NULL, "fsib_clk"); 1258 - if (clk) { 1258 + if (!IS_ERR(clk)) { 1259 1259 clk_register(&fsimckb_clk); 1260 1260 clk_set_parent(clk, &fsimckb_clk); 1261 1261 clk_set_rate(clk, 11000); ··· 1273 1273 1274 1274 /* set VPU clock to 166 MHz */ 1275 1275 clk = clk_get(NULL, "vpu_clk"); 1276 - if (clk) { 1276 + if (!IS_ERR(clk)) { 1277 1277 clk_set_rate(clk, clk_round_rate(clk, 166000000)); 1278 1278 clk_put(clk); 1279 1279 }
+4 -1
arch/sh/boards/mach-sdk7786/Makefile
··· 1 - obj-y := setup.o fpga.o irq.o 1 + obj-y := fpga.o irq.o setup.o 2 + 3 + obj-$(CONFIG_GENERIC_GPIO) += gpio.o 4 + obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o
+49
arch/sh/boards/mach-sdk7786/gpio.c
··· 1 + /* 2 + * SDK7786 FPGA USRGPIR Support. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include <linux/init.h> 11 + #include <linux/interrupt.h> 12 + #include <linux/gpio.h> 13 + #include <linux/irq.h> 14 + #include <linux/kernel.h> 15 + #include <linux/spinlock.h> 16 + #include <linux/io.h> 17 + #include <mach/fpga.h> 18 + 19 + #define NR_FPGA_GPIOS 8 20 + 21 + static const char *usrgpir_gpio_names[NR_FPGA_GPIOS] = { 22 + "in0", "in1", "in2", "in3", "in4", "in5", "in6", "in7", 23 + }; 24 + 25 + static int usrgpir_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 26 + { 27 + /* always in */ 28 + return 0; 29 + } 30 + 31 + static int usrgpir_gpio_get(struct gpio_chip *chip, unsigned gpio) 32 + { 33 + return !!(fpga_read_reg(USRGPIR) & (1 << gpio)); 34 + } 35 + 36 + static struct gpio_chip usrgpir_gpio_chip = { 37 + .label = "sdk7786-fpga", 38 + .names = usrgpir_gpio_names, 39 + .direction_input = usrgpir_gpio_direction_input, 40 + .get = usrgpir_gpio_get, 41 + .base = -1, /* don't care */ 42 + .ngpio = NR_FPGA_GPIOS, 43 + }; 44 + 45 + static int __init usrgpir_gpio_setup(void) 46 + { 47 + return gpiochip_add(&usrgpir_gpio_chip); 48 + } 49 + device_initcall(usrgpir_gpio_setup);
+53 -1
arch/sh/boards/mach-sdk7786/setup.c
··· 20 20 #include <asm/machvec.h> 21 21 #include <asm/heartbeat.h> 22 22 #include <asm/sizes.h> 23 + #include <asm/clock.h> 24 + #include <asm/clkdev.h> 23 25 #include <asm/reboot.h> 24 26 #include <asm/smp-ops.h> 25 27 ··· 142 140 return fpga_read_reg(MODSWR); 143 141 } 144 142 143 + /* 144 + * FPGA-driven PCIe clocks 145 + * 146 + * Historically these include the oscillator, clock B (slots 2/3/4) and 147 + * clock A (slot 1 and the CPU clock). Newer revs of the PCB shove 148 + * everything under a single PCIe clocks enable bit that happens to map 149 + * to the same bit position as the oscillator bit for earlier FPGA 150 + * versions. 151 + * 152 + * Given that the legacy clocks have the side-effect of shutting the CPU 153 + * off through the FPGA along with the PCI slots, we simply leave them in 154 + * their initial state and don't bother registering them with the clock 155 + * framework. 156 + */ 157 + static int sdk7786_pcie_clk_enable(struct clk *clk) 158 + { 159 + fpga_write_reg(fpga_read_reg(PCIECR) | PCIECR_CLKEN, PCIECR); 160 + return 0; 161 + } 162 + 163 + static void sdk7786_pcie_clk_disable(struct clk *clk) 164 + { 165 + fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR); 166 + } 167 + 168 + static struct clk_ops sdk7786_pcie_clk_ops = { 169 + .enable = sdk7786_pcie_clk_enable, 170 + .disable = sdk7786_pcie_clk_disable, 171 + }; 172 + 173 + static struct clk sdk7786_pcie_clk = { 174 + .ops = &sdk7786_pcie_clk_ops, 175 + }; 176 + 177 + static struct clk_lookup sdk7786_pcie_cl = { 178 + .con_id = "pcie_plat_clk", 179 + .clk = &sdk7786_pcie_clk, 180 + }; 181 + 145 182 static int sdk7786_clk_init(void) 146 183 { 147 184 struct clk *clk; ··· 199 158 ret = clk_set_rate(clk, 33333333); 200 159 clk_put(clk); 201 160 202 - return ret; 161 + /* 162 + * Setup the FPGA clocks. 163 + */ 164 + ret = clk_register(&sdk7786_pcie_clk); 165 + if (unlikely(ret)) { 166 + pr_err("FPGA clock registration failed\n"); 167 + return ret; 168 + } 169 + 170 + clkdev_add(&sdk7786_pcie_cl); 171 + 172 + return 0; 203 173 } 204 174 205 175 static void sdk7786_restart(char *cmd)
+72
arch/sh/boards/mach-sdk7786/sram.c
··· 1 + /* 2 + * SDK7786 FPGA SRAM Support. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 12 + #include <linux/init.h> 13 + #include <linux/kernel.h> 14 + #include <linux/types.h> 15 + #include <linux/io.h> 16 + #include <linux/string.h> 17 + #include <mach/fpga.h> 18 + #include <asm/sram.h> 19 + #include <asm/sizes.h> 20 + 21 + static int __init fpga_sram_init(void) 22 + { 23 + unsigned long phys; 24 + unsigned int area; 25 + void __iomem *vaddr; 26 + int ret; 27 + u16 data; 28 + 29 + /* Enable FPGA SRAM */ 30 + data = fpga_read_reg(LCLASR); 31 + data |= LCLASR_FRAMEN; 32 + fpga_write_reg(data, LCLASR); 33 + 34 + /* 35 + * FPGA_SEL determines the area mapping 36 + */ 37 + area = (data & LCLASR_FPGA_SEL_MASK) >> LCLASR_FPGA_SEL_SHIFT; 38 + if (unlikely(area == LCLASR_AREA_MASK)) { 39 + pr_err("FPGA memory unmapped.\n"); 40 + return -ENXIO; 41 + } 42 + 43 + /* 44 + * The memory itself occupies a 2KiB range at the top of the area 45 + * immediately below the system registers. 46 + */ 47 + phys = (area << 26) + SZ_64M - SZ_4K; 48 + 49 + /* 50 + * The FPGA SRAM resides in translatable physical space, so set 51 + * up a mapping prior to inserting it in to the pool. 52 + */ 53 + vaddr = ioremap(phys, SZ_2K); 54 + if (unlikely(!vaddr)) { 55 + pr_err("Failed remapping FPGA memory.\n"); 56 + return -ENXIO; 57 + } 58 + 59 + pr_info("Adding %dKiB of FPGA memory at 0x%08lx-0x%08lx " 60 + "(area %d) to pool.\n", 61 + SZ_2K >> 10, phys, phys + SZ_2K - 1, area); 62 + 63 + ret = gen_pool_add(sram_pool, (unsigned long)vaddr, SZ_2K, -1); 64 + if (unlikely(ret < 0)) { 65 + pr_err("Failed adding memory\n"); 66 + iounmap(vaddr); 67 + return ret; 68 + } 69 + 70 + return 0; 71 + } 72 + postcore_initcall(fpga_sram_init);
+2
arch/sh/boards/mach-x3proto/Makefile
··· 1 1 obj-y += setup.o ilsel.o 2 + 3 + obj-$(CONFIG_GENERIC_GPIO) += gpio.o
+135
arch/sh/boards/mach-x3proto/gpio.c
··· 1 + /* 2 + * arch/sh/boards/mach-x3proto/gpio.c 3 + * 4 + * Renesas SH-X3 Prototype Baseboard GPIO Support. 5 + * 6 + * Copyright (C) 2010 Paul Mundt 7 + * 8 + * This file is subject to the terms and conditions of the GNU General Public 9 + * License. See the file "COPYING" in the main directory of this archive 10 + * for more details. 11 + */ 12 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13 + 14 + #include <linux/init.h> 15 + #include <linux/interrupt.h> 16 + #include <linux/gpio.h> 17 + #include <linux/irq.h> 18 + #include <linux/kernel.h> 19 + #include <linux/spinlock.h> 20 + #include <linux/io.h> 21 + #include <mach/ilsel.h> 22 + #include <mach/hardware.h> 23 + 24 + #define KEYCTLR 0xb81c0000 25 + #define KEYOUTR 0xb81c0002 26 + #define KEYDETR 0xb81c0004 27 + 28 + static DEFINE_SPINLOCK(x3proto_gpio_lock); 29 + static unsigned int x3proto_gpio_irq_map[NR_BASEBOARD_GPIOS] = { 0, }; 30 + 31 + static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 32 + { 33 + unsigned long flags; 34 + unsigned int data; 35 + 36 + spin_lock_irqsave(&x3proto_gpio_lock, flags); 37 + data = __raw_readw(KEYCTLR); 38 + data |= (1 << gpio); 39 + __raw_writew(data, KEYCTLR); 40 + spin_unlock_irqrestore(&x3proto_gpio_lock, flags); 41 + 42 + return 0; 43 + } 44 + 45 + static int x3proto_gpio_get(struct gpio_chip *chip, unsigned gpio) 46 + { 47 + return !!(__raw_readw(KEYDETR) & (1 << gpio)); 48 + } 49 + 50 + static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) 51 + { 52 + return x3proto_gpio_irq_map[gpio]; 53 + } 54 + 55 + static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 56 + { 57 + struct irq_chip *chip = get_irq_desc_chip(desc); 58 + unsigned long mask; 59 + int pin; 60 + 61 + chip->mask_ack(irq); 62 + 63 + mask = __raw_readw(KEYDETR); 64 + 65 + for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) 66 + generic_handle_irq(x3proto_gpio_to_irq(NULL, pin)); 67 + 68 + chip->unmask(irq); 69 + } 70 + 71 + struct gpio_chip x3proto_gpio_chip = { 72 + .label = "x3proto-gpio", 73 + .direction_input = x3proto_gpio_direction_input, 74 + .get = x3proto_gpio_get, 75 + .to_irq = x3proto_gpio_to_irq, 76 + .base = -1, 77 + .ngpio = NR_BASEBOARD_GPIOS, 78 + }; 79 + 80 + int __init x3proto_gpio_setup(void) 81 + { 82 + int ilsel; 83 + int ret, i; 84 + 85 + ilsel = ilsel_enable(ILSEL_KEY); 86 + if (unlikely(ilsel < 0)) 87 + return ilsel; 88 + 89 + ret = gpiochip_add(&x3proto_gpio_chip); 90 + if (unlikely(ret)) 91 + goto err_gpio; 92 + 93 + for (i = 0; i < NR_BASEBOARD_GPIOS; i++) { 94 + unsigned long flags; 95 + int irq = create_irq(); 96 + 97 + if (unlikely(irq < 0)) { 98 + ret = -EINVAL; 99 + goto err_irq; 100 + } 101 + 102 + spin_lock_irqsave(&x3proto_gpio_lock, flags); 103 + x3proto_gpio_irq_map[i] = irq; 104 + set_irq_chip_and_handler_name(irq, &dummy_irq_chip, 105 + handle_simple_irq, "gpio"); 106 + spin_unlock_irqrestore(&x3proto_gpio_lock, flags); 107 + } 108 + 109 + pr_info("registering '%s' support, handling GPIOs %u -> %u, " 110 + "bound to IRQ %u\n", 111 + x3proto_gpio_chip.label, x3proto_gpio_chip.base, 112 + x3proto_gpio_chip.base + x3proto_gpio_chip.ngpio, 113 + ilsel); 114 + 115 + set_irq_chained_handler(ilsel, x3proto_gpio_irq_handler); 116 + set_irq_wake(ilsel, 1); 117 + 118 + return 0; 119 + 120 + err_irq: 121 + for (; i >= 0; --i) 122 + if (x3proto_gpio_irq_map[i]) 123 + destroy_irq(x3proto_gpio_irq_map[i]); 124 + 125 + ret = gpiochip_remove(&x3proto_gpio_chip); 126 + if (unlikely(ret)) 127 + pr_err("Failed deregistering GPIO\n"); 128 + 129 + err_gpio: 130 + synchronize_irq(ilsel); 131 + 132 + ilsel_disable(ILSEL_KEY); 133 + 134 + return ret; 135 + }
+13 -5
arch/sh/boards/mach-x3proto/ilsel.c
··· 1 1 /* 2 - * arch/sh/boards/renesas/x3proto/ilsel.c 2 + * arch/sh/boards/mach-x3proto/ilsel.c 3 3 * 4 4 * Helper routines for SH-X3 proto board ILSEL. 5 5 * 6 - * Copyright (C) 2007 Paul Mundt 6 + * Copyright (C) 2007 - 2010 Paul Mundt 7 7 * 8 8 * This file is subject to the terms and conditions of the GNU General Public 9 9 * License. See the file "COPYING" in the main directory of this archive 10 10 * for more details. 11 11 */ 12 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 13 + 12 14 #include <linux/init.h> 13 15 #include <linux/kernel.h> 14 16 #include <linux/module.h> 15 17 #include <linux/bitmap.h> 16 18 #include <linux/io.h> 17 - #include <asm/ilsel.h> 19 + #include <mach/ilsel.h> 18 20 19 21 /* 20 22 * ILSEL is split across: ··· 66 64 unsigned int tmp, shift; 67 65 unsigned long addr; 68 66 67 + pr_notice("enabling ILSEL set %d\n", set); 68 + 69 69 addr = mk_ilsel_addr(bit); 70 70 shift = mk_ilsel_shift(bit); 71 71 ··· 96 92 { 97 93 unsigned int bit; 98 94 99 - /* Aliased sources must use ilsel_enable_fixed() */ 100 - BUG_ON(set > ILSEL_KEY); 95 + if (unlikely(set > ILSEL_KEY)) { 96 + pr_err("Aliased sources must use ilsel_enable_fixed()\n"); 97 + return -EINVAL; 98 + } 101 99 102 100 do { 103 101 bit = find_first_zero_bit(&ilsel_level_map, ILSEL_LEVELS); ··· 145 139 { 146 140 unsigned long addr; 147 141 unsigned int tmp; 142 + 143 + pr_notice("disabling ILSEL set %d\n", irq); 148 144 149 145 addr = mk_ilsel_addr(irq); 150 146
+120 -12
arch/sh/boards/mach-x3proto/setup.c
··· 1 1 /* 2 - * arch/sh/boards/renesas/x3proto/setup.c 2 + * arch/sh/boards/mach-x3proto/setup.c 3 3 * 4 4 * Renesas SH-X3 Prototype Board Support. 5 5 * 6 - * Copyright (C) 2007 - 2008 Paul Mundt 6 + * Copyright (C) 2007 - 2010 Paul Mundt 7 7 * 8 8 * This file is subject to the terms and conditions of the GNU General Public 9 9 * License. See the file "COPYING" in the main directory of this archive ··· 16 16 #include <linux/smc91x.h> 17 17 #include <linux/irq.h> 18 18 #include <linux/interrupt.h> 19 + #include <linux/input.h> 19 20 #include <linux/usb/r8a66597.h> 20 21 #include <linux/usb/m66592.h> 21 - #include <asm/ilsel.h> 22 + #include <linux/gpio.h> 23 + #include <linux/gpio_keys.h> 24 + #include <mach/ilsel.h> 25 + #include <mach/hardware.h> 22 26 #include <asm/smp-ops.h> 23 27 24 28 static struct resource heartbeat_resources[] = { ··· 126 122 .resource = m66592_usb_peripheral_resources, 127 123 }; 128 124 125 + static struct gpio_keys_button baseboard_buttons[NR_BASEBOARD_GPIOS] = { 126 + { 127 + .desc = "key44", 128 + .code = KEY_POWER, 129 + .active_low = 1, 130 + .wakeup = 1, 131 + }, { 132 + .desc = "key43", 133 + .code = KEY_SUSPEND, 134 + .active_low = 1, 135 + .wakeup = 1, 136 + }, { 137 + .desc = "key42", 138 + .code = KEY_KATAKANAHIRAGANA, 139 + .active_low = 1, 140 + }, { 141 + .desc = "key41", 142 + .code = KEY_SWITCHVIDEOMODE, 143 + .active_low = 1, 144 + }, { 145 + .desc = "key34", 146 + .code = KEY_F12, 147 + .active_low = 1, 148 + }, { 149 + .desc = "key33", 150 + .code = KEY_F11, 151 + .active_low = 1, 152 + }, { 153 + .desc = "key32", 154 + .code = KEY_F10, 155 + .active_low = 1, 156 + }, { 157 + .desc = "key31", 158 + .code = KEY_F9, 159 + .active_low = 1, 160 + }, { 161 + .desc = "key24", 162 + .code = KEY_F8, 163 + .active_low = 1, 164 + }, { 165 + .desc = "key23", 166 + .code = KEY_F7, 167 + .active_low = 1, 168 + }, { 169 + .desc = "key22", 170 + .code = KEY_F6, 171 + .active_low = 1, 172 + }, { 173 + .desc = "key21", 174 + .code = KEY_F5, 175 + .active_low = 1, 176 + }, { 177 + .desc = "key14", 178 + .code = KEY_F4, 179 + .active_low = 1, 180 + }, { 181 + .desc = "key13", 182 + .code = KEY_F3, 183 + .active_low = 1, 184 + }, { 185 + .desc = "key12", 186 + .code = KEY_F2, 187 + .active_low = 1, 188 + }, { 189 + .desc = "key11", 190 + .code = KEY_F1, 191 + .active_low = 1, 192 + }, 193 + }; 194 + 195 + static struct gpio_keys_platform_data baseboard_buttons_data = { 196 + .buttons = baseboard_buttons, 197 + .nbuttons = ARRAY_SIZE(baseboard_buttons), 198 + }; 199 + 200 + static struct platform_device baseboard_buttons_device = { 201 + .name = "gpio-keys", 202 + .id = -1, 203 + .dev = { 204 + .platform_data = &baseboard_buttons_data, 205 + }, 206 + }; 207 + 129 208 static struct platform_device *x3proto_devices[] __initdata = { 130 209 &heartbeat_device, 131 210 &smc91x_device, 132 211 &r8a66597_usb_host_device, 133 212 &m66592_usb_peripheral_device, 213 + &baseboard_buttons_device, 134 214 }; 215 + 216 + static void __init x3proto_init_irq(void) 217 + { 218 + plat_irq_setup_pins(IRQ_MODE_IRL3210); 219 + 220 + /* Set ICR0.LVLMODE */ 221 + __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000); 222 + } 135 223 136 224 static int __init x3proto_devices_setup(void) 137 225 { 226 + int ret, i; 227 + 228 + /* 229 + * IRLs are only needed for ILSEL mappings, so flip over the INTC 230 + * pins at a later point to enable the GPIOs to settle. 231 + */ 232 + x3proto_init_irq(); 233 + 234 + /* 235 + * Now that ILSELs are available, set up the baseboard GPIOs. 236 + */ 237 + ret = x3proto_gpio_setup(); 238 + if (unlikely(ret)) 239 + return ret; 240 + 241 + /* 242 + * Propagate dynamic GPIOs for the baseboard button device. 243 + */ 244 + for (i = 0; i < ARRAY_SIZE(baseboard_buttons); i++) 245 + baseboard_buttons[i].gpio = x3proto_gpio_chip.base + i; 246 + 138 247 r8a66597_usb_host_resources[1].start = 139 248 r8a66597_usb_host_resources[1].end = ilsel_enable(ILSEL_USBH_I); 140 249 ··· 262 145 } 263 146 device_initcall(x3proto_devices_setup); 264 147 265 - static void __init x3proto_init_irq(void) 266 - { 267 - plat_irq_setup_pins(IRQ_MODE_IRL3210); 268 - 269 - /* Set ICR0.LVLMODE */ 270 - __raw_writel(__raw_readl(0xfe410000) | (1 << 21), 0xfe410000); 271 - } 272 - 273 148 static void __init x3proto_setup(char **cmdline_p) 274 149 { 275 150 register_smp_ops(&shx3_smp_ops); ··· 270 161 static struct sh_machine_vector mv_x3proto __initmv = { 271 162 .mv_name = "x3proto", 272 163 .mv_setup = x3proto_setup, 273 - .mv_init_irq = x3proto_init_irq, 274 164 };
+3 -1
arch/sh/boot/compressed/head_32.S
··· 91 91 end_addr: 92 92 .long _end 93 93 init_sr: 94 - .long 0x400000F0 /* Privileged mode, Bank=0, Block=0, IMASK=0xF */ 94 + .long 0x500000F0 /* Privileged mode, Bank=0, Block=1, IMASK=0xF */ 95 + kexec_magic: 96 + .long 0x400000F0 /* magic used by kexec to parse zImage format */ 95 97 init_stack_addr: 96 98 .long stack_start 97 99 decompress_kernel_addr:
+1 -1
arch/sh/cchips/hd6446x/Makefile
··· 1 1 obj-$(CONFIG_HD64461) += hd64461.o 2 2 3 - EXTRA_CFLAGS += -Werror 3 + ccflags-y := -Werror
-1
arch/sh/configs/ap325rxa_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_BSD_PROCESS_ACCT=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_KALLSYMS is not set 8 7 CONFIG_SLAB=y 9 8 CONFIG_MODULES=y
-1
arch/sh/configs/cayman_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_POSIX_MQUEUE=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 5 CONFIG_SLAB=y 7 6 CONFIG_MODULES=y
-1
arch/sh/configs/dreamcast_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_SYSFS_DEPRECATED_V2=y 6 5 # CONFIG_SYSCTL_SYSCALL is not set 7 6 CONFIG_SLAB=y 8 7 CONFIG_PROFILING=y
-1
arch/sh/configs/ecovec24-romimage_defconfig
··· 5 5 CONFIG_IKCONFIG=y 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_BLK_DEV_INITRD=y 10 9 # CONFIG_KALLSYMS is not set 11 10 CONFIG_SLAB=y
-1
arch/sh/configs/edosk7760_defconfig
··· 5 5 CONFIG_BSD_PROCESS_ACCT=y 6 6 CONFIG_IKCONFIG=y 7 7 CONFIG_IKCONFIG_PROC=y 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_BLK_DEV_INITRD=y 10 9 CONFIG_KALLSYMS_ALL=y 11 10 CONFIG_MODULES=y
-1
arch/sh/configs/espt_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 CONFIG_NAMESPACES=y 8 7 CONFIG_UTS_NS=y 9 8 CONFIG_IPC_NS=y
-1
arch/sh/configs/hp6xx_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 7 # CONFIG_SYSCTL_SYSCALL is not set 9 8 CONFIG_SLAB=y
-1
arch/sh/configs/kfr2r09-romimage_defconfig
··· 5 5 CONFIG_IKCONFIG=y 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_BLK_DEV_INITRD=y 10 9 # CONFIG_KALLSYMS is not set 11 10 CONFIG_SLAB=y
-1
arch/sh/configs/kfr2r09_defconfig
··· 5 5 CONFIG_IKCONFIG=y 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_BLK_DEV_INITRD=y 10 9 # CONFIG_KALLSYMS is not set 11 10 CONFIG_SLAB=y
-1
arch/sh/configs/landisk_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 # CONFIG_SYSCTL_SYSCALL is not set 6 5 CONFIG_KALLSYMS_EXTRA_PASS=y 7 6 CONFIG_SLAB=y
-1
arch/sh/configs/lboxre2_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 # CONFIG_SYSCTL_SYSCALL is not set 6 5 CONFIG_KALLSYMS_EXTRA_PASS=y 7 6 CONFIG_SLAB=y
-1
arch/sh/configs/magicpanelr2_defconfig
··· 5 5 CONFIG_BSD_PROCESS_ACCT=y 6 6 CONFIG_BSD_PROCESS_ACCT_V3=y 7 7 CONFIG_AUDIT=y 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_RELAY=y 10 9 CONFIG_BLK_DEV_INITRD=y 11 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-1
arch/sh/configs/microdev_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_BSD_PROCESS_ACCT=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 CONFIG_BLK_DEV_INITRD=y 6 5 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 6 # CONFIG_SYSCTL_SYSCALL is not set
-1
arch/sh/configs/migor_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 CONFIG_BLK_DEV_INITRD=y 8 7 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 9 8 # CONFIG_SYSCTL_SYSCALL is not set
-1
arch/sh/configs/polaris_defconfig
··· 7 7 CONFIG_BSD_PROCESS_ACCT_V3=y 8 8 CONFIG_AUDIT=y 9 9 CONFIG_LOG_BUF_SHIFT=14 10 - CONFIG_SYSFS_DEPRECATED_V2=y 11 10 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 12 11 CONFIG_SLAB=y 13 12 CONFIG_MODULES=y
-1
arch/sh/configs/r7780mp_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 7 # CONFIG_SYSCTL_SYSCALL is not set 9 8 # CONFIG_FUTEX is not set 10 9 # CONFIG_EPOLL is not set
-1
arch/sh/configs/r7785rp_defconfig
··· 8 8 CONFIG_IKCONFIG=y 9 9 CONFIG_IKCONFIG_PROC=y 10 10 CONFIG_LOG_BUF_SHIFT=14 11 - CONFIG_SYSFS_DEPRECATED_V2=y 12 11 # CONFIG_SYSCTL_SYSCALL is not set 13 12 CONFIG_SLAB=y 14 13 CONFIG_PROFILING=y
-1
arch/sh/configs/rts7751r2d1_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 5 # CONFIG_SYSCTL_SYSCALL is not set 7 6 CONFIG_SLAB=y
-1
arch/sh/configs/rts7751r2dplus_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 5 # CONFIG_SYSCTL_SYSCALL is not set 7 6 CONFIG_SLAB=y
-1
arch/sh/configs/sdk7780_defconfig
··· 6 6 CONFIG_IKCONFIG=y 7 7 CONFIG_IKCONFIG_PROC=y 8 8 CONFIG_LOG_BUF_SHIFT=18 9 - CONFIG_SYSFS_DEPRECATED_V2=y 10 9 CONFIG_RELAY=y 11 10 CONFIG_KALLSYMS_ALL=y 12 11 CONFIG_MODULES=y
-1
arch/sh/configs/se7343_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_POSIX_MQUEUE=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_SYSCTL_SYSCALL is not set 8 7 # CONFIG_FUTEX is not set 9 8 # CONFIG_EPOLL is not set
-1
arch/sh/configs/se7712_defconfig
··· 5 5 CONFIG_POSIX_MQUEUE=y 6 6 CONFIG_BSD_PROCESS_ACCT=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 9 CONFIG_KALLSYMS_ALL=y 11 10 # CONFIG_BUG is not set
-1
arch/sh/configs/se7721_defconfig
··· 5 5 CONFIG_POSIX_MQUEUE=y 6 6 CONFIG_BSD_PROCESS_ACCT=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 9 CONFIG_KALLSYMS_ALL=y 11 10 # CONFIG_BUG is not set
-1
arch/sh/configs/se7722_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 7 CONFIG_BLK_DEV_INITRD=y 9 8 CONFIG_PROFILING=y 10 9 CONFIG_MODULES=y
-1
arch/sh/configs/se7724_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_BSD_PROCESS_ACCT=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_KALLSYMS is not set 8 7 CONFIG_SLAB=y 9 8 CONFIG_MODULES=y
-1
arch/sh/configs/se7750_defconfig
··· 5 5 CONFIG_IKCONFIG=y 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=14 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 10 9 # CONFIG_SYSCTL_SYSCALL is not set 11 10 # CONFIG_HOTPLUG is not set
-1
arch/sh/configs/se7751_defconfig
··· 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_BSD_PROCESS_ACCT=y 4 4 CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_SYSFS_DEPRECATED_V2=y 6 5 CONFIG_BLK_DEV_INITRD=y 7 6 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 8 7 # CONFIG_SYSCTL_SYSCALL is not set
-1
arch/sh/configs/se7780_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_KALLSYMS is not set 8 7 # CONFIG_HOTPLUG is not set 9 8 # CONFIG_EPOLL is not set
-1
arch/sh/configs/sh03_defconfig
··· 3 3 CONFIG_POSIX_MQUEUE=y 4 4 CONFIG_BSD_PROCESS_ACCT=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 CONFIG_BLK_DEV_INITRD=y 8 7 # CONFIG_SYSCTL_SYSCALL is not set 9 8 CONFIG_SLAB=y
+212
arch/sh/configs/sh2007_defconfig
··· 1 + CONFIG_EXPERIMENTAL=y 2 + # CONFIG_LOCALVERSION_AUTO is not set 3 + CONFIG_SYSVIPC=y 4 + CONFIG_POSIX_MQUEUE=y 5 + CONFIG_BSD_PROCESS_ACCT=y 6 + CONFIG_AUDIT=y 7 + CONFIG_AUDITSYSCALL=y 8 + CONFIG_IKCONFIG=y 9 + CONFIG_LOG_BUF_SHIFT=14 10 + # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 + CONFIG_KALLSYMS_ALL=y 12 + CONFIG_SLAB=y 13 + # CONFIG_BLK_DEV_BSG is not set 14 + CONFIG_CPU_SUBTYPE_SH7780=y 15 + CONFIG_MEMORY_SIZE=0x08000000 16 + # CONFIG_VSYSCALL is not set 17 + CONFIG_FLATMEM_MANUAL=y 18 + CONFIG_SH_SH2007=y 19 + CONFIG_HIGH_RES_TIMERS=y 20 + CONFIG_SH_DMA=y 21 + CONFIG_SH_DMA_API=y 22 + CONFIG_NR_DMA_CHANNELS_BOOL=y 23 + CONFIG_HZ_100=y 24 + CONFIG_CMDLINE_OVERWRITE=y 25 + CONFIG_CMDLINE="console=ttySC1,115200 ip=dhcp root=/dev/nfs rw nfsroot=/nfs/rootfs,rsize=1024,wsize=1024 earlyprintk=sh-sci.1" 26 + CONFIG_PCCARD=y 27 + CONFIG_BINFMT_MISC=y 28 + CONFIG_PACKET=y 29 + CONFIG_UNIX=y 30 + CONFIG_XFRM_USER=y 31 + CONFIG_NET_KEY=y 32 + CONFIG_NET_KEY_MIGRATE=y 33 + CONFIG_INET=y 34 + CONFIG_IP_ADVANCED_ROUTER=y 35 + CONFIG_IP_MULTIPLE_TABLES=y 36 + CONFIG_IP_ROUTE_MULTIPATH=y 37 + CONFIG_IP_ROUTE_VERBOSE=y 38 + CONFIG_IP_PNP=y 39 + CONFIG_IP_PNP_DHCP=y 40 + CONFIG_NET_IPIP=y 41 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 42 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 43 + # CONFIG_INET_XFRM_MODE_BEET is not set 44 + # CONFIG_INET_LRO is not set 45 + # CONFIG_IPV6 is not set 46 + CONFIG_NETWORK_SECMARK=y 47 + CONFIG_NET_PKTGEN=y 48 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 49 + CONFIG_BLK_DEV_LOOP=y 50 + CONFIG_BLK_DEV_RAM=y 51 + CONFIG_CDROM_PKTCDVD=y 52 + # CONFIG_MISC_DEVICES is not set 53 + CONFIG_RAID_ATTRS=y 54 + CONFIG_SCSI=y 55 + CONFIG_SCSI_TGT=y 56 + CONFIG_BLK_DEV_SD=y 57 + CONFIG_BLK_DEV_SR=y 58 + CONFIG_CHR_DEV_SG=y 59 + CONFIG_SCSI_MULTI_LUN=y 60 + CONFIG_SCSI_CONSTANTS=y 61 + CONFIG_SCSI_LOGGING=y 62 + CONFIG_SCSI_SCAN_ASYNC=y 63 + CONFIG_SCSI_SPI_ATTRS=y 64 + CONFIG_SCSI_FC_ATTRS=y 65 + CONFIG_SCSI_ISCSI_ATTRS=y 66 + CONFIG_SCSI_SRP_ATTRS=y 67 + # CONFIG_SCSI_LOWLEVEL is not set 68 + CONFIG_NETDEVICES=y 69 + CONFIG_DUMMY=y 70 + CONFIG_EQUALIZER=y 71 + CONFIG_TUN=y 72 + CONFIG_VETH=y 73 + CONFIG_NET_ETHERNET=y 74 + CONFIG_SMSC911X=y 75 + # CONFIG_NETDEV_1000 is not set 76 + # CONFIG_NETDEV_10000 is not set 77 + # CONFIG_WLAN is not set 78 + CONFIG_INPUT_FF_MEMLESS=y 79 + # CONFIG_INPUT_MOUSEDEV is not set 80 + # CONFIG_INPUT_KEYBOARD is not set 81 + # CONFIG_INPUT_MOUSE is not set 82 + # CONFIG_SERIO is not set 83 + CONFIG_VT_HW_CONSOLE_BINDING=y 84 + # CONFIG_DEVKMEM is not set 85 + CONFIG_SERIAL_SH_SCI=y 86 + CONFIG_SERIAL_SH_SCI_CONSOLE=y 87 + # CONFIG_LEGACY_PTYS is not set 88 + # CONFIG_HWMON is not set 89 + CONFIG_WATCHDOG=y 90 + CONFIG_SH_WDT=y 91 + CONFIG_SSB=y 92 + CONFIG_FB=y 93 + CONFIG_BACKLIGHT_LCD_SUPPORT=y 94 + # CONFIG_LCD_CLASS_DEVICE is not set 95 + CONFIG_FRAMEBUFFER_CONSOLE=y 96 + CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 97 + CONFIG_LOGO=y 98 + # CONFIG_HID_SUPPORT is not set 99 + CONFIG_USB=y 100 + CONFIG_USB_DEVICEFS=y 101 + # CONFIG_USB_DEVICE_CLASS is not set 102 + CONFIG_USB_MON=y 103 + CONFIG_NEW_LEDS=y 104 + CONFIG_LEDS_CLASS=y 105 + CONFIG_LEDS_TRIGGERS=y 106 + CONFIG_RTC_CLASS=y 107 + CONFIG_RTC_INTF_DEV_UIE_EMUL=y 108 + CONFIG_DMADEVICES=y 109 + CONFIG_TIMB_DMA=y 110 + CONFIG_EXT3_FS=y 111 + CONFIG_ISO9660_FS=y 112 + CONFIG_JOLIET=y 113 + CONFIG_ZISOFS=y 114 + CONFIG_UDF_FS=y 115 + CONFIG_MSDOS_FS=y 116 + CONFIG_VFAT_FS=y 117 + CONFIG_FAT_DEFAULT_CODEPAGE=932 118 + CONFIG_FAT_DEFAULT_IOCHARSET="ascii" 119 + CONFIG_PROC_KCORE=y 120 + CONFIG_TMPFS=y 121 + CONFIG_TMPFS_POSIX_ACL=y 122 + CONFIG_CONFIGFS_FS=y 123 + # CONFIG_MISC_FILESYSTEMS is not set 124 + CONFIG_NFS_FS=y 125 + CONFIG_NFS_V3=y 126 + CONFIG_NFS_V3_ACL=y 127 + CONFIG_NFS_V4=y 128 + CONFIG_ROOT_NFS=y 129 + CONFIG_NLS_DEFAULT="utf8" 130 + CONFIG_NLS_CODEPAGE_437=y 131 + CONFIG_NLS_CODEPAGE_737=y 132 + CONFIG_NLS_CODEPAGE_775=y 133 + CONFIG_NLS_CODEPAGE_850=y 134 + CONFIG_NLS_CODEPAGE_852=y 135 + CONFIG_NLS_CODEPAGE_855=y 136 + CONFIG_NLS_CODEPAGE_857=y 137 + CONFIG_NLS_CODEPAGE_860=y 138 + CONFIG_NLS_CODEPAGE_861=y 139 + CONFIG_NLS_CODEPAGE_862=y 140 + CONFIG_NLS_CODEPAGE_863=y 141 + CONFIG_NLS_CODEPAGE_864=y 142 + CONFIG_NLS_CODEPAGE_865=y 143 + CONFIG_NLS_CODEPAGE_866=y 144 + CONFIG_NLS_CODEPAGE_869=y 145 + CONFIG_NLS_CODEPAGE_936=y 146 + CONFIG_NLS_CODEPAGE_950=y 147 + CONFIG_NLS_CODEPAGE_932=y 148 + CONFIG_NLS_CODEPAGE_949=y 149 + CONFIG_NLS_CODEPAGE_874=y 150 + CONFIG_NLS_ISO8859_8=y 151 + CONFIG_NLS_CODEPAGE_1250=y 152 + CONFIG_NLS_CODEPAGE_1251=y 153 + CONFIG_NLS_ASCII=y 154 + CONFIG_NLS_ISO8859_1=y 155 + CONFIG_NLS_ISO8859_2=y 156 + CONFIG_NLS_ISO8859_3=y 157 + CONFIG_NLS_ISO8859_4=y 158 + CONFIG_NLS_ISO8859_5=y 159 + CONFIG_NLS_ISO8859_6=y 160 + CONFIG_NLS_ISO8859_7=y 161 + CONFIG_NLS_ISO8859_9=y 162 + CONFIG_NLS_ISO8859_13=y 163 + CONFIG_NLS_ISO8859_14=y 164 + CONFIG_NLS_ISO8859_15=y 165 + CONFIG_NLS_KOI8_R=y 166 + CONFIG_NLS_KOI8_U=y 167 + CONFIG_NLS_UTF8=y 168 + # CONFIG_ENABLE_WARN_DEPRECATED is not set 169 + # CONFIG_ENABLE_MUST_CHECK is not set 170 + CONFIG_DEBUG_FS=y 171 + CONFIG_DEBUG_KERNEL=y 172 + # CONFIG_DETECT_SOFTLOCKUP is not set 173 + # CONFIG_SCHED_DEBUG is not set 174 + CONFIG_DEBUG_INFO=y 175 + CONFIG_FRAME_POINTER=y 176 + # CONFIG_RCU_CPU_STALL_DETECTOR is not set 177 + CONFIG_SH_STANDARD_BIOS=y 178 + CONFIG_CRYPTO_NULL=y 179 + CONFIG_CRYPTO_AUTHENC=y 180 + CONFIG_CRYPTO_ECB=y 181 + CONFIG_CRYPTO_LRW=y 182 + CONFIG_CRYPTO_PCBC=y 183 + CONFIG_CRYPTO_XTS=y 184 + CONFIG_CRYPTO_HMAC=y 185 + CONFIG_CRYPTO_XCBC=y 186 + CONFIG_CRYPTO_MD4=y 187 + CONFIG_CRYPTO_MICHAEL_MIC=y 188 + CONFIG_CRYPTO_SHA1=y 189 + CONFIG_CRYPTO_SHA256=y 190 + CONFIG_CRYPTO_SHA512=y 191 + CONFIG_CRYPTO_TGR192=y 192 + CONFIG_CRYPTO_WP512=y 193 + CONFIG_CRYPTO_AES=y 194 + CONFIG_CRYPTO_ANUBIS=y 195 + CONFIG_CRYPTO_ARC4=y 196 + CONFIG_CRYPTO_BLOWFISH=y 197 + CONFIG_CRYPTO_CAMELLIA=y 198 + CONFIG_CRYPTO_CAST5=y 199 + CONFIG_CRYPTO_CAST6=y 200 + CONFIG_CRYPTO_FCRYPT=y 201 + CONFIG_CRYPTO_KHAZAD=y 202 + CONFIG_CRYPTO_SEED=y 203 + CONFIG_CRYPTO_SERPENT=y 204 + CONFIG_CRYPTO_TEA=y 205 + CONFIG_CRYPTO_TWOFISH=y 206 + CONFIG_CRYPTO_DEFLATE=y 207 + CONFIG_CRYPTO_LZO=y 208 + # CONFIG_CRYPTO_ANSI_CPRNG is not set 209 + # CONFIG_CRYPTO_HW is not set 210 + CONFIG_CRC_CCITT=y 211 + CONFIG_CRC16=y 212 + CONFIG_LIBCRC32C=y
-1
arch/sh/configs/sh7710voipgw_defconfig
··· 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_POSIX_MQUEUE=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 # CONFIG_SYSCTL_SYSCALL is not set 8 7 # CONFIG_FUTEX is not set 9 8 # CONFIG_EPOLL is not set
+85
arch/sh/configs/sh7757lcr_defconfig
··· 1 + CONFIG_EXPERIMENTAL=y 2 + # CONFIG_SWAP is not set 3 + CONFIG_SYSVIPC=y 4 + CONFIG_POSIX_MQUEUE=y 5 + CONFIG_BSD_PROCESS_ACCT=y 6 + CONFIG_TASKSTATS=y 7 + CONFIG_TASK_DELAY_ACCT=y 8 + CONFIG_TASK_XACCT=y 9 + CONFIG_TASK_IO_ACCOUNTING=y 10 + CONFIG_LOG_BUF_SHIFT=14 11 + CONFIG_BLK_DEV_INITRD=y 12 + # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 13 + # CONFIG_SYSCTL_SYSCALL is not set 14 + CONFIG_KALLSYMS_ALL=y 15 + CONFIG_SLAB=y 16 + CONFIG_MODULES=y 17 + CONFIG_MODULE_UNLOAD=y 18 + # CONFIG_BLK_DEV_BSG is not set 19 + CONFIG_CPU_SUBTYPE_SH7757=y 20 + CONFIG_MEMORY_START=0x40000000 21 + CONFIG_MEMORY_SIZE=0x0f000000 22 + CONFIG_PMB=y 23 + CONFIG_FLATMEM_MANUAL=y 24 + CONFIG_SH_SH7757LCR=y 25 + CONFIG_HEARTBEAT=y 26 + CONFIG_SECCOMP=y 27 + CONFIG_CMDLINE_OVERWRITE=y 28 + CONFIG_CMDLINE="console=ttySC2,115200 root=/dev/nfs ip=dhcp" 29 + CONFIG_NET=y 30 + CONFIG_PACKET=y 31 + CONFIG_UNIX=y 32 + CONFIG_INET=y 33 + CONFIG_IP_MULTICAST=y 34 + CONFIG_IP_PNP=y 35 + CONFIG_IP_PNP_DHCP=y 36 + # CONFIG_INET_LRO is not set 37 + CONFIG_IPV6=y 38 + # CONFIG_WIRELESS is not set 39 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 40 + # CONFIG_FW_LOADER is not set 41 + CONFIG_BLK_DEV_RAM=y 42 + # CONFIG_MISC_DEVICES is not set 43 + CONFIG_NETDEVICES=y 44 + CONFIG_PHYLIB=y 45 + CONFIG_VITESSE_PHY=y 46 + CONFIG_MDIO_BITBANG=y 47 + CONFIG_NET_ETHERNET=y 48 + CONFIG_MII=y 49 + # CONFIG_NETDEV_10000 is not set 50 + # CONFIG_WLAN is not set 51 + # CONFIG_KEYBOARD_ATKBD is not set 52 + # CONFIG_MOUSE_PS2 is not set 53 + # CONFIG_SERIO is not set 54 + CONFIG_SERIAL_8250=y 55 + CONFIG_SERIAL_8250_CONSOLE=y 56 + CONFIG_SERIAL_8250_NR_UARTS=2 57 + CONFIG_SERIAL_SH_SCI=y 58 + CONFIG_SERIAL_SH_SCI_NR_UARTS=3 59 + CONFIG_SERIAL_SH_SCI_CONSOLE=y 60 + # CONFIG_LEGACY_PTYS is not set 61 + # CONFIG_HW_RANDOM is not set 62 + # CONFIG_HWMON is not set 63 + # CONFIG_USB_SUPPORT is not set 64 + CONFIG_EXT2_FS=y 65 + CONFIG_EXT3_FS=y 66 + CONFIG_INOTIFY=y 67 + CONFIG_ISO9660_FS=y 68 + CONFIG_VFAT_FS=y 69 + CONFIG_PROC_KCORE=y 70 + CONFIG_TMPFS=y 71 + CONFIG_SQUASHFS=y 72 + CONFIG_MINIX_FS=y 73 + CONFIG_NFS_FS=y 74 + CONFIG_ROOT_NFS=y 75 + CONFIG_NLS_CODEPAGE_437=y 76 + CONFIG_NLS_CODEPAGE_932=y 77 + CONFIG_NLS_ISO8859_1=y 78 + CONFIG_DEBUG_KERNEL=y 79 + # CONFIG_DETECT_SOFTLOCKUP is not set 80 + # CONFIG_SCHED_DEBUG is not set 81 + # CONFIG_DEBUG_BUGVERBOSE is not set 82 + CONFIG_DEBUG_INFO=y 83 + # CONFIG_RCU_CPU_STALL_DETECTOR is not set 84 + # CONFIG_FTRACE is not set 85 + # CONFIG_CRYPTO_ANSI_CPRNG is not set
-1
arch/sh/configs/sh7763rdp_defconfig
··· 3 3 CONFIG_IKCONFIG=y 4 4 CONFIG_IKCONFIG_PROC=y 5 5 CONFIG_LOG_BUF_SHIFT=14 6 - CONFIG_SYSFS_DEPRECATED_V2=y 7 6 CONFIG_NAMESPACES=y 8 7 CONFIG_UTS_NS=y 9 8 CONFIG_IPC_NS=y
-1
arch/sh/configs/sh7785lcr_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 7 CONFIG_SLAB=y 9 8 CONFIG_PROFILING=y 10 9 CONFIG_MODULES=y
-1
arch/sh/configs/shx3_defconfig
··· 15 15 CONFIG_CGROUP_CPUACCT=y 16 16 CONFIG_RESOURCE_COUNTERS=y 17 17 CONFIG_CGROUP_MEM_RES_CTLR=y 18 - CONFIG_SYSFS_DEPRECATED_V2=y 19 18 CONFIG_RELAY=y 20 19 CONFIG_NAMESPACES=y 21 20 CONFIG_UTS_NS=y
-1
arch/sh/configs/snapgear_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED_V2=y 5 4 CONFIG_BLK_DEV_INITRD=y 6 5 # CONFIG_SYSCTL_SYSCALL is not set 7 6 # CONFIG_HOTPLUG is not set
-1
arch/sh/configs/systemh_defconfig
··· 1 1 CONFIG_EXPERIMENTAL=y 2 2 CONFIG_LOG_BUF_SHIFT=14 3 - CONFIG_SYSFS_DEPRECATED_V2=y 4 3 CONFIG_BLK_DEV_INITRD=y 5 4 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 6 5 # CONFIG_SYSCTL_SYSCALL is not set
-1
arch/sh/configs/titan_defconfig
··· 5 5 CONFIG_IKCONFIG=y 6 6 CONFIG_IKCONFIG_PROC=y 7 7 CONFIG_LOG_BUF_SHIFT=16 8 - CONFIG_SYSFS_DEPRECATED_V2=y 9 8 CONFIG_BLK_DEV_INITRD=y 10 9 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 11 10 # CONFIG_SYSCTL_SYSCALL is not set
-1
arch/sh/configs/ul2_defconfig
··· 4 4 CONFIG_IKCONFIG=y 5 5 CONFIG_IKCONFIG_PROC=y 6 6 CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_SYSFS_DEPRECATED_V2=y 8 7 CONFIG_BLK_DEV_INITRD=y 9 8 CONFIG_PROFILING=y 10 9 CONFIG_MODULES=y
+2 -2
arch/sh/drivers/dma/dma-api.c
··· 412 412 static int __init dma_api_init(void) 413 413 { 414 414 printk(KERN_NOTICE "DMA: Registering DMA API.\n"); 415 - create_proc_read_entry("dma", 0, 0, dma_read_proc, 0); 416 - return 0; 415 + return create_proc_read_entry("dma", 0, 0, dma_read_proc, 0) 416 + ? 0 : -ENOMEM; 417 417 } 418 418 subsys_initcall(dma_api_init); 419 419
+1
arch/sh/drivers/pci/Makefile
··· 19 19 obj-$(CONFIG_SH_SH03) += fixups-sh03.o 20 20 obj-$(CONFIG_SH_HIGHLANDER) += fixups-r7780rp.o 21 21 obj-$(CONFIG_SH_SH7785LCR) += fixups-r7780rp.o 22 + obj-$(CONFIG_SH_SDK7786) += fixups-sdk7786.o 22 23 obj-$(CONFIG_SH_SDK7780) += fixups-sdk7780.o 23 24 obj-$(CONFIG_SH_7780_SOLUTION_ENGINE) += fixups-sdk7780.o 24 25 obj-$(CONFIG_SH_TITAN) += fixups-titan.o
+67
arch/sh/drivers/pci/fixups-sdk7786.c
··· 1 + /* 2 + * SDK7786 FPGA PCIe mux handling 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #define pr_fmt(fmt) "PCI: " fmt 11 + 12 + #include <linux/init.h> 13 + #include <linux/kernel.h> 14 + #include <linux/pci.h> 15 + #include <mach/fpga.h> 16 + 17 + /* 18 + * The SDK7786 FPGA supports mangling of most of the slots in some way or 19 + * another. Slots 3/4 are special in that only one can be supported at a 20 + * time, and both appear on port 3 to the PCI bus scan. Enabling slot 4 21 + * (the horizontal edge connector) will disable slot 3 entirely. 22 + * 23 + * Misconfigurations can be detected through the FPGA via the slot 24 + * resistors to determine card presence. Hotplug remains unsupported. 25 + */ 26 + static unsigned int slot4en __devinitdata; 27 + 28 + char *__devinit pcibios_setup(char *str) 29 + { 30 + if (strcmp(str, "slot4en") == 0) { 31 + slot4en = 1; 32 + return NULL; 33 + } 34 + 35 + return str; 36 + } 37 + 38 + static int __init sdk7786_pci_init(void) 39 + { 40 + u16 data = fpga_read_reg(PCIECR); 41 + 42 + /* 43 + * Enable slot #4 if it's been specified on the command line. 44 + * 45 + * Optionally reroute if slot #4 has a card present while slot #3 46 + * does not, regardless of command line value. 47 + * 48 + * Card presence is logically inverted. 49 + */ 50 + slot4en ?: (!(data & PCIECR_PRST4) && (data & PCIECR_PRST3)); 51 + if (slot4en) { 52 + pr_info("Activating PCIe slot#4 (disabling slot#3)\n"); 53 + 54 + data &= ~PCIECR_PCIEMUX1; 55 + fpga_write_reg(data, PCIECR); 56 + 57 + /* Warn about forced rerouting if slot#3 is occupied */ 58 + if ((data & PCIECR_PRST3) == 0) { 59 + pr_warning("Unreachable card detected in slot#3\n"); 60 + return -EBUSY; 61 + } 62 + } else 63 + pr_info("PCIe slot#4 disabled\n"); 64 + 65 + return 0; 66 + } 67 + postcore_initcall(sdk7786_pci_init);
+5 -6
arch/sh/drivers/pci/ops-sh4.c
··· 9 9 */ 10 10 #include <linux/pci.h> 11 11 #include <linux/io.h> 12 + #include <linux/spinlock.h> 12 13 #include <asm/addrspace.h> 13 14 #include "pci-sh4.h" 14 15 ··· 18 17 */ 19 18 #define CONFIG_CMD(bus, devfn, where) \ 20 19 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) 21 - 22 - static DEFINE_SPINLOCK(sh4_pci_lock); 23 20 24 21 /* 25 22 * Functions for accessing PCI configuration space with type 1 accesses ··· 33 34 * PCIPDR may only be accessed as 32 bit words, 34 35 * so we must do byte alignment by hand 35 36 */ 36 - spin_lock_irqsave(&sh4_pci_lock, flags); 37 + raw_spin_lock_irqsave(&pci_config_lock, flags); 37 38 pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); 38 39 data = pci_read_reg(chan, SH4_PCIPDR); 39 - spin_unlock_irqrestore(&sh4_pci_lock, flags); 40 + raw_spin_unlock_irqrestore(&pci_config_lock, flags); 40 41 41 42 switch (size) { 42 43 case 1: ··· 68 69 int shift; 69 70 u32 data; 70 71 71 - spin_lock_irqsave(&sh4_pci_lock, flags); 72 + raw_spin_lock_irqsave(&pci_config_lock, flags); 72 73 pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); 73 74 data = pci_read_reg(chan, SH4_PCIPDR); 74 - spin_unlock_irqrestore(&sh4_pci_lock, flags); 75 + raw_spin_unlock_irqrestore(&pci_config_lock, flags); 75 76 76 77 switch (size) { 77 78 case 1:
+53 -16
arch/sh/drivers/pci/ops-sh7786.c
··· 1 1 /* 2 2 * Generic SH7786 PCI-Express operations. 3 3 * 4 - * Copyright (C) 2009 Paul Mundt 4 + * Copyright (C) 2009 - 2010 Paul Mundt 5 5 * 6 6 * This file is subject to the terms and conditions of the GNU General Public 7 7 * License v2. See the file "COPYING" in the main directory of this archive ··· 19 19 PCI_ACCESS_WRITE, 20 20 }; 21 21 22 - static DEFINE_SPINLOCK(sh7786_pcie_lock); 23 - 24 22 static int sh7786_pcie_config_access(unsigned char access_type, 25 23 struct pci_bus *bus, unsigned int devfn, int where, u32 *data) 26 24 { 27 25 struct pci_channel *chan = bus->sysdata; 28 - int dev, func; 26 + int dev, func, type, reg; 29 27 30 28 dev = PCI_SLOT(devfn); 31 29 func = PCI_FUNC(devfn); 30 + type = !!bus->parent; 31 + reg = where & ~3; 32 32 33 33 if (bus->number > 255 || dev > 31 || func > 7) 34 34 return PCIBIOS_FUNC_NOT_SUPPORTED; 35 - if (devfn) 36 - return PCIBIOS_DEVICE_NOT_FOUND; 35 + 36 + /* 37 + * While each channel has its own memory-mapped extended config 38 + * space, it's generally only accessible when in endpoint mode. 39 + * When in root complex mode, the controller is unable to target 40 + * itself with either type 0 or type 1 accesses, and indeed, any 41 + * controller initiated target transfer to its own config space 42 + * result in a completer abort. 43 + * 44 + * Each channel effectively only supports a single device, but as 45 + * the same channel <-> device access works for any PCI_SLOT() 46 + * value, we cheat a bit here and bind the controller's config 47 + * space to devfn 0 in order to enable self-enumeration. In this 48 + * case the regular PAR/PDR path is sidelined and the mangled 49 + * config access itself is initiated as a SuperHyway transaction. 50 + */ 51 + if (pci_is_root_bus(bus)) { 52 + if (dev == 0) { 53 + if (access_type == PCI_ACCESS_READ) 54 + *data = pci_read_reg(chan, PCI_REG(reg)); 55 + else 56 + pci_write_reg(chan, *data, PCI_REG(reg)); 57 + 58 + return PCIBIOS_SUCCESSFUL; 59 + } else if (dev > 1) 60 + return PCIBIOS_DEVICE_NOT_FOUND; 61 + } 62 + 63 + /* Clear errors */ 64 + pci_write_reg(chan, pci_read_reg(chan, SH4A_PCIEERRFR), SH4A_PCIEERRFR); 37 65 38 66 /* Set the PIO address */ 39 67 pci_write_reg(chan, (bus->number << 24) | (dev << 19) | 40 - (func << 16) | (where & ~3), SH4A_PCIEPAR); 68 + (func << 16) | reg, SH4A_PCIEPAR); 41 69 42 70 /* Enable the configuration access */ 43 - pci_write_reg(chan, (1 << 31), SH4A_PCIEPCTLR); 71 + pci_write_reg(chan, (1 << 31) | (type << 8), SH4A_PCIEPCTLR); 72 + 73 + /* Check for errors */ 74 + if (pci_read_reg(chan, SH4A_PCIEERRFR) & 0x10) 75 + return PCIBIOS_DEVICE_NOT_FOUND; 76 + 77 + /* Check for master and target aborts */ 78 + if (pci_read_reg(chan, SH4A_PCIEPCICONF1) & ((1 << 29) | (1 << 28))) 79 + return PCIBIOS_DEVICE_NOT_FOUND; 44 80 45 81 if (access_type == PCI_ACCESS_READ) 46 82 *data = pci_read_reg(chan, SH4A_PCIEPDR); 47 83 else 48 84 pci_write_reg(chan, *data, SH4A_PCIEPDR); 49 85 50 - /* Check for master and target aborts */ 51 - if (pci_read_reg(chan, SH4A_PCIEPCICONF1) & ((1 << 29) | (1 << 28))) 52 - return PCIBIOS_DEVICE_NOT_FOUND; 86 + /* Disable the configuration access */ 87 + pci_write_reg(chan, 0, SH4A_PCIEPCTLR); 53 88 54 89 return PCIBIOS_SUCCESSFUL; 55 90 } ··· 101 66 else if ((size == 4) && (where & 3)) 102 67 return PCIBIOS_BAD_REGISTER_NUMBER; 103 68 104 - spin_lock_irqsave(&sh7786_pcie_lock, flags); 69 + raw_spin_lock_irqsave(&pci_config_lock, flags); 105 70 ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, 106 71 devfn, where, &data); 107 - if (ret != PCIBIOS_SUCCESSFUL) 72 + if (ret != PCIBIOS_SUCCESSFUL) { 73 + *val = 0xffffffff; 108 74 goto out; 75 + } 109 76 110 77 if (size == 1) 111 78 *val = (data >> ((where & 3) << 3)) & 0xff; ··· 121 84 devfn, where, size, (unsigned long)*val); 122 85 123 86 out: 124 - spin_unlock_irqrestore(&sh7786_pcie_lock, flags); 87 + raw_spin_unlock_irqrestore(&pci_config_lock, flags); 125 88 return ret; 126 89 } 127 90 ··· 137 100 else if ((size == 4) && (where & 3)) 138 101 return PCIBIOS_BAD_REGISTER_NUMBER; 139 102 140 - spin_lock_irqsave(&sh7786_pcie_lock, flags); 103 + raw_spin_lock_irqsave(&pci_config_lock, flags); 141 104 ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, 142 105 devfn, where, &data); 143 106 if (ret != PCIBIOS_SUCCESSFUL) ··· 161 124 ret = sh7786_pcie_config_access(PCI_ACCESS_WRITE, bus, 162 125 devfn, where, &data); 163 126 out: 164 - spin_unlock_irqrestore(&sh7786_pcie_lock, flags); 127 + raw_spin_unlock_irqrestore(&pci_config_lock, flags); 165 128 return ret; 166 129 } 167 130
+1 -1
arch/sh/drivers/pci/pci-sh7751.c
··· 81 81 unsigned int id; 82 82 u32 word, reg; 83 83 84 - printk(KERN_NOTICE "PCI: Starting intialization.\n"); 84 + printk(KERN_NOTICE "PCI: Starting initialization.\n"); 85 85 86 86 chan->reg_base = 0xfe200000; 87 87
+1 -1
arch/sh/drivers/pci/pci-sh7780.c
··· 246 246 const char *type; 247 247 int ret, i; 248 248 249 - printk(KERN_NOTICE "PCI: Starting intialization.\n"); 249 + printk(KERN_NOTICE "PCI: Starting initialization.\n"); 250 250 251 251 chan->reg_base = 0xfe040000; 252 252
-6
arch/sh/drivers/pci/pci-sh7780.h
··· 12 12 #ifndef _PCI_SH7780_H_ 13 13 #define _PCI_SH7780_H_ 14 14 15 - #define PCI_VENDOR_ID_RENESAS 0x1912 16 - #define PCI_DEVICE_ID_RENESAS_SH7781 0x0001 17 - #define PCI_DEVICE_ID_RENESAS_SH7780 0x0002 18 - #define PCI_DEVICE_ID_RENESAS_SH7763 0x0004 19 - #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 20 - 21 15 /* SH7780 Control Registers */ 22 16 #define PCIECR 0xFE000008 23 17 #define PCIECR_ENBL 0x01
+8 -35
arch/sh/drivers/pci/pci.c
··· 19 19 #include <linux/dma-debug.h> 20 20 #include <linux/io.h> 21 21 #include <linux/mutex.h> 22 + #include <linux/spinlock.h> 22 23 23 24 unsigned long PCIBIOS_MIN_IO = 0x0000; 24 25 unsigned long PCIBIOS_MIN_MEM = 0; ··· 57 56 } 58 57 } 59 58 59 + /* 60 + * This interrupt-safe spinlock protects all accesses to PCI 61 + * configuration space. 62 + */ 63 + DEFINE_RAW_SPINLOCK(pci_config_lock); 60 64 static DEFINE_MUTEX(pci_scan_mutex); 61 65 62 66 int __devinit register_pci_controller(struct pci_channel *hose) ··· 239 233 240 234 int pcibios_enable_device(struct pci_dev *dev, int mask) 241 235 { 242 - u16 cmd, old_cmd; 243 - int idx; 244 - struct resource *r; 245 - 246 - pci_read_config_word(dev, PCI_COMMAND, &cmd); 247 - old_cmd = cmd; 248 - for (idx=0; idx < PCI_NUM_RESOURCES; idx++) { 249 - /* Only set up the requested stuff */ 250 - if (!(mask & (1<<idx))) 251 - continue; 252 - 253 - r = &dev->resource[idx]; 254 - if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM))) 255 - continue; 256 - if ((idx == PCI_ROM_RESOURCE) && 257 - (!(r->flags & IORESOURCE_ROM_ENABLE))) 258 - continue; 259 - if (!r->start && r->end) { 260 - printk(KERN_ERR "PCI: Device %s not available " 261 - "because of resource collisions\n", 262 - pci_name(dev)); 263 - return -EINVAL; 264 - } 265 - if (r->flags & IORESOURCE_IO) 266 - cmd |= PCI_COMMAND_IO; 267 - if (r->flags & IORESOURCE_MEM) 268 - cmd |= PCI_COMMAND_MEMORY; 269 - } 270 - if (cmd != old_cmd) { 271 - printk("PCI: Enabling device %s (%04x -> %04x)\n", 272 - pci_name(dev), old_cmd, cmd); 273 - pci_write_config_word(dev, PCI_COMMAND, cmd); 274 - } 275 - return 0; 236 + return pci_enable_resources(dev, mask); 276 237 } 277 238 278 239 /* ··· 268 295 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); 269 296 } 270 297 271 - char * __devinit pcibios_setup(char *str) 298 + char * __devinit __weak pcibios_setup(char *str) 272 299 { 273 300 return str; 274 301 }
+196 -57
arch/sh/drivers/pci/pcie-sh7786.c
··· 13 13 #include <linux/io.h> 14 14 #include <linux/delay.h> 15 15 #include <linux/slab.h> 16 + #include <linux/clk.h> 17 + #include <linux/sh_clk.h> 16 18 #include "pcie-sh7786.h" 17 19 #include <asm/sizes.h> 18 20 19 21 struct sh7786_pcie_port { 20 22 struct pci_channel *hose; 23 + struct clk *fclk, phy_clk; 21 24 unsigned int index; 22 25 int endpoint; 23 26 int link; ··· 54 51 .name = "PCIe0 MEM 2", 55 52 .start = 0xfe100000, 56 53 .end = 0xfe100000 + SZ_1M - 1, 54 + .flags = IORESOURCE_MEM, 57 55 }, 58 56 }; 59 57 ··· 78 74 .name = "PCIe1 MEM 2", 79 75 .start = 0xfe300000, 80 76 .end = 0xfe300000 + SZ_1M - 1, 77 + .flags = IORESOURCE_MEM, 81 78 }, 82 79 }; 83 80 ··· 87 82 .name = "PCIe2 IO", 88 83 .start = 0xfc800000, 89 84 .end = 0xfc800000 + SZ_4M - 1, 85 + .flags = IORESOURCE_IO, 90 86 }, { 91 87 .name = "PCIe2 MEM 0", 92 88 .start = 0x80000000, ··· 102 96 .name = "PCIe2 MEM 2", 103 97 .start = 0xfcd00000, 104 98 .end = 0xfcd00000 + SZ_1M - 1, 99 + .flags = IORESOURCE_MEM, 105 100 }, 106 101 }; 107 102 ··· 124 117 DEFINE_CONTROLLER(0xfcc00000, 2), 125 118 }; 126 119 127 - static int phy_wait_for_ack(struct pci_channel *chan) 120 + static struct clk fixed_pciexclkp = { 121 + .rate = 100000000, /* 100 MHz reference clock */ 122 + }; 123 + 124 + static void __devinit sh7786_pci_fixup(struct pci_dev *dev) 125 + { 126 + /* 127 + * Prevent enumeration of root complex resources. 128 + */ 129 + if (pci_is_root_bus(dev->bus) && dev->devfn == 0) { 130 + int i; 131 + 132 + for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 133 + dev->resource[i].start = 0; 134 + dev->resource[i].end = 0; 135 + dev->resource[i].flags = 0; 136 + } 137 + } 138 + } 139 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RENESAS, PCI_DEVICE_ID_RENESAS_SH7786, 140 + sh7786_pci_fixup); 141 + 142 + static int __init phy_wait_for_ack(struct pci_channel *chan) 128 143 { 129 144 unsigned int timeout = 100; 130 145 ··· 160 131 return -ETIMEDOUT; 161 132 } 162 133 163 - static int pci_wait_for_irq(struct pci_channel *chan, unsigned int mask) 134 + static int __init pci_wait_for_irq(struct pci_channel *chan, unsigned int mask) 164 135 { 165 136 unsigned int timeout = 100; 166 137 ··· 174 145 return -ETIMEDOUT; 175 146 } 176 147 177 - static void phy_write_reg(struct pci_channel *chan, unsigned int addr, 178 - unsigned int lane, unsigned int data) 148 + static void __init phy_write_reg(struct pci_channel *chan, unsigned int addr, 149 + unsigned int lane, unsigned int data) 179 150 { 180 - unsigned long phyaddr, ctrl; 151 + unsigned long phyaddr; 181 152 182 153 phyaddr = (1 << BITS_CMD) + ((lane & 0xf) << BITS_LANE) + 183 154 ((addr & 0xff) << BITS_ADR); 184 - 185 - /* Enable clock */ 186 - ctrl = pci_read_reg(chan, SH4A_PCIEPHYCTLR); 187 - ctrl |= (1 << BITS_CKE); 188 - pci_write_reg(chan, ctrl, SH4A_PCIEPHYCTLR); 189 155 190 156 /* Set write data */ 191 157 pci_write_reg(chan, data, SH4A_PCIEPHYDOUTR); ··· 189 165 phy_wait_for_ack(chan); 190 166 191 167 /* Clear command */ 168 + pci_write_reg(chan, 0, SH4A_PCIEPHYDOUTR); 192 169 pci_write_reg(chan, 0, SH4A_PCIEPHYADRR); 193 170 194 171 phy_wait_for_ack(chan); 195 - 196 - /* Disable clock */ 197 - ctrl = pci_read_reg(chan, SH4A_PCIEPHYCTLR); 198 - ctrl &= ~(1 << BITS_CKE); 199 - pci_write_reg(chan, ctrl, SH4A_PCIEPHYCTLR); 200 172 } 201 173 202 - static int phy_init(struct pci_channel *chan) 174 + static int __init pcie_clk_init(struct sh7786_pcie_port *port) 203 175 { 176 + struct pci_channel *chan = port->hose; 177 + struct clk *clk; 178 + char fclk_name[16]; 179 + int ret; 180 + 181 + /* 182 + * First register the fixed clock 183 + */ 184 + ret = clk_register(&fixed_pciexclkp); 185 + if (unlikely(ret != 0)) 186 + return ret; 187 + 188 + /* 189 + * Grab the port's function clock, which the PHY clock depends 190 + * on. clock lookups don't help us much at this point, since no 191 + * dev_id is available this early. Lame. 192 + */ 193 + snprintf(fclk_name, sizeof(fclk_name), "pcie%d_fck", port->index); 194 + 195 + port->fclk = clk_get(NULL, fclk_name); 196 + if (IS_ERR(port->fclk)) { 197 + ret = PTR_ERR(port->fclk); 198 + goto err_fclk; 199 + } 200 + 201 + clk_enable(port->fclk); 202 + 203 + /* 204 + * And now, set up the PHY clock 205 + */ 206 + clk = &port->phy_clk; 207 + 208 + memset(clk, 0, sizeof(struct clk)); 209 + 210 + clk->parent = &fixed_pciexclkp; 211 + clk->enable_reg = (void __iomem *)(chan->reg_base + SH4A_PCIEPHYCTLR); 212 + clk->enable_bit = BITS_CKE; 213 + 214 + ret = sh_clk_mstp32_register(clk, 1); 215 + if (unlikely(ret < 0)) 216 + goto err_phy; 217 + 218 + return 0; 219 + 220 + err_phy: 221 + clk_disable(port->fclk); 222 + clk_put(port->fclk); 223 + err_fclk: 224 + clk_unregister(&fixed_pciexclkp); 225 + 226 + return ret; 227 + } 228 + 229 + static int __init phy_init(struct sh7786_pcie_port *port) 230 + { 231 + struct pci_channel *chan = port->hose; 204 232 unsigned int timeout = 100; 233 + 234 + clk_enable(&port->phy_clk); 205 235 206 236 /* Initialize the phy */ 207 237 phy_write_reg(chan, 0x60, 0xf, 0x004b008b); ··· 265 187 phy_write_reg(chan, 0x66, 0xf, 0x00000010); 266 188 phy_write_reg(chan, 0x74, 0xf, 0x0007001c); 267 189 phy_write_reg(chan, 0x79, 0xf, 0x01fc000d); 190 + phy_write_reg(chan, 0xb0, 0xf, 0x00000610); 268 191 269 192 /* Deassert Standby */ 270 - phy_write_reg(chan, 0x67, 0xf, 0x00000400); 193 + phy_write_reg(chan, 0x67, 0x1, 0x00000400); 194 + 195 + /* Disable clock */ 196 + clk_disable(&port->phy_clk); 271 197 272 198 while (timeout--) { 273 199 if (pci_read_reg(chan, SH4A_PCIEPHYSR)) ··· 283 201 return -ETIMEDOUT; 284 202 } 285 203 286 - static int pcie_init(struct sh7786_pcie_port *port) 204 + static void __init pcie_reset(struct sh7786_pcie_port *port) 205 + { 206 + struct pci_channel *chan = port->hose; 207 + 208 + pci_write_reg(chan, 1, SH4A_PCIESRSTR); 209 + pci_write_reg(chan, 0, SH4A_PCIETCTLR); 210 + pci_write_reg(chan, 0, SH4A_PCIESRSTR); 211 + pci_write_reg(chan, 0, SH4A_PCIETXVC0SR); 212 + } 213 + 214 + static int __init pcie_init(struct sh7786_pcie_port *port) 287 215 { 288 216 struct pci_channel *chan = port->hose; 289 217 unsigned int data; 290 218 phys_addr_t memphys; 291 219 size_t memsize; 292 - int ret, i; 220 + int ret, i, win; 293 221 294 222 /* Begin initialization */ 295 - pci_write_reg(chan, 0, SH4A_PCIETCTLR); 223 + pcie_reset(port); 296 224 297 - /* Initialize as type1. */ 298 - data = pci_read_reg(chan, SH4A_PCIEPCICONF3); 299 - data &= ~(0x7f << 16); 300 - data |= PCI_HEADER_TYPE_BRIDGE << 16; 301 - pci_write_reg(chan, data, SH4A_PCIEPCICONF3); 225 + /* 226 + * Initial header for port config space is type 1, set the device 227 + * class to match. Hardware takes care of propagating the IDSETR 228 + * settings, so there is no need to bother with a quirk. 229 + */ 230 + pci_write_reg(chan, PCI_CLASS_BRIDGE_PCI << 16, SH4A_PCIEIDSETR1); 302 231 303 232 /* Initialize default capabilities. */ 304 233 data = pci_read_reg(chan, SH4A_PCIEEXPCAP0); ··· 361 268 * LAR1/LAMR1. 362 269 */ 363 270 if (memsize > SZ_512M) { 364 - __raw_writel(memphys + SZ_512M, chan->reg_base + SH4A_PCIELAR1); 365 - __raw_writel(((memsize - SZ_512M) - SZ_256) | 1, 366 - chan->reg_base + SH4A_PCIELAMR1); 271 + pci_write_reg(chan, memphys + SZ_512M, SH4A_PCIELAR1); 272 + pci_write_reg(chan, ((memsize - SZ_512M) - SZ_256) | 1, 273 + SH4A_PCIELAMR1); 367 274 memsize = SZ_512M; 368 275 } else { 369 276 /* 370 277 * Otherwise just zero it out and disable it. 371 278 */ 372 - __raw_writel(0, chan->reg_base + SH4A_PCIELAR1); 373 - __raw_writel(0, chan->reg_base + SH4A_PCIELAMR1); 279 + pci_write_reg(chan, 0, SH4A_PCIELAR1); 280 + pci_write_reg(chan, 0, SH4A_PCIELAMR1); 374 281 } 375 282 376 283 /* 377 284 * LAR0/LAMR0 covers up to the first 512MB, which is enough to 378 285 * cover all of lowmem on most platforms. 379 286 */ 380 - __raw_writel(memphys, chan->reg_base + SH4A_PCIELAR0); 381 - __raw_writel((memsize - SZ_256) | 1, chan->reg_base + SH4A_PCIELAMR0); 287 + pci_write_reg(chan, memphys, SH4A_PCIELAR0); 288 + pci_write_reg(chan, (memsize - SZ_256) | 1, SH4A_PCIELAMR0); 382 289 383 290 /* Finish initialization */ 384 291 data = pci_read_reg(chan, SH4A_PCIETCTLR); 385 292 data |= 0x1; 386 293 pci_write_reg(chan, data, SH4A_PCIETCTLR); 294 + 295 + /* Let things settle down a bit.. */ 296 + mdelay(100); 387 297 388 298 /* Enable DL_Active Interrupt generation */ 389 299 data = pci_read_reg(chan, SH4A_PCIEDLINTENR); ··· 398 302 data |= PCIEMACCTLR_SCR_DIS | (0xff << 16); 399 303 pci_write_reg(chan, data, SH4A_PCIEMACCTLR); 400 304 305 + /* 306 + * This will timeout if we don't have a link, but we permit the 307 + * port to register anyways in order to support hotplug on future 308 + * hardware. 309 + */ 401 310 ret = pci_wait_for_irq(chan, MASK_INT_TX_CTRL); 402 - if (unlikely(ret != 0)) 403 - return -ENODEV; 404 311 405 312 data = pci_read_reg(chan, SH4A_PCIEPCICONF1); 406 313 data &= ~(PCI_STATUS_DEVSEL_MASK << 16); ··· 416 317 417 318 wmb(); 418 319 419 - data = pci_read_reg(chan, SH4A_PCIEMACSR); 420 - printk(KERN_NOTICE "PCI: PCIe#%d link width %d\n", 421 - port->index, (data >> 20) & 0x3f); 320 + if (ret == 0) { 321 + data = pci_read_reg(chan, SH4A_PCIEMACSR); 322 + printk(KERN_NOTICE "PCI: PCIe#%d x%d link detected\n", 323 + port->index, (data >> 20) & 0x3f); 324 + } else 325 + printk(KERN_NOTICE "PCI: PCIe#%d link down\n", 326 + port->index); 422 327 423 - 424 - for (i = 0; i < chan->nr_resources; i++) { 328 + for (i = win = 0; i < chan->nr_resources; i++) { 425 329 struct resource *res = chan->resources + i; 426 330 resource_size_t size; 427 - u32 enable_mask; 331 + u32 mask; 428 332 429 - pci_write_reg(chan, 0x00000000, SH4A_PCIEPTCTLR(i)); 333 + /* 334 + * We can't use the 32-bit mode windows in legacy 29-bit 335 + * mode, so just skip them entirely. 336 + */ 337 + if ((res->flags & IORESOURCE_MEM_32BIT) && __in_29bit_mode()) 338 + continue; 430 339 431 - size = resource_size(res); 340 + pci_write_reg(chan, 0x00000000, SH4A_PCIEPTCTLR(win)); 432 341 433 342 /* 434 343 * The PAMR mask is calculated in units of 256kB, which 435 344 * keeps things pretty simple. 436 345 */ 437 - __raw_writel(((roundup_pow_of_two(size) / SZ_256K) - 1) << 18, 438 - chan->reg_base + SH4A_PCIEPAMR(i)); 346 + size = resource_size(res); 347 + mask = (roundup_pow_of_two(size) / SZ_256K) - 1; 348 + pci_write_reg(chan, mask << 18, SH4A_PCIEPAMR(win)); 439 349 440 - pci_write_reg(chan, 0x00000000, SH4A_PCIEPARH(i)); 441 - pci_write_reg(chan, 0x00000000, SH4A_PCIEPARL(i)); 350 + pci_write_reg(chan, upper_32_bits(res->start), 351 + SH4A_PCIEPARH(win)); 352 + pci_write_reg(chan, lower_32_bits(res->start), 353 + SH4A_PCIEPARL(win)); 442 354 443 - enable_mask = MASK_PARE; 355 + mask = MASK_PARE; 444 356 if (res->flags & IORESOURCE_IO) 445 - enable_mask |= MASK_SPC; 357 + mask |= MASK_SPC; 446 358 447 - pci_write_reg(chan, enable_mask, SH4A_PCIEPTCTLR(i)); 359 + pci_write_reg(chan, mask, SH4A_PCIEPTCTLR(win)); 360 + 361 + win++; 448 362 } 449 363 450 364 return 0; ··· 468 356 return 71; 469 357 } 470 358 471 - static int sh7786_pcie_core_init(void) 359 + static int __init sh7786_pcie_core_init(void) 472 360 { 473 361 /* Return the number of ports */ 474 362 return test_mode_pin(MODE_PIN12) ? 3 : 2; 475 363 } 476 364 477 - static int __devinit sh7786_pcie_init_hw(struct sh7786_pcie_port *port) 365 + static int __init sh7786_pcie_init_hw(struct sh7786_pcie_port *port) 478 366 { 479 367 int ret; 480 - 481 - ret = phy_init(port->hose); 482 - if (unlikely(ret < 0)) 483 - return ret; 484 368 485 369 /* 486 370 * Check if we are configured in endpoint or root complex mode, 487 371 * this is a fixed pin setting that applies to all PCIe ports. 488 372 */ 489 373 port->endpoint = test_mode_pin(MODE_PIN11); 374 + 375 + /* 376 + * Setup clocks, needed both for PHY and PCIe registers. 377 + */ 378 + ret = pcie_clk_init(port); 379 + if (unlikely(ret < 0)) 380 + return ret; 381 + 382 + ret = phy_init(port); 383 + if (unlikely(ret < 0)) 384 + return ret; 490 385 491 386 ret = pcie_init(port); 492 387 if (unlikely(ret < 0)) ··· 509 390 510 391 static int __init sh7786_pcie_init(void) 511 392 { 393 + struct clk *platclk; 512 394 int ret = 0, i; 513 395 514 - printk(KERN_NOTICE "PCI: Starting intialization.\n"); 396 + printk(KERN_NOTICE "PCI: Starting initialization.\n"); 515 397 516 398 sh7786_pcie_hwops = &sh7786_65nm_pcie_hwops; 517 399 ··· 527 407 if (unlikely(!sh7786_pcie_ports)) 528 408 return -ENOMEM; 529 409 410 + /* 411 + * Fetch any optional platform clock associated with this block. 412 + * 413 + * This is a rather nasty hack for boards with spec-mocking FPGAs 414 + * that have a secondary set of clocks outside of the on-chip 415 + * ones that need to be accounted for before there is any chance 416 + * of touching the existing MSTP bits or CPG clocks. 417 + */ 418 + platclk = clk_get(NULL, "pcie_plat_clk"); 419 + if (IS_ERR(platclk)) { 420 + /* Sane hardware should probably get a WARN_ON.. */ 421 + platclk = NULL; 422 + } 423 + 424 + clk_enable(platclk); 425 + 530 426 printk(KERN_NOTICE "PCI: probing %d ports.\n", nr_ports); 531 427 532 428 for (i = 0; i < nr_ports; i++) { ··· 555 419 ret |= sh7786_pcie_hwops->port_init_hw(port); 556 420 } 557 421 558 - if (unlikely(ret)) 422 + if (unlikely(ret)) { 423 + clk_disable(platclk); 424 + clk_put(platclk); 559 425 return ret; 426 + } 560 427 561 428 return 0; 562 429 }
+54 -2
arch/sh/drivers/pci/pcie-sh7786.h
··· 55 55 #define BITS_ERRRCV (0) /* 0 ERRRCV 0 */ 56 56 #define MASK_ERRRCV (1<<BITS_ERRRCV) 57 57 58 + /* PCIEENBLR */ 59 + #define SH4A_PCIEENBLR (0x000008) /* R/W - 0x0000 0001 32 */ 60 + 58 61 /* PCIEECR */ 59 - #define SH4A_PCIEECR (0x000008) /* R/W - 0x0000 0000 32 */ 62 + #define SH4A_PCIEECR (0x00000C) /* R/W - 0x0000 0000 32 */ 60 63 #define BITS_ENBL (0) /* 0 ENBL 0 R/W */ 61 64 #define MASK_ENBL (1<<BITS_ENBL) 62 65 ··· 116 113 #define BITS_MDATA (0) 117 114 #define MASK_MDATA (0xffffffff<<BITS_MDATA) 118 115 116 + /* PCIEUNLOCKCR */ 117 + #define SH4A_PCIEUNLOCKCR (0x000048) /* R/W - 0x0000 0000 32 */ 118 + 119 + /* PCIEIDR */ 120 + #define SH4A_PCIEIDR (0x000060) /* R/W - 0x0101 1101 32 */ 121 + 122 + /* PCIEDBGCTLR */ 123 + #define SH4A_PCIEDBGCTLR (0x000100) /* R/W - 0x0000 0000 32 */ 124 + 125 + /* PCIEINTXR */ 126 + #define SH4A_PCIEINTXR (0x004000) /* R/W - 0x0000 0000 32 */ 127 + 128 + /* PCIERMSGR */ 129 + #define SH4A_PCIERMSGR (0x004010) /* R/W - 0x0000 0000 32 */ 130 + 131 + /* PCIERSTR */ 132 + #define SH4A_PCIERSTR(x) (0x008000 + ((x) * 0x4)) /* R/W - 0x0000 0000 32 */ 133 + 134 + /* PCIESRSTR */ 135 + #define SH4A_PCIESRSTR (0x008040) /* R/W - 0x0000 0000 32 */ 136 + 119 137 /* PCIEPHYCTLR */ 120 138 #define SH4A_PCIEPHYCTLR (0x010000) /* R/W - 0x0000 0000 32 */ 121 139 #define BITS_CKE (0) ··· 144 120 145 121 /* PCIERMSGIER */ 146 122 #define SH4A_PCIERMSGIER (0x004040) /* R/W - 0x0000 0000 32 */ 123 + 124 + /* PCIEPHYCTLR */ 125 + #define SH4A_PCIEPHYCTLR (0x010000) /* R/W - 0x0000 0000 32 */ 147 126 148 127 /* PCIEPHYADRR */ 149 128 #define SH4A_PCIEPHYADRR (0x010004) /* R/W - 0x0000 0000 32 */ ··· 179 152 #define MASK_CFINT (1<<BITS_CFINT) 180 153 181 154 /* PCIETSTR */ 182 - #define SH4A_PCIETSTR (0x020004) /* R/W R/W 0x0000 0000 32 */ 155 + #define SH4A_PCIETSTR (0x020004) /* R 0x0000 0000 32 */ 183 156 184 157 /* PCIEINTR */ 185 158 #define SH4A_PCIEINTR (0x020008) /* R/W R/W 0x0000 0000 32 */ ··· 263 236 #define BITS_INTPM (8) 264 237 #define MASK_INTPM (1<<BITS_INTPM) 265 238 239 + /* PCIEEH0R */ 240 + #define SH4A_PCIEEHR(x) (0x020010 + ((x) * 0x4)) /* R - 0x0000 0000 32 */ 241 + 266 242 /* PCIEAIR */ 267 243 #define SH4A_PCIEAIR (SH4A_PCIE_BASE + 0x020010) /* R/W R/W 0xxxxx xxxx 32 */ 268 244 ··· 274 244 275 245 /* PCIEERRFR */ // Rev1.18 276 246 #define SH4A_PCIEERRFR (0x020020) /* R/W R/W 0xxxxx xxxx 32 */ // Rev1.18 247 + 248 + /* PCIEERRFER */ 249 + #define SH4A_PCIEERRFER (0x020024) /* R/W R/W 0x0000 0000 32 */ 250 + 251 + /* PCIEERRFR2 */ 252 + #define SH4A_PCIEERRFR2 (0x020028) /* R/W R/W 0x0000 0000 32 */ 253 + 254 + /* PCIEMSIR */ 255 + #define SH4A_PCIEMSIR (0x020040) /* R/W - 0x0000 0000 32 */ 256 + 257 + /* PCIEMSIFR */ 258 + #define SH4A_PCIEMSIFR (0x020044) /* R/W R/W 0x0000 0000 32 */ 259 + 260 + /* PCIEPWRCTLR */ 261 + #define SH4A_PCIEPWRCTLR (0x020100) /* R/W - 0x0000 0000 32 */ 262 + 263 + /* PCIEPCCTLR */ 264 + #define SH4A_PCIEPCCTLR (0x020180) /* R/W - 0x0000 0000 32 */ 265 + 277 266 // Rev1.18 278 267 /* PCIELAR0 */ 279 268 #define SH4A_PCIELAR0 (0x020200) /* R/W R/W 0x0000 0000 32 */ ··· 401 352 #define SH4A_PCIEDMCCR0 (0x021120) /* R/W R/W 0x0000 0000 32 */ 402 353 #define SH4A_PCIEDMCC2R0 (0x021124) /* R/W R/W 0x0000 0000 - */ 403 354 #define SH4A_PCIEDMCCCR0 (0x021128) /* R/W R/W 0x0000 0000 32 */ 355 + #define SH4A_PCIEDMCHSR0 (0x02112C) /* R/W - 0x0000 0000 32 */ 404 356 #define SH4A_PCIEDMSAR1 (0x021140) /* R/W R/W 0x0000 0000 32 */ 405 357 #define SH4A_PCIEDMSAHR1 (0x021144) /* R/W R/W 0x0000 0000 32 */ 406 358 #define SH4A_PCIEDMDAR1 (0x021148) /* R/W R/W 0x0000 0000 32 */ ··· 413 363 #define SH4A_PCIEDMCCR1 (0x021160) /* R/W R/W 0x0000 0000 32 */ 414 364 #define SH4A_PCIEDMCC2R1 (0x021164) /* R/W R/W 0x0000 0000 - */ 415 365 #define SH4A_PCIEDMCCCR1 (0x021168) /* R/W R/W 0x0000 0000 32 */ 366 + #define SH4A_PCIEDMCHSR1 (0x02116C) /* R/W - 0x0000 0000 32 */ 416 367 #define SH4A_PCIEDMSAR2 (0x021180) /* R/W R/W 0x0000 0000 32 */ 417 368 #define SH4A_PCIEDMSAHR2 (0x021184) /* R/W R/W 0x0000 0000 32 */ 418 369 #define SH4A_PCIEDMDAR2 (0x021188) /* R/W R/W 0x0000 0000 32 */ ··· 436 385 #define SH4A_PCIEDMCCR3 (0x0211E0) /* R/W R/W 0x0000 0000 32 */ 437 386 #define SH4A_PCIEDMCC2R3 (0x0211E4) /* R/W R/W 0x0000 0000 - */ 438 387 #define SH4A_PCIEDMCCCR3 (0x0211E8) /* R/W R/W 0x0000 0000 32 */ 388 + #define SH4A_PCIEDMCHSR3 (0x0211EC) /* R/W R/W 0x0000 0000 32 */ 439 389 #define SH4A_PCIEPCICONF0 (0x040000) /* R R - 8/16/32 */ 440 390 #define SH4A_PCIEPCICONF1 (0x040004) /* R/W R/W 0x0008 0000 8/16/32 */ 441 391 #define SH4A_PCIEPCICONF2 (0x040008) /* R/W R/W 0xFF00 0000 8/16/32 */
+2
arch/sh/include/asm/Kbuild
··· 5 5 header-y += hw_breakpoint.h 6 6 header-y += posix_types_32.h 7 7 header-y += posix_types_64.h 8 + header-y += ptrace_32.h 9 + header-y += ptrace_64.h 8 10 header-y += unistd_32.h 9 11 header-y += unistd_64.h
+8 -19
arch/sh/include/asm/elf.h
··· 50 50 #define R_SH_GOTPC 167 51 51 52 52 /* FDPIC relocs */ 53 - #define R_SH_GOT20 70 54 - #define R_SH_GOTOFF20 71 55 - #define R_SH_GOTFUNCDESC 72 56 - #define R_SH_GOTFUNCDESC20 73 57 - #define R_SH_GOTOFFFUNCDESC 74 58 - #define R_SH_GOTOFFFUNCDESC20 75 59 - #define R_SH_FUNCDESC 76 60 - #define R_SH_FUNCDESC_VALUE 77 61 - 62 - #if 0 /* XXX - later .. */ 63 - #define R_SH_GOT20 198 64 - #define R_SH_GOTOFF20 199 65 - #define R_SH_GOTFUNCDESC 200 66 - #define R_SH_GOTFUNCDESC20 201 67 - #define R_SH_GOTOFFFUNCDESC 202 68 - #define R_SH_GOTOFFFUNCDESC20 203 69 - #define R_SH_FUNCDESC 204 70 - #define R_SH_FUNCDESC_VALUE 205 71 - #endif 53 + #define R_SH_GOT20 201 54 + #define R_SH_GOTOFF20 202 55 + #define R_SH_GOTFUNCDESC 203 56 + #define R_SH_GOTFUNCDESC20 204 57 + #define R_SH_GOTOFFFUNCDESC 205 58 + #define R_SH_GOTOFFFUNCDESC20 206 59 + #define R_SH_FUNCDESC 207 60 + #define R_SH_FUNCDESC_VALUE 208 72 61 73 62 /* SHmedia relocs */ 74 63 #define R_SH_IMM_LOW16 246
+2 -2
arch/sh/include/asm/fixmap.h
··· 58 58 59 59 #ifdef CONFIG_HIGHMEM 60 60 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */ 61 - FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1, 61 + FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, 62 62 #endif 63 63 64 64 #ifdef CONFIG_IOREMAP_FIXED ··· 69 69 */ 70 70 #define FIX_N_IOREMAPS 32 71 71 FIX_IOREMAP_BEGIN, 72 - FIX_IOREMAP_END = FIX_IOREMAP_BEGIN + FIX_N_IOREMAPS, 72 + FIX_IOREMAP_END = FIX_IOREMAP_BEGIN + FIX_N_IOREMAPS - 1, 73 73 #endif 74 74 75 75 __end_of_fixed_addresses
+2 -4
arch/sh/include/asm/gpio.h
··· 41 41 42 42 static inline int gpio_to_irq(unsigned gpio) 43 43 { 44 - WARN_ON(1); 45 - return -ENOSYS; 44 + return __gpio_to_irq(gpio); 46 45 } 47 46 48 47 static inline int irq_to_gpio(unsigned int irq) 49 48 { 50 - WARN_ON(1); 51 - return -EINVAL; 49 + return -ENOSYS; 52 50 } 53 51 54 52 #endif /* CONFIG_GPIOLIB */
arch/sh/include/asm/ilsel.h arch/sh/include/mach-x3proto/mach/ilsel.h
+1 -1
arch/sh/include/asm/irq.h
··· 9 9 * advised to cap this at the hard limit that they're interested in 10 10 * through the machvec. 11 11 */ 12 - #define NR_IRQS 256 12 + #define NR_IRQS 512 13 13 #define NR_IRQS_LEGACY 8 /* Legacy external IRQ0-7 */ 14 14 15 15 /*
-1
arch/sh/include/asm/kprobes.h
··· 16 16 ? (MAX_STACK_SIZE) \ 17 17 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 18 18 19 - #define regs_return_value(_regs) ((_regs)->regs[0]) 20 19 #define flush_insn_slot(p) do { } while (0) 21 20 #define kretprobe_blacklist_size 0 22 21
+2
arch/sh/include/asm/pci.h
··· 37 37 }; 38 38 39 39 /* arch/sh/drivers/pci/pci.c */ 40 + extern raw_spinlock_t pci_config_lock; 41 + 40 42 extern int register_pci_controller(struct pci_channel *hose); 41 43 extern void pcibios_report_status(unsigned int status_mask, int warn); 42 44
-3
arch/sh/include/asm/processor_32.h
··· 13 13 #include <linux/linkage.h> 14 14 #include <asm/page.h> 15 15 #include <asm/types.h> 16 - #include <asm/ptrace.h> 17 16 #include <asm/hw_breakpoint.h> 18 17 19 18 /* ··· 192 193 193 194 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc) 194 195 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[15]) 195 - 196 - #define user_stack_pointer(_regs) ((_regs)->regs[15]) 197 196 198 197 #if defined(CONFIG_CPU_SH2A) || defined(CONFIG_CPU_SH4) 199 198 #define PREFETCH_STRIDE L1_CACHE_BYTES
-3
arch/sh/include/asm/processor_64.h
··· 17 17 #include <linux/compiler.h> 18 18 #include <asm/page.h> 19 19 #include <asm/types.h> 20 - #include <asm/ptrace.h> 21 20 #include <cpu/registers.h> 22 21 23 22 /* ··· 229 230 230 231 #define KSTK_EIP(tsk) ((tsk)->thread.pc) 231 232 #define KSTK_ESP(tsk) ((tsk)->thread.sp) 232 - 233 - #define user_stack_pointer(_regs) ((_regs)->regs[15]) 234 233 235 234 #endif /* __ASSEMBLY__ */ 236 235 #endif /* __ASM_SH_PROCESSOR_64_H */
+85 -88
arch/sh/include/asm/ptrace.h
··· 3 3 4 4 /* 5 5 * Copyright (C) 1999, 2000 Niibe Yutaka 6 - * 7 6 */ 8 - #if defined(__SH5__) 9 - struct pt_regs { 10 - unsigned long long pc; 11 - unsigned long long sr; 12 - long long syscall_nr; 13 - unsigned long long regs[63]; 14 - unsigned long long tregs[8]; 15 - unsigned long long pad[2]; 16 - }; 17 - #else 18 - /* 19 - * GCC defines register number like this: 20 - * ----------------------------- 21 - * 0 - 15 are integer registers 22 - * 17 - 22 are control/special registers 23 - * 24 - 39 fp registers 24 - * 40 - 47 xd registers 25 - * 48 - fpscr register 26 - * ----------------------------- 27 - * 28 - * We follows above, except: 29 - * 16 --- program counter (PC) 30 - * 22 --- syscall # 31 - * 23 --- floating point communication register 32 - */ 33 - #define REG_REG0 0 34 - #define REG_REG15 15 35 - 36 - #define REG_PC 16 37 - 38 - #define REG_PR 17 39 - #define REG_SR 18 40 - #define REG_GBR 19 41 - #define REG_MACH 20 42 - #define REG_MACL 21 43 - 44 - #define REG_SYSCALL 22 45 - 46 - #define REG_FPREG0 23 47 - #define REG_FPREG15 38 48 - #define REG_XFREG0 39 49 - #define REG_XFREG15 54 50 - 51 - #define REG_FPSCR 55 52 - #define REG_FPUL 56 53 - 54 - /* 55 - * This struct defines the way the registers are stored on the 56 - * kernel stack during a system call or other kernel entry. 57 - */ 58 - struct pt_regs { 59 - unsigned long regs[16]; 60 - unsigned long pc; 61 - unsigned long pr; 62 - unsigned long sr; 63 - unsigned long gbr; 64 - unsigned long mach; 65 - unsigned long macl; 66 - long tra; 67 - }; 68 - 69 - /* 70 - * This struct defines the way the DSP registers are stored on the 71 - * kernel stack during a system call or other kernel entry. 72 - */ 73 - struct pt_dspregs { 74 - unsigned long a1; 75 - unsigned long a0g; 76 - unsigned long a1g; 77 - unsigned long m0; 78 - unsigned long m1; 79 - unsigned long a0; 80 - unsigned long x0; 81 - unsigned long x1; 82 - unsigned long y0; 83 - unsigned long y1; 84 - unsigned long dsr; 85 - unsigned long rs; 86 - unsigned long re; 87 - unsigned long mod; 88 - }; 89 - #endif 90 7 91 8 #define PTRACE_GETREGS 12 /* General registers */ 92 9 #define PTRACE_SETREGS 13 ··· 24 107 #define PT_DATA_ADDR 248 /* &(struct user)->start_data */ 25 108 #define PT_TEXT_LEN 252 26 109 110 + #if defined(__SH5__) || defined(CONFIG_CPU_SH5) 111 + #include "ptrace_64.h" 112 + #else 113 + #include "ptrace_32.h" 114 + #endif 115 + 27 116 #ifdef __KERNEL__ 117 + 118 + #include <linux/stringify.h> 119 + #include <linux/stddef.h> 120 + #include <linux/thread_info.h> 28 121 #include <asm/addrspace.h> 29 122 #include <asm/page.h> 30 123 #include <asm/system.h> 31 124 32 125 #define user_mode(regs) (((regs)->sr & 0x40000000)==0) 126 + #define user_stack_pointer(regs) ((unsigned long)(regs)->regs[15]) 127 + #define kernel_stack_pointer(regs) ((unsigned long)(regs)->regs[15]) 33 128 #define instruction_pointer(regs) ((unsigned long)(regs)->pc) 34 129 35 130 extern void show_regs(struct pt_regs *); 36 131 37 - /* 38 - * These are defined as per linux/ptrace.h. 39 - */ 40 - struct task_struct; 41 - 42 132 #define arch_has_single_step() (1) 133 + 134 + /* 135 + * kprobe-based event tracer support 136 + */ 137 + struct pt_regs_offset { 138 + const char *name; 139 + int offset; 140 + }; 141 + 142 + #define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)} 143 + #define REGS_OFFSET_NAME(num) \ 144 + {.name = __stringify(r##num), .offset = offsetof(struct pt_regs, regs[num])} 145 + #define TREGS_OFFSET_NAME(num) \ 146 + {.name = __stringify(tr##num), .offset = offsetof(struct pt_regs, tregs[num])} 147 + #define REG_OFFSET_END {.name = NULL, .offset = 0} 148 + 149 + /* Query offset/name of register from its name/offset */ 150 + extern int regs_query_register_offset(const char *name); 151 + extern const char *regs_query_register_name(unsigned int offset); 152 + 153 + extern const struct pt_regs_offset regoffset_table[]; 154 + 155 + /** 156 + * regs_get_register() - get register value from its offset 157 + * @regs: pt_regs from which register value is gotten. 158 + * @offset: offset number of the register. 159 + * 160 + * regs_get_register returns the value of a register. The @offset is the 161 + * offset of the register in struct pt_regs address which specified by @regs. 162 + * If @offset is bigger than MAX_REG_OFFSET, this returns 0. 163 + */ 164 + static inline unsigned long regs_get_register(struct pt_regs *regs, 165 + unsigned int offset) 166 + { 167 + if (unlikely(offset > MAX_REG_OFFSET)) 168 + return 0; 169 + return *(unsigned long *)((unsigned long)regs + offset); 170 + } 171 + 172 + /** 173 + * regs_within_kernel_stack() - check the address in the stack 174 + * @regs: pt_regs which contains kernel stack pointer. 175 + * @addr: address which is checked. 176 + * 177 + * regs_within_kernel_stack() checks @addr is within the kernel stack page(s). 178 + * If @addr is within the kernel stack, it returns true. If not, returns false. 179 + */ 180 + static inline int regs_within_kernel_stack(struct pt_regs *regs, 181 + unsigned long addr) 182 + { 183 + return ((addr & ~(THREAD_SIZE - 1)) == 184 + (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1))); 185 + } 186 + 187 + /** 188 + * regs_get_kernel_stack_nth() - get Nth entry of the stack 189 + * @regs: pt_regs which contains kernel stack pointer. 190 + * @n: stack entry number. 191 + * 192 + * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which 193 + * is specified by @regs. If the @n th entry is NOT in the kernel stack, 194 + * this returns 0. 195 + */ 196 + static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, 197 + unsigned int n) 198 + { 199 + unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs); 200 + addr += n; 201 + if (regs_within_kernel_stack(regs, (unsigned long)addr)) 202 + return *addr; 203 + else 204 + return 0; 205 + } 43 206 44 207 struct perf_event; 45 208 struct perf_sample_data;
+83
arch/sh/include/asm/ptrace_32.h
··· 1 + #ifndef __ASM_SH_PTRACE_32_H 2 + #define __ASM_SH_PTRACE_32_H 3 + 4 + /* 5 + * GCC defines register number like this: 6 + * ----------------------------- 7 + * 0 - 15 are integer registers 8 + * 17 - 22 are control/special registers 9 + * 24 - 39 fp registers 10 + * 40 - 47 xd registers 11 + * 48 - fpscr register 12 + * ----------------------------- 13 + * 14 + * We follows above, except: 15 + * 16 --- program counter (PC) 16 + * 22 --- syscall # 17 + * 23 --- floating point communication register 18 + */ 19 + #define REG_REG0 0 20 + #define REG_REG15 15 21 + 22 + #define REG_PC 16 23 + 24 + #define REG_PR 17 25 + #define REG_SR 18 26 + #define REG_GBR 19 27 + #define REG_MACH 20 28 + #define REG_MACL 21 29 + 30 + #define REG_SYSCALL 22 31 + 32 + #define REG_FPREG0 23 33 + #define REG_FPREG15 38 34 + #define REG_XFREG0 39 35 + #define REG_XFREG15 54 36 + 37 + #define REG_FPSCR 55 38 + #define REG_FPUL 56 39 + 40 + /* 41 + * This struct defines the way the registers are stored on the 42 + * kernel stack during a system call or other kernel entry. 43 + */ 44 + struct pt_regs { 45 + unsigned long regs[16]; 46 + unsigned long pc; 47 + unsigned long pr; 48 + unsigned long sr; 49 + unsigned long gbr; 50 + unsigned long mach; 51 + unsigned long macl; 52 + long tra; 53 + }; 54 + 55 + /* 56 + * This struct defines the way the DSP registers are stored on the 57 + * kernel stack during a system call or other kernel entry. 58 + */ 59 + struct pt_dspregs { 60 + unsigned long a1; 61 + unsigned long a0g; 62 + unsigned long a1g; 63 + unsigned long m0; 64 + unsigned long m1; 65 + unsigned long a0; 66 + unsigned long x0; 67 + unsigned long x1; 68 + unsigned long y0; 69 + unsigned long y1; 70 + unsigned long dsr; 71 + unsigned long rs; 72 + unsigned long re; 73 + unsigned long mod; 74 + }; 75 + 76 + #ifdef __KERNEL__ 77 + 78 + #define MAX_REG_OFFSET offsetof(struct pt_regs, tra) 79 + #define regs_return_value(regs) ((regs)->regs[0]) 80 + 81 + #endif /* __KERNEL__ */ 82 + 83 + #endif /* __ASM_SH_PTRACE_32_H */
+20
arch/sh/include/asm/ptrace_64.h
··· 1 + #ifndef __ASM_SH_PTRACE_64_H 2 + #define __ASM_SH_PTRACE_64_H 3 + 4 + struct pt_regs { 5 + unsigned long long pc; 6 + unsigned long long sr; 7 + long long syscall_nr; 8 + unsigned long long regs[63]; 9 + unsigned long long tregs[8]; 10 + unsigned long long pad[2]; 11 + }; 12 + 13 + #ifdef __KERNEL__ 14 + 15 + #define MAX_REG_OFFSET offsetof(struct pt_regs, tregs[7]) 16 + #define regs_return_value(regs) ((regs)->regs[3]) 17 + 18 + #endif /* __KERNEL__ */ 19 + 20 + #endif /* __ASM_SH_PTRACE_64_H */
+1
arch/sh/include/asm/sizes.h
··· 32 32 #define SZ_512 0x00000200 33 33 34 34 #define SZ_1K 0x00000400 35 + #define SZ_2K 0x00000800 35 36 #define SZ_4K 0x00001000 36 37 #define SZ_8K 0x00002000 37 38 #define SZ_16K 0x00004000
+38
arch/sh/include/asm/sram.h
··· 1 + #ifndef __ASM_SRAM_H 2 + #define __ASM_SRAM_H 3 + 4 + #ifdef CONFIG_HAVE_SRAM_POOL 5 + 6 + #include <linux/spinlock.h> 7 + #include <linux/genalloc.h> 8 + 9 + /* arch/sh/mm/sram.c */ 10 + extern struct gen_pool *sram_pool; 11 + 12 + static inline unsigned long sram_alloc(size_t len) 13 + { 14 + if (!sram_pool) 15 + return 0UL; 16 + 17 + return gen_pool_alloc(sram_pool, len); 18 + } 19 + 20 + static inline void sram_free(unsigned long addr, size_t len) 21 + { 22 + return gen_pool_free(sram_pool, addr, len); 23 + } 24 + 25 + #else 26 + 27 + static inline unsigned long sram_alloc(size_t len) 28 + { 29 + return 0; 30 + } 31 + 32 + static inline void sram_free(unsigned long addr, size_t len) 33 + { 34 + } 35 + 36 + #endif /* CONFIG_HAVE_SRAM_POOL */ 37 + 38 + #endif /* __ASM_SRAM_H */
-2
arch/sh/include/asm/system.h
··· 140 140 extern unsigned long cached_to_uncached; 141 141 extern unsigned long uncached_size; 142 142 143 - extern struct dentry *sh_debugfs_root; 144 - 145 143 void per_cpu_trap_init(void); 146 144 void default_idle(void); 147 145 void cpu_idle_wait(void);
+7 -8
arch/sh/include/asm/system_32.h
··· 212 212 } 213 213 214 214 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, 215 - struct mem_access *ma, int); 215 + struct mem_access *ma, int, unsigned long address); 216 216 217 217 static inline void trigger_address_error(void) 218 218 { 219 - if (__in_29bit_mode()) 220 - __asm__ __volatile__ ( 221 - "ldc %0, sr\n\t" 222 - "mov.l @%1, %0" 223 - : 224 - : "r" (0x10000000), "r" (0x80000001) 225 - ); 219 + __asm__ __volatile__ ( 220 + "ldc %0, sr\n\t" 221 + "mov.l @%1, %0" 222 + : 223 + : "r" (0x10000000), "r" (0x80000001) 224 + ); 226 225 } 227 226 228 227 asmlinkage void do_address_error(struct pt_regs *regs,
+2
arch/sh/include/asm/tlbflush.h
··· 21 21 unsigned long end); 22 22 extern void local_flush_tlb_one(unsigned long asid, unsigned long page); 23 23 24 + extern void __flush_tlb_global(void); 25 + 24 26 #ifdef CONFIG_SMP 25 27 26 28 extern void flush_tlb_all(void);
+24 -3
arch/sh/include/asm/unistd_32.h
··· 345 345 #define __NR_pwritev 334 346 346 #define __NR_rt_tgsigqueueinfo 335 347 347 #define __NR_perf_event_open 336 348 + #define __NR_fanotify_init 337 349 + #define __NR_fanotify_mark 338 350 + #define __NR_prlimit64 339 348 351 349 - #define NR_syscalls 337 352 + /* Non-multiplexed socket family */ 353 + #define __NR_socket 340 354 + #define __NR_bind 341 355 + #define __NR_connect 342 356 + #define __NR_listen 343 357 + #define __NR_accept 344 358 + #define __NR_getsockname 345 359 + #define __NR_getpeername 346 360 + #define __NR_socketpair 347 361 + #define __NR_send 348 362 + #define __NR_sendto 349 363 + #define __NR_recv 350 364 + #define __NR_recvfrom 351 365 + #define __NR_shutdown 352 366 + #define __NR_setsockopt 353 367 + #define __NR_getsockopt 354 368 + #define __NR_sendmsg 355 369 + #define __NR_recvmsg 356 370 + #define __NR_recvmmsg 357 371 + 372 + #define NR_syscalls 358 350 373 351 374 #ifdef __KERNEL__ 352 - 353 - #define __IGNORE_recvmmsg 354 375 355 376 #define __ARCH_WANT_IPC_PARSE_VERSION 356 377 #define __ARCH_WANT_OLD_READDIR
+4 -1
arch/sh/include/asm/unistd_64.h
··· 387 387 #define __NR_perf_event_open 364 388 388 #define __NR_recvmmsg 365 389 389 #define __NR_accept4 366 390 + #define __NR_fanotify_init 367 391 + #define __NR_fanotify_mark 368 392 + #define __NR_prlimit64 369 390 393 391 394 #ifdef __KERNEL__ 392 395 393 - #define NR_syscalls 367 396 + #define NR_syscalls 370 394 397 395 398 #define __ARCH_WANT_IPC_PARSE_VERSION 396 399 #define __ARCH_WANT_OLD_READDIR
+1
arch/sh/include/cpu-sh3/cpu/mmu_context.h
··· 16 16 #define MMU_TEA 0xFFFFFFFC /* TLB Exception Address */ 17 17 18 18 #define MMUCR 0xFFFFFFE0 /* MMU Control Register */ 19 + #define MMUCR_TI (1 << 2) /* TLB flush bit */ 19 20 20 21 #define MMU_TLB_ADDRESS_ARRAY 0xF2000000 21 22 #define MMU_PAGE_ASSOC_BIT 0x80
+3 -1
arch/sh/include/cpu-sh4/cpu/freq.h
··· 56 56 #define FRQCR1 0xffc40004 57 57 #define FRQMR1 0xffc40014 58 58 #elif defined(CONFIG_CPU_SUBTYPE_SHX3) 59 - #define FRQCR 0xffc00014 59 + #define FRQCR0 0xffc00000 60 + #define FRQCR1 0xffc00004 61 + #define FRQMR1 0xffc00014 60 62 #else 61 63 #define FRQCR 0xffc00000 62 64 #define FRQCR_PSTBY 0x0200
+149 -138
arch/sh/include/cpu-sh4/cpu/sh7757.h
··· 3 3 4 4 enum { 5 5 /* PTA */ 6 - GPIO_PTA7, GPIO_PTA6, GPIO_PTA5, GPIO_PTA4, 7 - GPIO_PTA3, GPIO_PTA2, GPIO_PTA1, GPIO_PTA0, 6 + GPIO_PTA0, GPIO_PTA1, GPIO_PTA2, GPIO_PTA3, 7 + GPIO_PTA4, GPIO_PTA5, GPIO_PTA6, GPIO_PTA7, 8 8 9 9 /* PTB */ 10 - GPIO_PTB7, GPIO_PTB6, GPIO_PTB5, GPIO_PTB4, 11 - GPIO_PTB3, GPIO_PTB2, GPIO_PTB1, GPIO_PTB0, 10 + GPIO_PTB0, GPIO_PTB1, GPIO_PTB2, GPIO_PTB3, 11 + GPIO_PTB4, GPIO_PTB5, GPIO_PTB6, GPIO_PTB7, 12 12 13 13 /* PTC */ 14 - GPIO_PTC7, GPIO_PTC6, GPIO_PTC5, GPIO_PTC4, 15 - GPIO_PTC3, GPIO_PTC2, GPIO_PTC1, GPIO_PTC0, 14 + GPIO_PTC0, GPIO_PTC1, GPIO_PTC2, GPIO_PTC3, 15 + GPIO_PTC4, GPIO_PTC5, GPIO_PTC6, GPIO_PTC7, 16 16 17 17 /* PTD */ 18 - GPIO_PTD7, GPIO_PTD6, GPIO_PTD5, GPIO_PTD4, 19 - GPIO_PTD3, GPIO_PTD2, GPIO_PTD1, GPIO_PTD0, 18 + GPIO_PTD0, GPIO_PTD1, GPIO_PTD2, GPIO_PTD3, 19 + GPIO_PTD4, GPIO_PTD5, GPIO_PTD6, GPIO_PTD7, 20 20 21 21 /* PTE */ 22 - GPIO_PTE7, GPIO_PTE6, GPIO_PTE5, GPIO_PTE4, 23 - GPIO_PTE3, GPIO_PTE2, GPIO_PTE1, GPIO_PTE0, 22 + GPIO_PTE0, GPIO_PTE1, GPIO_PTE2, GPIO_PTE3, 23 + GPIO_PTE4, GPIO_PTE5, GPIO_PTE6, GPIO_PTE7, 24 24 25 25 /* PTF */ 26 - GPIO_PTF7, GPIO_PTF6, GPIO_PTF5, GPIO_PTF4, 27 - GPIO_PTF3, GPIO_PTF2, GPIO_PTF1, GPIO_PTF0, 26 + GPIO_PTF0, GPIO_PTF1, GPIO_PTF2, GPIO_PTF3, 27 + GPIO_PTF4, GPIO_PTF5, GPIO_PTF6, GPIO_PTF7, 28 28 29 29 /* PTG */ 30 - GPIO_PTG7, GPIO_PTG6, GPIO_PTG5, GPIO_PTG4, 31 - GPIO_PTG3, GPIO_PTG2, GPIO_PTG1, GPIO_PTG0, 30 + GPIO_PTG0, GPIO_PTG1, GPIO_PTG2, GPIO_PTG3, 31 + GPIO_PTG4, GPIO_PTG5, GPIO_PTG6, GPIO_PTG7, 32 32 33 33 /* PTH */ 34 - GPIO_PTH7, GPIO_PTH6, GPIO_PTH5, GPIO_PTH4, 35 - GPIO_PTH3, GPIO_PTH2, GPIO_PTH1, GPIO_PTH0, 34 + GPIO_PTH0, GPIO_PTH1, GPIO_PTH2, GPIO_PTH3, 35 + GPIO_PTH4, GPIO_PTH5, GPIO_PTH6, GPIO_PTH7, 36 36 37 37 /* PTI */ 38 - GPIO_PTI7, GPIO_PTI6, GPIO_PTI5, GPIO_PTI4, 39 - GPIO_PTI3, GPIO_PTI2, GPIO_PTI1, GPIO_PTI0, 38 + GPIO_PTI0, GPIO_PTI1, GPIO_PTI2, GPIO_PTI3, 39 + GPIO_PTI4, GPIO_PTI5, GPIO_PTI6, GPIO_PTI7, 40 40 41 41 /* PTJ */ 42 - GPIO_PTJ7, GPIO_PTJ6, GPIO_PTJ5, GPIO_PTJ4, 43 - GPIO_PTJ3, GPIO_PTJ2, GPIO_PTJ1, GPIO_PTJ0, 42 + GPIO_PTJ0, GPIO_PTJ1, GPIO_PTJ2, GPIO_PTJ3, 43 + GPIO_PTJ4, GPIO_PTJ5, GPIO_PTJ6, GPIO_PTJ7_RESV, 44 44 45 45 /* PTK */ 46 - GPIO_PTK7, GPIO_PTK6, GPIO_PTK5, GPIO_PTK4, 47 - GPIO_PTK3, GPIO_PTK2, GPIO_PTK1, GPIO_PTK0, 46 + GPIO_PTK0, GPIO_PTK1, GPIO_PTK2, GPIO_PTK3, 47 + GPIO_PTK4, GPIO_PTK5, GPIO_PTK6, GPIO_PTK7, 48 48 49 49 /* PTL */ 50 - GPIO_PTL7, GPIO_PTL6, GPIO_PTL5, GPIO_PTL4, 51 - GPIO_PTL3, GPIO_PTL2, GPIO_PTL1, GPIO_PTL0, 50 + GPIO_PTL0, GPIO_PTL1, GPIO_PTL2, GPIO_PTL3, 51 + GPIO_PTL4, GPIO_PTL5, GPIO_PTL6, GPIO_PTL7_RESV, 52 52 53 53 /* PTM */ 54 - GPIO_PTM6, GPIO_PTM5, GPIO_PTM4, 55 - GPIO_PTM3, GPIO_PTM2, GPIO_PTM1, GPIO_PTM0, 54 + GPIO_PTM0, GPIO_PTM1, GPIO_PTM2, GPIO_PTM3, 55 + GPIO_PTM4, GPIO_PTM5, GPIO_PTM6, GPIO_PTM7, 56 56 57 57 /* PTN */ 58 - GPIO_PTN7, GPIO_PTN6, GPIO_PTN5, GPIO_PTN4, 59 - GPIO_PTN3, GPIO_PTN2, GPIO_PTN1, GPIO_PTN0, 58 + GPIO_PTN0, GPIO_PTN1, GPIO_PTN2, GPIO_PTN3, 59 + GPIO_PTN4, GPIO_PTN5, GPIO_PTN6, GPIO_PTN7_RESV, 60 60 61 61 /* PTO */ 62 - GPIO_PTO7, GPIO_PTO6, GPIO_PTO5, GPIO_PTO4, 63 - GPIO_PTO3, GPIO_PTO2, GPIO_PTO1, GPIO_PTO0, 62 + GPIO_PTO0, GPIO_PTO1, GPIO_PTO2, GPIO_PTO3, 63 + GPIO_PTO4, GPIO_PTO5, GPIO_PTO6, GPIO_PTO7, 64 64 65 65 /* PTP */ 66 - GPIO_PTP6, GPIO_PTP5, GPIO_PTP4, 67 - GPIO_PTP3, GPIO_PTP2, GPIO_PTP1, GPIO_PTP0, 66 + GPIO_PTP0, GPIO_PTP1, GPIO_PTP2, GPIO_PTP3, 67 + GPIO_PTP4, GPIO_PTP5, GPIO_PTP6, GPIO_PTP7, 68 68 69 69 /* PTQ */ 70 - GPIO_PTQ6, GPIO_PTQ5, GPIO_PTQ4, 71 - GPIO_PTQ3, GPIO_PTQ2, GPIO_PTQ1, GPIO_PTQ0, 70 + GPIO_PTQ0, GPIO_PTQ1, GPIO_PTQ2, GPIO_PTQ3, 71 + GPIO_PTQ4, GPIO_PTQ5, GPIO_PTQ6, GPIO_PTQ7_RESV, 72 72 73 73 /* PTR */ 74 - GPIO_PTR7, GPIO_PTR6, GPIO_PTR5, GPIO_PTR4, 75 - GPIO_PTR3, GPIO_PTR2, GPIO_PTR1, GPIO_PTR0, 74 + GPIO_PTR0, GPIO_PTR1, GPIO_PTR2, GPIO_PTR3, 75 + GPIO_PTR4, GPIO_PTR5, GPIO_PTR6, GPIO_PTR7, 76 76 77 77 /* PTS */ 78 - GPIO_PTS7, GPIO_PTS6, GPIO_PTS5, GPIO_PTS4, 79 - GPIO_PTS3, GPIO_PTS2, GPIO_PTS1, GPIO_PTS0, 78 + GPIO_PTS0, GPIO_PTS1, GPIO_PTS2, GPIO_PTS3, 79 + GPIO_PTS4, GPIO_PTS5, GPIO_PTS6, GPIO_PTS7, 80 80 81 81 /* PTT */ 82 - GPIO_PTT5, GPIO_PTT4, 83 - GPIO_PTT3, GPIO_PTT2, GPIO_PTT1, GPIO_PTT0, 82 + GPIO_PTT0, GPIO_PTT1, GPIO_PTT2, GPIO_PTT3, 83 + GPIO_PTT4, GPIO_PTT5, GPIO_PTT6, GPIO_PTT7, 84 84 85 85 /* PTU */ 86 - GPIO_PTU7, GPIO_PTU6, GPIO_PTU5, GPIO_PTU4, 87 - GPIO_PTU3, GPIO_PTU2, GPIO_PTU1, GPIO_PTU0, 86 + GPIO_PTU0, GPIO_PTU1, GPIO_PTU2, GPIO_PTU3, 87 + GPIO_PTU4, GPIO_PTU5, GPIO_PTU6, GPIO_PTU7, 88 88 89 89 /* PTV */ 90 - GPIO_PTV7, GPIO_PTV6, GPIO_PTV5, GPIO_PTV4, 91 - GPIO_PTV3, GPIO_PTV2, GPIO_PTV1, GPIO_PTV0, 90 + GPIO_PTV0, GPIO_PTV1, GPIO_PTV2, GPIO_PTV3, 91 + GPIO_PTV4, GPIO_PTV5, GPIO_PTV6, GPIO_PTV7, 92 92 93 93 /* PTW */ 94 - GPIO_PTW7, GPIO_PTW6, GPIO_PTW5, GPIO_PTW4, 95 - GPIO_PTW3, GPIO_PTW2, GPIO_PTW1, GPIO_PTW0, 94 + GPIO_PTW0, GPIO_PTW1, GPIO_PTW2, GPIO_PTW3, 95 + GPIO_PTW4, GPIO_PTW5, GPIO_PTW6, GPIO_PTW7, 96 96 97 97 /* PTX */ 98 - GPIO_PTX7, GPIO_PTX6, GPIO_PTX5, GPIO_PTX4, 99 - GPIO_PTX3, GPIO_PTX2, GPIO_PTX1, GPIO_PTX0, 98 + GPIO_PTX0, GPIO_PTX1, GPIO_PTX2, GPIO_PTX3, 99 + GPIO_PTX4, GPIO_PTX5, GPIO_PTX6, GPIO_PTX7, 100 100 101 101 /* PTY */ 102 - GPIO_PTY7, GPIO_PTY6, GPIO_PTY5, GPIO_PTY4, 103 - GPIO_PTY3, GPIO_PTY2, GPIO_PTY1, GPIO_PTY0, 102 + GPIO_PTY0, GPIO_PTY1, GPIO_PTY2, GPIO_PTY3, 103 + GPIO_PTY4, GPIO_PTY5, GPIO_PTY6, GPIO_PTY7, 104 104 105 105 /* PTZ */ 106 - GPIO_PTZ7, GPIO_PTZ6, GPIO_PTZ5, GPIO_PTZ4, 107 - GPIO_PTZ3, GPIO_PTZ2, GPIO_PTZ1, GPIO_PTZ0, 106 + GPIO_PTZ0, GPIO_PTZ1, GPIO_PTZ2, GPIO_PTZ3, 107 + GPIO_PTZ4, GPIO_PTZ5, GPIO_PTZ6, GPIO_PTZ7, 108 108 109 109 110 - /* PTA (mobule: LBSC, CPG, LPC) */ 110 + /* PTA (mobule: LBSC, RGMII) */ 111 111 GPIO_FN_BS, GPIO_FN_RDWR, GPIO_FN_WE1, GPIO_FN_RDY, 112 - GPIO_FN_MD10, GPIO_FN_MD9, GPIO_FN_MD8, 113 - GPIO_FN_LGPIO7, GPIO_FN_LGPIO6, GPIO_FN_LGPIO5, GPIO_FN_LGPIO4, 114 - GPIO_FN_LGPIO3, GPIO_FN_LGPIO2, GPIO_FN_LGPIO1, GPIO_FN_LGPIO0, 112 + GPIO_FN_ET0_MDC, GPIO_FN_ET0_MDIO, 113 + GPIO_FN_ET1_MDC, GPIO_FN_ET1_MDIO, 115 114 116 - /* PTB (mobule: LBSC, EtherC, SIM, LPC) */ 117 - GPIO_FN_D15, GPIO_FN_D14, GPIO_FN_D13, GPIO_FN_D12, 118 - GPIO_FN_D11, GPIO_FN_D10, GPIO_FN_D9, GPIO_FN_D8, 119 - GPIO_FN_ET0_MDC, GPIO_FN_ET0_MDIO, 120 - GPIO_FN_ET1_MDC, GPIO_FN_ET1_MDIO, 121 - GPIO_FN_SIM_D, GPIO_FN_SIM_CLK, GPIO_FN_SIM_RST, 122 - GPIO_FN_WPSZ1, GPIO_FN_WPSZ0, GPIO_FN_FWID, GPIO_FN_FLSHSZ, 123 - GPIO_FN_LPC_SPIEN, GPIO_FN_BASEL, 115 + /* PTB (mobule: INTC, ONFI, TMU) */ 116 + GPIO_FN_IRQ15, GPIO_FN_IRQ14, GPIO_FN_IRQ13, GPIO_FN_IRQ12, 117 + GPIO_FN_IRQ11, GPIO_FN_IRQ10, GPIO_FN_IRQ9, GPIO_FN_IRQ8, 118 + GPIO_FN_ON_NRE, GPIO_FN_ON_NWE, GPIO_FN_ON_NWP, GPIO_FN_ON_NCE0, 119 + GPIO_FN_ON_R_B0, GPIO_FN_ON_ALE, GPIO_FN_ON_CLE, 120 + GPIO_FN_TCLK, 124 121 125 - /* PTC (mobule: SD) */ 126 - GPIO_FN_SD_WP, GPIO_FN_SD_CD, GPIO_FN_SD_CLK, GPIO_FN_SD_CMD, 127 - GPIO_FN_SD_D3, GPIO_FN_SD_D2, GPIO_FN_SD_D1, GPIO_FN_SD_D0, 128 - 129 - /* PTD (mobule: INTC, SPI0, LBSC, CPG, ADC) */ 122 + /* PTC (mobule: IRQ, PWMU) */ 130 123 GPIO_FN_IRQ7, GPIO_FN_IRQ6, GPIO_FN_IRQ5, GPIO_FN_IRQ4, 131 124 GPIO_FN_IRQ3, GPIO_FN_IRQ2, GPIO_FN_IRQ1, GPIO_FN_IRQ0, 132 - GPIO_FN_MD6, GPIO_FN_MD5, GPIO_FN_MD3, GPIO_FN_MD2, 133 - GPIO_FN_MD1, GPIO_FN_MD0, GPIO_FN_ADTRG1, GPIO_FN_ADTRG0, 125 + GPIO_FN_PWMU0, GPIO_FN_PWMU1, GPIO_FN_PWMU2, GPIO_FN_PWMU3, 126 + GPIO_FN_PWMU4, GPIO_FN_PWMU5, 134 127 135 - /* PTE (mobule: EtherC) */ 136 - GPIO_FN_ET0_CRS_DV, GPIO_FN_ET0_TXD1, 137 - GPIO_FN_ET0_TXD0, GPIO_FN_ET0_TX_EN, 138 - GPIO_FN_ET0_REF_CLK, GPIO_FN_ET0_RXD1, 139 - GPIO_FN_ET0_RXD0, GPIO_FN_ET0_RX_ER, 128 + /* PTD (mobule: SPI0, DMAC) */ 129 + GPIO_FN_SP0_MOSI, GPIO_FN_SP0_MISO, GPIO_FN_SP0_SCK, 130 + GPIO_FN_SP0_SCK_FB, GPIO_FN_SP0_SS0, GPIO_FN_SP0_SS1, 131 + GPIO_FN_SP0_SS2, GPIO_FN_SP0_SS3, GPIO_FN_DREQ0, 132 + GPIO_FN_DACK0, GPIO_FN_TEND0, 140 133 141 - /* PTF (mobule: EtherC) */ 142 - GPIO_FN_ET1_CRS_DV, GPIO_FN_ET1_TXD1, 143 - GPIO_FN_ET1_TXD0, GPIO_FN_ET1_TX_EN, 144 - GPIO_FN_ET1_REF_CLK, GPIO_FN_ET1_RXD1, 145 - GPIO_FN_ET1_RXD0, GPIO_FN_ET1_RX_ER, 134 + /* PTE (mobule: RMII) */ 135 + GPIO_FN_RMII0_CRS_DV, GPIO_FN_RMII0_TXD1, GPIO_FN_RMII0_TXD0, 136 + GPIO_FN_RMII0_TXEN, GPIO_FN_RMII0_REFCLK, GPIO_FN_RMII0_RXD1, 137 + GPIO_FN_RMII0_RXD0, GPIO_FN_RMII0_RX_ER, 146 138 147 - /* PTG (mobule: SYSTEM, PWMX, LPC) */ 148 - GPIO_FN_STATUS0, GPIO_FN_STATUS1, 149 - GPIO_FN_PWX0, GPIO_FN_PWX1, GPIO_FN_PWX2, GPIO_FN_PWX3, 150 - GPIO_FN_SERIRQ, GPIO_FN_CLKRUN, GPIO_FN_LPCPD, GPIO_FN_LDRQ, 139 + /* PTF (mobule: RMII, SerMux) */ 140 + GPIO_FN_RMII1_CRS_DV, GPIO_FN_RMII1_TXD1, GPIO_FN_RMII1_TXD0, 141 + GPIO_FN_RMII1_TXEN, GPIO_FN_RMII1_REFCLK, GPIO_FN_RMII1_RXD1, 142 + GPIO_FN_RMII1_RXD0, GPIO_FN_RMII1_RX_ER, GPIO_FN_RAC_RI, 151 143 152 - /* PTH (mobule: TMU, SCIF234, SPI1, SPI0) */ 153 - GPIO_FN_TCLK, GPIO_FN_RXD4, GPIO_FN_TXD4, 144 + /* PTG (mobule: system, LBSC, LPC, WDT, LPC, eMMC) */ 145 + GPIO_FN_BOOTFMS, GPIO_FN_BOOTWP, 146 + GPIO_FN_A25, GPIO_FN_A24, GPIO_FN_SERIRQ, GPIO_FN_WDTOVF, 147 + GPIO_FN_LPCPD, GPIO_FN_LDRQ, GPIO_FN_MMCCLK, GPIO_FN_MMCCMD, 148 + 149 + /* PTH (mobule: SPI1, LPC, DMAC, ADC) */ 154 150 GPIO_FN_SP1_MOSI, GPIO_FN_SP1_MISO, 155 151 GPIO_FN_SP1_SCK, GPIO_FN_SP1_SCK_FB, 156 152 GPIO_FN_SP1_SS0, GPIO_FN_SP1_SS1, 157 - GPIO_FN_SP0_SS1, 153 + GPIO_FN_WP, GPIO_FN_FMS0, GPIO_FN_TEND1, GPIO_FN_DREQ1, 154 + GPIO_FN_DACK1, GPIO_FN_ADTRG1, GPIO_FN_ADTRG0, 158 155 159 - /* PTI (mobule: INTC) */ 160 - GPIO_FN_IRQ15, GPIO_FN_IRQ14, GPIO_FN_IRQ13, GPIO_FN_IRQ12, 161 - GPIO_FN_IRQ11, GPIO_FN_IRQ10, GPIO_FN_IRQ9, GPIO_FN_IRQ8, 156 + /* PTI (mobule: LBSC, SDHI) */ 157 + GPIO_FN_D15, GPIO_FN_D14, GPIO_FN_D13, GPIO_FN_D12, 158 + GPIO_FN_D11, GPIO_FN_D10, GPIO_FN_D9, GPIO_FN_D8, 159 + GPIO_FN_SD_WP, GPIO_FN_SD_CD, GPIO_FN_SD_CLK, GPIO_FN_SD_CMD, 160 + GPIO_FN_SD_D3, GPIO_FN_SD_D2, GPIO_FN_SD_D1, GPIO_FN_SD_D0, 162 161 163 - /* PTJ (mobule: SCIF234, SERMUX) */ 164 - GPIO_FN_RXD3, GPIO_FN_TXD3, GPIO_FN_RXD2, GPIO_FN_TXD2, 165 - GPIO_FN_COM1_TXD, GPIO_FN_COM1_RXD, 166 - GPIO_FN_COM1_RTS, GPIO_FN_COM1_CTS, 162 + /* PTJ (mobule: SCIF234) */ 163 + GPIO_FN_RTS3, GPIO_FN_CTS3, GPIO_FN_TXD3, GPIO_FN_RXD3, 164 + GPIO_FN_RTS4, GPIO_FN_RXD4, GPIO_FN_TXD4, 167 165 168 - /* PTK (mobule: SERMUX) */ 169 - GPIO_FN_COM2_TXD, GPIO_FN_COM2_RXD, 170 - GPIO_FN_COM2_RTS, GPIO_FN_COM2_CTS, 171 - GPIO_FN_COM2_DTR, GPIO_FN_COM2_DSR, 172 - GPIO_FN_COM2_DCD, GPIO_FN_COM2_RI, 166 + /* PTK (mobule: SERMUX, LBSC, SCIF) */ 167 + GPIO_FN_COM2_TXD, GPIO_FN_COM2_RXD, GPIO_FN_COM2_RTS, 168 + GPIO_FN_COM2_CTS, GPIO_FN_COM2_DTR, GPIO_FN_COM2_DSR, 169 + GPIO_FN_COM2_DCD, GPIO_FN_CLKOUT, 170 + GPIO_FN_SCK2, GPIO_FN_SCK4, GPIO_FN_SCK3, 173 171 174 - /* PTL (mobule: SERMUX) */ 175 - GPIO_FN_RAC_TXD, GPIO_FN_RAC_RXD, 176 - GPIO_FN_RAC_RTS, GPIO_FN_RAC_CTS, 177 - GPIO_FN_RAC_DTR, GPIO_FN_RAC_DSR, 178 - GPIO_FN_RAC_DCD, GPIO_FN_RAC_RI, 172 + /* PTL (mobule: SERMUX, SCIF, LBSC, AUD) */ 173 + GPIO_FN_RAC_RXD, GPIO_FN_RAC_RTS, GPIO_FN_RAC_CTS, 174 + GPIO_FN_RAC_DTR, GPIO_FN_RAC_DSR, GPIO_FN_RAC_DCD, 175 + GPIO_FN_RAC_TXD, GPIO_FN_RXD2, GPIO_FN_CS5, 176 + GPIO_FN_CS6, GPIO_FN_AUDSYNC, GPIO_FN_AUDCK, 177 + GPIO_FN_TXD2, 179 178 180 - /* PTM (mobule: IIC, LPC) */ 179 + /* PTM (mobule: LBSC, IIC) */ 180 + GPIO_FN_CS4, GPIO_FN_RD, GPIO_FN_WE0, GPIO_FN_CS0, 181 181 GPIO_FN_SDA6, GPIO_FN_SCL6, GPIO_FN_SDA7, GPIO_FN_SCL7, 182 - GPIO_FN_WP, GPIO_FN_FMS0, GPIO_FN_FMS1, 183 182 184 - /* PTN (mobule: SCIF234, EVC) */ 185 - GPIO_FN_SCK2, GPIO_FN_RTS4, GPIO_FN_RTS3, GPIO_FN_RTS2, 186 - GPIO_FN_CTS4, GPIO_FN_CTS3, GPIO_FN_CTS2, 187 - GPIO_FN_EVENT7, GPIO_FN_EVENT6, GPIO_FN_EVENT5, GPIO_FN_EVENT4, 188 - GPIO_FN_EVENT3, GPIO_FN_EVENT2, GPIO_FN_EVENT1, GPIO_FN_EVENT0, 183 + /* PTN (mobule: USB, JMC, SGPIO, WDT) */ 184 + GPIO_FN_VBUS_EN, GPIO_FN_VBUS_OC, GPIO_FN_JMCTCK, 185 + GPIO_FN_JMCTMS, GPIO_FN_JMCTDO, GPIO_FN_JMCTDI, 186 + GPIO_FN_JMCTRST, 187 + GPIO_FN_SGPIO1_CLK, GPIO_FN_SGPIO1_LOAD, GPIO_FN_SGPIO1_DI, 188 + GPIO_FN_SGPIO1_DO, GPIO_FN_SUB_CLKIN, 189 189 190 - /* PTO (mobule: SGPIO) */ 191 - GPIO_FN_SGPIO0_CLK, GPIO_FN_SGPIO0_LOAD, 192 - GPIO_FN_SGPIO0_DI, GPIO_FN_SGPIO0_DO, 193 - GPIO_FN_SGPIO1_CLK, GPIO_FN_SGPIO1_LOAD, 194 - GPIO_FN_SGPIO1_DI, GPIO_FN_SGPIO1_DO, 195 - 196 - /* PTP (mobule: JMC, SCIF234) */ 197 - GPIO_FN_JMCTCK, GPIO_FN_JMCTMS, GPIO_FN_JMCTDO, GPIO_FN_JMCTDI, 198 - GPIO_FN_JMCRST, GPIO_FN_SCK4, GPIO_FN_SCK3, 190 + /* PTO (mobule: SGPIO, SerMux) */ 191 + GPIO_FN_SGPIO0_CLK, GPIO_FN_SGPIO0_LOAD, GPIO_FN_SGPIO0_DI, 192 + GPIO_FN_SGPIO0_DO, GPIO_FN_SGPIO2_CLK, GPIO_FN_SGPIO2_LOAD, 193 + GPIO_FN_SGPIO2_DI, GPIO_FN_SGPIO2_DO, GPIO_FN_COM1_TXD, 194 + GPIO_FN_COM1_RXD, GPIO_FN_COM1_RTS, GPIO_FN_COM1_CTS, 199 195 200 196 /* PTQ (mobule: LPC) */ 201 197 GPIO_FN_LAD3, GPIO_FN_LAD2, GPIO_FN_LAD1, GPIO_FN_LAD0, 202 198 GPIO_FN_LFRAME, GPIO_FN_LRESET, GPIO_FN_LCLK, 203 199 204 200 /* PTR (mobule: GRA, IIC) */ 205 - GPIO_FN_DDC3, GPIO_FN_DDC2, 206 - GPIO_FN_SDA8, GPIO_FN_SCL8, GPIO_FN_SDA2, GPIO_FN_SCL2, 201 + GPIO_FN_DDC3, GPIO_FN_DDC2, GPIO_FN_SDA2, GPIO_FN_SCL2, 207 202 GPIO_FN_SDA1, GPIO_FN_SCL1, GPIO_FN_SDA0, GPIO_FN_SCL0, 203 + GPIO_FN_SDA8, GPIO_FN_SCL8, 208 204 209 205 /* PTS (mobule: GRA, IIC) */ 210 - GPIO_FN_DDC1, GPIO_FN_DDC0, 211 - GPIO_FN_SDA9, GPIO_FN_SCL9, GPIO_FN_SDA5, GPIO_FN_SCL5, 206 + GPIO_FN_DDC1, GPIO_FN_DDC0, GPIO_FN_SDA5, GPIO_FN_SCL5, 212 207 GPIO_FN_SDA4, GPIO_FN_SCL4, GPIO_FN_SDA3, GPIO_FN_SCL3, 208 + GPIO_FN_SDA9, GPIO_FN_SCL9, 213 209 214 - /* PTT (mobule: SYSTEM, PWMX) */ 215 - GPIO_FN_AUDSYNC, GPIO_FN_AUDCK, 216 - GPIO_FN_AUDATA3, GPIO_FN_AUDATA2, 217 - GPIO_FN_AUDATA1, GPIO_FN_AUDATA0, 218 - GPIO_FN_PWX7, GPIO_FN_PWX6, GPIO_FN_PWX5, GPIO_FN_PWX4, 210 + /* PTT (mobule: PWMX, AUD) */ 211 + GPIO_FN_PWMX7, GPIO_FN_PWMX6, GPIO_FN_PWMX5, GPIO_FN_PWMX4, 212 + GPIO_FN_PWMX3, GPIO_FN_PWMX2, GPIO_FN_PWMX1, GPIO_FN_PWMX0, 213 + GPIO_FN_AUDATA3, GPIO_FN_AUDATA2, GPIO_FN_AUDATA1, 214 + GPIO_FN_AUDATA0, GPIO_FN_STATUS1, GPIO_FN_STATUS0, 219 215 220 - /* PTU (mobule: LBSC, DMAC) */ 221 - GPIO_FN_CS6, GPIO_FN_CS5, GPIO_FN_CS4, GPIO_FN_CS0, 222 - GPIO_FN_RD, GPIO_FN_WE0, GPIO_FN_A25, GPIO_FN_A24, 223 - GPIO_FN_DREQ0, GPIO_FN_DACK0, 216 + /* PTU (mobule: LPC, APM) */ 217 + GPIO_FN_LGPIO7, GPIO_FN_LGPIO6, GPIO_FN_LGPIO5, GPIO_FN_LGPIO4, 218 + GPIO_FN_LGPIO3, GPIO_FN_LGPIO2, GPIO_FN_LGPIO1, GPIO_FN_LGPIO0, 219 + GPIO_FN_APMONCTL_O, GPIO_FN_APMPWBTOUT_O, GPIO_FN_APMSCI_O, 220 + GPIO_FN_APMVDDON, GPIO_FN_APMSLPBTN, GPIO_FN_APMPWRBTN, 221 + GPIO_FN_APMS5N, GPIO_FN_APMS3N, 224 222 225 - /* PTV (mobule: LBSC, DMAC) */ 223 + /* PTV (mobule: LBSC, SerMux, R-SPI, EVC, GRA) */ 226 224 GPIO_FN_A23, GPIO_FN_A22, GPIO_FN_A21, GPIO_FN_A20, 227 225 GPIO_FN_A19, GPIO_FN_A18, GPIO_FN_A17, GPIO_FN_A16, 228 - GPIO_FN_TEND0, GPIO_FN_DREQ1, GPIO_FN_DACK1, GPIO_FN_TEND1, 226 + GPIO_FN_COM2_RI, GPIO_FN_R_SPI_MOSI, GPIO_FN_R_SPI_MISO, 227 + GPIO_FN_R_SPI_RSPCK, GPIO_FN_R_SPI_SSL0, GPIO_FN_R_SPI_SSL1, 228 + GPIO_FN_EVENT7, GPIO_FN_EVENT6, GPIO_FN_VBIOS_DI, 229 + GPIO_FN_VBIOS_DO, GPIO_FN_VBIOS_CLK, GPIO_FN_VBIOS_CS, 229 230 230 - /* PTW (mobule: LBSC) */ 231 + /* PTW (mobule: LBSC, EVC, SCIF) */ 231 232 GPIO_FN_A15, GPIO_FN_A14, GPIO_FN_A13, GPIO_FN_A12, 232 233 GPIO_FN_A11, GPIO_FN_A10, GPIO_FN_A9, GPIO_FN_A8, 234 + GPIO_FN_EVENT5, GPIO_FN_EVENT4, GPIO_FN_EVENT3, GPIO_FN_EVENT2, 235 + GPIO_FN_EVENT1, GPIO_FN_EVENT0, GPIO_FN_CTS4, GPIO_FN_CTS2, 233 236 234 - /* PTX (mobule: LBSC) */ 237 + /* PTX (mobule: LBSC, SCIF, SIM) */ 235 238 GPIO_FN_A7, GPIO_FN_A6, GPIO_FN_A5, GPIO_FN_A4, 236 239 GPIO_FN_A3, GPIO_FN_A2, GPIO_FN_A1, GPIO_FN_A0, 240 + GPIO_FN_RTS2, GPIO_FN_SIM_D, GPIO_FN_SIM_CLK, GPIO_FN_SIM_RST, 237 241 238 242 /* PTY (mobule: LBSC) */ 239 243 GPIO_FN_D7, GPIO_FN_D6, GPIO_FN_D5, GPIO_FN_D4, 240 244 GPIO_FN_D3, GPIO_FN_D2, GPIO_FN_D1, GPIO_FN_D0, 245 + 246 + /* PTZ (mobule: eMMC, ONFI) */ 247 + GPIO_FN_MMCDAT7, GPIO_FN_MMCDAT6, GPIO_FN_MMCDAT5, 248 + GPIO_FN_MMCDAT4, GPIO_FN_MMCDAT3, GPIO_FN_MMCDAT2, 249 + GPIO_FN_MMCDAT1, GPIO_FN_MMCDAT0, 250 + GPIO_FN_ON_DQ7, GPIO_FN_ON_DQ6, GPIO_FN_ON_DQ5, GPIO_FN_ON_DQ4, 251 + GPIO_FN_ON_DQ3, GPIO_FN_ON_DQ2, GPIO_FN_ON_DQ1, GPIO_FN_ON_DQ0, 241 252 }; 242 253 243 254 #endif /* __ASM_SH7757_H__ */
+64
arch/sh/include/cpu-sh4/cpu/shx3.h
··· 1 + #ifndef __CPU_SHX3_H 2 + #define __CPU_SHX3_H 3 + 4 + enum { 5 + /* PA */ 6 + GPIO_PA7, GPIO_PA6, GPIO_PA5, GPIO_PA4, 7 + GPIO_PA3, GPIO_PA2, GPIO_PA1, GPIO_PA0, 8 + 9 + /* PB */ 10 + GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4, 11 + GPIO_PB3, GPIO_PB2, GPIO_PB1, GPIO_PB0, 12 + 13 + /* PC */ 14 + GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4, 15 + GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0, 16 + 17 + /* PD */ 18 + GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4, 19 + GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0, 20 + 21 + /* PE */ 22 + GPIO_PE7, GPIO_PE6, GPIO_PE5, GPIO_PE4, 23 + GPIO_PE3, GPIO_PE2, GPIO_PE1, GPIO_PE0, 24 + 25 + /* PF */ 26 + GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4, 27 + GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0, 28 + 29 + /* PG */ 30 + GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4, 31 + GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0, 32 + 33 + /* PH */ 34 + GPIO_PH5, GPIO_PH4, 35 + GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0, 36 + 37 + /* SCIF */ 38 + GPIO_FN_SCK3, GPIO_FN_TXD3, GPIO_FN_RXD3, 39 + GPIO_FN_SCK2, GPIO_FN_TXD2, GPIO_FN_RXD2, 40 + GPIO_FN_SCK1, GPIO_FN_TXD1, GPIO_FN_RXD1, 41 + GPIO_FN_SCK0, GPIO_FN_TXD0, GPIO_FN_RXD0, 42 + 43 + /* LBSC */ 44 + GPIO_FN_D31, GPIO_FN_D30, GPIO_FN_D29, GPIO_FN_D28, 45 + GPIO_FN_D27, GPIO_FN_D26, GPIO_FN_D25, GPIO_FN_D24, 46 + GPIO_FN_D23, GPIO_FN_D22, GPIO_FN_D21, GPIO_FN_D20, 47 + GPIO_FN_D19, GPIO_FN_D18, GPIO_FN_D17, GPIO_FN_D16, 48 + GPIO_FN_WE3, GPIO_FN_WE2, GPIO_FN_CS6, GPIO_FN_CS5, 49 + GPIO_FN_CS4, GPIO_FN_CLKOUTENB, GPIO_FN_BREQ, 50 + GPIO_FN_IOIS16, GPIO_FN_CE2B, GPIO_FN_CE2A, GPIO_FN_BACK, 51 + 52 + /* DMAC */ 53 + GPIO_FN_DACK0, GPIO_FN_DREQ0, GPIO_FN_DRAK0, 54 + GPIO_FN_DACK1, GPIO_FN_DREQ1, GPIO_FN_DRAK1, 55 + GPIO_FN_DACK2, GPIO_FN_DREQ2, GPIO_FN_DRAK2, 56 + GPIO_FN_DACK3, GPIO_FN_DREQ3, GPIO_FN_DRAK3, 57 + 58 + /* INTC */ 59 + GPIO_FN_IRQ3, GPIO_FN_IRQ2, GPIO_FN_IRQ1, GPIO_FN_IRQ0, 60 + GPIO_FN_IRL3, GPIO_FN_IRL2, GPIO_FN_IRL1, GPIO_FN_IRL0, 61 + GPIO_FN_IRQOUT, GPIO_FN_STATUS1, GPIO_FN_STATUS0, 62 + }; 63 + 64 + #endif /* __CPU_SHX3_H */
+117
arch/sh/include/mach-common/mach/sh2007.h
··· 1 + #ifndef __MACH_SH2007_H 2 + #define __MACH_SH2007_H 3 + 4 + #define CS5BCR 0xff802050 5 + #define CS5WCR 0xff802058 6 + #define CS5PCR 0xff802070 7 + 8 + #define BUS_SZ8 1 9 + #define BUS_SZ16 2 10 + #define BUS_SZ32 3 11 + 12 + #define PCMCIA_IODYN 1 13 + #define PCMCIA_ATA 0 14 + #define PCMCIA_IO8 2 15 + #define PCMCIA_IO16 3 16 + #define PCMCIA_COMM8 4 17 + #define PCMCIA_COMM16 5 18 + #define PCMCIA_ATTR8 6 19 + #define PCMCIA_ATTR16 7 20 + 21 + #define TYPE_SRAM 0 22 + #define TYPE_PCMCIA 4 23 + 24 + /* write-read/write-write delay (0-7:0,1,2,3,4,5,6,7) */ 25 + #define IWW5 0 26 + #define IWW6 3 27 + /* different area, read-write delay (0-7:0,1,2,3,4,5,6,7) */ 28 + #define IWRWD5 2 29 + #define IWRWD6 2 30 + /* same area, read-write delay (0-7:0,1,2,3,4,5,6,7) */ 31 + #define IWRWS5 2 32 + #define IWRWS6 2 33 + /* different area, read-read delay (0-7:0,1,2,3,4,5,6,7) */ 34 + #define IWRRD5 2 35 + #define IWRRD6 2 36 + /* same area, read-read delay (0-7:0,1,2,3,4,5,6,7) */ 37 + #define IWRRS5 0 38 + #define IWRRS6 2 39 + /* burst count (0-3:4,8,16,32) */ 40 + #define BST5 0 41 + #define BST6 0 42 + /* bus size */ 43 + #define SZ5 BUS_SZ16 44 + #define SZ6 BUS_SZ16 45 + /* RD hold for SRAM (0-1:0,1) */ 46 + #define RDSPL5 0 47 + #define RDSPL6 0 48 + /* Burst pitch (0-7:0,1,2,3,4,5,6,7) */ 49 + #define BW5 0 50 + #define BW6 0 51 + /* Multiplex (0-1:0,1) */ 52 + #define MPX5 0 53 + #define MPX6 0 54 + /* device type */ 55 + #define TYPE5 TYPE_PCMCIA 56 + #define TYPE6 TYPE_PCMCIA 57 + /* address setup before assert CSn for SRAM (0-7:0,1,2,3,4,5,6,7) */ 58 + #define ADS5 0 59 + #define ADS6 0 60 + /* address hold after negate CSn for SRAM (0-7:0,1,2,3,4,5,6,7) */ 61 + #define ADH5 0 62 + #define ADH6 0 63 + /* CSn assert to RD assert delay for SRAM (0-7:0,1,2,3,4,5,6,7) */ 64 + #define RDS5 0 65 + #define RDS6 0 66 + /* RD negate to CSn negate delay for SRAM (0-7:0,1,2,3,4,5,6,7) */ 67 + #define RDH5 0 68 + #define RDH6 0 69 + /* CSn assert to WE assert delay for SRAM (0-7:0,1,2,3,4,5,6,7) */ 70 + #define WTS5 0 71 + #define WTS6 0 72 + /* WE negate to CSn negate delay for SRAM (0-7:0,1,2,3,4,5,6,7) */ 73 + #define WTH5 0 74 + #define WTH6 0 75 + /* BS hold (0-1:1,2) */ 76 + #define BSH5 0 77 + #define BSH6 0 78 + /* wait cycle (0-15:0,1,2,3,4,5,6,7,8,9,11,13,15,17,21,25) */ 79 + #define IW5 6 /* 60ns PIO mode 4 */ 80 + #define IW6 15 /* 250ns */ 81 + 82 + #define SAA5 PCMCIA_IODYN /* IDE area b4000000-b5ffffff */ 83 + #define SAB5 PCMCIA_IODYN /* CF area b6000000-b7ffffff */ 84 + #define PCWA5 0 /* additional wait A (0-3:0,15,30,50) */ 85 + #define PCWB5 0 /* additional wait B (0-3:0,15,30,50) */ 86 + /* wait B (0-15:0,1,2,3,4,5,6,7,8,9,11,13,15,17,21,25) */ 87 + #define PCIW5 12 88 + /* Address->OE/WE assert delay A (0-7:0,1,2,3,6,9,12,15) */ 89 + #define TEDA5 2 90 + /* Address->OE/WE assert delay B (0-7:0,1,2,3,6,9,12,15) */ 91 + #define TEDB5 4 92 + /* OE/WE negate->Address delay A (0-7:0,1,2,3,6,9,12,15) */ 93 + #define TEHA5 2 94 + /* OE/WE negate->Address delay B (0-7:0,1,2,3,6,9,12,15) */ 95 + #define TEHB5 3 96 + 97 + #define CS5BCR_D ((IWW5<<28)|(IWRWD5<<24)|(IWRWS5<<20)| \ 98 + (IWRRD5<<16)|(IWRRS5<<12)|(BST5<<10)| \ 99 + (SZ5<<8)|(RDSPL5<<7)|(BW5<<4)|(MPX5<<3)|TYPE5) 100 + #define CS5WCR_D ((ADS5<<28)|(ADH5<<24)|(RDS5<<20)| \ 101 + (RDH5<<16)|(WTS5<<12)|(WTH5<<8)|(BSH5<<4)|IW5) 102 + #define CS5PCR_D ((SAA5<<28)|(SAB5<<24)|(PCWA5<<22)| \ 103 + (PCWB5<<20)|(PCIW5<<16)|(TEDA5<<12)| \ 104 + (TEDB5<<8)|(TEHA5<<4)|TEHB5) 105 + 106 + #define SMC0_BASE 0xb0800000 /* eth0 */ 107 + #define SMC1_BASE 0xb0900000 /* eth1 */ 108 + #define CF_BASE 0xb6100000 /* Compact Flash (I/O area) */ 109 + #define IDE_BASE 0xb4000000 /* IDE */ 110 + #define PC104_IO_BASE 0xb8000000 111 + #define PC104_MEM_BASE 0xba000000 112 + #define SMC_IO_SIZE 0x100 113 + 114 + #define CF_OFFSET 0x1f0 115 + #define IDE_OFFSET 0x170 116 + 117 + #endif /* __MACH_SH2007_H */
+25 -1
arch/sh/include/mach-sdk7786/mach/fpga.h
··· 31 31 #define EXTASR 0x110 32 32 #define SPCAR 0x120 33 33 #define INTMSR 0x130 34 + 34 35 #define PCIECR 0x140 36 + #define PCIECR_PCIEMUX1 BIT(15) 37 + #define PCIECR_PCIEMUX0 BIT(14) 38 + #define PCIECR_PRST4 BIT(12) /* slot 4 card present */ 39 + #define PCIECR_PRST3 BIT(11) /* slot 3 card present */ 40 + #define PCIECR_PRST2 BIT(10) /* slot 2 card present */ 41 + #define PCIECR_PRST1 BIT(9) /* slot 1 card present */ 42 + #define PCIECR_CLKEN BIT(4) /* oscillator enable */ 43 + 35 44 #define FAER 0x150 36 45 #define USRGPIR 0x160 46 + 37 47 /* 0x170 reserved */ 38 - #define LCLASR 0x180 48 + 49 + #define LCLASR 0x180 50 + #define LCLASR_FRAMEN BIT(15) 51 + 52 + #define LCLASR_FPGA_SEL_SHIFT 12 53 + #define LCLASR_NAND_SEL_SHIFT 8 54 + #define LCLASR_NORB_SEL_SHIFT 4 55 + #define LCLASR_NORA_SEL_SHIFT 0 56 + 57 + #define LCLASR_AREA_MASK 0x7 58 + 59 + #define LCLASR_FPGA_SEL_MASK (LCLASR_AREA_MASK << LCLASR_FPGA_SEL_SHIFT) 60 + #define LCLASR_NAND_SEL_MASK (LCLASR_AREA_MASK << LCLASR_NAND_SEL_SHIFT) 61 + #define LCLASR_NORB_SEL_MASK (LCLASR_AREA_MASK << LCLASR_NORB_SEL_SHIFT) 62 + #define LCLASR_NORA_SEL_MASK (LCLASR_AREA_MASK << LCLASR_NORA_SEL_SHIFT) 39 63 40 64 #define SBCR 0x190 41 65 #define SCBR_I2CMEN BIT(0) /* FPGA I2C master enable */
+12
arch/sh/include/mach-x3proto/mach/hardware.h
··· 1 + #ifndef __MACH_X3PROTO_HARDWARE_H 2 + #define __MACH_X3PROTO_HARDWARE_H 3 + 4 + struct gpio_chip; 5 + 6 + /* arch/sh/boards/mach-x3proto/gpio.c */ 7 + int x3proto_gpio_setup(void); 8 + extern struct gpio_chip x3proto_gpio_chip; 9 + 10 + #define NR_BASEBOARD_GPIOS 16 11 + 12 + #endif /* __MACH_X3PROTO_HARDWARE_H */
+4 -4
arch/sh/kernel/Makefile
··· 12 12 CFLAGS_REMOVE_return_address.o = -pg 13 13 14 14 obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \ 15 - idle.o io.o irq.o \ 16 - irq_$(BITS).o machvec.o nmi_debug.o process.o \ 17 - process_$(BITS).o ptrace_$(BITS).o \ 15 + idle.o io.o irq.o irq_$(BITS).o kdebugfs.o \ 16 + machvec.o nmi_debug.o process.o \ 17 + process_$(BITS).o ptrace.o ptrace_$(BITS).o \ 18 18 reboot.o return_address.o \ 19 19 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \ 20 20 syscalls_$(BITS).o time.o topology.o traps.o \ ··· 44 44 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o 45 45 obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST) += localtimer.o 46 46 47 - EXTRA_CFLAGS += -Werror 47 + ccflags-y := -Werror
+3 -1
arch/sh/kernel/clkdev.c
··· 161 161 */ 162 162 void clkdev_drop(struct clk_lookup *cl) 163 163 { 164 + struct clk_lookup_alloc *cla = container_of(cl, struct clk_lookup_alloc, cl); 165 + 164 166 mutex_lock(&clocks_mutex); 165 167 list_del(&cl->node); 166 168 mutex_unlock(&clocks_mutex); 167 - kfree(cl); 169 + kfree(cla); 168 170 } 169 171 EXPORT_SYMBOL(clkdev_drop);
+1 -1
arch/sh/kernel/cpu/sh4/probe.c
··· 150 150 boot_cpu_data.type = CPU_SH7724; 151 151 boot_cpu_data.flags |= CPU_HAS_L2_CACHE; 152 152 break; 153 - case 0x50: 153 + case 0x10: 154 154 boot_cpu_data.type = CPU_SH7757; 155 155 break; 156 156 }
+3 -2
arch/sh/kernel/cpu/sh4a/Makefile
··· 8 8 obj-$(CONFIG_CPU_SUBTYPE_SH7770) += setup-sh7770.o 9 9 obj-$(CONFIG_CPU_SUBTYPE_SH7780) += setup-sh7780.o 10 10 obj-$(CONFIG_CPU_SUBTYPE_SH7785) += setup-sh7785.o 11 - obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o 11 + obj-$(CONFIG_CPU_SUBTYPE_SH7786) += setup-sh7786.o intc-shx3.o 12 12 obj-$(CONFIG_CPU_SUBTYPE_SH7343) += setup-sh7343.o 13 13 obj-$(CONFIG_CPU_SUBTYPE_SH7722) += setup-sh7722.o 14 14 obj-$(CONFIG_CPU_SUBTYPE_SH7723) += setup-sh7723.o 15 15 obj-$(CONFIG_CPU_SUBTYPE_SH7724) += setup-sh7724.o 16 16 obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o 17 - obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o 17 + obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o intc-shx3.o 18 18 19 19 # SMP setup 20 20 smp-$(CONFIG_CPU_SHX3) := smp-shx3.o ··· 40 40 pinmux-$(CONFIG_CPU_SUBTYPE_SH7757) := pinmux-sh7757.o 41 41 pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 42 42 pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o 43 + pinmux-$(CONFIG_CPU_SUBTYPE_SHX3) := pinmux-shx3.o 43 44 44 45 obj-y += $(clock-y) 45 46 obj-$(CONFIG_SMP) += $(smp-y)
+129 -106
arch/sh/kernel/cpu/sh4a/clock-sh7757.c
··· 3 3 * 4 4 * SH7757 support for the clock framework 5 5 * 6 - * Copyright (C) 2009 Renesas Solutions Corp. 6 + * Copyright (C) 2009-2010 Renesas Solutions Corp. 7 7 * 8 8 * This file is subject to the terms and conditions of the GNU General Public 9 9 * License. See the file "COPYING" in the main directory of this archive ··· 16 16 #include <asm/clock.h> 17 17 #include <asm/freq.h> 18 18 19 - static int ifc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1, 20 - 16, 1, 1, 32, 1, 1, 1, 1 }; 21 - static int sfc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1, 22 - 16, 1, 1, 32, 1, 1, 1, 1 }; 23 - static int bfc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1, 24 - 16, 1, 1, 32, 1, 1, 1, 1 }; 25 - static int p1fc_divisors[] = { 2, 1, 4, 1, 1, 8, 1, 1, 26 - 16, 1, 1, 32, 1, 1, 1, 1 }; 27 - 28 - static void master_clk_init(struct clk *clk) 29 - { 30 - clk->rate = CONFIG_SH_PCLK_FREQ * 16; 31 - } 32 - 33 - static struct clk_ops sh7757_master_clk_ops = { 34 - .init = master_clk_init, 35 - }; 36 - 37 - static void module_clk_recalc(struct clk *clk) 38 - { 39 - int idx = __raw_readl(FRQCR) & 0x0000000f; 40 - clk->rate = clk->parent->rate / p1fc_divisors[idx]; 41 - } 42 - 43 - static struct clk_ops sh7757_module_clk_ops = { 44 - .recalc = module_clk_recalc, 45 - }; 46 - 47 - static void bus_clk_recalc(struct clk *clk) 48 - { 49 - int idx = (__raw_readl(FRQCR) >> 8) & 0x0000000f; 50 - clk->rate = clk->parent->rate / bfc_divisors[idx]; 51 - } 52 - 53 - static struct clk_ops sh7757_bus_clk_ops = { 54 - .recalc = bus_clk_recalc, 55 - }; 56 - 57 - static void cpu_clk_recalc(struct clk *clk) 58 - { 59 - int idx = (__raw_readl(FRQCR) >> 20) & 0x0000000f; 60 - clk->rate = clk->parent->rate / ifc_divisors[idx]; 61 - } 62 - 63 - static struct clk_ops sh7757_cpu_clk_ops = { 64 - .recalc = cpu_clk_recalc, 65 - }; 66 - 67 - static struct clk_ops *sh7757_clk_ops[] = { 68 - &sh7757_master_clk_ops, 69 - &sh7757_module_clk_ops, 70 - &sh7757_bus_clk_ops, 71 - &sh7757_cpu_clk_ops, 72 - }; 73 - 74 - void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 75 - { 76 - if (idx < ARRAY_SIZE(sh7757_clk_ops)) 77 - *ops = sh7757_clk_ops[idx]; 78 - } 79 - 80 - static void shyway_clk_recalc(struct clk *clk) 81 - { 82 - int idx = (__raw_readl(FRQCR) >> 12) & 0x0000000f; 83 - clk->rate = clk->parent->rate / sfc_divisors[idx]; 84 - } 85 - 86 - static struct clk_ops sh7757_shyway_clk_ops = { 87 - .recalc = shyway_clk_recalc, 88 - }; 89 - 90 - static struct clk sh7757_shyway_clk = { 91 - .flags = CLK_ENABLE_ON_INIT, 92 - .ops = &sh7757_shyway_clk_ops, 93 - }; 94 - 95 19 /* 96 - * Additional sh7757-specific on-chip clocks that aren't already part of the 97 - * clock framework 20 + * Default rate for the root input clock, reset this with clk_set_rate() 21 + * from the platform code. 98 22 */ 99 - static struct clk *sh7757_onchip_clocks[] = { 100 - &sh7757_shyway_clk, 23 + static struct clk extal_clk = { 24 + .rate = 48000000, 25 + }; 26 + 27 + static unsigned long pll_recalc(struct clk *clk) 28 + { 29 + int multiplier; 30 + 31 + multiplier = test_mode_pin(MODE_PIN0) ? 24 : 16; 32 + 33 + return clk->parent->rate * multiplier; 34 + } 35 + 36 + static struct clk_ops pll_clk_ops = { 37 + .recalc = pll_recalc, 38 + }; 39 + 40 + static struct clk pll_clk = { 41 + .ops = &pll_clk_ops, 42 + .parent = &extal_clk, 43 + .flags = CLK_ENABLE_ON_INIT, 44 + }; 45 + 46 + static struct clk *clks[] = { 47 + &extal_clk, 48 + &pll_clk, 49 + }; 50 + 51 + static unsigned int div2[] = { 1, 1, 2, 1, 1, 4, 1, 6, 52 + 1, 1, 1, 16, 1, 24, 1, 1 }; 53 + 54 + static struct clk_div_mult_table div4_div_mult_table = { 55 + .divisors = div2, 56 + .nr_divisors = ARRAY_SIZE(div2), 57 + }; 58 + 59 + static struct clk_div4_table div4_table = { 60 + .div_mult_table = &div4_div_mult_table, 61 + }; 62 + 63 + enum { DIV4_I, DIV4_SH, DIV4_P, DIV4_NR }; 64 + 65 + #define DIV4(_bit, _mask, _flags) \ 66 + SH_CLK_DIV4(&pll_clk, FRQCR, _bit, _mask, _flags) 67 + 68 + struct clk div4_clks[DIV4_NR] = { 69 + /* 70 + * P clock is always enable, because some P clock modules is used 71 + * by Host PC. 72 + */ 73 + [DIV4_P] = DIV4(0, 0x2800, CLK_ENABLE_ON_INIT), 74 + [DIV4_SH] = DIV4(12, 0x00a0, CLK_ENABLE_ON_INIT), 75 + [DIV4_I] = DIV4(20, 0x0004, CLK_ENABLE_ON_INIT), 76 + }; 77 + 78 + #define MSTPCR0 0xffc80030 79 + #define MSTPCR1 0xffc80034 80 + 81 + enum { MSTP004, MSTP000, MSTP114, MSTP113, MSTP112, 82 + MSTP111, MSTP110, MSTP103, MSTP102, 83 + MSTP_NR }; 84 + 85 + static struct clk mstp_clks[MSTP_NR] = { 86 + /* MSTPCR0 */ 87 + [MSTP004] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 4, 0), 88 + [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0), 89 + 90 + /* MSTPCR1 */ 91 + [MSTP114] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 14, 0), 92 + [MSTP113] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 13, 0), 93 + [MSTP112] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 12, 0), 94 + [MSTP111] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 11, 0), 95 + [MSTP110] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 10, 0), 96 + [MSTP103] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 3, 0), 97 + [MSTP102] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR1, 2, 0), 101 98 }; 102 99 103 100 #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } 104 101 105 102 static struct clk_lookup lookups[] = { 106 103 /* main clocks */ 107 - CLKDEV_CON_ID("shyway_clk", &sh7757_shyway_clk), 104 + CLKDEV_CON_ID("extal", &extal_clk), 105 + CLKDEV_CON_ID("pll_clk", &pll_clk), 106 + 107 + /* DIV4 clocks */ 108 + CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]), 109 + CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]), 110 + CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), 111 + 112 + /* MSTP32 clocks */ 113 + CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]), 114 + CLKDEV_CON_ID("riic", &mstp_clks[MSTP000]), 115 + { 116 + /* TMU0 */ 117 + .dev_id = "sh_tmu.0", 118 + .con_id = "tmu_fck", 119 + .clk = &mstp_clks[MSTP113], 120 + }, { 121 + /* TMU1 */ 122 + .dev_id = "sh_tmu.1", 123 + .con_id = "tmu_fck", 124 + .clk = &mstp_clks[MSTP114], 125 + }, 126 + { 127 + /* SCIF4 (But, ID is 2) */ 128 + .dev_id = "sh-sci.2", 129 + .con_id = "sci_fck", 130 + .clk = &mstp_clks[MSTP112], 131 + }, { 132 + /* SCIF3 */ 133 + .dev_id = "sh-sci.1", 134 + .con_id = "sci_fck", 135 + .clk = &mstp_clks[MSTP111], 136 + }, { 137 + /* SCIF2 */ 138 + .dev_id = "sh-sci.0", 139 + .con_id = "sci_fck", 140 + .clk = &mstp_clks[MSTP110], 141 + }, 142 + CLKDEV_CON_ID("usb0", &mstp_clks[MSTP102]), 108 143 }; 109 144 110 - static int __init sh7757_clk_init(void) 145 + int __init arch_clk_init(void) 111 146 { 112 - struct clk *clk = clk_get(NULL, "master_clk"); 113 - int i; 147 + int i, ret = 0; 114 148 115 - for (i = 0; i < ARRAY_SIZE(sh7757_onchip_clocks); i++) { 116 - struct clk *clkp = sh7757_onchip_clocks[i]; 149 + for (i = 0; i < ARRAY_SIZE(clks); i++) 150 + ret |= clk_register(clks[i]); 151 + for (i = 0; i < ARRAY_SIZE(lookups); i++) 152 + clkdev_add(&lookups[i]); 117 153 118 - clkp->parent = clk; 119 - clk_register(clkp); 120 - clk_enable(clkp); 121 - } 154 + if (!ret) 155 + ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 156 + &div4_table); 157 + if (!ret) 158 + ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 122 159 123 - /* 124 - * Now that we have the rest of the clocks registered, we need to 125 - * force the parent clock to propagate so that these clocks will 126 - * automatically figure out their rate. We cheat by handing the 127 - * parent clock its current rate and forcing child propagation. 128 - */ 129 - clk_set_rate(clk, clk_get_rate(clk)); 130 - 131 - clk_put(clk); 132 - 133 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 134 - 135 - return 0; 160 + return ret; 136 161 } 137 - 138 - arch_initcall(sh7757_clk_init); 139 162
+159 -100
arch/sh/kernel/cpu/sh4a/clock-shx3.c
··· 5 5 * 6 6 * Copyright (C) 2006-2007 Renesas Technology Corp. 7 7 * Copyright (C) 2006-2007 Renesas Solutions Corp. 8 - * Copyright (C) 2006-2007 Paul Mundt 8 + * Copyright (C) 2006-2010 Paul Mundt 9 9 * 10 10 * This file is subject to the terms and conditions of the GNU General Public 11 11 * License. See the file "COPYING" in the main directory of this archive ··· 18 18 #include <asm/clock.h> 19 19 #include <asm/freq.h> 20 20 21 - static int ifc_divisors[] = { 1, 2, 4 ,6 }; 22 - static int bfc_divisors[] = { 1, 1, 1, 1, 1, 12, 16, 18, 24, 32, 36, 48 }; 23 - static int pfc_divisors[] = { 1, 1, 1, 1, 1, 1, 1, 18, 24, 32, 36, 48 }; 24 - static int cfc_divisors[] = { 1, 1, 4, 6 }; 25 - 26 - #define IFC_POS 28 27 - #define IFC_MSK 0x0003 28 - #define BFC_MSK 0x000f 29 - #define PFC_MSK 0x000f 30 - #define CFC_MSK 0x0003 31 - #define BFC_POS 16 32 - #define PFC_POS 0 33 - #define CFC_POS 20 34 - 35 - static void master_clk_init(struct clk *clk) 36 - { 37 - clk->rate *= pfc_divisors[(__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK]; 38 - } 39 - 40 - static struct clk_ops shx3_master_clk_ops = { 41 - .init = master_clk_init, 42 - }; 43 - 44 - static unsigned long module_clk_recalc(struct clk *clk) 45 - { 46 - int idx = ((__raw_readl(FRQCR) >> PFC_POS) & PFC_MSK); 47 - return clk->parent->rate / pfc_divisors[idx]; 48 - } 49 - 50 - static struct clk_ops shx3_module_clk_ops = { 51 - .recalc = module_clk_recalc, 52 - }; 53 - 54 - static unsigned long bus_clk_recalc(struct clk *clk) 55 - { 56 - int idx = ((__raw_readl(FRQCR) >> BFC_POS) & BFC_MSK); 57 - return clk->parent->rate / bfc_divisors[idx]; 58 - } 59 - 60 - static struct clk_ops shx3_bus_clk_ops = { 61 - .recalc = bus_clk_recalc, 62 - }; 63 - 64 - static unsigned long cpu_clk_recalc(struct clk *clk) 65 - { 66 - int idx = ((__raw_readl(FRQCR) >> IFC_POS) & IFC_MSK); 67 - return clk->parent->rate / ifc_divisors[idx]; 68 - } 69 - 70 - static struct clk_ops shx3_cpu_clk_ops = { 71 - .recalc = cpu_clk_recalc, 72 - }; 73 - 74 - static struct clk_ops *shx3_clk_ops[] = { 75 - &shx3_master_clk_ops, 76 - &shx3_module_clk_ops, 77 - &shx3_bus_clk_ops, 78 - &shx3_cpu_clk_ops, 79 - }; 80 - 81 - void __init arch_init_clk_ops(struct clk_ops **ops, int idx) 82 - { 83 - if (idx < ARRAY_SIZE(shx3_clk_ops)) 84 - *ops = shx3_clk_ops[idx]; 85 - } 86 - 87 - static unsigned long shyway_clk_recalc(struct clk *clk) 88 - { 89 - int idx = ((__raw_readl(FRQCR) >> CFC_POS) & CFC_MSK); 90 - return clk->parent->rate / cfc_divisors[idx]; 91 - } 92 - 93 - static struct clk_ops shx3_shyway_clk_ops = { 94 - .recalc = shyway_clk_recalc, 95 - }; 96 - 97 - static struct clk shx3_shyway_clk = { 98 - .flags = CLK_ENABLE_ON_INIT, 99 - .ops = &shx3_shyway_clk_ops, 100 - }; 101 - 102 21 /* 103 - * Additional SHx3-specific on-chip clocks that aren't already part of the 104 - * clock framework 22 + * Default rate for the root input clock, reset this with clk_set_rate() 23 + * from the platform code. 105 24 */ 106 - static struct clk *shx3_onchip_clocks[] = { 107 - &shx3_shyway_clk, 25 + static struct clk extal_clk = { 26 + .rate = 16666666, 27 + }; 28 + 29 + static unsigned long pll_recalc(struct clk *clk) 30 + { 31 + /* PLL1 has a fixed x72 multiplier. */ 32 + return clk->parent->rate * 72; 33 + } 34 + 35 + static struct clk_ops pll_clk_ops = { 36 + .recalc = pll_recalc, 37 + }; 38 + 39 + static struct clk pll_clk = { 40 + .ops = &pll_clk_ops, 41 + .parent = &extal_clk, 42 + .flags = CLK_ENABLE_ON_INIT, 43 + }; 44 + 45 + static struct clk *clks[] = { 46 + &extal_clk, 47 + &pll_clk, 48 + }; 49 + 50 + static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18, 51 + 24, 32, 36, 48 }; 52 + 53 + static struct clk_div_mult_table div4_div_mult_table = { 54 + .divisors = div2, 55 + .nr_divisors = ARRAY_SIZE(div2), 56 + }; 57 + 58 + static struct clk_div4_table div4_table = { 59 + .div_mult_table = &div4_div_mult_table, 60 + }; 61 + 62 + enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_SHA, DIV4_P, DIV4_NR }; 63 + 64 + #define DIV4(_bit, _mask, _flags) \ 65 + SH_CLK_DIV4(&pll_clk, FRQMR1, _bit, _mask, _flags) 66 + 67 + struct clk div4_clks[DIV4_NR] = { 68 + [DIV4_P] = DIV4(0, 0x0f80, 0), 69 + [DIV4_SHA] = DIV4(4, 0x0ff0, 0), 70 + [DIV4_DDR] = DIV4(12, 0x000c, CLK_ENABLE_ON_INIT), 71 + [DIV4_B] = DIV4(16, 0x0fe0, CLK_ENABLE_ON_INIT), 72 + [DIV4_SH] = DIV4(20, 0x000c, CLK_ENABLE_ON_INIT), 73 + [DIV4_I] = DIV4(28, 0x000e, CLK_ENABLE_ON_INIT), 74 + }; 75 + 76 + #define MSTPCR0 0xffc00030 77 + #define MSTPCR1 0xffc00034 78 + 79 + enum { MSTP027, MSTP026, MSTP025, MSTP024, 80 + MSTP009, MSTP008, MSTP003, MSTP002, 81 + MSTP001, MSTP000, MSTP119, MSTP105, 82 + MSTP104, MSTP_NR }; 83 + 84 + static struct clk mstp_clks[MSTP_NR] = { 85 + /* MSTPCR0 */ 86 + [MSTP027] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 27, 0), 87 + [MSTP026] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 26, 0), 88 + [MSTP025] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 25, 0), 89 + [MSTP024] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 24, 0), 90 + [MSTP009] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 9, 0), 91 + [MSTP008] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 8, 0), 92 + [MSTP003] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 3, 0), 93 + [MSTP002] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 2, 0), 94 + [MSTP001] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 1, 0), 95 + [MSTP000] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 0, 0), 96 + 97 + /* MSTPCR1 */ 98 + [MSTP119] = SH_CLK_MSTP32(NULL, MSTPCR1, 19, 0), 99 + [MSTP105] = SH_CLK_MSTP32(NULL, MSTPCR1, 5, 0), 100 + [MSTP104] = SH_CLK_MSTP32(NULL, MSTPCR1, 4, 0), 108 101 }; 109 102 110 103 #define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk } 111 104 112 105 static struct clk_lookup lookups[] = { 113 106 /* main clocks */ 114 - CLKDEV_CON_ID("shyway_clk", &shx3_shyway_clk), 107 + CLKDEV_CON_ID("extal", &extal_clk), 108 + CLKDEV_CON_ID("pll_clk", &pll_clk), 109 + 110 + /* DIV4 clocks */ 111 + CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]), 112 + CLKDEV_CON_ID("shywaya_clk", &div4_clks[DIV4_SHA]), 113 + CLKDEV_CON_ID("ddr_clk", &div4_clks[DIV4_DDR]), 114 + CLKDEV_CON_ID("bus_clk", &div4_clks[DIV4_B]), 115 + CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_SH]), 116 + CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), 117 + 118 + /* MSTP32 clocks */ 119 + { 120 + /* SCIF3 */ 121 + .dev_id = "sh-sci.3", 122 + .con_id = "sci_fck", 123 + .clk = &mstp_clks[MSTP027], 124 + }, { 125 + /* SCIF2 */ 126 + .dev_id = "sh-sci.2", 127 + .con_id = "sci_fck", 128 + .clk = &mstp_clks[MSTP026], 129 + }, { 130 + /* SCIF1 */ 131 + .dev_id = "sh-sci.1", 132 + .con_id = "sci_fck", 133 + .clk = &mstp_clks[MSTP025], 134 + }, { 135 + /* SCIF0 */ 136 + .dev_id = "sh-sci.0", 137 + .con_id = "sci_fck", 138 + .clk = &mstp_clks[MSTP024], 139 + }, 140 + CLKDEV_CON_ID("h8ex_fck", &mstp_clks[MSTP003]), 141 + CLKDEV_CON_ID("csm_fck", &mstp_clks[MSTP002]), 142 + CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]), 143 + CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]), 144 + { 145 + /* TMU0 */ 146 + .dev_id = "sh_tmu.0", 147 + .con_id = "tmu_fck", 148 + .clk = &mstp_clks[MSTP008], 149 + }, { 150 + /* TMU1 */ 151 + .dev_id = "sh_tmu.1", 152 + .con_id = "tmu_fck", 153 + .clk = &mstp_clks[MSTP008], 154 + }, { 155 + /* TMU2 */ 156 + .dev_id = "sh_tmu.2", 157 + .con_id = "tmu_fck", 158 + .clk = &mstp_clks[MSTP008], 159 + }, { 160 + /* TMU3 */ 161 + .dev_id = "sh_tmu.3", 162 + .con_id = "tmu_fck", 163 + .clk = &mstp_clks[MSTP009], 164 + }, { 165 + /* TMU4 */ 166 + .dev_id = "sh_tmu.4", 167 + .con_id = "tmu_fck", 168 + .clk = &mstp_clks[MSTP009], 169 + }, { 170 + /* TMU5 */ 171 + .dev_id = "sh_tmu.5", 172 + .con_id = "tmu_fck", 173 + .clk = &mstp_clks[MSTP009], 174 + }, 175 + CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), 176 + CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), 177 + CLKDEV_CON_ID("dmac_5_0_fck", &mstp_clks[MSTP104]), 115 178 }; 116 179 117 180 int __init arch_clk_init(void) 118 181 { 119 - struct clk *clk; 120 182 int i, ret = 0; 121 183 122 - cpg_clk_init(); 184 + for (i = 0; i < ARRAY_SIZE(clks); i++) 185 + ret |= clk_register(clks[i]); 186 + for (i = 0; i < ARRAY_SIZE(lookups); i++) 187 + clkdev_add(&lookups[i]); 123 188 124 - clk = clk_get(NULL, "master_clk"); 125 - for (i = 0; i < ARRAY_SIZE(shx3_onchip_clocks); i++) { 126 - struct clk *clkp = shx3_onchip_clocks[i]; 127 - 128 - clkp->parent = clk; 129 - ret |= clk_register(clkp); 130 - } 131 - 132 - clk_put(clk); 133 - 134 - clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 189 + if (!ret) 190 + ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks), 191 + &div4_table); 192 + if (!ret) 193 + ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 135 194 136 195 return ret; 137 196 }
+34
arch/sh/kernel/cpu/sh4a/intc-shx3.c
··· 1 + /* 2 + * Shared support for SH-X3 interrupt controllers. 3 + * 4 + * Copyright (C) 2009 - 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include <linux/irq.h> 11 + #include <linux/io.h> 12 + #include <linux/init.h> 13 + 14 + #define INTACK 0xfe4100b8 15 + #define INTACKCLR 0xfe4100bc 16 + #define INTC_USERIMASK 0xfe411000 17 + 18 + #ifdef CONFIG_INTC_BALANCING 19 + unsigned int irq_lookup(unsigned int irq) 20 + { 21 + return __raw_readl(INTACK) & 1 ? irq : NO_IRQ_IGNORE; 22 + } 23 + 24 + void irq_finish(unsigned int irq) 25 + { 26 + __raw_writel(irq2evt(irq), INTACKCLR); 27 + } 28 + #endif 29 + 30 + static int __init shx3_irq_setup(void) 31 + { 32 + return register_intc_userimask(INTC_USERIMASK); 33 + } 34 + arch_initcall(shx3_irq_setup);
+19 -1
arch/sh/kernel/cpu/sh4a/perf_event.c
··· 1 1 /* 2 2 * Performance events support for SH-4A performance counters 3 3 * 4 - * Copyright (C) 2009 Paul Mundt 4 + * Copyright (C) 2009, 2010 Paul Mundt 5 5 * 6 6 * This file is subject to the terms and conditions of the GNU General Public 7 7 * License. See the file "COPYING" in the main directory of this archive ··· 22 22 #define CCBR_CMDS (1 << 1) 23 23 #define CCBR_PPCE (1 << 0) 24 24 25 + #ifdef CONFIG_CPU_SHX3 26 + /* 27 + * The PMCAT location for SH-X3 CPUs was quietly moved, while the CCBR 28 + * and PMCTR locations remains tentatively constant. This change remains 29 + * wholly undocumented, and was simply found through trial and error. 30 + * 31 + * Early cuts of SH-X3 still appear to use the SH-X/SH-X2 locations, and 32 + * it's unclear when this ceased to be the case. For now we always use 33 + * the new location (if future parts keep up with this trend then 34 + * scanning for them at runtime also remains a viable option.) 35 + * 36 + * The gap in the register space also suggests that there are other 37 + * undocumented counters, so this will need to be revisited at a later 38 + * point in time. 39 + */ 40 + #define PPC_PMCAT 0xfc100240 41 + #else 25 42 #define PPC_PMCAT 0xfc100080 43 + #endif 26 44 27 45 #define PMCAT_OVF3 (1 << 27) 28 46 #define PMCAT_CNN3 (1 << 26)
+937 -669
arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c
··· 1 1 /* 2 - * SH7757 (A0 step) Pinmux 2 + * SH7757 (B0 step) Pinmux 3 3 * 4 - * Copyright (C) 2009 Renesas Solutions Corp. 4 + * Copyright (C) 2009-2010 Renesas Solutions Corp. 5 5 * 6 6 * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> 7 7 * 8 - * Based on SH7757 Pinmux 8 + * Based on SH7723 Pinmux 9 9 * Copyright (C) 2008 Magnus Damm 10 10 * 11 11 * This file is subject to the terms and conditions of the GNU General Public ··· 40 40 PTH3_DATA, PTH2_DATA, PTH1_DATA, PTH0_DATA, 41 41 PTI7_DATA, PTI6_DATA, PTI5_DATA, PTI4_DATA, 42 42 PTI3_DATA, PTI2_DATA, PTI1_DATA, PTI0_DATA, 43 - PTJ7_DATA, PTJ6_DATA, PTJ5_DATA, PTJ4_DATA, 43 + PTJ6_DATA, PTJ5_DATA, PTJ4_DATA, 44 44 PTJ3_DATA, PTJ2_DATA, PTJ1_DATA, PTJ0_DATA, 45 45 PTK7_DATA, PTK6_DATA, PTK5_DATA, PTK4_DATA, 46 46 PTK3_DATA, PTK2_DATA, PTK1_DATA, PTK0_DATA, 47 - PTL7_DATA, PTL6_DATA, PTL5_DATA, PTL4_DATA, 47 + PTL6_DATA, PTL5_DATA, PTL4_DATA, 48 48 PTL3_DATA, PTL2_DATA, PTL1_DATA, PTL0_DATA, 49 - PTM6_DATA, PTM5_DATA, PTM4_DATA, 49 + PTM7_DATA, PTM6_DATA, PTM5_DATA, PTM4_DATA, 50 50 PTM3_DATA, PTM2_DATA, PTM1_DATA, PTM0_DATA, 51 - PTN7_DATA, PTN6_DATA, PTN5_DATA, PTN4_DATA, 51 + PTN6_DATA, PTN5_DATA, PTN4_DATA, 52 52 PTN3_DATA, PTN2_DATA, PTN1_DATA, PTN0_DATA, 53 53 PTO7_DATA, PTO6_DATA, PTO5_DATA, PTO4_DATA, 54 54 PTO3_DATA, PTO2_DATA, PTO1_DATA, PTO0_DATA, 55 - PTP6_DATA, PTP5_DATA, PTP4_DATA, 55 + PTP7_DATA, PTP6_DATA, PTP5_DATA, PTP4_DATA, 56 56 PTP3_DATA, PTP2_DATA, PTP1_DATA, PTP0_DATA, 57 - PTQ6_DATA, PTQ5_DATA, PTQ4_DATA, 57 + PTQ6_DATA, PTQ5_DATA, PTQ4_DATA, 58 58 PTQ3_DATA, PTQ2_DATA, PTQ1_DATA, PTQ0_DATA, 59 59 PTR7_DATA, PTR6_DATA, PTR5_DATA, PTR4_DATA, 60 60 PTR3_DATA, PTR2_DATA, PTR1_DATA, PTR0_DATA, 61 61 PTS7_DATA, PTS6_DATA, PTS5_DATA, PTS4_DATA, 62 62 PTS3_DATA, PTS2_DATA, PTS1_DATA, PTS0_DATA, 63 - PTT5_DATA, PTT4_DATA, 63 + PTT7_DATA, PTT6_DATA, PTT5_DATA, PTT4_DATA, 64 64 PTT3_DATA, PTT2_DATA, PTT1_DATA, PTT0_DATA, 65 65 PTU7_DATA, PTU6_DATA, PTU5_DATA, PTU4_DATA, 66 66 PTU3_DATA, PTU2_DATA, PTU1_DATA, PTU0_DATA, ··· 95 95 PTH3_IN, PTH2_IN, PTH1_IN, PTH0_IN, 96 96 PTI7_IN, PTI6_IN, PTI5_IN, PTI4_IN, 97 97 PTI3_IN, PTI2_IN, PTI1_IN, PTI0_IN, 98 - PTJ7_IN, PTJ6_IN, PTJ5_IN, PTJ4_IN, 98 + PTJ6_IN, PTJ5_IN, PTJ4_IN, 99 99 PTJ3_IN, PTJ2_IN, PTJ1_IN, PTJ0_IN, 100 100 PTK7_IN, PTK6_IN, PTK5_IN, PTK4_IN, 101 101 PTK3_IN, PTK2_IN, PTK1_IN, PTK0_IN, 102 - PTL7_IN, PTL6_IN, PTL5_IN, PTL4_IN, 102 + PTL6_IN, PTL5_IN, PTL4_IN, 103 103 PTL3_IN, PTL2_IN, PTL1_IN, PTL0_IN, 104 - PTM6_IN, PTM5_IN, PTM4_IN, 104 + PTM7_IN, PTM6_IN, PTM5_IN, PTM4_IN, 105 105 PTM3_IN, PTM2_IN, PTM1_IN, PTM0_IN, 106 - PTN7_IN, PTN6_IN, PTN5_IN, PTN4_IN, 106 + PTN6_IN, PTN5_IN, PTN4_IN, 107 107 PTN3_IN, PTN2_IN, PTN1_IN, PTN0_IN, 108 108 PTO7_IN, PTO6_IN, PTO5_IN, PTO4_IN, 109 109 PTO3_IN, PTO2_IN, PTO1_IN, PTO0_IN, 110 - PTP6_IN, PTP5_IN, PTP4_IN, 110 + PTP7_IN, PTP6_IN, PTP5_IN, PTP4_IN, 111 111 PTP3_IN, PTP2_IN, PTP1_IN, PTP0_IN, 112 - PTQ6_IN, PTQ5_IN, PTQ4_IN, 112 + PTQ6_IN, PTQ5_IN, PTQ4_IN, 113 113 PTQ3_IN, PTQ2_IN, PTQ1_IN, PTQ0_IN, 114 114 PTR7_IN, PTR6_IN, PTR5_IN, PTR4_IN, 115 115 PTR3_IN, PTR2_IN, PTR1_IN, PTR0_IN, 116 116 PTS7_IN, PTS6_IN, PTS5_IN, PTS4_IN, 117 117 PTS3_IN, PTS2_IN, PTS1_IN, PTS0_IN, 118 - PTT5_IN, PTT4_IN, 118 + PTT7_IN, PTT6_IN, PTT5_IN, PTT4_IN, 119 119 PTT3_IN, PTT2_IN, PTT1_IN, PTT0_IN, 120 120 PTU7_IN, PTU6_IN, PTU5_IN, PTU4_IN, 121 121 PTU3_IN, PTU2_IN, PTU1_IN, PTU0_IN, ··· 132 132 PINMUX_INPUT_END, 133 133 134 134 PINMUX_INPUT_PULLUP_BEGIN, 135 + PTA7_IN_PU, PTA6_IN_PU, PTA5_IN_PU, PTA4_IN_PU, 136 + PTA3_IN_PU, PTA2_IN_PU, PTA1_IN_PU, PTA0_IN_PU, 137 + PTD7_IN_PU, PTD6_IN_PU, PTD5_IN_PU, PTD4_IN_PU, 138 + PTD3_IN_PU, PTD2_IN_PU, PTD1_IN_PU, PTD0_IN_PU, 139 + PTE7_IN_PU, PTE6_IN_PU, PTE5_IN_PU, PTE4_IN_PU, 140 + PTE3_IN_PU, PTE2_IN_PU, PTE1_IN_PU, PTE0_IN_PU, 141 + PTF7_IN_PU, PTF6_IN_PU, PTF5_IN_PU, PTF4_IN_PU, 142 + PTF3_IN_PU, PTF2_IN_PU, PTF1_IN_PU, PTF0_IN_PU, 143 + PTG7_IN_PU, PTG6_IN_PU, PTG4_IN_PU, 144 + PTH7_IN_PU, PTH6_IN_PU, PTH5_IN_PU, PTH4_IN_PU, 145 + PTH3_IN_PU, PTH2_IN_PU, PTH1_IN_PU, PTH0_IN_PU, 146 + PTI7_IN_PU, PTI6_IN_PU, PTI4_IN_PU, 147 + PTI3_IN_PU, PTI2_IN_PU, PTI1_IN_PU, PTI0_IN_PU, 148 + PTJ6_IN_PU, PTJ5_IN_PU, PTJ4_IN_PU, 149 + PTJ3_IN_PU, PTJ2_IN_PU, PTJ1_IN_PU, PTJ0_IN_PU, 150 + PTK7_IN_PU, PTK6_IN_PU, PTK5_IN_PU, PTK4_IN_PU, 151 + PTK3_IN_PU, PTK2_IN_PU, PTK1_IN_PU, PTK0_IN_PU, 152 + PTL6_IN_PU, PTL5_IN_PU, PTL4_IN_PU, 153 + PTL3_IN_PU, PTL2_IN_PU, PTL1_IN_PU, PTL0_IN_PU, 154 + PTM7_IN_PU, PTM6_IN_PU, PTM5_IN_PU, PTM4_IN_PU, 155 + PTN4_IN_PU, 156 + PTN3_IN_PU, PTN2_IN_PU, PTN1_IN_PU, PTN0_IN_PU, 157 + PTO7_IN_PU, PTO6_IN_PU, PTO5_IN_PU, PTO4_IN_PU, 158 + PTO3_IN_PU, PTO2_IN_PU, PTO1_IN_PU, PTO0_IN_PU, 159 + PTT7_IN_PU, PTT6_IN_PU, PTT5_IN_PU, PTT4_IN_PU, 160 + PTT3_IN_PU, PTT2_IN_PU, PTT1_IN_PU, PTT0_IN_PU, 135 161 PTU7_IN_PU, PTU6_IN_PU, PTU5_IN_PU, PTU4_IN_PU, 136 162 PTU3_IN_PU, PTU2_IN_PU, PTU1_IN_PU, PTU0_IN_PU, 137 163 PTV7_IN_PU, PTV6_IN_PU, PTV5_IN_PU, PTV4_IN_PU, 138 - PTV3_IN_PU, PTV2_IN_PU, PTV1_IN_PU, PTV0_IN_PU, 139 - PTW7_IN_PU, PTW6_IN_PU, PTW5_IN_PU, PTW4_IN_PU, 140 - PTW3_IN_PU, PTW2_IN_PU, PTW1_IN_PU, PTW0_IN_PU, 164 + PTV3_IN_PU, PTV2_IN_PU, 165 + PTW1_IN_PU, PTW0_IN_PU, 141 166 PTX7_IN_PU, PTX6_IN_PU, PTX5_IN_PU, PTX4_IN_PU, 142 167 PTX3_IN_PU, PTX2_IN_PU, PTX1_IN_PU, PTX0_IN_PU, 143 168 PTY7_IN_PU, PTY6_IN_PU, PTY5_IN_PU, PTY4_IN_PU, 144 169 PTY3_IN_PU, PTY2_IN_PU, PTY1_IN_PU, PTY0_IN_PU, 170 + PTZ7_IN_PU, PTZ6_IN_PU, PTZ5_IN_PU, PTZ4_IN_PU, 171 + PTZ3_IN_PU, PTZ2_IN_PU, PTZ1_IN_PU, PTZ0_IN_PU, 145 172 PINMUX_INPUT_PULLUP_END, 146 173 147 174 PINMUX_OUTPUT_BEGIN, ··· 190 163 PTH3_OUT, PTH2_OUT, PTH1_OUT, PTH0_OUT, 191 164 PTI7_OUT, PTI6_OUT, PTI5_OUT, PTI4_OUT, 192 165 PTI3_OUT, PTI2_OUT, PTI1_OUT, PTI0_OUT, 193 - PTJ7_OUT, PTJ6_OUT, PTJ5_OUT, PTJ4_OUT, 166 + PTJ6_OUT, PTJ5_OUT, PTJ4_OUT, 194 167 PTJ3_OUT, PTJ2_OUT, PTJ1_OUT, PTJ0_OUT, 195 168 PTK7_OUT, PTK6_OUT, PTK5_OUT, PTK4_OUT, 196 169 PTK3_OUT, PTK2_OUT, PTK1_OUT, PTK0_OUT, 197 - PTL7_OUT, PTL6_OUT, PTL5_OUT, PTL4_OUT, 170 + PTL6_OUT, PTL5_OUT, PTL4_OUT, 198 171 PTL3_OUT, PTL2_OUT, PTL1_OUT, PTL0_OUT, 199 - PTM6_OUT, PTM5_OUT, PTM4_OUT, 172 + PTM7_OUT, PTM6_OUT, PTM5_OUT, PTM4_OUT, 200 173 PTM3_OUT, PTM2_OUT, PTM1_OUT, PTM0_OUT, 201 - PTN7_OUT, PTN6_OUT, PTN5_OUT, PTN4_OUT, 174 + PTN6_OUT, PTN5_OUT, PTN4_OUT, 202 175 PTN3_OUT, PTN2_OUT, PTN1_OUT, PTN0_OUT, 203 176 PTO7_OUT, PTO6_OUT, PTO5_OUT, PTO4_OUT, 204 177 PTO3_OUT, PTO2_OUT, PTO1_OUT, PTO0_OUT, 205 - PTP6_OUT, PTP5_OUT, PTP4_OUT, 178 + PTP7_OUT, PTP6_OUT, PTP5_OUT, PTP4_OUT, 206 179 PTP3_OUT, PTP2_OUT, PTP1_OUT, PTP0_OUT, 207 - PTQ6_OUT, PTQ5_OUT, PTQ4_OUT, 180 + PTQ6_OUT, PTQ5_OUT, PTQ4_OUT, 208 181 PTQ3_OUT, PTQ2_OUT, PTQ1_OUT, PTQ0_OUT, 209 182 PTR7_OUT, PTR6_OUT, PTR5_OUT, PTR4_OUT, 210 183 PTR3_OUT, PTR2_OUT, PTR1_OUT, PTR0_OUT, 211 184 PTS7_OUT, PTS6_OUT, PTS5_OUT, PTS4_OUT, 212 185 PTS3_OUT, PTS2_OUT, PTS1_OUT, PTS0_OUT, 213 - PTT5_OUT, PTT4_OUT, 186 + PTT7_OUT, PTT6_OUT, PTT5_OUT, PTT4_OUT, 214 187 PTT3_OUT, PTT2_OUT, PTT1_OUT, PTT0_OUT, 215 188 PTU7_OUT, PTU6_OUT, PTU5_OUT, PTU4_OUT, 216 189 PTU3_OUT, PTU2_OUT, PTU1_OUT, PTU0_OUT, ··· 245 218 PTH3_FN, PTH2_FN, PTH1_FN, PTH0_FN, 246 219 PTI7_FN, PTI6_FN, PTI5_FN, PTI4_FN, 247 220 PTI3_FN, PTI2_FN, PTI1_FN, PTI0_FN, 248 - PTJ7_FN, PTJ6_FN, PTJ5_FN, PTJ4_FN, 221 + PTJ6_FN, PTJ5_FN, PTJ4_FN, 249 222 PTJ3_FN, PTJ2_FN, PTJ1_FN, PTJ0_FN, 250 223 PTK7_FN, PTK6_FN, PTK5_FN, PTK4_FN, 251 224 PTK3_FN, PTK2_FN, PTK1_FN, PTK0_FN, 252 - PTL7_FN, PTL6_FN, PTL5_FN, PTL4_FN, 225 + PTL6_FN, PTL5_FN, PTL4_FN, 253 226 PTL3_FN, PTL2_FN, PTL1_FN, PTL0_FN, 254 - PTM6_FN, PTM5_FN, PTM4_FN, 227 + PTM7_FN, PTM6_FN, PTM5_FN, PTM4_FN, 255 228 PTM3_FN, PTM2_FN, PTM1_FN, PTM0_FN, 256 - PTN7_FN, PTN6_FN, PTN5_FN, PTN4_FN, 229 + PTN6_FN, PTN5_FN, PTN4_FN, 257 230 PTN3_FN, PTN2_FN, PTN1_FN, PTN0_FN, 258 231 PTO7_FN, PTO6_FN, PTO5_FN, PTO4_FN, 259 232 PTO3_FN, PTO2_FN, PTO1_FN, PTO0_FN, 260 - PTP6_FN, PTP5_FN, PTP4_FN, 233 + PTP7_FN, PTP6_FN, PTP5_FN, PTP4_FN, 261 234 PTP3_FN, PTP2_FN, PTP1_FN, PTP0_FN, 262 - PTQ6_FN, PTQ5_FN, PTQ4_FN, 235 + PTQ6_FN, PTQ5_FN, PTQ4_FN, 263 236 PTQ3_FN, PTQ2_FN, PTQ1_FN, PTQ0_FN, 264 237 PTR7_FN, PTR6_FN, PTR5_FN, PTR4_FN, 265 238 PTR3_FN, PTR2_FN, PTR1_FN, PTR0_FN, 266 239 PTS7_FN, PTS6_FN, PTS5_FN, PTS4_FN, 267 240 PTS3_FN, PTS2_FN, PTS1_FN, PTS0_FN, 268 - PTT5_FN, PTT4_FN, 241 + PTT7_FN, PTT6_FN, PTT5_FN, PTT4_FN, 269 242 PTT3_FN, PTT2_FN, PTT1_FN, PTT0_FN, 270 243 PTU7_FN, PTU6_FN, PTU5_FN, PTU4_FN, 271 244 PTU3_FN, PTU2_FN, PTU1_FN, PTU0_FN, ··· 280 253 PTZ7_FN, PTZ6_FN, PTZ5_FN, PTZ4_FN, 281 254 PTZ3_FN, PTZ2_FN, PTZ1_FN, PTZ0_FN, 282 255 283 - PS0_15_FN1, PS0_15_FN3, 284 - PS0_14_FN1, PS0_14_FN3, 285 - PS0_13_FN1, PS0_13_FN3, 286 - PS0_12_FN1, PS0_12_FN3, 256 + PS0_15_FN1, PS0_15_FN2, 257 + PS0_14_FN1, PS0_14_FN2, 258 + PS0_13_FN1, PS0_13_FN2, 259 + PS0_12_FN1, PS0_12_FN2, 260 + PS0_11_FN1, PS0_11_FN2, 261 + PS0_10_FN1, PS0_10_FN2, 262 + PS0_9_FN1, PS0_9_FN2, 263 + PS0_8_FN1, PS0_8_FN2, 287 264 PS0_7_FN1, PS0_7_FN2, 288 265 PS0_6_FN1, PS0_6_FN2, 289 266 PS0_5_FN1, PS0_5_FN2, 290 267 PS0_4_FN1, PS0_4_FN2, 291 268 PS0_3_FN1, PS0_3_FN2, 292 269 PS0_2_FN1, PS0_2_FN2, 293 - PS0_1_FN1, PS0_1_FN2, 294 270 295 - PS1_7_FN1, PS1_7_FN3, 296 - PS1_6_FN1, PS1_6_FN3, 271 + PS1_10_FN1, PS1_10_FN2, 272 + PS1_9_FN1, PS1_9_FN2, 273 + PS1_8_FN1, PS1_8_FN2, 274 + PS1_2_FN1, PS1_2_FN2, 297 275 298 - PS2_13_FN1, PS2_13_FN3, 299 - PS2_12_FN1, PS2_12_FN3, 300 - PS2_1_FN1, PS2_1_FN2, 301 - PS2_0_FN1, PS2_0_FN2, 276 + PS2_13_FN1, PS2_13_FN2, 277 + PS2_12_FN1, PS2_12_FN2, 278 + PS2_7_FN1, PS2_7_FN2, 279 + PS2_6_FN1, PS2_6_FN2, 280 + PS2_5_FN1, PS2_5_FN2, 281 + PS2_4_FN1, PS2_4_FN2, 282 + PS2_2_FN1, PS2_2_FN2, 302 283 303 - PS4_15_FN1, PS4_15_FN2, 284 + PS3_15_FN1, PS3_15_FN2, 285 + PS3_14_FN1, PS3_14_FN2, 286 + PS3_13_FN1, PS3_13_FN2, 287 + PS3_12_FN1, PS3_12_FN2, 288 + PS3_11_FN1, PS3_11_FN2, 289 + PS3_10_FN1, PS3_10_FN2, 290 + PS3_9_FN1, PS3_9_FN2, 291 + PS3_8_FN1, PS3_8_FN2, 292 + PS3_7_FN1, PS3_7_FN2, 293 + PS3_2_FN1, PS3_2_FN2, 294 + PS3_1_FN1, PS3_1_FN2, 295 + 304 296 PS4_14_FN1, PS4_14_FN2, 305 297 PS4_13_FN1, PS4_13_FN2, 306 298 PS4_12_FN1, PS4_12_FN2, 307 - PS4_11_FN1, PS4_11_FN2, 308 299 PS4_10_FN1, PS4_10_FN2, 309 300 PS4_9_FN1, PS4_9_FN2, 301 + PS4_8_FN1, PS4_8_FN2, 302 + PS4_4_FN1, PS4_4_FN2, 310 303 PS4_3_FN1, PS4_3_FN2, 311 304 PS4_2_FN1, PS4_2_FN2, 312 305 PS4_1_FN1, PS4_1_FN2, 313 306 PS4_0_FN1, PS4_0_FN2, 314 307 308 + PS5_11_FN1, PS5_11_FN2, 309 + PS5_10_FN1, PS5_10_FN2, 315 310 PS5_9_FN1, PS5_9_FN2, 316 311 PS5_8_FN1, PS5_8_FN2, 317 312 PS5_7_FN1, PS5_7_FN2, 318 313 PS5_6_FN1, PS5_6_FN2, 319 314 PS5_5_FN1, PS5_5_FN2, 320 315 PS5_4_FN1, PS5_4_FN2, 316 + PS5_3_FN1, PS5_3_FN2, 317 + PS5_2_FN1, PS5_2_FN2, 321 318 322 - /* AN15 to 8 : EVENT15 to 8 */ 323 - PS6_7_FN_AN, PS6_7_FN_EV, 324 - PS6_6_FN_AN, PS6_6_FN_EV, 325 - PS6_5_FN_AN, PS6_5_FN_EV, 326 - PS6_4_FN_AN, PS6_4_FN_EV, 327 - PS6_3_FN_AN, PS6_3_FN_EV, 328 - PS6_2_FN_AN, PS6_2_FN_EV, 329 - PS6_1_FN_AN, PS6_1_FN_EV, 330 - PS6_0_FN_AN, PS6_0_FN_EV, 319 + PS6_15_FN1, PS6_15_FN2, 320 + PS6_14_FN1, PS6_14_FN2, 321 + PS6_13_FN1, PS6_13_FN2, 322 + PS6_12_FN1, PS6_12_FN2, 323 + PS6_11_FN1, PS6_11_FN2, 324 + PS6_10_FN1, PS6_10_FN2, 325 + PS6_9_FN1, PS6_9_FN2, 326 + PS6_8_FN1, PS6_8_FN2, 327 + PS6_7_FN1, PS6_7_FN2, 328 + PS6_6_FN1, PS6_6_FN2, 329 + PS6_5_FN1, PS6_5_FN2, 330 + PS6_4_FN1, PS6_4_FN2, 331 + PS6_3_FN1, PS6_3_FN2, 332 + PS6_2_FN1, PS6_2_FN2, 333 + PS6_1_FN1, PS6_1_FN2, 334 + PS6_0_FN1, PS6_0_FN2, 331 335 336 + PS7_15_FN1, PS7_15_FN2, 337 + PS7_14_FN1, PS7_14_FN2, 338 + PS7_13_FN1, PS7_13_FN2, 339 + PS7_12_FN1, PS7_12_FN2, 340 + PS7_11_FN1, PS7_11_FN2, 341 + PS7_10_FN1, PS7_10_FN2, 342 + PS7_9_FN1, PS7_9_FN2, 343 + PS7_8_FN1, PS7_8_FN2, 344 + PS7_7_FN1, PS7_7_FN2, 345 + PS7_6_FN1, PS7_6_FN2, 346 + PS7_5_FN1, PS7_5_FN2, 347 + PS7_4_FN1, PS7_4_FN2, 348 + 349 + PS8_15_FN1, PS8_15_FN2, 350 + PS8_14_FN1, PS8_14_FN2, 351 + PS8_13_FN1, PS8_13_FN2, 352 + PS8_12_FN1, PS8_12_FN2, 353 + PS8_11_FN1, PS8_11_FN2, 354 + PS8_10_FN1, PS8_10_FN2, 355 + PS8_9_FN1, PS8_9_FN2, 356 + PS8_8_FN1, PS8_8_FN2, 332 357 PINMUX_FUNCTION_END, 333 358 334 359 PINMUX_MARK_BEGIN, 335 - /* PTA (mobule: LBSC, CPG, LPC) */ 360 + /* PTA (mobule: LBSC, RGMII) */ 336 361 BS_MARK, RDWR_MARK, WE1_MARK, RDY_MARK, 337 - MD10_MARK, MD9_MARK, MD8_MARK, 338 - LGPIO7_MARK, LGPIO6_MARK, LGPIO5_MARK, LGPIO4_MARK, 339 - LGPIO3_MARK, LGPIO2_MARK, LGPIO1_MARK, LGPIO0_MARK, 362 + ET0_MDC_MARK, ET0_MDIO_MARK, ET1_MDC_MARK, ET1_MDIO_MARK, 340 363 341 - /* PTB (mobule: LBSC, EtherC, SIM, LPC) */ 364 + /* PTB (mobule: INTC, ONFI, TMU) */ 365 + IRQ15_MARK, IRQ14_MARK, IRQ13_MARK, IRQ12_MARK, 366 + IRQ11_MARK, IRQ10_MARK, IRQ9_MARK, IRQ8_MARK, 367 + ON_NRE_MARK, ON_NWE_MARK, ON_NWP_MARK, ON_NCE0_MARK, 368 + ON_R_B0_MARK, ON_ALE_MARK, ON_CLE_MARK, TCLK_MARK, 369 + 370 + /* PTC (mobule: IRQ, PWMU) */ 371 + IRQ7_MARK, IRQ6_MARK, IRQ5_MARK, IRQ4_MARK, 372 + IRQ3_MARK, IRQ2_MARK, IRQ1_MARK, IRQ0_MARK, 373 + PWMU0_MARK, PWMU1_MARK, PWMU2_MARK, PWMU3_MARK, 374 + PWMU4_MARK, PWMU5_MARK, 375 + 376 + /* PTD (mobule: SPI0, DMAC) */ 377 + SP0_MOSI_MARK, SP0_MISO_MARK, SP0_SCK_MARK, SP0_SCK_FB_MARK, 378 + SP0_SS0_MARK, SP0_SS1_MARK, SP0_SS2_MARK, SP0_SS3_MARK, 379 + DREQ0_MARK, DACK0_MARK, TEND0_MARK, 380 + 381 + /* PTE (mobule: RMII) */ 382 + RMII0_CRS_DV_MARK, RMII0_TXD1_MARK, 383 + RMII0_TXD0_MARK, RMII0_TXEN_MARK, 384 + RMII0_REFCLK_MARK, RMII0_RXD1_MARK, 385 + RMII0_RXD0_MARK, RMII0_RX_ER_MARK, 386 + 387 + /* PTF (mobule: RMII, SerMux) */ 388 + RMII1_CRS_DV_MARK, RMII1_TXD1_MARK, 389 + RMII1_TXD0_MARK, RMII1_TXEN_MARK, 390 + RMII1_REFCLK_MARK, RMII1_RXD1_MARK, 391 + RMII1_RXD0_MARK, RMII1_RX_ER_MARK, 392 + RAC_RI_MARK, 393 + 394 + /* PTG (mobule: system, LBSC, LPC, WDT, LPC, eMMC) */ 395 + BOOTFMS_MARK, BOOTWP_MARK, A25_MARK, A24_MARK, 396 + SERIRQ_MARK, WDTOVF_MARK, LPCPD_MARK, LDRQ_MARK, 397 + MMCCLK_MARK, MMCCMD_MARK, 398 + 399 + /* PTH (mobule: SPI1, LPC, DMAC, ADC) */ 400 + SP1_MOSI_MARK, SP1_MISO_MARK, SP1_SCK_MARK, SP1_SCK_FB_MARK, 401 + SP1_SS0_MARK, SP1_SS1_MARK, WP_MARK, FMS0_MARK, 402 + TEND1_MARK, DREQ1_MARK, DACK1_MARK, ADTRG1_MARK, 403 + ADTRG0_MARK, 404 + 405 + /* PTI (mobule: LBSC, SDHI) */ 342 406 D15_MARK, D14_MARK, D13_MARK, D12_MARK, 343 407 D11_MARK, D10_MARK, D9_MARK, D8_MARK, 344 - ET0_MDC_MARK, ET0_MDIO_MARK, ET1_MDC_MARK, ET1_MDIO_MARK, 345 - SIM_D_MARK, SIM_CLK_MARK, SIM_RST_MARK, 346 - WPSZ1_MARK, WPSZ0_MARK, FWID_MARK, FLSHSZ_MARK, 347 - LPC_SPIEN_MARK, BASEL_MARK, 348 - 349 - /* PTC (mobule: SD) */ 350 408 SD_WP_MARK, SD_CD_MARK, SD_CLK_MARK, SD_CMD_MARK, 351 409 SD_D3_MARK, SD_D2_MARK, SD_D1_MARK, SD_D0_MARK, 352 410 353 - /* PTD (mobule: INTC, SPI0, LBSC, CPG, ADC) */ 354 - IRQ7_MARK, IRQ6_MARK, IRQ5_MARK, IRQ4_MARK, 355 - IRQ3_MARK, IRQ2_MARK, IRQ1_MARK, IRQ0_MARK, 356 - MD6_MARK, MD5_MARK, MD3_MARK, MD2_MARK, 357 - MD1_MARK, MD0_MARK, ADTRG1_MARK, ADTRG0_MARK, 411 + /* PTJ (mobule: SCIF234) */ 412 + RTS3_MARK, CTS3_MARK, TXD3_MARK, RXD3_MARK, 413 + RTS4_MARK, RXD4_MARK, TXD4_MARK, 358 414 359 - /* PTE (mobule: EtherC) */ 360 - ET0_CRS_DV_MARK, ET0_TXD1_MARK, 361 - ET0_TXD0_MARK, ET0_TX_EN_MARK, 362 - ET0_REF_CLK_MARK, ET0_RXD1_MARK, 363 - ET0_RXD0_MARK, ET0_RX_ER_MARK, 364 - 365 - /* PTF (mobule: EtherC) */ 366 - ET1_CRS_DV_MARK, ET1_TXD1_MARK, 367 - ET1_TXD0_MARK, ET1_TX_EN_MARK, 368 - ET1_REF_CLK_MARK, ET1_RXD1_MARK, 369 - ET1_RXD0_MARK, ET1_RX_ER_MARK, 370 - 371 - /* PTG (mobule: SYSTEM, PWMX, LPC) */ 372 - STATUS0_MARK, STATUS1_MARK, 373 - PWX0_MARK, PWX1_MARK, PWX2_MARK, PWX3_MARK, 374 - SERIRQ_MARK, CLKRUN_MARK, LPCPD_MARK, LDRQ_MARK, 375 - 376 - /* PTH (mobule: TMU, SCIF234, SPI1, SPI0) */ 377 - TCLK_MARK, RXD4_MARK, TXD4_MARK, 378 - SP1_MOSI_MARK, SP1_MISO_MARK, SP1_SCK_MARK, SP1_SCK_FB_MARK, 379 - SP1_SS0_MARK, SP1_SS1_MARK, SP0_SS1_MARK, 380 - 381 - /* PTI (mobule: INTC) */ 382 - IRQ15_MARK, IRQ14_MARK, IRQ13_MARK, IRQ12_MARK, 383 - IRQ11_MARK, IRQ10_MARK, IRQ9_MARK, IRQ8_MARK, 384 - 385 - /* PTJ (mobule: SCIF234, SERMUX) */ 386 - RXD3_MARK, TXD3_MARK, RXD2_MARK, TXD2_MARK, 387 - COM1_TXD_MARK, COM1_RXD_MARK, COM1_RTS_MARK, COM1_CTS_MARK, 388 - 389 - /* PTK (mobule: SERMUX) */ 415 + /* PTK (mobule: SERMUX, LBSC, SCIF) */ 390 416 COM2_TXD_MARK, COM2_RXD_MARK, COM2_RTS_MARK, COM2_CTS_MARK, 391 - COM2_DTR_MARK, COM2_DSR_MARK, COM2_DCD_MARK, COM2_RI_MARK, 417 + COM2_DTR_MARK, COM2_DSR_MARK, COM2_DCD_MARK, CLKOUT_MARK, 418 + SCK2_MARK, SCK4_MARK, SCK3_MARK, 392 419 393 - /* PTL (mobule: SERMUX) */ 394 - RAC_TXD_MARK, RAC_RXD_MARK, RAC_RTS_MARK, RAC_CTS_MARK, 395 - RAC_DTR_MARK, RAC_DSR_MARK, RAC_DCD_MARK, RAC_RI_MARK, 420 + /* PTL (mobule: SERMUX, SCIF, LBSC, AUD) */ 421 + RAC_RXD_MARK, RAC_RTS_MARK, RAC_CTS_MARK, RAC_DTR_MARK, 422 + RAC_DSR_MARK, RAC_DCD_MARK, RAC_TXD_MARK, RXD2_MARK, 423 + CS5_MARK, CS6_MARK, AUDSYNC_MARK, AUDCK_MARK, 424 + TXD2_MARK, 396 425 397 - /* PTM (mobule: IIC, LPC) */ 426 + /* PTM (mobule: LBSC, IIC) */ 427 + CS4_MARK, RD_MARK, WE0_MARK, CS0_MARK, 398 428 SDA6_MARK, SCL6_MARK, SDA7_MARK, SCL7_MARK, 399 - WP_MARK, FMS0_MARK, FMS1_MARK, 400 429 401 - /* PTN (mobule: SCIF234, EVC) */ 402 - SCK2_MARK, RTS4_MARK, RTS3_MARK, RTS2_MARK, 403 - CTS4_MARK, CTS3_MARK, CTS2_MARK, 404 - EVENT7_MARK, EVENT6_MARK, EVENT5_MARK, EVENT4_MARK, 405 - EVENT3_MARK, EVENT2_MARK, EVENT1_MARK, EVENT0_MARK, 430 + /* PTN (mobule: USB, JMC, SGPIO, WDT) */ 431 + VBUS_EN_MARK, VBUS_OC_MARK, JMCTCK_MARK, JMCTMS_MARK, 432 + JMCTDO_MARK, JMCTDI_MARK, JMCTRST_MARK, 433 + SGPIO1_CLK_MARK, SGPIO1_LOAD_MARK, SGPIO1_DI_MARK, 434 + SGPIO1_DO_MARK, SUB_CLKIN_MARK, 406 435 407 - /* PTO (mobule: SGPIO) */ 408 - SGPIO0_CLK_MARK, SGPIO0_LOAD_MARK, 409 - SGPIO0_DI_MARK, SGPIO0_DO_MARK, 410 - SGPIO1_CLK_MARK, SGPIO1_LOAD_MARK, 411 - SGPIO1_DI_MARK, SGPIO1_DO_MARK, 412 - 413 - /* PTP (mobule: JMC, SCIF234) */ 414 - JMCTCK_MARK, JMCTMS_MARK, JMCTDO_MARK, JMCTDI_MARK, 415 - JMCRST_MARK, SCK4_MARK, SCK3_MARK, 436 + /* PTO (mobule: SGPIO, SerMux) */ 437 + SGPIO0_CLK_MARK, SGPIO0_LOAD_MARK, SGPIO0_DI_MARK, 438 + SGPIO0_DO_MARK, SGPIO2_CLK_MARK, SGPIO2_LOAD_MARK, 439 + SGPIO2_DI_MARK, SGPIO2_DO_MARK, 440 + COM1_TXD_MARK, COM1_RXD_MARK, COM1_RTS_MARK, COM1_CTS_MARK, 416 441 417 442 /* PTQ (mobule: LPC) */ 418 443 LAD3_MARK, LAD2_MARK, LAD1_MARK, LAD0_MARK, 419 444 LFRAME_MARK, LRESET_MARK, LCLK_MARK, 420 445 421 446 /* PTR (mobule: GRA, IIC) */ 422 - DDC3_MARK, DDC2_MARK, 423 - SDA8_MARK, SCL8_MARK, SDA2_MARK, SCL2_MARK, 447 + DDC3_MARK, DDC2_MARK, SDA2_MARK, SCL2_MARK, 424 448 SDA1_MARK, SCL1_MARK, SDA0_MARK, SCL0_MARK, 449 + SDA8_MARK, SCL8_MARK, 425 450 426 451 /* PTS (mobule: GRA, IIC) */ 427 - DDC1_MARK, DDC0_MARK, 428 - SDA9_MARK, SCL9_MARK, SDA5_MARK, SCL5_MARK, 452 + DDC1_MARK, DDC0_MARK, SDA5_MARK, SCL5_MARK, 429 453 SDA4_MARK, SCL4_MARK, SDA3_MARK, SCL3_MARK, 454 + SDA9_MARK, SCL9_MARK, 430 455 431 - /* PTT (mobule: SYSTEM, PWMX) */ 432 - AUDSYNC_MARK, AUDCK_MARK, 433 - AUDATA3_MARK, AUDATA2_MARK, 434 - AUDATA1_MARK, AUDATA0_MARK, 435 - PWX7_MARK, PWX6_MARK, PWX5_MARK, PWX4_MARK, 456 + /* PTT (mobule: PWMX, AUD) */ 457 + PWMX7_MARK, PWMX6_MARK, PWMX5_MARK, PWMX4_MARK, 458 + PWMX3_MARK, PWMX2_MARK, PWMX1_MARK, PWMX0_MARK, 459 + AUDATA3_MARK, AUDATA2_MARK, AUDATA1_MARK, AUDATA0_MARK, 460 + STATUS1_MARK, STATUS0_MARK, 436 461 437 - /* PTU (mobule: LBSC, DMAC) */ 438 - CS6_MARK, CS5_MARK, CS4_MARK, CS0_MARK, 439 - RD_MARK, WE0_MARK, A25_MARK, A24_MARK, 440 - DREQ0_MARK, DACK0_MARK, 462 + /* PTU (mobule: LPC, APM) */ 463 + LGPIO7_MARK, LGPIO6_MARK, LGPIO5_MARK, LGPIO4_MARK, 464 + LGPIO3_MARK, LGPIO2_MARK, LGPIO1_MARK, LGPIO0_MARK, 465 + APMONCTL_O_MARK, APMPWBTOUT_O_MARK, APMSCI_O_MARK, 466 + APMVDDON_MARK, APMSLPBTN_MARK, APMPWRBTN_MARK, APMS5N_MARK, 467 + APMS3N_MARK, 441 468 442 - /* PTV (mobule: LBSC, DMAC) */ 469 + /* PTV (mobule: LBSC, SerMux, R-SPI, EVC, GRA) */ 443 470 A23_MARK, A22_MARK, A21_MARK, A20_MARK, 444 471 A19_MARK, A18_MARK, A17_MARK, A16_MARK, 445 - TEND0_MARK, DREQ1_MARK, DACK1_MARK, TEND1_MARK, 472 + COM2_RI_MARK, R_SPI_MOSI_MARK, R_SPI_MISO_MARK, 473 + R_SPI_RSPCK_MARK, R_SPI_SSL0_MARK, R_SPI_SSL1_MARK, 474 + EVENT7_MARK, EVENT6_MARK, VBIOS_DI_MARK, VBIOS_DO_MARK, 475 + VBIOS_CLK_MARK, VBIOS_CS_MARK, 446 476 447 - /* PTW (mobule: LBSC) */ 477 + /* PTW (mobule: LBSC, EVC, SCIF) */ 448 478 A15_MARK, A14_MARK, A13_MARK, A12_MARK, 449 479 A11_MARK, A10_MARK, A9_MARK, A8_MARK, 480 + EVENT5_MARK, EVENT4_MARK, EVENT3_MARK, EVENT2_MARK, 481 + EVENT1_MARK, EVENT0_MARK, CTS4_MARK, CTS2_MARK, 450 482 451 - /* PTX (mobule: LBSC) */ 483 + /* PTX (mobule: LBSC, SCIF, SIM) */ 452 484 A7_MARK, A6_MARK, A5_MARK, A4_MARK, 453 485 A3_MARK, A2_MARK, A1_MARK, A0_MARK, 486 + RTS2_MARK, SIM_D_MARK, SIM_CLK_MARK, SIM_RST_MARK, 454 487 455 488 /* PTY (mobule: LBSC) */ 456 489 D7_MARK, D6_MARK, D5_MARK, D4_MARK, 457 490 D3_MARK, D2_MARK, D1_MARK, D0_MARK, 491 + 492 + /* PTZ (mobule: eMMC, ONFI) */ 493 + MMCDAT7_MARK, MMCDAT6_MARK, MMCDAT5_MARK, MMCDAT4_MARK, 494 + MMCDAT3_MARK, MMCDAT2_MARK, MMCDAT1_MARK, MMCDAT0_MARK, 495 + ON_DQ7_MARK, ON_DQ6_MARK, ON_DQ5_MARK, ON_DQ4_MARK, 496 + ON_DQ3_MARK, ON_DQ2_MARK, ON_DQ1_MARK, ON_DQ0_MARK, 497 + 458 498 PINMUX_MARK_END, 459 499 }; 460 500 ··· 567 473 PINMUX_DATA(PTD0_DATA, PTD0_IN, PTD0_OUT), 568 474 569 475 /* PTE GPIO */ 476 + PINMUX_DATA(PTE7_DATA, PTE7_IN, PTE7_OUT), 477 + PINMUX_DATA(PTE6_DATA, PTE6_IN, PTE6_OUT), 570 478 PINMUX_DATA(PTE5_DATA, PTE5_IN, PTE5_OUT), 571 479 PINMUX_DATA(PTE4_DATA, PTE4_IN, PTE4_OUT), 572 480 PINMUX_DATA(PTE3_DATA, PTE3_IN, PTE3_OUT), ··· 617 521 PINMUX_DATA(PTI0_DATA, PTI0_IN, PTI0_OUT), 618 522 619 523 /* PTJ GPIO */ 620 - PINMUX_DATA(PTJ7_DATA, PTJ7_IN, PTJ7_OUT), 621 524 PINMUX_DATA(PTJ6_DATA, PTJ6_IN, PTJ6_OUT), 622 525 PINMUX_DATA(PTJ5_DATA, PTJ5_IN, PTJ5_OUT), 623 526 PINMUX_DATA(PTJ4_DATA, PTJ4_IN, PTJ4_OUT), ··· 636 541 PINMUX_DATA(PTK0_DATA, PTK0_IN, PTK0_OUT), 637 542 638 543 /* PTL GPIO */ 639 - PINMUX_DATA(PTL7_DATA, PTL7_IN, PTL7_OUT), 640 544 PINMUX_DATA(PTL6_DATA, PTL6_IN, PTL6_OUT), 641 545 PINMUX_DATA(PTL5_DATA, PTL5_IN, PTL5_OUT), 642 546 PINMUX_DATA(PTL4_DATA, PTL4_IN, PTL4_OUT), ··· 654 560 PINMUX_DATA(PTM0_DATA, PTM0_IN, PTM0_OUT), 655 561 656 562 /* PTN GPIO */ 657 - PINMUX_DATA(PTN7_DATA, PTN7_IN, PTN7_OUT), 658 563 PINMUX_DATA(PTN6_DATA, PTN6_IN, PTN6_OUT), 659 564 PINMUX_DATA(PTN5_DATA, PTN5_IN, PTN5_OUT), 660 565 PINMUX_DATA(PTN4_DATA, PTN4_IN, PTN4_OUT), ··· 702 609 PINMUX_DATA(PTS0_DATA, PTS0_IN, PTS0_OUT), 703 610 704 611 /* PTT GPIO */ 612 + PINMUX_DATA(PTT7_DATA, PTT7_IN, PTT7_OUT), 613 + PINMUX_DATA(PTT6_DATA, PTT6_IN, PTT6_OUT), 705 614 PINMUX_DATA(PTT5_DATA, PTT5_IN, PTT5_OUT), 706 615 PINMUX_DATA(PTT4_DATA, PTT4_IN, PTT4_OUT), 707 616 PINMUX_DATA(PTT3_DATA, PTT3_IN, PTT3_OUT), ··· 772 677 PINMUX_DATA(PTZ0_DATA, PTZ0_IN, PTZ0_OUT), 773 678 774 679 /* PTA FN */ 775 - PINMUX_DATA(BS_MARK, PS0_15_FN1, PTA7_FN), 776 - PINMUX_DATA(LGPIO7_MARK, PS0_15_FN3, PTA7_FN), 777 - PINMUX_DATA(RDWR_MARK, PS0_14_FN1, PTA6_FN), 778 - PINMUX_DATA(LGPIO6_MARK, PS0_14_FN3, PTA6_FN), 779 - PINMUX_DATA(WE1_MARK, PS0_13_FN1, PTA5_FN), 780 - PINMUX_DATA(LGPIO5_MARK, PS0_13_FN3, PTA5_FN), 781 - PINMUX_DATA(RDY_MARK, PS0_12_FN1, PTA4_FN), 782 - PINMUX_DATA(LGPIO4_MARK, PS0_12_FN3, PTA4_FN), 783 - PINMUX_DATA(LGPIO3_MARK, PTA3_FN), 784 - PINMUX_DATA(LGPIO2_MARK, PTA2_FN), 785 - PINMUX_DATA(LGPIO1_MARK, PTA1_FN), 786 - PINMUX_DATA(LGPIO0_MARK, PTA0_FN), 680 + PINMUX_DATA(BS_MARK, PTA7_FN), 681 + PINMUX_DATA(RDWR_MARK, PTA6_FN), 682 + PINMUX_DATA(WE1_MARK, PTA5_FN), 683 + PINMUX_DATA(RDY_MARK, PTA4_FN), 684 + PINMUX_DATA(ET0_MDC_MARK, PTA3_FN), 685 + PINMUX_DATA(ET0_MDIO_MARK, PTA2_FN), 686 + PINMUX_DATA(ET1_MDC_MARK, PTA1_FN), 687 + PINMUX_DATA(ET1_MDIO_MARK, PTA0_FN), 787 688 788 689 /* PTB FN */ 789 - PINMUX_DATA(D15_MARK, PS0_7_FN1, PTB7_FN), 790 - PINMUX_DATA(ET0_MDC_MARK, PS0_7_FN2, PTB7_FN), 791 - PINMUX_DATA(D14_MARK, PS0_6_FN1, PTB6_FN), 792 - PINMUX_DATA(ET0_MDIO_MARK, PS0_6_FN2, PTB6_FN), 793 - PINMUX_DATA(D13_MARK, PS0_5_FN1, PTB5_FN), 794 - PINMUX_DATA(ET1_MDC_MARK, PS0_5_FN2, PTB5_FN), 795 - PINMUX_DATA(D12_MARK, PS0_4_FN1, PTB4_FN), 796 - PINMUX_DATA(ET1_MDIO_MARK, PS0_4_FN2, PTB4_FN), 797 - PINMUX_DATA(D11_MARK, PS0_3_FN1, PTB3_FN), 798 - PINMUX_DATA(SIM_D_MARK, PS0_3_FN2, PTB3_FN), 799 - PINMUX_DATA(D10_MARK, PS0_2_FN1, PTB2_FN), 800 - PINMUX_DATA(SIM_CLK_MARK, PS0_2_FN2, PTB2_FN), 801 - PINMUX_DATA(D9_MARK, PS0_1_FN1, PTB1_FN), 802 - PINMUX_DATA(SIM_RST_MARK, PS0_1_FN2, PTB1_FN), 803 - PINMUX_DATA(D8_MARK, PTB0_FN), 690 + PINMUX_DATA(IRQ15_MARK, PS0_15_FN1, PTB7_FN), 691 + PINMUX_DATA(ON_NRE_MARK, PS0_15_FN2, PTB7_FN), 692 + PINMUX_DATA(IRQ14_MARK, PS0_14_FN1, PTB6_FN), 693 + PINMUX_DATA(ON_NWE_MARK, PS0_14_FN2, PTB6_FN), 694 + PINMUX_DATA(IRQ13_MARK, PS0_13_FN1, PTB5_FN), 695 + PINMUX_DATA(ON_NWP_MARK, PS0_13_FN2, PTB5_FN), 696 + PINMUX_DATA(IRQ12_MARK, PS0_12_FN1, PTB4_FN), 697 + PINMUX_DATA(ON_NCE0_MARK, PS0_12_FN2, PTB4_FN), 698 + PINMUX_DATA(IRQ11_MARK, PS0_11_FN1, PTB3_FN), 699 + PINMUX_DATA(ON_R_B0_MARK, PS0_11_FN2, PTB3_FN), 700 + PINMUX_DATA(IRQ10_MARK, PS0_10_FN1, PTB2_FN), 701 + PINMUX_DATA(ON_ALE_MARK, PS0_10_FN2, PTB2_FN), 702 + PINMUX_DATA(IRQ9_MARK, PS0_9_FN1, PTB1_FN), 703 + PINMUX_DATA(ON_CLE_MARK, PS0_9_FN2, PTB1_FN), 704 + PINMUX_DATA(IRQ8_MARK, PS0_8_FN1, PTB0_FN), 705 + PINMUX_DATA(TCLK_MARK, PS0_8_FN2, PTB0_FN), 804 706 805 707 /* PTC FN */ 806 - PINMUX_DATA(SD_WP_MARK, PTC7_FN), 807 - PINMUX_DATA(SD_CD_MARK, PTC6_FN), 808 - PINMUX_DATA(SD_CLK_MARK, PTC5_FN), 809 - PINMUX_DATA(SD_CMD_MARK, PTC4_FN), 810 - PINMUX_DATA(SD_D3_MARK, PTC3_FN), 811 - PINMUX_DATA(SD_D2_MARK, PTC2_FN), 812 - PINMUX_DATA(SD_D1_MARK, PTC1_FN), 813 - PINMUX_DATA(SD_D0_MARK, PTC0_FN), 708 + PINMUX_DATA(IRQ7_MARK, PS0_7_FN1, PTC7_FN), 709 + PINMUX_DATA(PWMU0_MARK, PS0_7_FN2, PTC7_FN), 710 + PINMUX_DATA(IRQ6_MARK, PS0_6_FN1, PTC6_FN), 711 + PINMUX_DATA(PWMU1_MARK, PS0_6_FN2, PTC6_FN), 712 + PINMUX_DATA(IRQ5_MARK, PS0_5_FN1, PTC5_FN), 713 + PINMUX_DATA(PWMU2_MARK, PS0_5_FN2, PTC5_FN), 714 + PINMUX_DATA(IRQ4_MARK, PS0_4_FN1, PTC5_FN), 715 + PINMUX_DATA(PWMU3_MARK, PS0_4_FN2, PTC4_FN), 716 + PINMUX_DATA(IRQ3_MARK, PS0_3_FN1, PTC3_FN), 717 + PINMUX_DATA(PWMU4_MARK, PS0_3_FN2, PTC3_FN), 718 + PINMUX_DATA(IRQ2_MARK, PS0_2_FN1, PTC2_FN), 719 + PINMUX_DATA(PWMU5_MARK, PS0_2_FN2, PTC2_FN), 720 + PINMUX_DATA(IRQ1_MARK, PTC1_FN), 721 + PINMUX_DATA(IRQ0_MARK, PTC0_FN), 814 722 815 723 /* PTD FN */ 816 - PINMUX_DATA(IRQ7_MARK, PS1_7_FN1, PTD7_FN), 817 - PINMUX_DATA(ADTRG1_MARK, PS1_7_FN3, PTD7_FN), 818 - PINMUX_DATA(IRQ6_MARK, PS1_6_FN1, PTD6_FN), 819 - PINMUX_DATA(ADTRG0_MARK, PS1_6_FN3, PTD6_FN), 820 - PINMUX_DATA(IRQ5_MARK, PTD5_FN), 821 - PINMUX_DATA(IRQ4_MARK, PTD4_FN), 822 - PINMUX_DATA(IRQ3_MARK, PTD3_FN), 823 - PINMUX_DATA(IRQ2_MARK, PTD2_FN), 824 - PINMUX_DATA(IRQ1_MARK, PTD1_FN), 825 - PINMUX_DATA(IRQ0_MARK, PTD0_FN), 724 + PINMUX_DATA(SP0_MOSI_MARK, PTD7_FN), 725 + PINMUX_DATA(SP0_MISO_MARK, PTD6_FN), 726 + PINMUX_DATA(SP0_SCK_MARK, PTD5_FN), 727 + PINMUX_DATA(SP0_SCK_FB_MARK, PTD4_FN), 728 + PINMUX_DATA(SP0_SS0_MARK, PTD3_FN), 729 + PINMUX_DATA(SP0_SS1_MARK, PS1_10_FN1, PTD2_FN), 730 + PINMUX_DATA(DREQ0_MARK, PS1_10_FN2, PTD2_FN), 731 + PINMUX_DATA(SP0_SS2_MARK, PS1_9_FN1, PTD1_FN), 732 + PINMUX_DATA(DACK0_MARK, PS1_9_FN2, PTD1_FN), 733 + PINMUX_DATA(SP0_SS3_MARK, PS1_8_FN1, PTD0_FN), 734 + PINMUX_DATA(TEND0_MARK, PS1_8_FN2, PTD0_FN), 826 735 827 736 /* PTE FN */ 828 - PINMUX_DATA(ET0_CRS_DV_MARK, PTE7_FN), 829 - PINMUX_DATA(ET0_TXD1_MARK, PTE6_FN), 830 - PINMUX_DATA(ET0_TXD0_MARK, PTE5_FN), 831 - PINMUX_DATA(ET0_TX_EN_MARK, PTE4_FN), 832 - PINMUX_DATA(ET0_REF_CLK_MARK, PTE3_FN), 833 - PINMUX_DATA(ET0_RXD1_MARK, PTE2_FN), 834 - PINMUX_DATA(ET0_RXD0_MARK, PTE1_FN), 835 - PINMUX_DATA(ET0_RX_ER_MARK, PTE0_FN), 737 + PINMUX_DATA(RMII0_CRS_DV_MARK, PTE7_FN), 738 + PINMUX_DATA(RMII0_TXD1_MARK, PTE6_FN), 739 + PINMUX_DATA(RMII0_TXD0_MARK, PTE5_FN), 740 + PINMUX_DATA(RMII0_TXEN_MARK, PTE4_FN), 741 + PINMUX_DATA(RMII0_REFCLK_MARK, PTE3_FN), 742 + PINMUX_DATA(RMII0_RXD1_MARK, PTE2_FN), 743 + PINMUX_DATA(RMII0_RXD0_MARK, PTE1_FN), 744 + PINMUX_DATA(RMII0_RX_ER_MARK, PTE0_FN), 836 745 837 746 /* PTF FN */ 838 - PINMUX_DATA(ET1_CRS_DV_MARK, PTF7_FN), 839 - PINMUX_DATA(ET1_TXD1_MARK, PTF6_FN), 840 - PINMUX_DATA(ET1_TXD0_MARK, PTF5_FN), 841 - PINMUX_DATA(ET1_TX_EN_MARK, PTF4_FN), 842 - PINMUX_DATA(ET1_REF_CLK_MARK, PTF3_FN), 843 - PINMUX_DATA(ET1_RXD1_MARK, PTF2_FN), 844 - PINMUX_DATA(ET1_RXD0_MARK, PTF1_FN), 845 - PINMUX_DATA(ET1_RX_ER_MARK, PTF0_FN), 747 + PINMUX_DATA(RMII1_CRS_DV_MARK, PTF7_FN), 748 + PINMUX_DATA(RMII1_TXD1_MARK, PTF6_FN), 749 + PINMUX_DATA(RMII1_TXD0_MARK, PTF5_FN), 750 + PINMUX_DATA(RMII1_TXEN_MARK, PTF4_FN), 751 + PINMUX_DATA(RMII1_REFCLK_MARK, PTF3_FN), 752 + PINMUX_DATA(RMII1_RXD1_MARK, PS1_2_FN1, PTF2_FN), 753 + PINMUX_DATA(RAC_RI_MARK, PS1_2_FN2, PTF2_FN), 754 + PINMUX_DATA(RMII1_RXD0_MARK, PTF1_FN), 755 + PINMUX_DATA(RMII1_RX_ER_MARK, PTF0_FN), 846 756 847 757 /* PTG FN */ 848 - PINMUX_DATA(PWX0_MARK, PTG7_FN), 849 - PINMUX_DATA(PWX1_MARK, PTG6_FN), 850 - PINMUX_DATA(STATUS0_MARK, PS2_13_FN1, PTG5_FN), 851 - PINMUX_DATA(PWX2_MARK, PS2_13_FN3, PTG5_FN), 852 - PINMUX_DATA(STATUS1_MARK, PS2_12_FN1, PTG4_FN), 853 - PINMUX_DATA(PWX3_MARK, PS2_12_FN3, PTG4_FN), 758 + PINMUX_DATA(BOOTFMS_MARK, PTG7_FN), 759 + PINMUX_DATA(BOOTWP_MARK, PTG6_FN), 760 + PINMUX_DATA(A25_MARK, PS2_13_FN1, PTG5_FN), 761 + PINMUX_DATA(MMCCLK_MARK, PS2_13_FN2, PTG5_FN), 762 + PINMUX_DATA(A24_MARK, PS2_12_FN1, PTG4_FN), 763 + PINMUX_DATA(MMCCMD_MARK, PS2_12_FN2, PTG4_FN), 854 764 PINMUX_DATA(SERIRQ_MARK, PTG3_FN), 855 - PINMUX_DATA(CLKRUN_MARK, PTG2_FN), 765 + PINMUX_DATA(WDTOVF_MARK, PTG2_FN), 856 766 PINMUX_DATA(LPCPD_MARK, PTG1_FN), 857 767 PINMUX_DATA(LDRQ_MARK, PTG0_FN), 858 768 859 769 /* PTH FN */ 860 - PINMUX_DATA(SP1_MOSI_MARK, PTH7_FN), 861 - PINMUX_DATA(SP1_MISO_MARK, PTH6_FN), 862 - PINMUX_DATA(SP1_SCK_MARK, PTH5_FN), 863 - PINMUX_DATA(SP1_SCK_FB_MARK, PTH4_FN), 770 + PINMUX_DATA(SP1_MOSI_MARK, PS2_7_FN1, PTH7_FN), 771 + PINMUX_DATA(TEND1_MARK, PS2_7_FN2, PTH7_FN), 772 + PINMUX_DATA(SP1_MISO_MARK, PS2_6_FN1, PTH6_FN), 773 + PINMUX_DATA(DREQ1_MARK, PS2_6_FN2, PTH6_FN), 774 + PINMUX_DATA(SP1_SCK_MARK, PS2_5_FN1, PTH5_FN), 775 + PINMUX_DATA(DACK1_MARK, PS2_5_FN2, PTH5_FN), 776 + PINMUX_DATA(SP1_SCK_FB_MARK, PS2_4_FN1, PTH4_FN), 777 + PINMUX_DATA(ADTRG1_MARK, PS2_4_FN2, PTH4_FN), 864 778 PINMUX_DATA(SP1_SS0_MARK, PTH3_FN), 865 - PINMUX_DATA(TCLK_MARK, PTH2_FN), 866 - PINMUX_DATA(RXD4_MARK, PS2_1_FN1, PTH1_FN), 867 - PINMUX_DATA(SP1_SS1_MARK, PS2_1_FN2, PTH1_FN), 868 - PINMUX_DATA(TXD4_MARK, PS2_0_FN1, PTH0_FN), 869 - PINMUX_DATA(SP0_SS1_MARK, PS2_0_FN2, PTH0_FN), 779 + PINMUX_DATA(SP1_SS1_MARK, PS2_2_FN1, PTH2_FN), 780 + PINMUX_DATA(ADTRG0_MARK, PS2_2_FN2, PTH2_FN), 781 + PINMUX_DATA(WP_MARK, PTH1_FN), 782 + PINMUX_DATA(FMS0_MARK, PTH0_FN), 870 783 871 784 /* PTI FN */ 872 - PINMUX_DATA(IRQ15_MARK, PTI7_FN), 873 - PINMUX_DATA(IRQ14_MARK, PTI6_FN), 874 - PINMUX_DATA(IRQ13_MARK, PTI5_FN), 875 - PINMUX_DATA(IRQ12_MARK, PTI4_FN), 876 - PINMUX_DATA(IRQ11_MARK, PTI3_FN), 877 - PINMUX_DATA(IRQ10_MARK, PTI2_FN), 878 - PINMUX_DATA(IRQ9_MARK, PTI1_FN), 879 - PINMUX_DATA(IRQ8_MARK, PTI0_FN), 785 + PINMUX_DATA(D15_MARK, PS3_15_FN1, PTI7_FN), 786 + PINMUX_DATA(SD_WP_MARK, PS3_15_FN2, PTI7_FN), 787 + PINMUX_DATA(D14_MARK, PS3_14_FN1, PTI6_FN), 788 + PINMUX_DATA(SD_CD_MARK, PS3_14_FN2, PTI6_FN), 789 + PINMUX_DATA(D13_MARK, PS3_13_FN1, PTI5_FN), 790 + PINMUX_DATA(SD_CLK_MARK, PS3_13_FN2, PTI5_FN), 791 + PINMUX_DATA(D12_MARK, PS3_12_FN1, PTI4_FN), 792 + PINMUX_DATA(SD_CMD_MARK, PS3_12_FN2, PTI4_FN), 793 + PINMUX_DATA(D11_MARK, PS3_11_FN1, PTI3_FN), 794 + PINMUX_DATA(SD_D3_MARK, PS3_11_FN2, PTI3_FN), 795 + PINMUX_DATA(D10_MARK, PS3_10_FN1, PTI2_FN), 796 + PINMUX_DATA(SD_D2_MARK, PS3_10_FN2, PTI2_FN), 797 + PINMUX_DATA(D9_MARK, PS3_9_FN1, PTI1_FN), 798 + PINMUX_DATA(SD_D1_MARK, PS3_9_FN2, PTI1_FN), 799 + PINMUX_DATA(D8_MARK, PS3_8_FN1, PTI0_FN), 800 + PINMUX_DATA(SD_D0_MARK, PS3_8_FN2, PTI0_FN), 880 801 881 802 /* PTJ FN */ 882 - PINMUX_DATA(RXD3_MARK, PTJ7_FN), 883 - PINMUX_DATA(TXD3_MARK, PTJ6_FN), 884 - PINMUX_DATA(RXD2_MARK, PTJ5_FN), 885 - PINMUX_DATA(TXD2_MARK, PTJ4_FN), 886 - PINMUX_DATA(COM1_TXD_MARK, PTJ3_FN), 887 - PINMUX_DATA(COM1_RXD_MARK, PTJ2_FN), 888 - PINMUX_DATA(COM1_RTS_MARK, PTJ1_FN), 889 - PINMUX_DATA(COM1_CTS_MARK, PTJ0_FN), 803 + PINMUX_DATA(RTS3_MARK, PTJ6_FN), 804 + PINMUX_DATA(CTS3_MARK, PTJ5_FN), 805 + PINMUX_DATA(TXD3_MARK, PTJ4_FN), 806 + PINMUX_DATA(RXD3_MARK, PTJ3_FN), 807 + PINMUX_DATA(RTS4_MARK, PTJ2_FN), 808 + PINMUX_DATA(RXD4_MARK, PTJ1_FN), 809 + PINMUX_DATA(TXD4_MARK, PTJ0_FN), 890 810 891 811 /* PTK FN */ 892 - PINMUX_DATA(COM2_TXD_MARK, PTK7_FN), 812 + PINMUX_DATA(COM2_TXD_MARK, PS3_7_FN1, PTK7_FN), 813 + PINMUX_DATA(SCK2_MARK, PS3_7_FN2, PTK7_FN), 893 814 PINMUX_DATA(COM2_RXD_MARK, PTK6_FN), 894 815 PINMUX_DATA(COM2_RTS_MARK, PTK5_FN), 895 816 PINMUX_DATA(COM2_CTS_MARK, PTK4_FN), 896 817 PINMUX_DATA(COM2_DTR_MARK, PTK3_FN), 897 - PINMUX_DATA(COM2_DSR_MARK, PTK2_FN), 898 - PINMUX_DATA(COM2_DCD_MARK, PTK1_FN), 899 - PINMUX_DATA(COM2_RI_MARK, PTK0_FN), 818 + PINMUX_DATA(COM2_DSR_MARK, PS3_2_FN1, PTK2_FN), 819 + PINMUX_DATA(SCK4_MARK, PS3_2_FN2, PTK2_FN), 820 + PINMUX_DATA(COM2_DCD_MARK, PS3_1_FN1, PTK1_FN), 821 + PINMUX_DATA(SCK3_MARK, PS3_1_FN2, PTK1_FN), 822 + PINMUX_DATA(CLKOUT_MARK, PTK0_FN), 900 823 901 824 /* PTL FN */ 902 - PINMUX_DATA(RAC_TXD_MARK, PTL7_FN), 903 - PINMUX_DATA(RAC_RXD_MARK, PTL6_FN), 904 - PINMUX_DATA(RAC_RTS_MARK, PTL5_FN), 905 - PINMUX_DATA(RAC_CTS_MARK, PTL4_FN), 825 + PINMUX_DATA(RAC_RXD_MARK, PS4_14_FN1, PTL6_FN), 826 + PINMUX_DATA(RXD2_MARK, PS4_14_FN2, PTL6_FN), 827 + PINMUX_DATA(RAC_RTS_MARK, PS4_13_FN1, PTL5_FN), 828 + PINMUX_DATA(CS5_MARK, PS4_13_FN2, PTL5_FN), 829 + PINMUX_DATA(RAC_CTS_MARK, PS4_12_FN1, PTL4_FN), 830 + PINMUX_DATA(CS6_MARK, PS4_12_FN2, PTL4_FN), 906 831 PINMUX_DATA(RAC_DTR_MARK, PTL3_FN), 907 - PINMUX_DATA(RAC_DSR_MARK, PTL2_FN), 908 - PINMUX_DATA(RAC_DCD_MARK, PTL1_FN), 909 - PINMUX_DATA(RAC_RI_MARK, PTL0_FN), 832 + PINMUX_DATA(RAC_DSR_MARK, PS4_10_FN1, PTL2_FN), 833 + PINMUX_DATA(AUDSYNC_MARK, PS4_10_FN2, PTL2_FN), 834 + PINMUX_DATA(RAC_DCD_MARK, PS4_9_FN1, PTL1_FN), 835 + PINMUX_DATA(AUDCK_MARK, PS4_9_FN2, PTL1_FN), 836 + PINMUX_DATA(RAC_TXD_MARK, PS4_8_FN1, PTL0_FN), 837 + PINMUX_DATA(TXD2_MARK, PS4_8_FN1, PTL0_FN), 910 838 911 839 /* PTM FN */ 912 - PINMUX_DATA(WP_MARK, PTM6_FN), 913 - PINMUX_DATA(FMS0_MARK, PTM5_FN), 914 - PINMUX_DATA(FMS1_MARK, PTM4_FN), 840 + PINMUX_DATA(CS4_MARK, PTM7_FN), 841 + PINMUX_DATA(RD_MARK, PTM6_FN), 842 + PINMUX_DATA(WE0_MARK, PTM7_FN), 843 + PINMUX_DATA(CS0_MARK, PTM4_FN), 915 844 PINMUX_DATA(SDA6_MARK, PTM3_FN), 916 845 PINMUX_DATA(SCL6_MARK, PTM2_FN), 917 846 PINMUX_DATA(SDA7_MARK, PTM1_FN), 918 847 PINMUX_DATA(SCL7_MARK, PTM0_FN), 919 848 920 849 /* PTN FN */ 921 - PINMUX_DATA(SCK2_MARK, PS4_15_FN1, PTN7_FN), 922 - PINMUX_DATA(EVENT7_MARK, PS4_15_FN2, PTN7_FN), 923 - PINMUX_DATA(RTS4_MARK, PS4_14_FN1, PTN6_FN), 924 - PINMUX_DATA(EVENT6_MARK, PS4_14_FN2, PTN6_FN), 925 - PINMUX_DATA(RTS3_MARK, PS4_13_FN1, PTN5_FN), 926 - PINMUX_DATA(EVENT5_MARK, PS4_13_FN2, PTN5_FN), 927 - PINMUX_DATA(RTS2_MARK, PS4_12_FN1, PTN4_FN), 928 - PINMUX_DATA(EVENT4_MARK, PS4_12_FN2, PTN4_FN), 929 - PINMUX_DATA(CTS4_MARK, PS4_11_FN1, PTN3_FN), 930 - PINMUX_DATA(EVENT3_MARK, PS4_11_FN2, PTN3_FN), 931 - PINMUX_DATA(CTS3_MARK, PS4_10_FN1, PTN2_FN), 932 - PINMUX_DATA(EVENT2_MARK, PS4_10_FN2, PTN2_FN), 933 - PINMUX_DATA(CTS2_MARK, PS4_9_FN1, PTN1_FN), 934 - PINMUX_DATA(EVENT1_MARK, PS4_9_FN2, PTN1_FN), 935 - PINMUX_DATA(EVENT0_MARK, PTN0_FN), 850 + PINMUX_DATA(VBUS_EN_MARK, PTN6_FN), 851 + PINMUX_DATA(VBUS_OC_MARK, PTN5_FN), 852 + PINMUX_DATA(JMCTCK_MARK, PS4_4_FN1, PTN4_FN), 853 + PINMUX_DATA(SGPIO1_CLK_MARK, PS4_4_FN2, PTN4_FN), 854 + PINMUX_DATA(JMCTMS_MARK, PS4_3_FN1, PTN5_FN), 855 + PINMUX_DATA(SGPIO1_LOAD_MARK, PS4_3_FN2, PTN5_FN), 856 + PINMUX_DATA(JMCTDO_MARK, PS4_2_FN1, PTN2_FN), 857 + PINMUX_DATA(SGPIO1_DO_MARK, PS4_2_FN2, PTN2_FN), 858 + PINMUX_DATA(JMCTDI_MARK, PS4_1_FN1, PTN1_FN), 859 + PINMUX_DATA(SGPIO1_DI_MARK, PS4_1_FN2, PTN1_FN), 860 + PINMUX_DATA(JMCTRST_MARK, PS4_0_FN1, PTN0_FN), 861 + PINMUX_DATA(SUB_CLKIN_MARK, PS4_0_FN2, PTN0_FN), 936 862 937 863 /* PTO FN */ 938 864 PINMUX_DATA(SGPIO0_CLK_MARK, PTO7_FN), 939 865 PINMUX_DATA(SGPIO0_LOAD_MARK, PTO6_FN), 940 866 PINMUX_DATA(SGPIO0_DI_MARK, PTO5_FN), 941 867 PINMUX_DATA(SGPIO0_DO_MARK, PTO4_FN), 942 - PINMUX_DATA(SGPIO1_CLK_MARK, PTO3_FN), 943 - PINMUX_DATA(SGPIO1_LOAD_MARK, PTO2_FN), 944 - PINMUX_DATA(SGPIO1_DI_MARK, PTO1_FN), 945 - PINMUX_DATA(SGPIO1_DO_MARK, PTO0_FN), 868 + PINMUX_DATA(SGPIO2_CLK_MARK, PS5_11_FN1, PTO3_FN), 869 + PINMUX_DATA(COM1_TXD_MARK, PS5_11_FN2, PTO3_FN), 870 + PINMUX_DATA(SGPIO2_LOAD_MARK, PS5_10_FN1, PTO2_FN), 871 + PINMUX_DATA(COM1_RXD_MARK, PS5_10_FN2, PTO2_FN), 872 + PINMUX_DATA(SGPIO2_DI_MARK, PS5_9_FN1, PTO1_FN), 873 + PINMUX_DATA(COM1_RTS_MARK, PS5_9_FN2, PTO1_FN), 874 + PINMUX_DATA(SGPIO2_DO_MARK, PS5_8_FN1, PTO0_FN), 875 + PINMUX_DATA(COM1_CTS_MARK, PS5_8_FN2, PTO0_FN), 946 876 947 877 /* PTP FN */ 948 - PINMUX_DATA(JMCTCK_MARK, PTP6_FN), 949 - PINMUX_DATA(JMCTMS_MARK, PTP5_FN), 950 - PINMUX_DATA(JMCTDO_MARK, PTP4_FN), 951 - PINMUX_DATA(JMCTDI_MARK, PTP3_FN), 952 - PINMUX_DATA(JMCRST_MARK, PTP2_FN), 953 - PINMUX_DATA(SCK4_MARK, PTP1_FN), 954 - PINMUX_DATA(SCK3_MARK, PTP0_FN), 955 878 956 879 /* PTQ FN */ 957 880 PINMUX_DATA(LAD3_MARK, PTQ6_FN), ··· 977 864 PINMUX_DATA(LAD1_MARK, PTQ4_FN), 978 865 PINMUX_DATA(LAD0_MARK, PTQ3_FN), 979 866 PINMUX_DATA(LFRAME_MARK, PTQ2_FN), 980 - PINMUX_DATA(SCK4_MARK, PTQ1_FN), 981 - PINMUX_DATA(SCK3_MARK, PTQ0_FN), 867 + PINMUX_DATA(LRESET_MARK, PTQ1_FN), 868 + PINMUX_DATA(LCLK_MARK, PTQ0_FN), 982 869 983 870 /* PTR FN */ 984 871 PINMUX_DATA(SDA8_MARK, PTR7_FN), /* DDC3? */ ··· 1001 888 PINMUX_DATA(SCL3_MARK, PTS0_FN), 1002 889 1003 890 /* PTT FN */ 1004 - PINMUX_DATA(AUDSYNC_MARK, PTS5_FN), 1005 - PINMUX_DATA(AUDCK_MARK, PTS4_FN), 1006 - PINMUX_DATA(AUDATA3_MARK, PS4_3_FN1, PTS3_FN), 1007 - PINMUX_DATA(PWX7_MARK, PS4_3_FN2, PTS3_FN), 1008 - PINMUX_DATA(AUDATA2_MARK, PS4_2_FN1, PTS2_FN), 1009 - PINMUX_DATA(PWX6_MARK, PS4_2_FN2, PTS2_FN), 1010 - PINMUX_DATA(AUDATA1_MARK, PS4_1_FN1, PTS1_FN), 1011 - PINMUX_DATA(PWX5_MARK, PS4_1_FN2, PTS1_FN), 1012 - PINMUX_DATA(AUDATA0_MARK, PS4_0_FN1, PTS0_FN), 1013 - PINMUX_DATA(PWX4_MARK, PS4_0_FN2, PTS0_FN), 891 + PINMUX_DATA(PWMX7_MARK, PS5_7_FN1, PTT7_FN), 892 + PINMUX_DATA(AUDATA3_MARK, PS5_7_FN2, PTT7_FN), 893 + PINMUX_DATA(PWMX6_MARK, PS5_6_FN1, PTT6_FN), 894 + PINMUX_DATA(AUDATA2_MARK, PS5_6_FN2, PTT6_FN), 895 + PINMUX_DATA(PWMX5_MARK, PS5_5_FN1, PTT5_FN), 896 + PINMUX_DATA(AUDATA1_MARK, PS5_5_FN2, PTT5_FN), 897 + PINMUX_DATA(PWMX4_MARK, PS5_4_FN1, PTT4_FN), 898 + PINMUX_DATA(AUDATA0_MARK, PS5_4_FN2, PTT4_FN), 899 + PINMUX_DATA(PWMX3_MARK, PS5_3_FN1, PTT3_FN), 900 + PINMUX_DATA(STATUS1_MARK, PS5_3_FN2, PTT3_FN), 901 + PINMUX_DATA(PWMX2_MARK, PS5_2_FN1, PTT2_FN), 902 + PINMUX_DATA(STATUS0_MARK, PS5_2_FN2, PTT2_FN), 903 + PINMUX_DATA(PWMX1_MARK, PTT1_FN), 904 + PINMUX_DATA(PWMX0_MARK, PTT0_FN), 1014 905 1015 906 /* PTU FN */ 1016 - PINMUX_DATA(CS6_MARK, PTU7_FN), 1017 - PINMUX_DATA(CS5_MARK, PTU6_FN), 1018 - PINMUX_DATA(CS4_MARK, PTU5_FN), 1019 - PINMUX_DATA(CS0_MARK, PTU4_FN), 1020 - PINMUX_DATA(RD_MARK, PTU3_FN), 1021 - PINMUX_DATA(WE0_MARK, PTU2_FN), 1022 - PINMUX_DATA(A25_MARK, PS5_9_FN1, PTU1_FN), 1023 - PINMUX_DATA(DREQ0_MARK, PS5_9_FN2, PTU1_FN), 1024 - PINMUX_DATA(A24_MARK, PS5_8_FN1, PTU0_FN), 1025 - PINMUX_DATA(DACK0_MARK, PS5_8_FN2, PTU0_FN), 907 + PINMUX_DATA(LGPIO7_MARK, PS6_15_FN1, PTU7_FN), 908 + PINMUX_DATA(APMONCTL_O_MARK, PS6_15_FN2, PTU7_FN), 909 + PINMUX_DATA(LGPIO6_MARK, PS6_14_FN1, PTU6_FN), 910 + PINMUX_DATA(APMPWBTOUT_O_MARK, PS6_14_FN2, PTU6_FN), 911 + PINMUX_DATA(LGPIO5_MARK, PS6_13_FN1, PTU5_FN), 912 + PINMUX_DATA(APMSCI_O_MARK, PS6_13_FN2, PTU5_FN), 913 + PINMUX_DATA(LGPIO4_MARK, PS6_12_FN1, PTU4_FN), 914 + PINMUX_DATA(APMVDDON_MARK, PS6_12_FN2, PTU4_FN), 915 + PINMUX_DATA(LGPIO3_MARK, PS6_11_FN1, PTU3_FN), 916 + PINMUX_DATA(APMSLPBTN_MARK, PS6_11_FN2, PTU3_FN), 917 + PINMUX_DATA(LGPIO2_MARK, PS6_10_FN1, PTU2_FN), 918 + PINMUX_DATA(APMPWRBTN_MARK, PS6_10_FN2, PTU2_FN), 919 + PINMUX_DATA(LGPIO1_MARK, PS6_9_FN1, PTU1_FN), 920 + PINMUX_DATA(APMS5N_MARK, PS6_9_FN2, PTU1_FN), 921 + PINMUX_DATA(LGPIO0_MARK, PS6_8_FN1, PTU0_FN), 922 + PINMUX_DATA(APMS3N_MARK, PS6_8_FN2, PTU0_FN), 1026 923 1027 924 /* PTV FN */ 1028 - PINMUX_DATA(A23_MARK, PS5_7_FN1, PTV7_FN), 1029 - PINMUX_DATA(TEND0_MARK, PS5_7_FN2, PTV7_FN), 1030 - PINMUX_DATA(A22_MARK, PS5_6_FN1, PTV6_FN), 1031 - PINMUX_DATA(DREQ1_MARK, PS5_6_FN2, PTV6_FN), 1032 - PINMUX_DATA(A21_MARK, PS5_5_FN1, PTV5_FN), 1033 - PINMUX_DATA(DACK1_MARK, PS5_5_FN2, PTV5_FN), 1034 - PINMUX_DATA(A20_MARK, PS5_4_FN1, PTV4_FN), 1035 - PINMUX_DATA(TEND1_MARK, PS5_4_FN2, PTV4_FN), 1036 - PINMUX_DATA(A19_MARK, PTV3_FN), 1037 - PINMUX_DATA(A18_MARK, PTV2_FN), 1038 - PINMUX_DATA(A17_MARK, PTV1_FN), 1039 - PINMUX_DATA(A16_MARK, PTV0_FN), 925 + PINMUX_DATA(A23_MARK, PS6_7_FN1, PTV7_FN), 926 + PINMUX_DATA(COM2_RI_MARK, PS6_7_FN2, PTV7_FN), 927 + PINMUX_DATA(A22_MARK, PS6_6_FN1, PTV6_FN), 928 + PINMUX_DATA(R_SPI_MOSI_MARK, PS6_6_FN2, PTV6_FN), 929 + PINMUX_DATA(A21_MARK, PS6_5_FN1, PTV5_FN), 930 + PINMUX_DATA(R_SPI_MISO_MARK, PS6_5_FN2, PTV5_FN), 931 + PINMUX_DATA(A20_MARK, PS6_4_FN1, PTV4_FN), 932 + PINMUX_DATA(R_SPI_RSPCK_MARK, PS6_4_FN2, PTV4_FN), 933 + PINMUX_DATA(A19_MARK, PS6_3_FN1, PTV3_FN), 934 + PINMUX_DATA(R_SPI_SSL0_MARK, PS6_3_FN2, PTV3_FN), 935 + PINMUX_DATA(A18_MARK, PS6_2_FN1, PTV2_FN), 936 + PINMUX_DATA(R_SPI_SSL1_MARK, PS6_2_FN2, PTV2_FN), 937 + PINMUX_DATA(A17_MARK, PS6_1_FN1, PTV1_FN), 938 + PINMUX_DATA(EVENT7_MARK, PS6_1_FN2, PTV1_FN), 939 + PINMUX_DATA(A16_MARK, PS6_0_FN1, PTV0_FN), 940 + PINMUX_DATA(EVENT6_MARK, PS6_0_FN1, PTV0_FN), 1040 941 1041 942 /* PTW FN */ 1042 - PINMUX_DATA(A15_MARK, PTW7_FN), 1043 - PINMUX_DATA(A14_MARK, PTW6_FN), 1044 - PINMUX_DATA(A13_MARK, PTW5_FN), 1045 - PINMUX_DATA(A12_MARK, PTW4_FN), 1046 - PINMUX_DATA(A11_MARK, PTW3_FN), 1047 - PINMUX_DATA(A10_MARK, PTW2_FN), 1048 - PINMUX_DATA(A9_MARK, PTW1_FN), 1049 - PINMUX_DATA(A8_MARK, PTW0_FN), 943 + PINMUX_DATA(A15_MARK, PS7_15_FN1, PTW7_FN), 944 + PINMUX_DATA(EVENT5_MARK, PS7_15_FN2, PTW7_FN), 945 + PINMUX_DATA(A14_MARK, PS7_14_FN1, PTW6_FN), 946 + PINMUX_DATA(EVENT4_MARK, PS7_14_FN2, PTW6_FN), 947 + PINMUX_DATA(A13_MARK, PS7_13_FN1, PTW5_FN), 948 + PINMUX_DATA(EVENT3_MARK, PS7_13_FN2, PTW5_FN), 949 + PINMUX_DATA(A12_MARK, PS7_12_FN1, PTW4_FN), 950 + PINMUX_DATA(EVENT2_MARK, PS7_12_FN2, PTW4_FN), 951 + PINMUX_DATA(A11_MARK, PS7_11_FN1, PTW3_FN), 952 + PINMUX_DATA(EVENT1_MARK, PS7_11_FN2, PTW3_FN), 953 + PINMUX_DATA(A10_MARK, PS7_10_FN1, PTW2_FN), 954 + PINMUX_DATA(EVENT0_MARK, PS7_10_FN2, PTW2_FN), 955 + PINMUX_DATA(A9_MARK, PS7_9_FN1, PTW1_FN), 956 + PINMUX_DATA(CTS4_MARK, PS7_9_FN2, PTW1_FN), 957 + PINMUX_DATA(A8_MARK, PS7_8_FN1, PTW0_FN), 958 + PINMUX_DATA(CTS2_MARK, PS7_8_FN2, PTW0_FN), 1050 959 1051 960 /* PTX FN */ 1052 - PINMUX_DATA(A7_MARK, PTX7_FN), 1053 - PINMUX_DATA(A6_MARK, PTX6_FN), 1054 - PINMUX_DATA(A5_MARK, PTX5_FN), 1055 - PINMUX_DATA(A4_MARK, PTX4_FN), 961 + PINMUX_DATA(A7_MARK, PS7_7_FN1, PTX7_FN), 962 + PINMUX_DATA(RTS2_MARK, PS7_7_FN2, PTX7_FN), 963 + PINMUX_DATA(A6_MARK, PS7_6_FN1, PTX6_FN), 964 + PINMUX_DATA(SIM_D_MARK, PS7_6_FN2, PTX6_FN), 965 + PINMUX_DATA(A5_MARK, PS7_5_FN1, PTX5_FN), 966 + PINMUX_DATA(SIM_CLK_MARK, PS7_5_FN2, PTX5_FN), 967 + PINMUX_DATA(A4_MARK, PS7_4_FN1, PTX4_FN), 968 + PINMUX_DATA(SIM_RST_MARK, PS7_4_FN2, PTX4_FN), 1056 969 PINMUX_DATA(A3_MARK, PTX3_FN), 1057 970 PINMUX_DATA(A2_MARK, PTX2_FN), 1058 971 PINMUX_DATA(A1_MARK, PTX1_FN), ··· 1093 954 PINMUX_DATA(D2_MARK, PTY2_FN), 1094 955 PINMUX_DATA(D1_MARK, PTY1_FN), 1095 956 PINMUX_DATA(D0_MARK, PTY0_FN), 957 + 958 + /* PTZ FN */ 959 + PINMUX_DATA(MMCDAT7_MARK, PS8_15_FN1, PTZ7_FN), 960 + PINMUX_DATA(ON_DQ7_MARK, PS8_15_FN2, PTZ7_FN), 961 + PINMUX_DATA(MMCDAT6_MARK, PS8_14_FN1, PTZ6_FN), 962 + PINMUX_DATA(ON_DQ6_MARK, PS8_14_FN2, PTZ6_FN), 963 + PINMUX_DATA(MMCDAT5_MARK, PS8_13_FN1, PTZ5_FN), 964 + PINMUX_DATA(ON_DQ5_MARK, PS8_13_FN2, PTZ5_FN), 965 + PINMUX_DATA(MMCDAT4_MARK, PS8_12_FN1, PTZ4_FN), 966 + PINMUX_DATA(ON_DQ4_MARK, PS8_12_FN2, PTZ4_FN), 967 + PINMUX_DATA(MMCDAT3_MARK, PS8_11_FN1, PTZ3_FN), 968 + PINMUX_DATA(ON_DQ3_MARK, PS8_11_FN2, PTZ3_FN), 969 + PINMUX_DATA(MMCDAT2_MARK, PS8_10_FN1, PTZ2_FN), 970 + PINMUX_DATA(ON_DQ2_MARK, PS8_10_FN2, PTZ2_FN), 971 + PINMUX_DATA(MMCDAT1_MARK, PS8_9_FN1, PTZ1_FN), 972 + PINMUX_DATA(ON_DQ1_MARK, PS8_9_FN2, PTZ1_FN), 973 + PINMUX_DATA(MMCDAT0_MARK, PS8_8_FN1, PTZ0_FN), 974 + PINMUX_DATA(ON_DQ0_MARK, PS8_8_FN2, PTZ0_FN), 1096 975 }; 1097 976 1098 977 static struct pinmux_gpio pinmux_gpios[] = { ··· 1205 1048 PINMUX_GPIO(GPIO_PTI0, PTI0_DATA), 1206 1049 1207 1050 /* PTJ */ 1208 - PINMUX_GPIO(GPIO_PTJ7, PTJ7_DATA), 1209 1051 PINMUX_GPIO(GPIO_PTJ6, PTJ6_DATA), 1210 1052 PINMUX_GPIO(GPIO_PTJ5, PTJ5_DATA), 1211 1053 PINMUX_GPIO(GPIO_PTJ4, PTJ4_DATA), ··· 1224 1068 PINMUX_GPIO(GPIO_PTK0, PTK0_DATA), 1225 1069 1226 1070 /* PTL */ 1227 - PINMUX_GPIO(GPIO_PTL7, PTL7_DATA), 1228 1071 PINMUX_GPIO(GPIO_PTL6, PTL6_DATA), 1229 1072 PINMUX_GPIO(GPIO_PTL5, PTL5_DATA), 1230 1073 PINMUX_GPIO(GPIO_PTL4, PTL4_DATA), ··· 1233 1078 PINMUX_GPIO(GPIO_PTL0, PTL0_DATA), 1234 1079 1235 1080 /* PTM */ 1081 + PINMUX_GPIO(GPIO_PTM7, PTM7_DATA), 1236 1082 PINMUX_GPIO(GPIO_PTM6, PTM6_DATA), 1237 1083 PINMUX_GPIO(GPIO_PTM5, PTM5_DATA), 1238 1084 PINMUX_GPIO(GPIO_PTM4, PTM4_DATA), ··· 1243 1087 PINMUX_GPIO(GPIO_PTM0, PTM0_DATA), 1244 1088 1245 1089 /* PTN */ 1246 - PINMUX_GPIO(GPIO_PTN7, PTN7_DATA), 1247 1090 PINMUX_GPIO(GPIO_PTN6, PTN6_DATA), 1248 1091 PINMUX_GPIO(GPIO_PTN5, PTN5_DATA), 1249 1092 PINMUX_GPIO(GPIO_PTN4, PTN4_DATA), ··· 1262 1107 PINMUX_GPIO(GPIO_PTO0, PTO0_DATA), 1263 1108 1264 1109 /* PTP */ 1110 + PINMUX_GPIO(GPIO_PTP7, PTP7_DATA), 1265 1111 PINMUX_GPIO(GPIO_PTP6, PTP6_DATA), 1266 1112 PINMUX_GPIO(GPIO_PTP5, PTP5_DATA), 1267 1113 PINMUX_GPIO(GPIO_PTP4, PTP4_DATA), ··· 1301 1145 PINMUX_GPIO(GPIO_PTS0, PTS0_DATA), 1302 1146 1303 1147 /* PTT */ 1148 + PINMUX_GPIO(GPIO_PTT7, PTT7_DATA), 1149 + PINMUX_GPIO(GPIO_PTT6, PTT6_DATA), 1304 1150 PINMUX_GPIO(GPIO_PTT5, PTT5_DATA), 1305 1151 PINMUX_GPIO(GPIO_PTT4, PTT4_DATA), 1306 1152 PINMUX_GPIO(GPIO_PTT3, PTT3_DATA), ··· 1370 1212 PINMUX_GPIO(GPIO_PTZ1, PTZ1_DATA), 1371 1213 PINMUX_GPIO(GPIO_PTZ0, PTZ0_DATA), 1372 1214 1373 - /* PTA (mobule: LBSC, CPG, LPC) */ 1215 + /* PTA (mobule: LBSC, RGMII) */ 1374 1216 PINMUX_GPIO(GPIO_FN_BS, BS_MARK), 1375 1217 PINMUX_GPIO(GPIO_FN_RDWR, RDWR_MARK), 1376 1218 PINMUX_GPIO(GPIO_FN_WE1, WE1_MARK), 1377 1219 PINMUX_GPIO(GPIO_FN_RDY, RDY_MARK), 1378 - PINMUX_GPIO(GPIO_FN_MD10, MD10_MARK), 1379 - PINMUX_GPIO(GPIO_FN_MD9, MD9_MARK), 1380 - PINMUX_GPIO(GPIO_FN_MD8, MD8_MARK), 1381 - PINMUX_GPIO(GPIO_FN_LGPIO7, LGPIO7_MARK), 1382 - PINMUX_GPIO(GPIO_FN_LGPIO6, LGPIO6_MARK), 1383 - PINMUX_GPIO(GPIO_FN_LGPIO5, LGPIO5_MARK), 1384 - PINMUX_GPIO(GPIO_FN_LGPIO4, LGPIO4_MARK), 1385 - PINMUX_GPIO(GPIO_FN_LGPIO3, LGPIO3_MARK), 1386 - PINMUX_GPIO(GPIO_FN_LGPIO2, LGPIO2_MARK), 1387 - PINMUX_GPIO(GPIO_FN_LGPIO1, LGPIO1_MARK), 1388 - PINMUX_GPIO(GPIO_FN_LGPIO0, LGPIO0_MARK), 1220 + PINMUX_GPIO(GPIO_FN_ET0_MDC, ET0_MDC_MARK), 1221 + PINMUX_GPIO(GPIO_FN_ET0_MDIO, ET0_MDC_MARK), 1222 + PINMUX_GPIO(GPIO_FN_ET1_MDC, ET1_MDC_MARK), 1223 + PINMUX_GPIO(GPIO_FN_ET1_MDIO, ET1_MDC_MARK), 1389 1224 1390 - /* PTB (mobule: LBSC, EtherC, SIM, LPC) */ 1225 + /* PTB (mobule: INTC, ONFI, TMU) */ 1226 + PINMUX_GPIO(GPIO_FN_IRQ15, IRQ15_MARK), 1227 + PINMUX_GPIO(GPIO_FN_IRQ14, IRQ14_MARK), 1228 + PINMUX_GPIO(GPIO_FN_IRQ13, IRQ13_MARK), 1229 + PINMUX_GPIO(GPIO_FN_IRQ12, IRQ12_MARK), 1230 + PINMUX_GPIO(GPIO_FN_IRQ11, IRQ11_MARK), 1231 + PINMUX_GPIO(GPIO_FN_IRQ10, IRQ10_MARK), 1232 + PINMUX_GPIO(GPIO_FN_IRQ9, IRQ9_MARK), 1233 + PINMUX_GPIO(GPIO_FN_IRQ8, IRQ8_MARK), 1234 + PINMUX_GPIO(GPIO_FN_ON_NRE, ON_NRE_MARK), 1235 + PINMUX_GPIO(GPIO_FN_ON_NWE, ON_NWE_MARK), 1236 + PINMUX_GPIO(GPIO_FN_ON_NWP, ON_NWP_MARK), 1237 + PINMUX_GPIO(GPIO_FN_ON_NCE0, ON_NCE0_MARK), 1238 + PINMUX_GPIO(GPIO_FN_ON_R_B0, ON_R_B0_MARK), 1239 + PINMUX_GPIO(GPIO_FN_ON_ALE, ON_ALE_MARK), 1240 + PINMUX_GPIO(GPIO_FN_ON_CLE, ON_CLE_MARK), 1241 + PINMUX_GPIO(GPIO_FN_TCLK, TCLK_MARK), 1242 + 1243 + /* PTC (mobule: IRQ, PWMU) */ 1244 + PINMUX_GPIO(GPIO_FN_IRQ7, IRQ7_MARK), 1245 + PINMUX_GPIO(GPIO_FN_IRQ6, IRQ6_MARK), 1246 + PINMUX_GPIO(GPIO_FN_IRQ5, IRQ5_MARK), 1247 + PINMUX_GPIO(GPIO_FN_IRQ4, IRQ4_MARK), 1248 + PINMUX_GPIO(GPIO_FN_IRQ3, IRQ3_MARK), 1249 + PINMUX_GPIO(GPIO_FN_IRQ2, IRQ2_MARK), 1250 + PINMUX_GPIO(GPIO_FN_IRQ1, IRQ1_MARK), 1251 + PINMUX_GPIO(GPIO_FN_IRQ0, IRQ0_MARK), 1252 + PINMUX_GPIO(GPIO_FN_PWMU0, PWMU0_MARK), 1253 + PINMUX_GPIO(GPIO_FN_PWMU1, PWMU1_MARK), 1254 + PINMUX_GPIO(GPIO_FN_PWMU2, PWMU2_MARK), 1255 + PINMUX_GPIO(GPIO_FN_PWMU3, PWMU3_MARK), 1256 + PINMUX_GPIO(GPIO_FN_PWMU4, PWMU4_MARK), 1257 + PINMUX_GPIO(GPIO_FN_PWMU5, PWMU5_MARK), 1258 + 1259 + /* PTD (mobule: SPI0, DMAC) */ 1260 + PINMUX_GPIO(GPIO_FN_SP0_MOSI, SP0_MOSI_MARK), 1261 + PINMUX_GPIO(GPIO_FN_SP0_MISO, SP0_MISO_MARK), 1262 + PINMUX_GPIO(GPIO_FN_SP0_SCK, SP0_SCK_MARK), 1263 + PINMUX_GPIO(GPIO_FN_SP0_SCK_FB, SP0_SCK_FB_MARK), 1264 + PINMUX_GPIO(GPIO_FN_SP0_SS0, SP0_SS0_MARK), 1265 + PINMUX_GPIO(GPIO_FN_SP0_SS1, SP0_SS1_MARK), 1266 + PINMUX_GPIO(GPIO_FN_SP0_SS2, SP0_SS2_MARK), 1267 + PINMUX_GPIO(GPIO_FN_SP0_SS3, SP0_SS3_MARK), 1268 + PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK), 1269 + PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK), 1270 + PINMUX_GPIO(GPIO_FN_TEND0, TEND0_MARK), 1271 + 1272 + /* PTE (mobule: RMII) */ 1273 + PINMUX_GPIO(GPIO_FN_RMII0_CRS_DV, RMII0_CRS_DV_MARK), 1274 + PINMUX_GPIO(GPIO_FN_RMII0_TXD1, RMII0_TXD1_MARK), 1275 + PINMUX_GPIO(GPIO_FN_RMII0_TXD0, RMII0_TXD0_MARK), 1276 + PINMUX_GPIO(GPIO_FN_RMII0_TXEN, RMII0_TXEN_MARK), 1277 + PINMUX_GPIO(GPIO_FN_RMII0_REFCLK, RMII0_REFCLK_MARK), 1278 + PINMUX_GPIO(GPIO_FN_RMII0_RXD1, RMII0_RXD1_MARK), 1279 + PINMUX_GPIO(GPIO_FN_RMII0_RXD0, RMII0_RXD0_MARK), 1280 + PINMUX_GPIO(GPIO_FN_RMII0_RX_ER, RMII0_RX_ER_MARK), 1281 + 1282 + /* PTF (mobule: RMII, SerMux) */ 1283 + PINMUX_GPIO(GPIO_FN_RMII1_CRS_DV, RMII1_CRS_DV_MARK), 1284 + PINMUX_GPIO(GPIO_FN_RMII1_TXD1, RMII1_TXD1_MARK), 1285 + PINMUX_GPIO(GPIO_FN_RMII1_TXD0, RMII1_TXD0_MARK), 1286 + PINMUX_GPIO(GPIO_FN_RMII1_TXEN, RMII1_TXEN_MARK), 1287 + PINMUX_GPIO(GPIO_FN_RMII1_REFCLK, RMII1_REFCLK_MARK), 1288 + PINMUX_GPIO(GPIO_FN_RMII1_RXD1, RMII1_RXD1_MARK), 1289 + PINMUX_GPIO(GPIO_FN_RMII1_RXD0, RMII1_RXD0_MARK), 1290 + PINMUX_GPIO(GPIO_FN_RMII1_RX_ER, RMII1_RX_ER_MARK), 1291 + PINMUX_GPIO(GPIO_FN_RAC_RI, RAC_RI_MARK), 1292 + 1293 + /* PTG (mobule: system, LBSC, LPC, WDT, LPC, eMMC) */ 1294 + PINMUX_GPIO(GPIO_FN_BOOTFMS, BOOTFMS_MARK), 1295 + PINMUX_GPIO(GPIO_FN_BOOTWP, BOOTWP_MARK), 1296 + PINMUX_GPIO(GPIO_FN_A25, A25_MARK), 1297 + PINMUX_GPIO(GPIO_FN_A24, A24_MARK), 1298 + PINMUX_GPIO(GPIO_FN_SERIRQ, SERIRQ_MARK), 1299 + PINMUX_GPIO(GPIO_FN_WDTOVF, WDTOVF_MARK), 1300 + PINMUX_GPIO(GPIO_FN_LPCPD, LPCPD_MARK), 1301 + PINMUX_GPIO(GPIO_FN_LDRQ, LDRQ_MARK), 1302 + PINMUX_GPIO(GPIO_FN_MMCCLK, MMCCLK_MARK), 1303 + PINMUX_GPIO(GPIO_FN_MMCCMD, MMCCMD_MARK), 1304 + 1305 + /* PTH (mobule: SPI1, LPC, DMAC, ADC) */ 1306 + PINMUX_GPIO(GPIO_FN_SP1_MOSI, SP1_MOSI_MARK), 1307 + PINMUX_GPIO(GPIO_FN_SP1_MISO, SP1_MISO_MARK), 1308 + PINMUX_GPIO(GPIO_FN_SP1_SCK, SP1_SCK_MARK), 1309 + PINMUX_GPIO(GPIO_FN_SP1_SCK_FB, SP1_SCK_FB_MARK), 1310 + PINMUX_GPIO(GPIO_FN_SP1_SS0, SP1_SS0_MARK), 1311 + PINMUX_GPIO(GPIO_FN_SP1_SS1, SP1_SS1_MARK), 1312 + PINMUX_GPIO(GPIO_FN_WP, WP_MARK), 1313 + PINMUX_GPIO(GPIO_FN_FMS0, FMS0_MARK), 1314 + PINMUX_GPIO(GPIO_FN_TEND1, TEND1_MARK), 1315 + PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK), 1316 + PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK), 1317 + PINMUX_GPIO(GPIO_FN_ADTRG1, ADTRG1_MARK), 1318 + PINMUX_GPIO(GPIO_FN_ADTRG0, ADTRG0_MARK), 1319 + 1320 + /* PTI (mobule: LBSC, SDHI) */ 1391 1321 PINMUX_GPIO(GPIO_FN_D15, D15_MARK), 1392 1322 PINMUX_GPIO(GPIO_FN_D14, D14_MARK), 1393 1323 PINMUX_GPIO(GPIO_FN_D13, D13_MARK), ··· 1484 1238 PINMUX_GPIO(GPIO_FN_D10, D10_MARK), 1485 1239 PINMUX_GPIO(GPIO_FN_D9, D9_MARK), 1486 1240 PINMUX_GPIO(GPIO_FN_D8, D8_MARK), 1487 - PINMUX_GPIO(GPIO_FN_ET0_MDC, ET0_MDC_MARK), 1488 - PINMUX_GPIO(GPIO_FN_ET0_MDIO, ET0_MDIO_MARK), 1489 - PINMUX_GPIO(GPIO_FN_ET1_MDC, ET1_MDC_MARK), 1490 - PINMUX_GPIO(GPIO_FN_ET1_MDIO, ET1_MDIO_MARK), 1491 - PINMUX_GPIO(GPIO_FN_WPSZ1, WPSZ1_MARK), 1492 - PINMUX_GPIO(GPIO_FN_WPSZ0, WPSZ0_MARK), 1493 - PINMUX_GPIO(GPIO_FN_FWID, FWID_MARK), 1494 - PINMUX_GPIO(GPIO_FN_FLSHSZ, FLSHSZ_MARK), 1495 - PINMUX_GPIO(GPIO_FN_LPC_SPIEN, LPC_SPIEN_MARK), 1496 - PINMUX_GPIO(GPIO_FN_BASEL, BASEL_MARK), 1497 - 1498 - /* PTC (mobule: SD) */ 1499 1241 PINMUX_GPIO(GPIO_FN_SD_WP, SD_WP_MARK), 1500 1242 PINMUX_GPIO(GPIO_FN_SD_CD, SD_CD_MARK), 1501 1243 PINMUX_GPIO(GPIO_FN_SD_CLK, SD_CLK_MARK), ··· 1493 1259 PINMUX_GPIO(GPIO_FN_SD_D1, SD_D1_MARK), 1494 1260 PINMUX_GPIO(GPIO_FN_SD_D0, SD_D0_MARK), 1495 1261 1496 - /* PTD (mobule: INTC, SPI0, LBSC, CPG, ADC) */ 1497 - PINMUX_GPIO(GPIO_FN_IRQ7, IRQ7_MARK), 1498 - PINMUX_GPIO(GPIO_FN_IRQ6, IRQ6_MARK), 1499 - PINMUX_GPIO(GPIO_FN_IRQ5, IRQ5_MARK), 1500 - PINMUX_GPIO(GPIO_FN_IRQ4, IRQ4_MARK), 1501 - PINMUX_GPIO(GPIO_FN_IRQ3, IRQ3_MARK), 1502 - PINMUX_GPIO(GPIO_FN_IRQ2, IRQ2_MARK), 1503 - PINMUX_GPIO(GPIO_FN_IRQ1, IRQ1_MARK), 1504 - PINMUX_GPIO(GPIO_FN_IRQ0, IRQ0_MARK), 1505 - PINMUX_GPIO(GPIO_FN_MD6, MD6_MARK), 1506 - PINMUX_GPIO(GPIO_FN_MD5, MD5_MARK), 1507 - PINMUX_GPIO(GPIO_FN_MD3, MD3_MARK), 1508 - PINMUX_GPIO(GPIO_FN_MD2, MD2_MARK), 1509 - PINMUX_GPIO(GPIO_FN_MD1, MD1_MARK), 1510 - PINMUX_GPIO(GPIO_FN_MD0, MD0_MARK), 1511 - PINMUX_GPIO(GPIO_FN_ADTRG1, ADTRG1_MARK), 1512 - PINMUX_GPIO(GPIO_FN_ADTRG0, ADTRG0_MARK), 1513 - 1514 - /* PTE (mobule: EtherC) */ 1515 - PINMUX_GPIO(GPIO_FN_ET0_CRS_DV, ET0_CRS_DV_MARK), 1516 - PINMUX_GPIO(GPIO_FN_ET0_TXD1, ET0_TXD1_MARK), 1517 - PINMUX_GPIO(GPIO_FN_ET0_TXD0, ET0_TXD0_MARK), 1518 - PINMUX_GPIO(GPIO_FN_ET0_TX_EN, ET0_TX_EN_MARK), 1519 - PINMUX_GPIO(GPIO_FN_ET0_REF_CLK, ET0_REF_CLK_MARK), 1520 - PINMUX_GPIO(GPIO_FN_ET0_RXD1, ET0_RXD1_MARK), 1521 - PINMUX_GPIO(GPIO_FN_ET0_RXD0, ET0_RXD0_MARK), 1522 - PINMUX_GPIO(GPIO_FN_ET0_RX_ER, ET0_RX_ER_MARK), 1523 - 1524 - /* PTF (mobule: EtherC) */ 1525 - PINMUX_GPIO(GPIO_FN_ET1_CRS_DV, ET1_CRS_DV_MARK), 1526 - PINMUX_GPIO(GPIO_FN_ET1_TXD1, ET1_TXD1_MARK), 1527 - PINMUX_GPIO(GPIO_FN_ET1_TXD0, ET1_TXD0_MARK), 1528 - PINMUX_GPIO(GPIO_FN_ET1_TX_EN, ET1_TX_EN_MARK), 1529 - PINMUX_GPIO(GPIO_FN_ET1_REF_CLK, ET1_REF_CLK_MARK), 1530 - PINMUX_GPIO(GPIO_FN_ET1_RXD1, ET1_RXD1_MARK), 1531 - PINMUX_GPIO(GPIO_FN_ET1_RXD0, ET1_RXD0_MARK), 1532 - PINMUX_GPIO(GPIO_FN_ET1_RX_ER, ET1_RX_ER_MARK), 1533 - 1534 - /* PTG (mobule: SYSTEM, PWMX, LPC) */ 1535 - PINMUX_GPIO(GPIO_FN_STATUS0, STATUS0_MARK), 1536 - PINMUX_GPIO(GPIO_FN_STATUS1, STATUS1_MARK), 1537 - PINMUX_GPIO(GPIO_FN_PWX0, PWX0_MARK), 1538 - PINMUX_GPIO(GPIO_FN_PWX1, PWX1_MARK), 1539 - PINMUX_GPIO(GPIO_FN_PWX2, PWX2_MARK), 1540 - PINMUX_GPIO(GPIO_FN_PWX3, PWX3_MARK), 1541 - PINMUX_GPIO(GPIO_FN_SERIRQ, SERIRQ_MARK), 1542 - PINMUX_GPIO(GPIO_FN_CLKRUN, CLKRUN_MARK), 1543 - PINMUX_GPIO(GPIO_FN_LPCPD, LPCPD_MARK), 1544 - PINMUX_GPIO(GPIO_FN_LDRQ, LDRQ_MARK), 1545 - 1546 - /* PTH (mobule: TMU, SCIF234, SPI1, SPI0) */ 1547 - PINMUX_GPIO(GPIO_FN_TCLK, TCLK_MARK), 1262 + /* PTJ (mobule: SCIF234, SERMUX) */ 1263 + PINMUX_GPIO(GPIO_FN_RTS3, RTS3_MARK), 1264 + PINMUX_GPIO(GPIO_FN_CTS3, CTS3_MARK), 1265 + PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK), 1266 + PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK), 1267 + PINMUX_GPIO(GPIO_FN_RTS4, RTS4_MARK), 1548 1268 PINMUX_GPIO(GPIO_FN_RXD4, RXD4_MARK), 1549 1269 PINMUX_GPIO(GPIO_FN_TXD4, TXD4_MARK), 1550 - PINMUX_GPIO(GPIO_FN_SP1_MOSI, SP1_MOSI_MARK), 1551 - PINMUX_GPIO(GPIO_FN_SP1_MISO, SP1_MISO_MARK), 1552 - PINMUX_GPIO(GPIO_FN_SP1_SCK, SP1_SCK_MARK), 1553 - PINMUX_GPIO(GPIO_FN_SP1_SCK_FB, SP1_SCK_FB_MARK), 1554 - PINMUX_GPIO(GPIO_FN_SP1_SS0, SP1_SS0_MARK), 1555 - PINMUX_GPIO(GPIO_FN_SP1_SS1, SP1_SS1_MARK), 1556 - PINMUX_GPIO(GPIO_FN_SP0_SS1, SP0_SS1_MARK), 1557 1270 1558 - /* PTI (mobule: INTC) */ 1559 - PINMUX_GPIO(GPIO_FN_IRQ15, IRQ15_MARK), 1560 - PINMUX_GPIO(GPIO_FN_IRQ14, IRQ14_MARK), 1561 - PINMUX_GPIO(GPIO_FN_IRQ13, IRQ13_MARK), 1562 - PINMUX_GPIO(GPIO_FN_IRQ12, IRQ12_MARK), 1563 - PINMUX_GPIO(GPIO_FN_IRQ11, IRQ11_MARK), 1564 - PINMUX_GPIO(GPIO_FN_IRQ10, IRQ10_MARK), 1565 - PINMUX_GPIO(GPIO_FN_IRQ9, IRQ9_MARK), 1566 - PINMUX_GPIO(GPIO_FN_IRQ8, IRQ8_MARK), 1567 - 1568 - /* PTJ (mobule: SCIF234, SERMUX) */ 1569 - PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK), 1570 - PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK), 1571 - PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK), 1572 - PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK), 1573 - PINMUX_GPIO(GPIO_FN_COM1_TXD, COM1_TXD_MARK), 1574 - PINMUX_GPIO(GPIO_FN_COM1_RXD, COM1_RXD_MARK), 1575 - PINMUX_GPIO(GPIO_FN_COM1_RTS, COM1_RTS_MARK), 1576 - PINMUX_GPIO(GPIO_FN_COM1_CTS, COM1_CTS_MARK), 1577 - 1578 - /* PTK (mobule: SERMUX) */ 1271 + /* PTK (mobule: SERMUX, LBSC, SCIF) */ 1579 1272 PINMUX_GPIO(GPIO_FN_COM2_TXD, COM2_TXD_MARK), 1580 1273 PINMUX_GPIO(GPIO_FN_COM2_RXD, COM2_RXD_MARK), 1581 1274 PINMUX_GPIO(GPIO_FN_COM2_RTS, COM2_RTS_MARK), ··· 1510 1349 PINMUX_GPIO(GPIO_FN_COM2_DTR, COM2_DTR_MARK), 1511 1350 PINMUX_GPIO(GPIO_FN_COM2_DSR, COM2_DSR_MARK), 1512 1351 PINMUX_GPIO(GPIO_FN_COM2_DCD, COM2_DCD_MARK), 1513 - PINMUX_GPIO(GPIO_FN_COM2_RI, COM2_RI_MARK), 1352 + PINMUX_GPIO(GPIO_FN_CLKOUT, CLKOUT_MARK), 1353 + PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK), 1354 + PINMUX_GPIO(GPIO_FN_SCK4, SCK4_MARK), 1355 + PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK), 1514 1356 1515 - /* PTL (mobule: SERMUX) */ 1516 - PINMUX_GPIO(GPIO_FN_RAC_TXD, RAC_TXD_MARK), 1357 + /* PTL (mobule: SERMUX, SCIF, LBSC, AUD) */ 1517 1358 PINMUX_GPIO(GPIO_FN_RAC_RXD, RAC_RXD_MARK), 1518 1359 PINMUX_GPIO(GPIO_FN_RAC_RTS, RAC_RTS_MARK), 1519 1360 PINMUX_GPIO(GPIO_FN_RAC_CTS, RAC_CTS_MARK), 1520 1361 PINMUX_GPIO(GPIO_FN_RAC_DTR, RAC_DTR_MARK), 1521 1362 PINMUX_GPIO(GPIO_FN_RAC_DSR, RAC_DSR_MARK), 1522 1363 PINMUX_GPIO(GPIO_FN_RAC_DCD, RAC_DCD_MARK), 1523 - PINMUX_GPIO(GPIO_FN_RAC_RI, RAC_RI_MARK), 1364 + PINMUX_GPIO(GPIO_FN_RAC_TXD, RAC_TXD_MARK), 1365 + PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK), 1366 + PINMUX_GPIO(GPIO_FN_CS5, CS5_MARK), 1367 + PINMUX_GPIO(GPIO_FN_CS6, CS6_MARK), 1368 + PINMUX_GPIO(GPIO_FN_AUDSYNC, AUDSYNC_MARK), 1369 + PINMUX_GPIO(GPIO_FN_AUDCK, AUDCK_MARK), 1370 + PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK), 1524 1371 1525 - /* PTM (mobule: IIC, LPC) */ 1372 + /* PTM (mobule: LBSC, IIC) */ 1373 + PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK), 1374 + PINMUX_GPIO(GPIO_FN_RD, RD_MARK), 1375 + PINMUX_GPIO(GPIO_FN_WE0, WE0_MARK), 1376 + PINMUX_GPIO(GPIO_FN_CS0, CS0_MARK), 1526 1377 PINMUX_GPIO(GPIO_FN_SDA6, SDA6_MARK), 1527 1378 PINMUX_GPIO(GPIO_FN_SCL6, SCL6_MARK), 1528 1379 PINMUX_GPIO(GPIO_FN_SDA7, SDA7_MARK), 1529 1380 PINMUX_GPIO(GPIO_FN_SCL7, SCL7_MARK), 1530 - PINMUX_GPIO(GPIO_FN_WP, WP_MARK), 1531 - PINMUX_GPIO(GPIO_FN_FMS0, FMS0_MARK), 1532 - PINMUX_GPIO(GPIO_FN_FMS1, FMS1_MARK), 1533 1381 1534 - /* PTN (mobule: SCIF234, EVC) */ 1535 - PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK), 1536 - PINMUX_GPIO(GPIO_FN_RTS4, RTS4_MARK), 1537 - PINMUX_GPIO(GPIO_FN_RTS3, RTS3_MARK), 1538 - PINMUX_GPIO(GPIO_FN_RTS2, RTS2_MARK), 1539 - PINMUX_GPIO(GPIO_FN_CTS4, CTS4_MARK), 1540 - PINMUX_GPIO(GPIO_FN_CTS3, CTS3_MARK), 1541 - PINMUX_GPIO(GPIO_FN_CTS2, CTS2_MARK), 1542 - PINMUX_GPIO(GPIO_FN_EVENT7, EVENT7_MARK), 1543 - PINMUX_GPIO(GPIO_FN_EVENT6, EVENT6_MARK), 1544 - PINMUX_GPIO(GPIO_FN_EVENT5, EVENT5_MARK), 1545 - PINMUX_GPIO(GPIO_FN_EVENT4, EVENT4_MARK), 1546 - PINMUX_GPIO(GPIO_FN_EVENT3, EVENT3_MARK), 1547 - PINMUX_GPIO(GPIO_FN_EVENT2, EVENT2_MARK), 1548 - PINMUX_GPIO(GPIO_FN_EVENT1, EVENT1_MARK), 1549 - PINMUX_GPIO(GPIO_FN_EVENT0, EVENT0_MARK), 1550 - 1551 - /* PTO (mobule: SGPIO) */ 1552 - PINMUX_GPIO(GPIO_FN_SGPIO0_CLK, SGPIO0_CLK_MARK), 1553 - PINMUX_GPIO(GPIO_FN_SGPIO0_LOAD, SGPIO0_LOAD_MARK), 1554 - PINMUX_GPIO(GPIO_FN_SGPIO0_DI, SGPIO0_DI_MARK), 1555 - PINMUX_GPIO(GPIO_FN_SGPIO0_DO, SGPIO0_DO_MARK), 1556 - PINMUX_GPIO(GPIO_FN_SGPIO1_CLK, SGPIO1_CLK_MARK), 1557 - PINMUX_GPIO(GPIO_FN_SGPIO1_LOAD, SGPIO1_LOAD_MARK), 1558 - PINMUX_GPIO(GPIO_FN_SGPIO1_DI, SGPIO1_DI_MARK), 1559 - PINMUX_GPIO(GPIO_FN_SGPIO1_DO, SGPIO1_DO_MARK), 1560 - 1561 - /* PTP (mobule: JMC, SCIF234) */ 1382 + /* PTN (mobule: USB, JMC, SGPIO, WDT) */ 1383 + PINMUX_GPIO(GPIO_FN_VBUS_EN, VBUS_EN_MARK), 1384 + PINMUX_GPIO(GPIO_FN_VBUS_OC, VBUS_OC_MARK), 1562 1385 PINMUX_GPIO(GPIO_FN_JMCTCK, JMCTCK_MARK), 1563 1386 PINMUX_GPIO(GPIO_FN_JMCTMS, JMCTMS_MARK), 1564 1387 PINMUX_GPIO(GPIO_FN_JMCTDO, JMCTDO_MARK), 1565 1388 PINMUX_GPIO(GPIO_FN_JMCTDI, JMCTDI_MARK), 1566 - PINMUX_GPIO(GPIO_FN_JMCRST, JMCRST_MARK), 1567 - PINMUX_GPIO(GPIO_FN_SCK4, SCK4_MARK), 1568 - PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK), 1389 + PINMUX_GPIO(GPIO_FN_JMCTRST, JMCTRST_MARK), 1390 + PINMUX_GPIO(GPIO_FN_SGPIO1_CLK, SGPIO1_CLK_MARK), 1391 + PINMUX_GPIO(GPIO_FN_SGPIO1_LOAD, SGPIO1_LOAD_MARK), 1392 + PINMUX_GPIO(GPIO_FN_SGPIO1_DI, SGPIO1_DI_MARK), 1393 + PINMUX_GPIO(GPIO_FN_SGPIO1_DO, SGPIO1_DO_MARK), 1394 + PINMUX_GPIO(GPIO_FN_SUB_CLKIN, SUB_CLKIN_MARK), 1395 + 1396 + /* PTO (mobule: SGPIO, SerMux) */ 1397 + PINMUX_GPIO(GPIO_FN_SGPIO0_CLK, SGPIO0_CLK_MARK), 1398 + PINMUX_GPIO(GPIO_FN_SGPIO0_LOAD, SGPIO0_LOAD_MARK), 1399 + PINMUX_GPIO(GPIO_FN_SGPIO0_DI, SGPIO0_DI_MARK), 1400 + PINMUX_GPIO(GPIO_FN_SGPIO0_DO, SGPIO0_DO_MARK), 1401 + PINMUX_GPIO(GPIO_FN_SGPIO2_CLK, SGPIO2_CLK_MARK), 1402 + PINMUX_GPIO(GPIO_FN_SGPIO2_LOAD, SGPIO2_LOAD_MARK), 1403 + PINMUX_GPIO(GPIO_FN_SGPIO2_DI, SGPIO2_DI_MARK), 1404 + PINMUX_GPIO(GPIO_FN_SGPIO2_DO, SGPIO2_DO_MARK), 1405 + PINMUX_GPIO(GPIO_FN_COM1_TXD, COM1_TXD_MARK), 1406 + PINMUX_GPIO(GPIO_FN_COM1_RXD, COM1_RXD_MARK), 1407 + PINMUX_GPIO(GPIO_FN_COM1_RTS, COM1_RTS_MARK), 1408 + PINMUX_GPIO(GPIO_FN_COM1_CTS, COM1_CTS_MARK), 1409 + 1410 + /* PTP (mobule: EVC, ADC) */ 1569 1411 1570 1412 /* PTQ (mobule: LPC) */ 1571 1413 PINMUX_GPIO(GPIO_FN_LAD3, LAD3_MARK), ··· 1603 1439 PINMUX_GPIO(GPIO_FN_SDA3, SDA3_MARK), 1604 1440 PINMUX_GPIO(GPIO_FN_SCL3, SCL3_MARK), 1605 1441 1606 - /* PTT (mobule: SYSTEM, PWMX) */ 1607 - PINMUX_GPIO(GPIO_FN_AUDSYNC, AUDSYNC_MARK), 1608 - PINMUX_GPIO(GPIO_FN_AUDCK, AUDCK_MARK), 1442 + /* PTT (mobule: PWMX, AUD) */ 1443 + PINMUX_GPIO(GPIO_FN_PWMX7, PWMX7_MARK), 1444 + PINMUX_GPIO(GPIO_FN_PWMX6, PWMX6_MARK), 1445 + PINMUX_GPIO(GPIO_FN_PWMX5, PWMX5_MARK), 1446 + PINMUX_GPIO(GPIO_FN_PWMX4, PWMX4_MARK), 1447 + PINMUX_GPIO(GPIO_FN_PWMX3, PWMX3_MARK), 1448 + PINMUX_GPIO(GPIO_FN_PWMX2, PWMX2_MARK), 1449 + PINMUX_GPIO(GPIO_FN_PWMX1, PWMX1_MARK), 1450 + PINMUX_GPIO(GPIO_FN_PWMX0, PWMX0_MARK), 1609 1451 PINMUX_GPIO(GPIO_FN_AUDATA3, AUDATA3_MARK), 1610 1452 PINMUX_GPIO(GPIO_FN_AUDATA2, AUDATA2_MARK), 1611 1453 PINMUX_GPIO(GPIO_FN_AUDATA1, AUDATA1_MARK), 1612 1454 PINMUX_GPIO(GPIO_FN_AUDATA0, AUDATA0_MARK), 1613 - PINMUX_GPIO(GPIO_FN_PWX7, PWX7_MARK), 1614 - PINMUX_GPIO(GPIO_FN_PWX6, PWX6_MARK), 1615 - PINMUX_GPIO(GPIO_FN_PWX5, PWX5_MARK), 1616 - PINMUX_GPIO(GPIO_FN_PWX4, PWX4_MARK), 1455 + PINMUX_GPIO(GPIO_FN_STATUS1, STATUS1_MARK), 1456 + PINMUX_GPIO(GPIO_FN_STATUS0, STATUS0_MARK), 1617 1457 1618 - /* PTU (mobule: LBSC, DMAC) */ 1619 - PINMUX_GPIO(GPIO_FN_CS6, CS6_MARK), 1620 - PINMUX_GPIO(GPIO_FN_CS5, CS5_MARK), 1621 - PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK), 1622 - PINMUX_GPIO(GPIO_FN_CS0, CS0_MARK), 1623 - PINMUX_GPIO(GPIO_FN_RD, RD_MARK), 1624 - PINMUX_GPIO(GPIO_FN_WE0, WE0_MARK), 1625 - PINMUX_GPIO(GPIO_FN_A25, A25_MARK), 1626 - PINMUX_GPIO(GPIO_FN_A24, A24_MARK), 1627 - PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK), 1628 - PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK), 1458 + /* PTU (mobule: LPC, APM) */ 1459 + PINMUX_GPIO(GPIO_FN_LGPIO7, LGPIO7_MARK), 1460 + PINMUX_GPIO(GPIO_FN_LGPIO6, LGPIO6_MARK), 1461 + PINMUX_GPIO(GPIO_FN_LGPIO5, LGPIO5_MARK), 1462 + PINMUX_GPIO(GPIO_FN_LGPIO4, LGPIO4_MARK), 1463 + PINMUX_GPIO(GPIO_FN_LGPIO3, LGPIO3_MARK), 1464 + PINMUX_GPIO(GPIO_FN_LGPIO2, LGPIO2_MARK), 1465 + PINMUX_GPIO(GPIO_FN_LGPIO1, LGPIO1_MARK), 1466 + PINMUX_GPIO(GPIO_FN_LGPIO0, LGPIO0_MARK), 1467 + PINMUX_GPIO(GPIO_FN_APMONCTL_O, APMONCTL_O_MARK), 1468 + PINMUX_GPIO(GPIO_FN_APMPWBTOUT_O, APMPWBTOUT_O_MARK), 1469 + PINMUX_GPIO(GPIO_FN_APMSCI_O, APMSCI_O_MARK), 1470 + PINMUX_GPIO(GPIO_FN_APMVDDON, APMVDDON_MARK), 1471 + PINMUX_GPIO(GPIO_FN_APMSLPBTN, APMSLPBTN_MARK), 1472 + PINMUX_GPIO(GPIO_FN_APMPWRBTN, APMPWRBTN_MARK), 1473 + PINMUX_GPIO(GPIO_FN_APMS5N, APMS5N_MARK), 1474 + PINMUX_GPIO(GPIO_FN_APMS3N, APMS3N_MARK), 1629 1475 1630 - /* PTV (mobule: LBSC, DMAC) */ 1476 + /* PTV (mobule: LBSC, SerMux, R-SPI, EVC, GRA) */ 1631 1477 PINMUX_GPIO(GPIO_FN_A23, A23_MARK), 1632 1478 PINMUX_GPIO(GPIO_FN_A22, A22_MARK), 1633 1479 PINMUX_GPIO(GPIO_FN_A21, A21_MARK), ··· 1646 1472 PINMUX_GPIO(GPIO_FN_A18, A18_MARK), 1647 1473 PINMUX_GPIO(GPIO_FN_A17, A17_MARK), 1648 1474 PINMUX_GPIO(GPIO_FN_A16, A16_MARK), 1649 - PINMUX_GPIO(GPIO_FN_TEND0, TEND0_MARK), 1650 - PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK), 1651 - PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK), 1652 - PINMUX_GPIO(GPIO_FN_TEND1, TEND1_MARK), 1475 + PINMUX_GPIO(GPIO_FN_COM2_RI, COM2_RI_MARK), 1476 + PINMUX_GPIO(GPIO_FN_R_SPI_MOSI, R_SPI_MOSI_MARK), 1477 + PINMUX_GPIO(GPIO_FN_R_SPI_MISO, R_SPI_MISO_MARK), 1478 + PINMUX_GPIO(GPIO_FN_R_SPI_RSPCK, R_SPI_RSPCK_MARK), 1479 + PINMUX_GPIO(GPIO_FN_R_SPI_SSL0, R_SPI_SSL0_MARK), 1480 + PINMUX_GPIO(GPIO_FN_R_SPI_SSL1, R_SPI_SSL1_MARK), 1481 + PINMUX_GPIO(GPIO_FN_EVENT7, EVENT7_MARK), 1482 + PINMUX_GPIO(GPIO_FN_EVENT6, EVENT6_MARK), 1483 + PINMUX_GPIO(GPIO_FN_VBIOS_DI, VBIOS_DI_MARK), 1484 + PINMUX_GPIO(GPIO_FN_VBIOS_DO, VBIOS_DO_MARK), 1485 + PINMUX_GPIO(GPIO_FN_VBIOS_CLK, VBIOS_CLK_MARK), 1486 + PINMUX_GPIO(GPIO_FN_VBIOS_CS, VBIOS_CS_MARK), 1653 1487 1654 - /* PTW (mobule: LBSC) */ 1488 + /* PTW (mobule: LBSC, EVC, SCIF) */ 1655 1489 PINMUX_GPIO(GPIO_FN_A16, A16_MARK), 1656 1490 PINMUX_GPIO(GPIO_FN_A15, A15_MARK), 1657 1491 PINMUX_GPIO(GPIO_FN_A14, A14_MARK), ··· 1669 1487 PINMUX_GPIO(GPIO_FN_A10, A10_MARK), 1670 1488 PINMUX_GPIO(GPIO_FN_A9, A9_MARK), 1671 1489 PINMUX_GPIO(GPIO_FN_A8, A8_MARK), 1490 + PINMUX_GPIO(GPIO_FN_EVENT5, EVENT5_MARK), 1491 + PINMUX_GPIO(GPIO_FN_EVENT4, EVENT4_MARK), 1492 + PINMUX_GPIO(GPIO_FN_EVENT3, EVENT3_MARK), 1493 + PINMUX_GPIO(GPIO_FN_EVENT2, EVENT2_MARK), 1494 + PINMUX_GPIO(GPIO_FN_EVENT1, EVENT1_MARK), 1495 + PINMUX_GPIO(GPIO_FN_EVENT0, EVENT0_MARK), 1496 + PINMUX_GPIO(GPIO_FN_CTS4, CTS4_MARK), 1497 + PINMUX_GPIO(GPIO_FN_CTS2, CTS2_MARK), 1672 1498 1673 1499 /* PTX (mobule: LBSC) */ 1674 1500 PINMUX_GPIO(GPIO_FN_A7, A7_MARK), ··· 1687 1497 PINMUX_GPIO(GPIO_FN_A2, A2_MARK), 1688 1498 PINMUX_GPIO(GPIO_FN_A1, A1_MARK), 1689 1499 PINMUX_GPIO(GPIO_FN_A0, A0_MARK), 1500 + PINMUX_GPIO(GPIO_FN_RTS2, RTS2_MARK), 1501 + PINMUX_GPIO(GPIO_FN_SIM_D, SIM_D_MARK), 1502 + PINMUX_GPIO(GPIO_FN_SIM_CLK, SIM_CLK_MARK), 1503 + PINMUX_GPIO(GPIO_FN_SIM_RST, SIM_RST_MARK), 1690 1504 1691 1505 /* PTY (mobule: LBSC) */ 1692 1506 PINMUX_GPIO(GPIO_FN_D7, D7_MARK), ··· 1701 1507 PINMUX_GPIO(GPIO_FN_D2, D2_MARK), 1702 1508 PINMUX_GPIO(GPIO_FN_D1, D1_MARK), 1703 1509 PINMUX_GPIO(GPIO_FN_D0, D0_MARK), 1510 + 1511 + /* PTZ (mobule: eMMC, ONFI) */ 1512 + PINMUX_GPIO(GPIO_FN_MMCDAT7, MMCDAT7_MARK), 1513 + PINMUX_GPIO(GPIO_FN_MMCDAT6, MMCDAT6_MARK), 1514 + PINMUX_GPIO(GPIO_FN_MMCDAT5, MMCDAT5_MARK), 1515 + PINMUX_GPIO(GPIO_FN_MMCDAT4, MMCDAT4_MARK), 1516 + PINMUX_GPIO(GPIO_FN_MMCDAT3, MMCDAT3_MARK), 1517 + PINMUX_GPIO(GPIO_FN_MMCDAT2, MMCDAT2_MARK), 1518 + PINMUX_GPIO(GPIO_FN_MMCDAT1, MMCDAT1_MARK), 1519 + PINMUX_GPIO(GPIO_FN_MMCDAT0, MMCDAT0_MARK), 1520 + PINMUX_GPIO(GPIO_FN_ON_DQ7, ON_DQ7_MARK), 1521 + PINMUX_GPIO(GPIO_FN_ON_DQ6, ON_DQ6_MARK), 1522 + PINMUX_GPIO(GPIO_FN_ON_DQ5, ON_DQ5_MARK), 1523 + PINMUX_GPIO(GPIO_FN_ON_DQ4, ON_DQ4_MARK), 1524 + PINMUX_GPIO(GPIO_FN_ON_DQ3, ON_DQ3_MARK), 1525 + PINMUX_GPIO(GPIO_FN_ON_DQ2, ON_DQ2_MARK), 1526 + PINMUX_GPIO(GPIO_FN_ON_DQ1, ON_DQ1_MARK), 1527 + PINMUX_GPIO(GPIO_FN_ON_DQ0, ON_DQ0_MARK), 1704 1528 }; 1705 1529 1706 1530 static struct pinmux_cfg_reg pinmux_config_regs[] = { 1707 1531 { PINMUX_CFG_REG("PACR", 0xffec0000, 16, 2) { 1708 - PTA7_FN, PTA7_OUT, PTA7_IN, 0, 1709 - PTA6_FN, PTA6_OUT, PTA6_IN, 0, 1710 - PTA5_FN, PTA5_OUT, PTA5_IN, 0, 1711 - PTA4_FN, PTA4_OUT, PTA4_IN, 0, 1712 - PTA3_FN, PTA3_OUT, PTA3_IN, 0, 1713 - PTA2_FN, PTA2_OUT, PTA2_IN, 0, 1714 - PTA1_FN, PTA1_OUT, PTA1_IN, 0, 1715 - PTA0_FN, PTA0_OUT, PTA0_IN, 0 } 1532 + PTA7_FN, PTA7_OUT, PTA7_IN, PTA7_IN_PU, 1533 + PTA6_FN, PTA6_OUT, PTA6_IN, PTA6_IN_PU, 1534 + PTA5_FN, PTA5_OUT, PTA5_IN, PTA5_IN_PU, 1535 + PTA4_FN, PTA4_OUT, PTA4_IN, PTA4_IN_PU, 1536 + PTA3_FN, PTA3_OUT, PTA3_IN, PTA3_IN_PU, 1537 + PTA2_FN, PTA2_OUT, PTA2_IN, PTA2_IN_PU, 1538 + PTA1_FN, PTA1_OUT, PTA1_IN, PTA1_IN_PU, 1539 + PTA0_FN, PTA0_OUT, PTA0_IN, PTA0_IN_PU } 1716 1540 }, 1717 1541 { PINMUX_CFG_REG("PBCR", 0xffec0002, 16, 2) { 1718 1542 PTB7_FN, PTB7_OUT, PTB7_IN, 0, ··· 1753 1541 PTC0_FN, PTC0_OUT, PTC0_IN, 0 } 1754 1542 }, 1755 1543 { PINMUX_CFG_REG("PDCR", 0xffec0006, 16, 2) { 1756 - PTD7_FN, PTD7_OUT, PTD7_IN, 0, 1757 - PTD6_FN, PTD6_OUT, PTD6_IN, 0, 1758 - PTD5_FN, PTD5_OUT, PTD5_IN, 0, 1759 - PTD4_FN, PTD4_OUT, PTD4_IN, 0, 1760 - PTD3_FN, PTD3_OUT, PTD3_IN, 0, 1761 - PTD2_FN, PTD2_OUT, PTD2_IN, 0, 1762 - PTD1_FN, PTD1_OUT, PTD1_IN, 0, 1763 - PTD0_FN, PTD0_OUT, PTD0_IN, 0 } 1544 + PTD7_FN, PTD7_OUT, PTD7_IN, PTD7_IN_PU, 1545 + PTD6_FN, PTD6_OUT, PTD6_IN, PTD6_IN_PU, 1546 + PTD5_FN, PTD5_OUT, PTD5_IN, PTD5_IN_PU, 1547 + PTD4_FN, PTD4_OUT, PTD4_IN, PTD4_IN_PU, 1548 + PTD3_FN, PTD3_OUT, PTD3_IN, PTD3_IN_PU, 1549 + PTD2_FN, PTD2_OUT, PTD2_IN, PTD2_IN_PU, 1550 + PTD1_FN, PTD1_OUT, PTD1_IN, PTD1_IN_PU, 1551 + PTD0_FN, PTD0_OUT, PTD0_IN, PTD0_IN_PU } 1764 1552 }, 1765 1553 { PINMUX_CFG_REG("PECR", 0xffec0008, 16, 2) { 1766 - PTE7_FN, PTE7_OUT, PTE7_IN, 0, 1767 - PTE6_FN, PTE6_OUT, PTE6_IN, 0, 1768 - PTE5_FN, PTE5_OUT, PTE5_IN, 0, 1769 - PTE4_FN, PTE4_OUT, PTE4_IN, 0, 1770 - PTE3_FN, PTE3_OUT, PTE3_IN, 0, 1771 - PTE2_FN, PTE2_OUT, PTE2_IN, 0, 1772 - PTE1_FN, PTE1_OUT, PTE1_IN, 0, 1773 - PTE0_FN, PTE0_OUT, PTE0_IN, 0 } 1554 + PTE7_FN, PTE7_OUT, PTE7_IN, PTE7_IN_PU, 1555 + PTE6_FN, PTE6_OUT, PTE6_IN, PTE6_IN_PU, 1556 + PTE5_FN, PTE5_OUT, PTE5_IN, PTE5_IN_PU, 1557 + PTE4_FN, PTE4_OUT, PTE4_IN, PTE4_IN_PU, 1558 + PTE3_FN, PTE3_OUT, PTE3_IN, PTE3_IN_PU, 1559 + PTE2_FN, PTE2_OUT, PTE2_IN, PTE2_IN_PU, 1560 + PTE1_FN, PTE1_OUT, PTE1_IN, PTE1_IN_PU, 1561 + PTE0_FN, PTE0_OUT, PTE0_IN, PTE0_IN_PU } 1774 1562 }, 1775 1563 { PINMUX_CFG_REG("PFCR", 0xffec000a, 16, 2) { 1776 - PTF7_FN, PTF7_OUT, PTF7_IN, 0, 1777 - PTF6_FN, PTF6_OUT, PTF6_IN, 0, 1778 - PTF5_FN, PTF5_OUT, PTF5_IN, 0, 1779 - PTF4_FN, PTF4_OUT, PTF4_IN, 0, 1780 - PTF3_FN, PTF3_OUT, PTF3_IN, 0, 1781 - PTF2_FN, PTF2_OUT, PTF2_IN, 0, 1782 - PTF1_FN, PTF1_OUT, PTF1_IN, 0, 1783 - PTF0_FN, PTF0_OUT, PTF0_IN, 0 } 1564 + PTF7_FN, PTF7_OUT, PTF7_IN, PTF7_IN_PU, 1565 + PTF6_FN, PTF6_OUT, PTF6_IN, PTF6_IN_PU, 1566 + PTF5_FN, PTF5_OUT, PTF5_IN, PTF5_IN_PU, 1567 + PTF4_FN, PTF4_OUT, PTF4_IN, PTF4_IN_PU, 1568 + PTF3_FN, PTF3_OUT, PTF3_IN, PTF3_IN_PU, 1569 + PTF2_FN, PTF2_OUT, PTF2_IN, PTF2_IN_PU, 1570 + PTF1_FN, PTF1_OUT, PTF1_IN, PTF1_IN_PU, 1571 + PTF0_FN, PTF0_OUT, PTF0_IN, PTF0_IN_PU } 1784 1572 }, 1785 1573 { PINMUX_CFG_REG("PGCR", 0xffec000c, 16, 2) { 1786 - PTG7_FN, PTG7_OUT, PTG7_IN, 0, 1787 - PTG6_FN, PTG6_OUT, PTG6_IN, 0, 1574 + PTG7_FN, PTG7_OUT, PTG7_IN, PTG7_IN_PU , 1575 + PTG6_FN, PTG6_OUT, PTG6_IN, PTG6_IN_PU , 1788 1576 PTG5_FN, PTG5_OUT, PTG5_IN, 0, 1789 - PTG4_FN, PTG4_OUT, PTG4_IN, 0, 1577 + PTG4_FN, PTG4_OUT, PTG4_IN, PTG4_IN_PU , 1790 1578 PTG3_FN, PTG3_OUT, PTG3_IN, 0, 1791 1579 PTG2_FN, PTG2_OUT, PTG2_IN, 0, 1792 1580 PTG1_FN, PTG1_OUT, PTG1_IN, 0, 1793 1581 PTG0_FN, PTG0_OUT, PTG0_IN, 0 } 1794 1582 }, 1795 1583 { PINMUX_CFG_REG("PHCR", 0xffec000e, 16, 2) { 1796 - PTH7_FN, PTH7_OUT, PTH7_IN, 0, 1797 - PTH6_FN, PTH6_OUT, PTH6_IN, 0, 1798 - PTH5_FN, PTH5_OUT, PTH5_IN, 0, 1799 - PTH4_FN, PTH4_OUT, PTH4_IN, 0, 1800 - PTH3_FN, PTH3_OUT, PTH3_IN, 0, 1801 - PTH2_FN, PTH2_OUT, PTH2_IN, 0, 1802 - PTH1_FN, PTH1_OUT, PTH1_IN, 0, 1803 - PTH0_FN, PTH0_OUT, PTH0_IN, 0 } 1584 + PTH7_FN, PTH7_OUT, PTH7_IN, PTH7_IN_PU, 1585 + PTH6_FN, PTH6_OUT, PTH6_IN, PTH6_IN_PU, 1586 + PTH5_FN, PTH5_OUT, PTH5_IN, PTH5_IN_PU, 1587 + PTH4_FN, PTH4_OUT, PTH4_IN, PTH4_IN_PU, 1588 + PTH3_FN, PTH3_OUT, PTH3_IN, PTH3_IN_PU, 1589 + PTH2_FN, PTH2_OUT, PTH2_IN, PTH2_IN_PU, 1590 + PTH1_FN, PTH1_OUT, PTH1_IN, PTH1_IN_PU, 1591 + PTH0_FN, PTH0_OUT, PTH0_IN, PTH0_IN_PU } 1804 1592 }, 1805 1593 { PINMUX_CFG_REG("PICR", 0xffec0010, 16, 2) { 1806 - PTI7_FN, PTI7_OUT, PTI7_IN, 0, 1807 - PTI6_FN, PTI6_OUT, PTI6_IN, 0, 1594 + PTI7_FN, PTI7_OUT, PTI7_IN, PTI7_IN_PU, 1595 + PTI6_FN, PTI6_OUT, PTI6_IN, PTI6_IN_PU, 1808 1596 PTI5_FN, PTI5_OUT, PTI5_IN, 0, 1809 - PTI4_FN, PTI4_OUT, PTI4_IN, 0, 1810 - PTI3_FN, PTI3_OUT, PTI3_IN, 0, 1811 - PTI2_FN, PTI2_OUT, PTI2_IN, 0, 1812 - PTI1_FN, PTI1_OUT, PTI1_IN, 0, 1813 - PTI0_FN, PTI0_OUT, PTI0_IN, 0 } 1597 + PTI4_FN, PTI4_OUT, PTI4_IN, PTI4_IN_PU, 1598 + PTI3_FN, PTI3_OUT, PTI3_IN, PTI3_IN_PU, 1599 + PTI2_FN, PTI2_OUT, PTI2_IN, PTI2_IN_PU, 1600 + PTI1_FN, PTI1_OUT, PTI1_IN, PTI1_IN_PU, 1601 + PTI0_FN, PTI0_OUT, PTI0_IN, PTI0_IN_PU } 1814 1602 }, 1815 1603 { PINMUX_CFG_REG("PJCR", 0xffec0012, 16, 2) { 1816 - PTJ7_FN, PTJ7_OUT, PTJ7_IN, 0, 1817 - PTJ6_FN, PTJ6_OUT, PTJ6_IN, 0, 1818 - PTJ5_FN, PTJ5_OUT, PTJ5_IN, 0, 1819 - PTJ4_FN, PTJ4_OUT, PTJ4_IN, 0, 1820 - PTJ3_FN, PTJ3_OUT, PTJ3_IN, 0, 1821 - PTJ2_FN, PTJ2_OUT, PTJ2_IN, 0, 1822 - PTJ1_FN, PTJ1_OUT, PTJ1_IN, 0, 1823 - PTJ0_FN, PTJ0_OUT, PTJ0_IN, 0 } 1604 + 0, 0, 0, 0, /* reserved: always set 1 */ 1605 + PTJ6_FN, PTJ6_OUT, PTJ6_IN, PTJ6_IN_PU, 1606 + PTJ5_FN, PTJ5_OUT, PTJ5_IN, PTJ5_IN_PU, 1607 + PTJ4_FN, PTJ4_OUT, PTJ4_IN, PTJ4_IN_PU, 1608 + PTJ3_FN, PTJ3_OUT, PTJ3_IN, PTJ3_IN_PU, 1609 + PTJ2_FN, PTJ2_OUT, PTJ2_IN, PTJ2_IN_PU, 1610 + PTJ1_FN, PTJ1_OUT, PTJ1_IN, PTJ1_IN_PU, 1611 + PTJ0_FN, PTJ0_OUT, PTJ0_IN, PTJ0_IN_PU } 1824 1612 }, 1825 1613 { PINMUX_CFG_REG("PKCR", 0xffec0014, 16, 2) { 1826 - PTK7_FN, PTK7_OUT, PTK7_IN, 0, 1827 - PTK6_FN, PTK6_OUT, PTK6_IN, 0, 1828 - PTK5_FN, PTK5_OUT, PTK5_IN, 0, 1829 - PTK4_FN, PTK4_OUT, PTK4_IN, 0, 1830 - PTK3_FN, PTK3_OUT, PTK3_IN, 0, 1831 - PTK2_FN, PTK2_OUT, PTK2_IN, 0, 1832 - PTK1_FN, PTK1_OUT, PTK1_IN, 0, 1833 - PTK0_FN, PTK0_OUT, PTK0_IN, 0 } 1614 + PTK7_FN, PTK7_OUT, PTK7_IN, PTK7_IN_PU, 1615 + PTK6_FN, PTK6_OUT, PTK6_IN, PTK6_IN_PU, 1616 + PTK5_FN, PTK5_OUT, PTK5_IN, PTK5_IN_PU, 1617 + PTK4_FN, PTK4_OUT, PTK4_IN, PTK4_IN_PU, 1618 + PTK3_FN, PTK3_OUT, PTK3_IN, PTK3_IN_PU, 1619 + PTK2_FN, PTK2_OUT, PTK2_IN, PTK2_IN_PU, 1620 + PTK1_FN, PTK1_OUT, PTK1_IN, PTK1_IN_PU, 1621 + PTK0_FN, PTK0_OUT, PTK0_IN, PTK0_IN_PU } 1834 1622 }, 1835 1623 { PINMUX_CFG_REG("PLCR", 0xffec0016, 16, 2) { 1836 - PTL7_FN, PTL7_OUT, PTL7_IN, 0, 1837 - PTL6_FN, PTL6_OUT, PTL6_IN, 0, 1838 - PTL5_FN, PTL5_OUT, PTL5_IN, 0, 1839 - PTL4_FN, PTL4_OUT, PTL4_IN, 0, 1840 - PTL3_FN, PTL3_OUT, PTL3_IN, 0, 1841 - PTL2_FN, PTL2_OUT, PTL2_IN, 0, 1842 - PTL1_FN, PTL1_OUT, PTL1_IN, 0, 1843 - PTL0_FN, PTL0_OUT, PTL0_IN, 0 } 1624 + 0, 0, 0, 0, /* reserved: always set 1 */ 1625 + PTL6_FN, PTL6_OUT, PTL6_IN, PTL6_IN_PU, 1626 + PTL5_FN, PTL5_OUT, PTL5_IN, PTL5_IN_PU, 1627 + PTL4_FN, PTL4_OUT, PTL4_IN, PTL4_IN_PU, 1628 + PTL3_FN, PTL3_OUT, PTL3_IN, PTL3_IN_PU, 1629 + PTL2_FN, PTL2_OUT, PTL2_IN, PTL2_IN_PU, 1630 + PTL1_FN, PTL1_OUT, PTL1_IN, PTL1_IN_PU, 1631 + PTL0_FN, PTL0_OUT, PTL0_IN, PTL0_IN_PU } 1844 1632 }, 1845 1633 { PINMUX_CFG_REG("PMCR", 0xffec0018, 16, 2) { 1846 - 0, 0, 0, 0, /* reserved: always set 1 */ 1847 - PTM6_FN, PTM6_OUT, PTM6_IN, 0, 1848 - PTM5_FN, PTM5_OUT, PTM5_IN, 0, 1849 - PTM4_FN, PTM4_OUT, PTM4_IN, 0, 1634 + PTM7_FN, PTM7_OUT, PTM7_IN, PTM7_IN_PU, 1635 + PTM6_FN, PTM6_OUT, PTM6_IN, PTM6_IN_PU, 1636 + PTM5_FN, PTM5_OUT, PTM5_IN, PTM5_IN_PU, 1637 + PTM4_FN, PTM4_OUT, PTM4_IN, PTM4_IN_PU, 1850 1638 PTM3_FN, PTM3_OUT, PTM3_IN, 0, 1851 1639 PTM2_FN, PTM2_OUT, PTM2_IN, 0, 1852 1640 PTM1_FN, PTM1_OUT, PTM1_IN, 0, 1853 1641 PTM0_FN, PTM0_OUT, PTM0_IN, 0 } 1854 1642 }, 1855 1643 { PINMUX_CFG_REG("PNCR", 0xffec001a, 16, 2) { 1856 - PTN7_FN, PTN7_OUT, PTN7_IN, 0, 1644 + 0, 0, 0, 0, /* reserved: always set 1 */ 1857 1645 PTN6_FN, PTN6_OUT, PTN6_IN, 0, 1858 1646 PTN5_FN, PTN5_OUT, PTN5_IN, 0, 1859 - PTN4_FN, PTN4_OUT, PTN4_IN, 0, 1860 - PTN3_FN, PTN3_OUT, PTN3_IN, 0, 1861 - PTN2_FN, PTN2_OUT, PTN2_IN, 0, 1862 - PTN1_FN, PTN1_OUT, PTN1_IN, 0, 1863 - PTN0_FN, PTN0_OUT, PTN0_IN, 0 } 1647 + PTN4_FN, PTN4_OUT, PTN4_IN, PTN4_IN_PU, 1648 + PTN3_FN, PTN3_OUT, PTN3_IN, PTN3_IN_PU, 1649 + PTN2_FN, PTN2_OUT, PTN2_IN, PTN2_IN_PU, 1650 + PTN1_FN, PTN1_OUT, PTN1_IN, PTN1_IN_PU, 1651 + PTN0_FN, PTN0_OUT, PTN0_IN, PTN0_IN_PU } 1864 1652 }, 1865 1653 { PINMUX_CFG_REG("POCR", 0xffec001c, 16, 2) { 1866 - PTO7_FN, PTO7_OUT, PTO7_IN, 0, 1867 - PTO6_FN, PTO6_OUT, PTO6_IN, 0, 1868 - PTO5_FN, PTO5_OUT, PTO5_IN, 0, 1869 - PTO4_FN, PTO4_OUT, PTO4_IN, 0, 1870 - PTO3_FN, PTO3_OUT, PTO3_IN, 0, 1871 - PTO2_FN, PTO2_OUT, PTO2_IN, 0, 1872 - PTO1_FN, PTO1_OUT, PTO1_IN, 0, 1873 - PTO0_FN, PTO0_OUT, PTO0_IN, 0 } 1654 + PTO7_FN, PTO7_OUT, PTO7_IN, PTO7_IN_PU, 1655 + PTO6_FN, PTO6_OUT, PTO6_IN, PTO6_IN_PU, 1656 + PTO5_FN, PTO5_OUT, PTO5_IN, PTO5_IN_PU, 1657 + PTO4_FN, PTO4_OUT, PTO4_IN, PTO4_IN_PU, 1658 + PTO3_FN, PTO3_OUT, PTO3_IN, PTO3_IN_PU, 1659 + PTO2_FN, PTO2_OUT, PTO2_IN, PTO2_IN_PU, 1660 + PTO1_FN, PTO1_OUT, PTO1_IN, PTO1_IN_PU, 1661 + PTO0_FN, PTO0_OUT, PTO0_IN, PTO0_IN_PU } 1874 1662 }, 1663 + #if 0 /* FIXME: Remove it? */ 1875 1664 { PINMUX_CFG_REG("PPCR", 0xffec001e, 16, 2) { 1876 1665 0, 0, 0, 0, /* reserved: always set 1 */ 1877 1666 PTP6_FN, PTP6_OUT, PTP6_IN, 0, ··· 1883 1670 PTP1_FN, PTP1_OUT, PTP1_IN, 0, 1884 1671 PTP0_FN, PTP0_OUT, PTP0_IN, 0 } 1885 1672 }, 1673 + #endif 1886 1674 { PINMUX_CFG_REG("PQCR", 0xffec0020, 16, 2) { 1887 1675 0, 0, 0, 0, /* reserved: always set 1 */ 1888 1676 PTQ6_FN, PTQ6_OUT, PTQ6_IN, 0, ··· 1915 1701 PTS0_FN, PTS0_OUT, PTS0_IN, 0 } 1916 1702 }, 1917 1703 { PINMUX_CFG_REG("PTCR", 0xffec0026, 16, 2) { 1918 - 0, 0, 0, 0, /* reserved: always set 1 */ 1919 - 0, 0, 0, 0, /* reserved: always set 1 */ 1920 - PTT5_FN, PTT5_OUT, PTT5_IN, 0, 1921 - PTT4_FN, PTT4_OUT, PTT4_IN, 0, 1922 - PTT3_FN, PTT3_OUT, PTT3_IN, 0, 1923 - PTT2_FN, PTT2_OUT, PTT2_IN, 0, 1924 - PTT1_FN, PTT1_OUT, PTT1_IN, 0, 1925 - PTT0_FN, PTT0_OUT, PTT0_IN, 0 } 1704 + PTT7_FN, PTT7_OUT, PTT7_IN, PTO7_IN_PU, 1705 + PTT6_FN, PTT6_OUT, PTT6_IN, PTO6_IN_PU, 1706 + PTT5_FN, PTT5_OUT, PTT5_IN, PTO5_IN_PU, 1707 + PTT4_FN, PTT4_OUT, PTT4_IN, PTO4_IN_PU, 1708 + PTT3_FN, PTT3_OUT, PTT3_IN, PTO3_IN_PU, 1709 + PTT2_FN, PTT2_OUT, PTT2_IN, PTO2_IN_PU, 1710 + PTT1_FN, PTT1_OUT, PTT1_IN, PTO1_IN_PU, 1711 + PTT0_FN, PTT0_OUT, PTT0_IN, PTO0_IN_PU } 1926 1712 }, 1927 1713 { PINMUX_CFG_REG("PUCR", 0xffec0028, 16, 2) { 1928 1714 PTU7_FN, PTU7_OUT, PTU7_IN, PTU7_IN_PU, ··· 1941 1727 PTV4_FN, PTV4_OUT, PTV4_IN, PTV4_IN_PU, 1942 1728 PTV3_FN, PTV3_OUT, PTV3_IN, PTV3_IN_PU, 1943 1729 PTV2_FN, PTV2_OUT, PTV2_IN, PTV2_IN_PU, 1944 - PTV1_FN, PTV1_OUT, PTV1_IN, PTV1_IN_PU, 1945 - PTV0_FN, PTV0_OUT, PTV0_IN, PTV0_IN_PU } 1730 + PTV1_FN, PTV1_OUT, PTV1_IN, 0, 1731 + PTV0_FN, PTV0_OUT, PTV0_IN, 0 } 1946 1732 }, 1947 1733 { PINMUX_CFG_REG("PWCR", 0xffec002c, 16, 2) { 1948 - PTW7_FN, PTW7_OUT, PTW7_IN, PTW7_IN_PU, 1949 - PTW6_FN, PTW6_OUT, PTW6_IN, PTW6_IN_PU, 1950 - PTW5_FN, PTW5_OUT, PTW5_IN, PTW5_IN_PU, 1951 - PTW4_FN, PTW4_OUT, PTW4_IN, PTW4_IN_PU, 1952 - PTW3_FN, PTW3_OUT, PTW3_IN, PTW3_IN_PU, 1953 - PTW2_FN, PTW2_OUT, PTW2_IN, PTW2_IN_PU, 1734 + PTW7_FN, PTW7_OUT, PTW7_IN, 0, 1735 + PTW6_FN, PTW6_OUT, PTW6_IN, 0, 1736 + PTW5_FN, PTW5_OUT, PTW5_IN, 0, 1737 + PTW4_FN, PTW4_OUT, PTW4_IN, 0, 1738 + PTW3_FN, PTW3_OUT, PTW3_IN, 0, 1739 + PTW2_FN, PTW2_OUT, PTW2_IN, 0, 1954 1740 PTW1_FN, PTW1_OUT, PTW1_IN, PTW1_IN_PU, 1955 1741 PTW0_FN, PTW0_OUT, PTW0_IN, PTW0_IN_PU } 1956 1742 }, ··· 1975 1761 PTY0_FN, PTY0_OUT, PTY0_IN, PTY0_IN_PU } 1976 1762 }, 1977 1763 { PINMUX_CFG_REG("PZCR", 0xffec0032, 16, 2) { 1978 - 0, PTZ7_OUT, PTZ7_IN, 0, 1979 - 0, PTZ6_OUT, PTZ6_IN, 0, 1980 - 0, PTZ5_OUT, PTZ5_IN, 0, 1981 - 0, PTZ4_OUT, PTZ4_IN, 0, 1982 - 0, PTZ3_OUT, PTZ3_IN, 0, 1983 - 0, PTZ2_OUT, PTZ2_IN, 0, 1984 - 0, PTZ1_OUT, PTZ1_IN, 0, 1985 - 0, PTZ0_OUT, PTZ0_IN, 0 } 1764 + PTZ7_FN, PTZ7_OUT, PTZ7_IN, 0, 1765 + PTZ6_FN, PTZ6_OUT, PTZ6_IN, 0, 1766 + PTZ5_FN, PTZ5_OUT, PTZ5_IN, 0, 1767 + PTZ4_FN, PTZ4_OUT, PTZ4_IN, 0, 1768 + PTZ3_FN, PTZ3_OUT, PTZ3_IN, 0, 1769 + PTZ2_FN, PTZ2_OUT, PTZ2_IN, 0, 1770 + PTZ1_FN, PTZ1_OUT, PTZ1_IN, 0, 1771 + PTZ0_FN, PTZ0_OUT, PTZ0_IN, 0 } 1986 1772 }, 1987 1773 1988 1774 { PINMUX_CFG_REG("PSEL0", 0xffec0070, 16, 1) { 1989 - PS0_15_FN3, PS0_15_FN1, 1990 - PS0_14_FN3, PS0_14_FN1, 1991 - PS0_13_FN3, PS0_13_FN1, 1992 - PS0_12_FN3, PS0_12_FN1, 1775 + PS0_15_FN1, PS0_15_FN2, 1776 + PS0_14_FN1, PS0_14_FN2, 1777 + PS0_13_FN1, PS0_13_FN2, 1778 + PS0_12_FN1, PS0_12_FN2, 1779 + PS0_11_FN1, PS0_11_FN2, 1780 + PS0_10_FN1, PS0_10_FN2, 1781 + PS0_9_FN1, PS0_9_FN2, 1782 + PS0_8_FN1, PS0_8_FN2, 1783 + PS0_7_FN1, PS0_7_FN2, 1784 + PS0_6_FN1, PS0_6_FN2, 1785 + PS0_5_FN1, PS0_5_FN2, 1786 + PS0_4_FN1, PS0_4_FN2, 1787 + PS0_3_FN1, PS0_3_FN2, 1788 + PS0_2_FN1, PS0_2_FN2, 1993 1789 0, 0, 1994 - 0, 0, 1995 - 0, 0, 1996 - 0, 0, 1997 - PS0_7_FN2, PS0_7_FN1, 1998 - PS0_6_FN2, PS0_6_FN1, 1999 - PS0_5_FN2, PS0_5_FN1, 2000 - PS0_4_FN2, PS0_4_FN1, 2001 - PS0_3_FN2, PS0_3_FN1, 2002 - PS0_2_FN2, PS0_2_FN1, 2003 - PS0_1_FN2, PS0_1_FN1, 2004 1790 0, 0, } 2005 1791 }, 2006 1792 { PINMUX_CFG_REG("PSEL1", 0xffec0072, 16, 1) { ··· 2009 1795 0, 0, 2010 1796 0, 0, 2011 1797 0, 0, 1798 + PS1_10_FN1, PS1_10_FN2, 1799 + PS1_9_FN1, PS1_9_FN2, 1800 + PS1_8_FN1, PS1_8_FN2, 2012 1801 0, 0, 2013 1802 0, 0, 2014 1803 0, 0, 2015 - PS1_7_FN1, PS1_7_FN3, 2016 - PS1_6_FN1, PS1_6_FN3, 2017 1804 0, 0, 2018 1805 0, 0, 2019 - 0, 0, 2020 - 0, 0, 1806 + PS1_2_FN1, PS1_2_FN2, 2021 1807 0, 0, 2022 1808 0, 0, } 2023 1809 }, 2024 1810 { PINMUX_CFG_REG("PSEL2", 0xffec0074, 16, 1) { 2025 1811 0, 0, 2026 1812 0, 0, 2027 - PS2_13_FN3, PS2_13_FN1, 2028 - PS2_12_FN3, PS2_12_FN1, 1813 + PS2_13_FN1, PS2_13_FN2, 1814 + PS2_12_FN1, PS2_12_FN2, 2029 1815 0, 0, 2030 1816 0, 0, 2031 1817 0, 0, 2032 1818 0, 0, 1819 + PS2_7_FN1, PS2_7_FN2, 1820 + PS2_6_FN1, PS2_6_FN2, 1821 + PS2_5_FN1, PS2_5_FN2, 1822 + PS2_4_FN1, PS2_4_FN2, 2033 1823 0, 0, 1824 + PS2_2_FN1, PS2_2_FN2, 2034 1825 0, 0, 2035 - 0, 0, 2036 - 0, 0, 2037 - 0, 0, 2038 - 0, 0, 2039 - PS2_1_FN1, PS2_1_FN2, 2040 - PS2_0_FN1, PS2_0_FN2, } 1826 + 0, 0, } 2041 1827 }, 1828 + { PINMUX_CFG_REG("PSEL3", 0xffec0076, 16, 1) { 1829 + PS3_15_FN1, PS3_15_FN2, 1830 + PS3_14_FN1, PS3_14_FN2, 1831 + PS3_13_FN1, PS3_13_FN2, 1832 + PS3_12_FN1, PS3_12_FN2, 1833 + PS3_11_FN1, PS3_11_FN2, 1834 + PS3_10_FN1, PS3_10_FN2, 1835 + PS3_9_FN1, PS3_9_FN2, 1836 + PS3_8_FN1, PS3_8_FN2, 1837 + PS3_7_FN1, PS3_7_FN2, 1838 + 0, 0, 1839 + 0, 0, 1840 + 0, 0, 1841 + 0, 0, 1842 + PS3_2_FN1, PS3_2_FN2, 1843 + PS3_1_FN1, PS3_1_FN2, 1844 + 0, 0, } 1845 + }, 1846 + 2042 1847 { PINMUX_CFG_REG("PSEL4", 0xffec0078, 16, 1) { 2043 - PS4_15_FN2, PS4_15_FN1, 2044 - PS4_14_FN2, PS4_14_FN1, 2045 - PS4_13_FN2, PS4_13_FN1, 2046 - PS4_12_FN2, PS4_12_FN1, 2047 - PS4_11_FN2, PS4_11_FN1, 2048 - PS4_10_FN2, PS4_10_FN1, 2049 - PS4_9_FN2, PS4_9_FN1, 1848 + 0, 0, 1849 + PS4_14_FN1, PS4_14_FN2, 1850 + PS4_13_FN1, PS4_13_FN2, 1851 + PS4_12_FN1, PS4_12_FN2, 1852 + 0, 0, 1853 + PS4_10_FN1, PS4_10_FN2, 1854 + PS4_9_FN1, PS4_9_FN2, 1855 + PS4_8_FN1, PS4_8_FN2, 2050 1856 0, 0, 2051 1857 0, 0, 2052 1858 0, 0, 2053 - 0, 0, 2054 - 0, 0, 2055 - PS4_3_FN2, PS4_3_FN1, 2056 - PS4_2_FN2, PS4_2_FN1, 2057 - PS4_1_FN2, PS4_1_FN1, 2058 - PS4_0_FN2, PS4_0_FN1, } 1859 + PS4_4_FN1, PS4_4_FN2, 1860 + PS4_3_FN1, PS4_3_FN2, 1861 + PS4_2_FN1, PS4_2_FN2, 1862 + PS4_1_FN1, PS4_1_FN2, 1863 + PS4_0_FN1, PS4_0_FN2, } 2059 1864 }, 2060 1865 { PINMUX_CFG_REG("PSEL5", 0xffec007a, 16, 1) { 2061 1866 0, 0, 2062 1867 0, 0, 2063 1868 0, 0, 2064 1869 0, 0, 2065 - 0, 0, 2066 - 0, 0, 1870 + PS5_11_FN1, PS5_11_FN2, 1871 + PS5_10_FN1, PS5_10_FN2, 2067 1872 PS5_9_FN1, PS5_9_FN2, 2068 1873 PS5_8_FN1, PS5_8_FN2, 2069 1874 PS5_7_FN1, PS5_7_FN2, 2070 1875 PS5_6_FN1, PS5_6_FN2, 2071 1876 PS5_5_FN1, PS5_5_FN2, 1877 + PS5_4_FN1, PS5_4_FN2, 1878 + PS5_3_FN1, PS5_3_FN2, 1879 + PS5_2_FN1, PS5_2_FN2, 1880 + 0, 0, 1881 + 0, 0, } 1882 + }, 1883 + { PINMUX_CFG_REG("PSEL6", 0xffec007c, 16, 1) { 1884 + PS6_15_FN1, PS6_15_FN2, 1885 + PS6_14_FN1, PS6_14_FN2, 1886 + PS6_13_FN1, PS6_13_FN2, 1887 + PS6_12_FN1, PS6_12_FN2, 1888 + PS6_11_FN1, PS6_11_FN2, 1889 + PS6_10_FN1, PS6_10_FN2, 1890 + PS6_9_FN1, PS6_9_FN2, 1891 + PS6_8_FN1, PS6_8_FN2, 1892 + PS6_7_FN1, PS6_7_FN2, 1893 + PS6_6_FN1, PS6_6_FN2, 1894 + PS6_5_FN1, PS6_5_FN2, 1895 + PS6_4_FN1, PS6_4_FN2, 1896 + PS6_3_FN1, PS6_3_FN2, 1897 + PS6_2_FN1, PS6_2_FN2, 1898 + PS6_1_FN1, PS6_1_FN2, 1899 + PS6_0_FN1, PS6_0_FN2, } 1900 + }, 1901 + { PINMUX_CFG_REG("PSEL7", 0xffec0082, 16, 1) { 1902 + PS7_15_FN1, PS7_15_FN2, 1903 + PS7_14_FN1, PS7_14_FN2, 1904 + PS7_13_FN1, PS7_13_FN2, 1905 + PS7_12_FN1, PS7_12_FN2, 1906 + PS7_11_FN1, PS7_11_FN2, 1907 + PS7_10_FN1, PS7_10_FN2, 1908 + PS7_9_FN1, PS7_9_FN2, 1909 + PS7_8_FN1, PS7_8_FN2, 1910 + PS7_7_FN1, PS7_7_FN2, 1911 + PS7_6_FN1, PS7_6_FN2, 1912 + PS7_5_FN1, PS7_5_FN2, 2072 1913 0, 0, 2073 1914 0, 0, 2074 1915 0, 0, 2075 1916 0, 0, 2076 1917 0, 0, } 2077 1918 }, 2078 - { PINMUX_CFG_REG("PSEL6", 0xffec007c, 16, 1) { 1919 + { PINMUX_CFG_REG("PSEL8", 0xffec0084, 16, 1) { 1920 + PS8_15_FN1, PS8_15_FN2, 1921 + PS8_14_FN1, PS8_14_FN2, 1922 + PS8_13_FN1, PS8_13_FN2, 1923 + PS8_12_FN1, PS8_12_FN2, 1924 + PS8_11_FN1, PS8_11_FN2, 1925 + PS8_10_FN1, PS8_10_FN2, 1926 + PS8_9_FN1, PS8_9_FN2, 1927 + PS8_8_FN1, PS8_8_FN2, 2079 1928 0, 0, 2080 1929 0, 0, 2081 1930 0, 0, ··· 2146 1869 0, 0, 2147 1870 0, 0, 2148 1871 0, 0, 2149 - 0, 0, 2150 - PS6_7_FN_AN, PS6_7_FN_EV, 2151 - PS6_6_FN_AN, PS6_6_FN_EV, 2152 - PS6_5_FN_AN, PS6_5_FN_EV, 2153 - PS6_4_FN_AN, PS6_4_FN_EV, 2154 - PS6_3_FN_AN, PS6_3_FN_EV, 2155 - PS6_2_FN_AN, PS6_2_FN_EV, 2156 - PS6_1_FN_AN, PS6_1_FN_EV, 2157 - PS6_0_FN_AN, PS6_0_FN_EV, } 1872 + 0, 0, } 2158 1873 }, 2159 1874 {} 2160 1875 }; ··· 2189 1920 PTI3_DATA, PTI2_DATA, PTI1_DATA, PTI0_DATA } 2190 1921 }, 2191 1922 { PINMUX_DATA_REG("PJDR", 0xffec0046, 8) { 2192 - PTJ7_DATA, PTJ6_DATA, PTJ5_DATA, PTJ4_DATA, 1923 + 0, PTJ6_DATA, PTJ5_DATA, PTJ4_DATA, 2193 1924 PTJ3_DATA, PTJ2_DATA, PTJ1_DATA, PTJ0_DATA } 2194 1925 }, 2195 1926 { PINMUX_DATA_REG("PKDR", 0xffec0048, 8) { ··· 2197 1928 PTK3_DATA, PTK2_DATA, PTK1_DATA, PTK0_DATA } 2198 1929 }, 2199 1930 { PINMUX_DATA_REG("PLDR", 0xffec004a, 8) { 2200 - PTL7_DATA, PTL6_DATA, PTL5_DATA, PTL4_DATA, 1931 + 0, PTL6_DATA, PTL5_DATA, PTL4_DATA, 2201 1932 PTL3_DATA, PTL2_DATA, PTL1_DATA, PTL0_DATA } 2202 1933 }, 2203 1934 { PINMUX_DATA_REG("PMDR", 0xffec004c, 8) { 2204 - 0, PTM6_DATA, PTM5_DATA, PTM4_DATA, 1935 + PTM7_DATA, PTM6_DATA, PTM5_DATA, PTM4_DATA, 2205 1936 PTM3_DATA, PTM2_DATA, PTM1_DATA, PTM0_DATA } 2206 1937 }, 2207 1938 { PINMUX_DATA_REG("PNDR", 0xffec004e, 8) { 2208 - PTN7_DATA, PTN6_DATA, PTN5_DATA, PTN4_DATA, 1939 + 0, PTN6_DATA, PTN5_DATA, PTN4_DATA, 2209 1940 PTN3_DATA, PTN2_DATA, PTN1_DATA, PTN0_DATA } 2210 1941 }, 2211 1942 { PINMUX_DATA_REG("PODR", 0xffec0050, 8) { ··· 2213 1944 PTO3_DATA, PTO2_DATA, PTO1_DATA, PTO0_DATA } 2214 1945 }, 2215 1946 { PINMUX_DATA_REG("PPDR", 0xffec0052, 8) { 2216 - 0, PTP6_DATA, PTP5_DATA, PTP4_DATA, 1947 + PTP7_DATA, PTP6_DATA, PTP5_DATA, PTP4_DATA, 2217 1948 PTP3_DATA, PTP2_DATA, PTP1_DATA, PTP0_DATA } 2218 1949 }, 2219 1950 { PINMUX_DATA_REG("PQDR", 0xffec0054, 8) { ··· 2229 1960 PTS3_DATA, PTS2_DATA, PTS1_DATA, PTS0_DATA } 2230 1961 }, 2231 1962 { PINMUX_DATA_REG("PTDR", 0xffec005a, 8) { 2232 - 0, 0, PTT5_DATA, PTT4_DATA, 1963 + PTT7_DATA, PTT6_DATA, PTT5_DATA, PTT4_DATA, 2233 1964 PTT3_DATA, PTT2_DATA, PTT1_DATA, PTT0_DATA } 2234 1965 }, 2235 1966 { PINMUX_DATA_REG("PUDR", 0xffec005c, 8) { ··· 2269 2000 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END }, 2270 2001 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2271 2002 2272 - .first_gpio = GPIO_PTA7, 2273 - .last_gpio = GPIO_FN_D0, 2003 + .first_gpio = GPIO_PTA0, 2004 + .last_gpio = GPIO_FN_ON_DQ0, 2274 2005 2275 2006 .gpios = pinmux_gpios, 2276 2007 .cfg_regs = pinmux_config_regs, ··· 2284 2015 { 2285 2016 return register_pinmux(&sh7757_pinmux_info); 2286 2017 } 2287 - 2288 2018 arch_initcall(plat_pinmux_setup);
+587
arch/sh/kernel/cpu/sh4a/pinmux-shx3.c
··· 1 + /* 2 + * SH-X3 prototype CPU pinmux 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include <linux/init.h> 11 + #include <linux/kernel.h> 12 + #include <linux/gpio.h> 13 + #include <cpu/shx3.h> 14 + 15 + enum { 16 + PINMUX_RESERVED = 0, 17 + 18 + PINMUX_DATA_BEGIN, 19 + PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA, 20 + PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA, 21 + PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA, 22 + PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA, 23 + PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA, 24 + PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA, 25 + PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA, 26 + PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA, 27 + PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA, 28 + PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA, 29 + PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA, 30 + PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA, 31 + PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA, 32 + PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA, 33 + 34 + PH5_DATA, PH4_DATA, 35 + PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA, 36 + PINMUX_DATA_END, 37 + 38 + PINMUX_INPUT_BEGIN, 39 + PA7_IN, PA6_IN, PA5_IN, PA4_IN, 40 + PA3_IN, PA2_IN, PA1_IN, PA0_IN, 41 + PB7_IN, PB6_IN, PB5_IN, PB4_IN, 42 + PB3_IN, PB2_IN, PB1_IN, PB0_IN, 43 + PC7_IN, PC6_IN, PC5_IN, PC4_IN, 44 + PC3_IN, PC2_IN, PC1_IN, PC0_IN, 45 + PD7_IN, PD6_IN, PD5_IN, PD4_IN, 46 + PD3_IN, PD2_IN, PD1_IN, PD0_IN, 47 + PE7_IN, PE6_IN, PE5_IN, PE4_IN, 48 + PE3_IN, PE2_IN, PE1_IN, PE0_IN, 49 + PF7_IN, PF6_IN, PF5_IN, PF4_IN, 50 + PF3_IN, PF2_IN, PF1_IN, PF0_IN, 51 + PG7_IN, PG6_IN, PG5_IN, PG4_IN, 52 + PG3_IN, PG2_IN, PG1_IN, PG0_IN, 53 + 54 + PH5_IN, PH4_IN, 55 + PH3_IN, PH2_IN, PH1_IN, PH0_IN, 56 + PINMUX_INPUT_END, 57 + 58 + PINMUX_INPUT_PULLUP_BEGIN, 59 + PA7_IN_PU, PA6_IN_PU, PA5_IN_PU, PA4_IN_PU, 60 + PA3_IN_PU, PA2_IN_PU, PA1_IN_PU, PA0_IN_PU, 61 + PB7_IN_PU, PB6_IN_PU, PB5_IN_PU, PB4_IN_PU, 62 + PB3_IN_PU, PB2_IN_PU, PB1_IN_PU, PB0_IN_PU, 63 + PC7_IN_PU, PC6_IN_PU, PC5_IN_PU, PC4_IN_PU, 64 + PC3_IN_PU, PC2_IN_PU, PC1_IN_PU, PC0_IN_PU, 65 + PD7_IN_PU, PD6_IN_PU, PD5_IN_PU, PD4_IN_PU, 66 + PD3_IN_PU, PD2_IN_PU, PD1_IN_PU, PD0_IN_PU, 67 + PE7_IN_PU, PE6_IN_PU, PE5_IN_PU, PE4_IN_PU, 68 + PE3_IN_PU, PE2_IN_PU, PE1_IN_PU, PE0_IN_PU, 69 + PF7_IN_PU, PF6_IN_PU, PF5_IN_PU, PF4_IN_PU, 70 + PF3_IN_PU, PF2_IN_PU, PF1_IN_PU, PF0_IN_PU, 71 + PG7_IN_PU, PG6_IN_PU, PG5_IN_PU, PG4_IN_PU, 72 + PG3_IN_PU, PG2_IN_PU, PG1_IN_PU, PG0_IN_PU, 73 + 74 + PH5_IN_PU, PH4_IN_PU, 75 + PH3_IN_PU, PH2_IN_PU, PH1_IN_PU, PH0_IN_PU, 76 + PINMUX_INPUT_PULLUP_END, 77 + 78 + PINMUX_OUTPUT_BEGIN, 79 + PA7_OUT, PA6_OUT, PA5_OUT, PA4_OUT, 80 + PA3_OUT, PA2_OUT, PA1_OUT, PA0_OUT, 81 + PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT, 82 + PB3_OUT, PB2_OUT, PB1_OUT, PB0_OUT, 83 + PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT, 84 + PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT, 85 + PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT, 86 + PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT, 87 + PE7_OUT, PE6_OUT, PE5_OUT, PE4_OUT, 88 + PE3_OUT, PE2_OUT, PE1_OUT, PE0_OUT, 89 + PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT, 90 + PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT, 91 + PG7_OUT, PG6_OUT, PG5_OUT, PG4_OUT, 92 + PG3_OUT, PG2_OUT, PG1_OUT, PG0_OUT, 93 + 94 + PH5_OUT, PH4_OUT, 95 + PH3_OUT, PH2_OUT, PH1_OUT, PH0_OUT, 96 + PINMUX_OUTPUT_END, 97 + 98 + PINMUX_FUNCTION_BEGIN, 99 + PA7_FN, PA6_FN, PA5_FN, PA4_FN, 100 + PA3_FN, PA2_FN, PA1_FN, PA0_FN, 101 + PB7_FN, PB6_FN, PB5_FN, PB4_FN, 102 + PB3_FN, PB2_FN, PB1_FN, PB0_FN, 103 + PC7_FN, PC6_FN, PC5_FN, PC4_FN, 104 + PC3_FN, PC2_FN, PC1_FN, PC0_FN, 105 + PD7_FN, PD6_FN, PD5_FN, PD4_FN, 106 + PD3_FN, PD2_FN, PD1_FN, PD0_FN, 107 + PE7_FN, PE6_FN, PE5_FN, PE4_FN, 108 + PE3_FN, PE2_FN, PE1_FN, PE0_FN, 109 + PF7_FN, PF6_FN, PF5_FN, PF4_FN, 110 + PF3_FN, PF2_FN, PF1_FN, PF0_FN, 111 + PG7_FN, PG6_FN, PG5_FN, PG4_FN, 112 + PG3_FN, PG2_FN, PG1_FN, PG0_FN, 113 + 114 + PH5_FN, PH4_FN, 115 + PH3_FN, PH2_FN, PH1_FN, PH0_FN, 116 + PINMUX_FUNCTION_END, 117 + 118 + PINMUX_MARK_BEGIN, 119 + 120 + D31_MARK, D30_MARK, D29_MARK, D28_MARK, D27_MARK, D26_MARK, 121 + D25_MARK, D24_MARK, D23_MARK, D22_MARK, D21_MARK, D20_MARK, 122 + D19_MARK, D18_MARK, D17_MARK, D16_MARK, 123 + 124 + BACK_MARK, BREQ_MARK, 125 + WE3_MARK, WE2_MARK, 126 + CS6_MARK, CS5_MARK, CS4_MARK, 127 + CLKOUTENB_MARK, 128 + 129 + DACK3_MARK, DACK2_MARK, DACK1_MARK, DACK0_MARK, 130 + DREQ3_MARK, DREQ2_MARK, DREQ1_MARK, DREQ0_MARK, 131 + 132 + IRQ3_MARK, IRQ2_MARK, IRQ1_MARK, IRQ0_MARK, 133 + 134 + DRAK3_MARK, DRAK2_MARK, DRAK1_MARK, DRAK0_MARK, 135 + 136 + SCK3_MARK, SCK2_MARK, SCK1_MARK, SCK0_MARK, 137 + IRL3_MARK, IRL2_MARK, IRL1_MARK, IRL0_MARK, 138 + TXD3_MARK, TXD2_MARK, TXD1_MARK, TXD0_MARK, 139 + RXD3_MARK, RXD2_MARK, RXD1_MARK, RXD0_MARK, 140 + 141 + CE2B_MARK, CE2A_MARK, IOIS16_MARK, 142 + STATUS1_MARK, STATUS0_MARK, 143 + 144 + IRQOUT_MARK, 145 + 146 + PINMUX_MARK_END, 147 + }; 148 + 149 + static pinmux_enum_t shx3_pinmux_data[] = { 150 + 151 + /* PA GPIO */ 152 + PINMUX_DATA(PA7_DATA, PA7_IN, PA7_OUT, PA7_IN_PU), 153 + PINMUX_DATA(PA6_DATA, PA6_IN, PA6_OUT, PA6_IN_PU), 154 + PINMUX_DATA(PA5_DATA, PA5_IN, PA5_OUT, PA5_IN_PU), 155 + PINMUX_DATA(PA4_DATA, PA4_IN, PA4_OUT, PA4_IN_PU), 156 + PINMUX_DATA(PA3_DATA, PA3_IN, PA3_OUT, PA3_IN_PU), 157 + PINMUX_DATA(PA2_DATA, PA2_IN, PA2_OUT, PA2_IN_PU), 158 + PINMUX_DATA(PA1_DATA, PA1_IN, PA1_OUT, PA1_IN_PU), 159 + PINMUX_DATA(PA0_DATA, PA0_IN, PA0_OUT, PA0_IN_PU), 160 + 161 + /* PB GPIO */ 162 + PINMUX_DATA(PB7_DATA, PB7_IN, PB7_OUT, PB7_IN_PU), 163 + PINMUX_DATA(PB6_DATA, PB6_IN, PB6_OUT, PB6_IN_PU), 164 + PINMUX_DATA(PB5_DATA, PB5_IN, PB5_OUT, PB5_IN_PU), 165 + PINMUX_DATA(PB4_DATA, PB4_IN, PB4_OUT, PB4_IN_PU), 166 + PINMUX_DATA(PB3_DATA, PB3_IN, PB3_OUT, PB3_IN_PU), 167 + PINMUX_DATA(PB2_DATA, PB2_IN, PB2_OUT, PB2_IN_PU), 168 + PINMUX_DATA(PB1_DATA, PB1_IN, PB1_OUT, PB1_IN_PU), 169 + PINMUX_DATA(PB0_DATA, PB0_IN, PB0_OUT, PB0_IN_PU), 170 + 171 + /* PC GPIO */ 172 + PINMUX_DATA(PC7_DATA, PC7_IN, PC7_OUT, PC7_IN_PU), 173 + PINMUX_DATA(PC6_DATA, PC6_IN, PC6_OUT, PC6_IN_PU), 174 + PINMUX_DATA(PC5_DATA, PC5_IN, PC5_OUT, PC5_IN_PU), 175 + PINMUX_DATA(PC4_DATA, PC4_IN, PC4_OUT, PC4_IN_PU), 176 + PINMUX_DATA(PC3_DATA, PC3_IN, PC3_OUT, PC3_IN_PU), 177 + PINMUX_DATA(PC2_DATA, PC2_IN, PC2_OUT, PC2_IN_PU), 178 + PINMUX_DATA(PC1_DATA, PC1_IN, PC1_OUT, PC1_IN_PU), 179 + PINMUX_DATA(PC0_DATA, PC0_IN, PC0_OUT, PC0_IN_PU), 180 + 181 + /* PD GPIO */ 182 + PINMUX_DATA(PD7_DATA, PD7_IN, PD7_OUT, PD7_IN_PU), 183 + PINMUX_DATA(PD6_DATA, PD6_IN, PD6_OUT, PD6_IN_PU), 184 + PINMUX_DATA(PD5_DATA, PD5_IN, PD5_OUT, PD5_IN_PU), 185 + PINMUX_DATA(PD4_DATA, PD4_IN, PD4_OUT, PD4_IN_PU), 186 + PINMUX_DATA(PD3_DATA, PD3_IN, PD3_OUT, PD3_IN_PU), 187 + PINMUX_DATA(PD2_DATA, PD2_IN, PD2_OUT, PD2_IN_PU), 188 + PINMUX_DATA(PD1_DATA, PD1_IN, PD1_OUT, PD1_IN_PU), 189 + PINMUX_DATA(PD0_DATA, PD0_IN, PD0_OUT, PD0_IN_PU), 190 + 191 + /* PE GPIO */ 192 + PINMUX_DATA(PE7_DATA, PE7_IN, PE7_OUT, PE7_IN_PU), 193 + PINMUX_DATA(PE6_DATA, PE6_IN, PE6_OUT, PE6_IN_PU), 194 + PINMUX_DATA(PE5_DATA, PE5_IN, PE5_OUT, PE5_IN_PU), 195 + PINMUX_DATA(PE4_DATA, PE4_IN, PE4_OUT, PE4_IN_PU), 196 + PINMUX_DATA(PE3_DATA, PE3_IN, PE3_OUT, PE3_IN_PU), 197 + PINMUX_DATA(PE2_DATA, PE2_IN, PE2_OUT, PE2_IN_PU), 198 + PINMUX_DATA(PE1_DATA, PE1_IN, PE1_OUT, PE1_IN_PU), 199 + PINMUX_DATA(PE0_DATA, PE0_IN, PE0_OUT, PE0_IN_PU), 200 + 201 + /* PF GPIO */ 202 + PINMUX_DATA(PF7_DATA, PF7_IN, PF7_OUT, PF7_IN_PU), 203 + PINMUX_DATA(PF6_DATA, PF6_IN, PF6_OUT, PF6_IN_PU), 204 + PINMUX_DATA(PF5_DATA, PF5_IN, PF5_OUT, PF5_IN_PU), 205 + PINMUX_DATA(PF4_DATA, PF4_IN, PF4_OUT, PF4_IN_PU), 206 + PINMUX_DATA(PF3_DATA, PF3_IN, PF3_OUT, PF3_IN_PU), 207 + PINMUX_DATA(PF2_DATA, PF2_IN, PF2_OUT, PF2_IN_PU), 208 + PINMUX_DATA(PF1_DATA, PF1_IN, PF1_OUT, PF1_IN_PU), 209 + PINMUX_DATA(PF0_DATA, PF0_IN, PF0_OUT, PF0_IN_PU), 210 + 211 + /* PG GPIO */ 212 + PINMUX_DATA(PG7_DATA, PG7_IN, PG7_OUT, PG7_IN_PU), 213 + PINMUX_DATA(PG6_DATA, PG6_IN, PG6_OUT, PG6_IN_PU), 214 + PINMUX_DATA(PG5_DATA, PG5_IN, PG5_OUT, PG5_IN_PU), 215 + PINMUX_DATA(PG4_DATA, PG4_IN, PG4_OUT, PG4_IN_PU), 216 + PINMUX_DATA(PG3_DATA, PG3_IN, PG3_OUT, PG3_IN_PU), 217 + PINMUX_DATA(PG2_DATA, PG2_IN, PG2_OUT, PG2_IN_PU), 218 + PINMUX_DATA(PG1_DATA, PG1_IN, PG1_OUT, PG1_IN_PU), 219 + PINMUX_DATA(PG0_DATA, PG0_IN, PG0_OUT, PG0_IN_PU), 220 + 221 + /* PH GPIO */ 222 + PINMUX_DATA(PH5_DATA, PH5_IN, PH5_OUT, PH5_IN_PU), 223 + PINMUX_DATA(PH4_DATA, PH4_IN, PH4_OUT, PH4_IN_PU), 224 + PINMUX_DATA(PH3_DATA, PH3_IN, PH3_OUT, PH3_IN_PU), 225 + PINMUX_DATA(PH2_DATA, PH2_IN, PH2_OUT, PH2_IN_PU), 226 + PINMUX_DATA(PH1_DATA, PH1_IN, PH1_OUT, PH1_IN_PU), 227 + PINMUX_DATA(PH0_DATA, PH0_IN, PH0_OUT, PH0_IN_PU), 228 + 229 + /* PA FN */ 230 + PINMUX_DATA(D31_MARK, PA7_FN), 231 + PINMUX_DATA(D30_MARK, PA6_FN), 232 + PINMUX_DATA(D29_MARK, PA5_FN), 233 + PINMUX_DATA(D28_MARK, PA4_FN), 234 + PINMUX_DATA(D27_MARK, PA3_FN), 235 + PINMUX_DATA(D26_MARK, PA2_FN), 236 + PINMUX_DATA(D25_MARK, PA1_FN), 237 + PINMUX_DATA(D24_MARK, PA0_FN), 238 + 239 + /* PB FN */ 240 + PINMUX_DATA(D23_MARK, PB7_FN), 241 + PINMUX_DATA(D22_MARK, PB6_FN), 242 + PINMUX_DATA(D21_MARK, PB5_FN), 243 + PINMUX_DATA(D20_MARK, PB4_FN), 244 + PINMUX_DATA(D19_MARK, PB3_FN), 245 + PINMUX_DATA(D18_MARK, PB2_FN), 246 + PINMUX_DATA(D17_MARK, PB1_FN), 247 + PINMUX_DATA(D16_MARK, PB0_FN), 248 + 249 + /* PC FN */ 250 + PINMUX_DATA(BACK_MARK, PC7_FN), 251 + PINMUX_DATA(BREQ_MARK, PC6_FN), 252 + PINMUX_DATA(WE3_MARK, PC5_FN), 253 + PINMUX_DATA(WE2_MARK, PC4_FN), 254 + PINMUX_DATA(CS6_MARK, PC3_FN), 255 + PINMUX_DATA(CS5_MARK, PC2_FN), 256 + PINMUX_DATA(CS4_MARK, PC1_FN), 257 + PINMUX_DATA(CLKOUTENB_MARK, PC0_FN), 258 + 259 + /* PD FN */ 260 + PINMUX_DATA(DACK3_MARK, PD7_FN), 261 + PINMUX_DATA(DACK2_MARK, PD6_FN), 262 + PINMUX_DATA(DACK1_MARK, PD5_FN), 263 + PINMUX_DATA(DACK0_MARK, PD4_FN), 264 + PINMUX_DATA(DREQ3_MARK, PD3_FN), 265 + PINMUX_DATA(DREQ2_MARK, PD2_FN), 266 + PINMUX_DATA(DREQ1_MARK, PD1_FN), 267 + PINMUX_DATA(DREQ0_MARK, PD0_FN), 268 + 269 + /* PE FN */ 270 + PINMUX_DATA(IRQ3_MARK, PE7_FN), 271 + PINMUX_DATA(IRQ2_MARK, PE6_FN), 272 + PINMUX_DATA(IRQ1_MARK, PE5_FN), 273 + PINMUX_DATA(IRQ0_MARK, PE4_FN), 274 + PINMUX_DATA(DRAK3_MARK, PE3_FN), 275 + PINMUX_DATA(DRAK2_MARK, PE2_FN), 276 + PINMUX_DATA(DRAK1_MARK, PE1_FN), 277 + PINMUX_DATA(DRAK0_MARK, PE0_FN), 278 + 279 + /* PF FN */ 280 + PINMUX_DATA(SCK3_MARK, PF7_FN), 281 + PINMUX_DATA(SCK2_MARK, PF6_FN), 282 + PINMUX_DATA(SCK1_MARK, PF5_FN), 283 + PINMUX_DATA(SCK0_MARK, PF4_FN), 284 + PINMUX_DATA(IRL3_MARK, PF3_FN), 285 + PINMUX_DATA(IRL2_MARK, PF2_FN), 286 + PINMUX_DATA(IRL1_MARK, PF1_FN), 287 + PINMUX_DATA(IRL0_MARK, PF0_FN), 288 + 289 + /* PG FN */ 290 + PINMUX_DATA(TXD3_MARK, PG7_FN), 291 + PINMUX_DATA(TXD2_MARK, PG6_FN), 292 + PINMUX_DATA(TXD1_MARK, PG5_FN), 293 + PINMUX_DATA(TXD0_MARK, PG4_FN), 294 + PINMUX_DATA(RXD3_MARK, PG3_FN), 295 + PINMUX_DATA(RXD2_MARK, PG2_FN), 296 + PINMUX_DATA(RXD1_MARK, PG1_FN), 297 + PINMUX_DATA(RXD0_MARK, PG0_FN), 298 + 299 + /* PH FN */ 300 + PINMUX_DATA(CE2B_MARK, PH5_FN), 301 + PINMUX_DATA(CE2A_MARK, PH4_FN), 302 + PINMUX_DATA(IOIS16_MARK, PH3_FN), 303 + PINMUX_DATA(STATUS1_MARK, PH2_FN), 304 + PINMUX_DATA(STATUS0_MARK, PH1_FN), 305 + PINMUX_DATA(IRQOUT_MARK, PH0_FN), 306 + }; 307 + 308 + static struct pinmux_gpio shx3_pinmux_gpios[] = { 309 + /* PA */ 310 + PINMUX_GPIO(GPIO_PA7, PA7_DATA), 311 + PINMUX_GPIO(GPIO_PA6, PA6_DATA), 312 + PINMUX_GPIO(GPIO_PA5, PA5_DATA), 313 + PINMUX_GPIO(GPIO_PA4, PA4_DATA), 314 + PINMUX_GPIO(GPIO_PA3, PA3_DATA), 315 + PINMUX_GPIO(GPIO_PA2, PA2_DATA), 316 + PINMUX_GPIO(GPIO_PA1, PA1_DATA), 317 + PINMUX_GPIO(GPIO_PA0, PA0_DATA), 318 + 319 + /* PB */ 320 + PINMUX_GPIO(GPIO_PB7, PB7_DATA), 321 + PINMUX_GPIO(GPIO_PB6, PB6_DATA), 322 + PINMUX_GPIO(GPIO_PB5, PB5_DATA), 323 + PINMUX_GPIO(GPIO_PB4, PB4_DATA), 324 + PINMUX_GPIO(GPIO_PB3, PB3_DATA), 325 + PINMUX_GPIO(GPIO_PB2, PB2_DATA), 326 + PINMUX_GPIO(GPIO_PB1, PB1_DATA), 327 + PINMUX_GPIO(GPIO_PB0, PB0_DATA), 328 + 329 + /* PC */ 330 + PINMUX_GPIO(GPIO_PC7, PC7_DATA), 331 + PINMUX_GPIO(GPIO_PC6, PC6_DATA), 332 + PINMUX_GPIO(GPIO_PC5, PC5_DATA), 333 + PINMUX_GPIO(GPIO_PC4, PC4_DATA), 334 + PINMUX_GPIO(GPIO_PC3, PC3_DATA), 335 + PINMUX_GPIO(GPIO_PC2, PC2_DATA), 336 + PINMUX_GPIO(GPIO_PC1, PC1_DATA), 337 + PINMUX_GPIO(GPIO_PC0, PC0_DATA), 338 + 339 + /* PD */ 340 + PINMUX_GPIO(GPIO_PD7, PD7_DATA), 341 + PINMUX_GPIO(GPIO_PD6, PD6_DATA), 342 + PINMUX_GPIO(GPIO_PD5, PD5_DATA), 343 + PINMUX_GPIO(GPIO_PD4, PD4_DATA), 344 + PINMUX_GPIO(GPIO_PD3, PD3_DATA), 345 + PINMUX_GPIO(GPIO_PD2, PD2_DATA), 346 + PINMUX_GPIO(GPIO_PD1, PD1_DATA), 347 + PINMUX_GPIO(GPIO_PD0, PD0_DATA), 348 + 349 + /* PE */ 350 + PINMUX_GPIO(GPIO_PE7, PE7_DATA), 351 + PINMUX_GPIO(GPIO_PE6, PE6_DATA), 352 + PINMUX_GPIO(GPIO_PE5, PE5_DATA), 353 + PINMUX_GPIO(GPIO_PE4, PE4_DATA), 354 + PINMUX_GPIO(GPIO_PE3, PE3_DATA), 355 + PINMUX_GPIO(GPIO_PE2, PE2_DATA), 356 + PINMUX_GPIO(GPIO_PE1, PE1_DATA), 357 + PINMUX_GPIO(GPIO_PE0, PE0_DATA), 358 + 359 + /* PF */ 360 + PINMUX_GPIO(GPIO_PF7, PF7_DATA), 361 + PINMUX_GPIO(GPIO_PF6, PF6_DATA), 362 + PINMUX_GPIO(GPIO_PF5, PF5_DATA), 363 + PINMUX_GPIO(GPIO_PF4, PF4_DATA), 364 + PINMUX_GPIO(GPIO_PF3, PF3_DATA), 365 + PINMUX_GPIO(GPIO_PF2, PF2_DATA), 366 + PINMUX_GPIO(GPIO_PF1, PF1_DATA), 367 + PINMUX_GPIO(GPIO_PF0, PF0_DATA), 368 + 369 + /* PG */ 370 + PINMUX_GPIO(GPIO_PG7, PG7_DATA), 371 + PINMUX_GPIO(GPIO_PG6, PG6_DATA), 372 + PINMUX_GPIO(GPIO_PG5, PG5_DATA), 373 + PINMUX_GPIO(GPIO_PG4, PG4_DATA), 374 + PINMUX_GPIO(GPIO_PG3, PG3_DATA), 375 + PINMUX_GPIO(GPIO_PG2, PG2_DATA), 376 + PINMUX_GPIO(GPIO_PG1, PG1_DATA), 377 + PINMUX_GPIO(GPIO_PG0, PG0_DATA), 378 + 379 + /* PH */ 380 + PINMUX_GPIO(GPIO_PH5, PH5_DATA), 381 + PINMUX_GPIO(GPIO_PH4, PH4_DATA), 382 + PINMUX_GPIO(GPIO_PH3, PH3_DATA), 383 + PINMUX_GPIO(GPIO_PH2, PH2_DATA), 384 + PINMUX_GPIO(GPIO_PH1, PH1_DATA), 385 + PINMUX_GPIO(GPIO_PH0, PH0_DATA), 386 + 387 + /* FN */ 388 + PINMUX_GPIO(GPIO_FN_D31, D31_MARK), 389 + PINMUX_GPIO(GPIO_FN_D30, D30_MARK), 390 + PINMUX_GPIO(GPIO_FN_D29, D29_MARK), 391 + PINMUX_GPIO(GPIO_FN_D28, D28_MARK), 392 + PINMUX_GPIO(GPIO_FN_D27, D27_MARK), 393 + PINMUX_GPIO(GPIO_FN_D26, D26_MARK), 394 + PINMUX_GPIO(GPIO_FN_D25, D25_MARK), 395 + PINMUX_GPIO(GPIO_FN_D24, D24_MARK), 396 + PINMUX_GPIO(GPIO_FN_D23, D23_MARK), 397 + PINMUX_GPIO(GPIO_FN_D22, D22_MARK), 398 + PINMUX_GPIO(GPIO_FN_D21, D21_MARK), 399 + PINMUX_GPIO(GPIO_FN_D20, D20_MARK), 400 + PINMUX_GPIO(GPIO_FN_D19, D19_MARK), 401 + PINMUX_GPIO(GPIO_FN_D18, D18_MARK), 402 + PINMUX_GPIO(GPIO_FN_D17, D17_MARK), 403 + PINMUX_GPIO(GPIO_FN_D16, D16_MARK), 404 + PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK), 405 + PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK), 406 + PINMUX_GPIO(GPIO_FN_WE3, WE3_MARK), 407 + PINMUX_GPIO(GPIO_FN_WE2, WE2_MARK), 408 + PINMUX_GPIO(GPIO_FN_CS6, CS6_MARK), 409 + PINMUX_GPIO(GPIO_FN_CS5, CS5_MARK), 410 + PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK), 411 + PINMUX_GPIO(GPIO_FN_CLKOUTENB, CLKOUTENB_MARK), 412 + PINMUX_GPIO(GPIO_FN_DACK3, DACK3_MARK), 413 + PINMUX_GPIO(GPIO_FN_DACK2, DACK2_MARK), 414 + PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK), 415 + PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK), 416 + PINMUX_GPIO(GPIO_FN_DREQ3, DREQ3_MARK), 417 + PINMUX_GPIO(GPIO_FN_DREQ2, DREQ2_MARK), 418 + PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK), 419 + PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK), 420 + PINMUX_GPIO(GPIO_FN_IRQ3, IRQ3_MARK), 421 + PINMUX_GPIO(GPIO_FN_IRQ2, IRQ2_MARK), 422 + PINMUX_GPIO(GPIO_FN_IRQ1, IRQ1_MARK), 423 + PINMUX_GPIO(GPIO_FN_IRQ0, IRQ0_MARK), 424 + PINMUX_GPIO(GPIO_FN_DRAK3, DRAK3_MARK), 425 + PINMUX_GPIO(GPIO_FN_DRAK2, DRAK2_MARK), 426 + PINMUX_GPIO(GPIO_FN_DRAK1, DRAK1_MARK), 427 + PINMUX_GPIO(GPIO_FN_DRAK0, DRAK0_MARK), 428 + PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK), 429 + PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK), 430 + PINMUX_GPIO(GPIO_FN_SCK1, SCK1_MARK), 431 + PINMUX_GPIO(GPIO_FN_SCK0, SCK0_MARK), 432 + PINMUX_GPIO(GPIO_FN_IRL3, IRL3_MARK), 433 + PINMUX_GPIO(GPIO_FN_IRL2, IRL2_MARK), 434 + PINMUX_GPIO(GPIO_FN_IRL1, IRL1_MARK), 435 + PINMUX_GPIO(GPIO_FN_IRL0, IRL0_MARK), 436 + PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK), 437 + PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK), 438 + PINMUX_GPIO(GPIO_FN_TXD1, TXD1_MARK), 439 + PINMUX_GPIO(GPIO_FN_TXD0, TXD0_MARK), 440 + PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK), 441 + PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK), 442 + PINMUX_GPIO(GPIO_FN_RXD1, RXD1_MARK), 443 + PINMUX_GPIO(GPIO_FN_RXD0, RXD0_MARK), 444 + PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK), 445 + PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK), 446 + PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK), 447 + PINMUX_GPIO(GPIO_FN_STATUS1, STATUS1_MARK), 448 + PINMUX_GPIO(GPIO_FN_STATUS0, STATUS0_MARK), 449 + PINMUX_GPIO(GPIO_FN_IRQOUT, IRQOUT_MARK), 450 + }; 451 + 452 + static struct pinmux_cfg_reg shx3_pinmux_config_regs[] = { 453 + { PINMUX_CFG_REG("PABCR", 0xffc70000, 32, 2) { 454 + PA7_FN, PA7_OUT, PA7_IN, PA7_IN_PU, 455 + PA6_FN, PA6_OUT, PA6_IN, PA6_IN_PU, 456 + PA5_FN, PA5_OUT, PA5_IN, PA5_IN_PU, 457 + PA4_FN, PA4_OUT, PA4_IN, PA4_IN_PU, 458 + PA3_FN, PA3_OUT, PA3_IN, PA3_IN_PU, 459 + PA2_FN, PA2_OUT, PA2_IN, PA2_IN_PU, 460 + PA1_FN, PA1_OUT, PA1_IN, PA1_IN_PU, 461 + PA0_FN, PA0_OUT, PA0_IN, PA0_IN_PU, 462 + PB7_FN, PB7_OUT, PB7_IN, PB7_IN_PU, 463 + PB6_FN, PB6_OUT, PB6_IN, PB6_IN_PU, 464 + PB5_FN, PB5_OUT, PB5_IN, PB5_IN_PU, 465 + PB4_FN, PB4_OUT, PB4_IN, PB4_IN_PU, 466 + PB3_FN, PB3_OUT, PB3_IN, PB3_IN_PU, 467 + PB2_FN, PB2_OUT, PB2_IN, PB2_IN_PU, 468 + PB1_FN, PB1_OUT, PB1_IN, PB1_IN_PU, 469 + PB0_FN, PB0_OUT, PB0_IN, PB0_IN_PU, }, 470 + }, 471 + { PINMUX_CFG_REG("PCDCR", 0xffc70004, 32, 2) { 472 + PC7_FN, PC7_OUT, PC7_IN, PC7_IN_PU, 473 + PC6_FN, PC6_OUT, PC6_IN, PC6_IN_PU, 474 + PC5_FN, PC5_OUT, PC5_IN, PC5_IN_PU, 475 + PC4_FN, PC4_OUT, PC4_IN, PC4_IN_PU, 476 + PC3_FN, PC3_OUT, PC3_IN, PC3_IN_PU, 477 + PC2_FN, PC2_OUT, PC2_IN, PC2_IN_PU, 478 + PC1_FN, PC1_OUT, PC1_IN, PC1_IN_PU, 479 + PC0_FN, PC0_OUT, PC0_IN, PC0_IN_PU, 480 + PD7_FN, PD7_OUT, PD7_IN, PD7_IN_PU, 481 + PD6_FN, PD6_OUT, PD6_IN, PD6_IN_PU, 482 + PD5_FN, PD5_OUT, PD5_IN, PD5_IN_PU, 483 + PD4_FN, PD4_OUT, PD4_IN, PD4_IN_PU, 484 + PD3_FN, PD3_OUT, PD3_IN, PD3_IN_PU, 485 + PD2_FN, PD2_OUT, PD2_IN, PD2_IN_PU, 486 + PD1_FN, PD1_OUT, PD1_IN, PD1_IN_PU, 487 + PD0_FN, PD0_OUT, PD0_IN, PD0_IN_PU, }, 488 + }, 489 + { PINMUX_CFG_REG("PEFCR", 0xffc70008, 32, 2) { 490 + PE7_FN, PE7_OUT, PE7_IN, PE7_IN_PU, 491 + PE6_FN, PE6_OUT, PE6_IN, PE6_IN_PU, 492 + PE5_FN, PE5_OUT, PE5_IN, PE5_IN_PU, 493 + PE4_FN, PE4_OUT, PE4_IN, PE4_IN_PU, 494 + PE3_FN, PE3_OUT, PE3_IN, PE3_IN_PU, 495 + PE2_FN, PE2_OUT, PE2_IN, PE2_IN_PU, 496 + PE1_FN, PE1_OUT, PE1_IN, PE1_IN_PU, 497 + PE0_FN, PE0_OUT, PE0_IN, PE0_IN_PU, 498 + PF7_FN, PF7_OUT, PF7_IN, PF7_IN_PU, 499 + PF6_FN, PF6_OUT, PF6_IN, PF6_IN_PU, 500 + PF5_FN, PF5_OUT, PF5_IN, PF5_IN_PU, 501 + PF4_FN, PF4_OUT, PF4_IN, PF4_IN_PU, 502 + PF3_FN, PF3_OUT, PF3_IN, PF3_IN_PU, 503 + PF2_FN, PF2_OUT, PF2_IN, PF2_IN_PU, 504 + PF1_FN, PF1_OUT, PF1_IN, PF1_IN_PU, 505 + PF0_FN, PF0_OUT, PF0_IN, PF0_IN_PU, }, 506 + }, 507 + { PINMUX_CFG_REG("PGHCR", 0xffc7000c, 32, 2) { 508 + PG7_FN, PG7_OUT, PG7_IN, PG7_IN_PU, 509 + PG6_FN, PG6_OUT, PG6_IN, PG6_IN_PU, 510 + PG5_FN, PG5_OUT, PG5_IN, PG5_IN_PU, 511 + PG4_FN, PG4_OUT, PG4_IN, PG4_IN_PU, 512 + PG3_FN, PG3_OUT, PG3_IN, PG3_IN_PU, 513 + PG2_FN, PG2_OUT, PG2_IN, PG2_IN_PU, 514 + PG1_FN, PG1_OUT, PG1_IN, PG1_IN_PU, 515 + PG0_FN, PG0_OUT, PG0_IN, PG0_IN_PU, 516 + 0, 0, 0, 0, 517 + 0, 0, 0, 0, 518 + PH5_FN, PH5_OUT, PH5_IN, PH5_IN_PU, 519 + PH4_FN, PH4_OUT, PH4_IN, PH4_IN_PU, 520 + PH3_FN, PH3_OUT, PH3_IN, PH3_IN_PU, 521 + PH2_FN, PH2_OUT, PH2_IN, PH2_IN_PU, 522 + PH1_FN, PH1_OUT, PH1_IN, PH1_IN_PU, 523 + PH0_FN, PH0_OUT, PH0_IN, PH0_IN_PU, }, 524 + }, 525 + { }, 526 + }; 527 + 528 + static struct pinmux_data_reg shx3_pinmux_data_regs[] = { 529 + { PINMUX_DATA_REG("PABDR", 0xffc70010, 32) { 530 + 0, 0, 0, 0, 0, 0, 0, 0, 531 + PA7_DATA, PA6_DATA, PA5_DATA, PA4_DATA, 532 + PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA, 533 + 0, 0, 0, 0, 0, 0, 0, 0, 534 + PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA, 535 + PB3_DATA, PB2_DATA, PB1_DATA, PB0_DATA, }, 536 + }, 537 + { PINMUX_DATA_REG("PCDDR", 0xffc70014, 32) { 538 + 0, 0, 0, 0, 0, 0, 0, 0, 539 + PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA, 540 + PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA, 541 + 0, 0, 0, 0, 0, 0, 0, 0, 542 + PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA, 543 + PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA, }, 544 + }, 545 + { PINMUX_DATA_REG("PEFDR", 0xffc70018, 32) { 546 + 0, 0, 0, 0, 0, 0, 0, 0, 547 + PE7_DATA, PE6_DATA, PE5_DATA, PE4_DATA, 548 + PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA, 549 + 0, 0, 0, 0, 0, 0, 0, 0, 550 + PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA, 551 + PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA, }, 552 + }, 553 + { PINMUX_DATA_REG("PGHDR", 0xffc7001c, 32) { 554 + 0, 0, 0, 0, 0, 0, 0, 0, 555 + PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA, 556 + PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA, 557 + 0, 0, 0, 0, 0, 0, 0, 0, 558 + 0, 0, PH5_DATA, PH4_DATA, 559 + PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA, }, 560 + }, 561 + { }, 562 + }; 563 + 564 + static struct pinmux_info shx3_pinmux_info = { 565 + .name = "shx3_pfc", 566 + .reserved_id = PINMUX_RESERVED, 567 + .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END }, 568 + .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END }, 569 + .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, 570 + PINMUX_INPUT_PULLUP_END }, 571 + .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END }, 572 + .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END }, 573 + .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 574 + .first_gpio = GPIO_PA7, 575 + .last_gpio = GPIO_FN_IRQOUT, 576 + .gpios = shx3_pinmux_gpios, 577 + .gpio_data = shx3_pinmux_data, 578 + .gpio_data_size = ARRAY_SIZE(shx3_pinmux_data), 579 + .cfg_regs = shx3_pinmux_config_regs, 580 + .data_regs = shx3_pinmux_data_regs, 581 + }; 582 + 583 + static int __init shx3_pinmux_setup(void) 584 + { 585 + return register_pinmux(&shx3_pinmux_info); 586 + } 587 + arch_initcall(shx3_pinmux_setup);
+66
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
··· 524 524 }, 525 525 }; 526 526 527 + /* BEU0 */ 528 + static struct uio_info beu0_platform_data = { 529 + .name = "BEU0", 530 + .version = "0", 531 + .irq = evt2irq(0x8A0), 532 + }; 533 + 534 + static struct resource beu0_resources[] = { 535 + [0] = { 536 + .name = "BEU0", 537 + .start = 0xfe930000, 538 + .end = 0xfe933400, 539 + .flags = IORESOURCE_MEM, 540 + }, 541 + [1] = { 542 + /* place holder for contiguous memory */ 543 + }, 544 + }; 545 + 546 + static struct platform_device beu0_device = { 547 + .name = "uio_pdrv_genirq", 548 + .id = 6, 549 + .dev = { 550 + .platform_data = &beu0_platform_data, 551 + }, 552 + .resource = beu0_resources, 553 + .num_resources = ARRAY_SIZE(beu0_resources), 554 + .archdata = { 555 + .hwblk_id = HWBLK_BEU0, 556 + }, 557 + }; 558 + 559 + /* BEU1 */ 560 + static struct uio_info beu1_platform_data = { 561 + .name = "BEU1", 562 + .version = "0", 563 + .irq = evt2irq(0xA00), 564 + }; 565 + 566 + static struct resource beu1_resources[] = { 567 + [0] = { 568 + .name = "BEU1", 569 + .start = 0xfe940000, 570 + .end = 0xfe943400, 571 + .flags = IORESOURCE_MEM, 572 + }, 573 + [1] = { 574 + /* place holder for contiguous memory */ 575 + }, 576 + }; 577 + 578 + static struct platform_device beu1_device = { 579 + .name = "uio_pdrv_genirq", 580 + .id = 7, 581 + .dev = { 582 + .platform_data = &beu1_platform_data, 583 + }, 584 + .resource = beu1_resources, 585 + .num_resources = ARRAY_SIZE(beu1_resources), 586 + .archdata = { 587 + .hwblk_id = HWBLK_BEU1, 588 + }, 589 + }; 590 + 527 591 static struct sh_timer_config cmt_platform_data = { 528 592 .channel_offset = 0x60, 529 593 .timer_bit = 5, ··· 921 857 &vpu_device, 922 858 &veu0_device, 923 859 &veu1_device, 860 + &beu0_device, 861 + &beu1_device, 924 862 &jpu_device, 925 863 &spu0_device, 926 864 &spu1_device,
+150 -72
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 26 26 27 27 static struct platform_device scif2_device = { 28 28 .name = "sh-sci", 29 - .id = 2, 29 + .id = 0, 30 30 .dev = { 31 31 .platform_data = &scif2_platform_data, 32 32 }, ··· 41 41 42 42 static struct platform_device scif3_device = { 43 43 .name = "sh-sci", 44 - .id = 3, 44 + .id = 1, 45 45 .dev = { 46 46 .platform_data = &scif3_platform_data, 47 47 }, ··· 56 56 57 57 static struct platform_device scif4_device = { 58 58 .name = "sh-sci", 59 - .id = 4, 59 + .id = 2, 60 60 .dev = { 61 61 .platform_data = &scif4_platform_data, 62 62 }, ··· 163 163 IRL4_HHLL, IRL4_HHLH, IRL4_HHHL, 164 164 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7, 165 165 166 - SDHI, 167 - DVC, 168 - IRQ8, IRQ9, IRQ10, 169 - WDT0, 170 - TMU0, TMU1, TMU2, TMU2_TICPI, 166 + SDHI, DVC, 167 + IRQ8, IRQ9, IRQ11, IRQ10, IRQ12, IRQ13, IRQ14, IRQ15, 168 + TMU0, TMU1, TMU2, TMU2_TICPI, TMU3, TMU4, TMU5, 171 169 HUDI, 172 - 173 170 ARC4, 174 - DMAC0, 175 - IRQ11, 176 - SCIF2, 177 - DMAC1_6, 178 - USB0, 179 - IRQ12, 171 + DMAC0_5, DMAC6_7, DMAC8_11, 172 + SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, 173 + USB0, USB1, 180 174 JMC, 181 - SPI1, 182 - IRQ13, IRQ14, 183 - USB1, 175 + SPI0, SPI1, 184 176 TMR01, TMR23, TMR45, 185 - WDT1, 186 177 FRT, 187 - LPC, 188 - SCIF0, SCIF1, SCIF3, 189 - PECI0I, PECI1I, PECI2I, 190 - IRQ15, 178 + LPC, LPC5, LPC6, LPC7, LPC8, 179 + PECI0, PECI1, PECI2, PECI3, PECI4, PECI5, 191 180 ETHERC, 192 - SPI0, 193 - ADC1, 194 - DMAC1_8, 181 + ADC0, ADC1, 195 182 SIM, 196 - TMU3, TMU4, TMU5, 197 - ADC0, 198 - SCIF4, 199 183 IIC0_0, IIC0_1, IIC0_2, IIC0_3, 200 184 IIC1_0, IIC1_1, IIC1_2, IIC1_3, 201 185 IIC2_0, IIC2_1, IIC2_2, IIC2_3, ··· 190 206 IIC7_0, IIC7_1, IIC7_2, IIC7_3, 191 207 IIC8_0, IIC8_1, IIC8_2, IIC8_3, 192 208 IIC9_0, IIC9_1, IIC9_2, IIC9_3, 193 - PCIINTA, 194 - PCIE, 209 + ONFICTL, 210 + MMC1, MMC2, 211 + ECCU, 212 + PCIC, 213 + G200, 214 + RSPI, 195 215 SGPIO, 216 + DMINT12, DMINT13, DMINT14, DMINT15, DMINT16, DMINT17, DMINT18, DMINT19, 217 + DMINT20, DMINT21, DMINT22, DMINT23, 218 + DDRECC, 219 + TSIP, 220 + PCIE_BRIDGE, 221 + WDT0B, WDT1B, WDT2B, WDT3B, WDT4B, WDT5B, WDT6B, WDT7B, WDT8B, 222 + GETHER0, GETHER1, GETHER2, 223 + PBIA, PBIB, PBIC, 224 + DMAE2, DMAE3, 225 + SERMUX2, SERMUX3, 196 226 197 227 /* interrupt groups */ 198 228 ··· 219 221 INTC_VECT(DVC, 0x4e0), 220 222 INTC_VECT(IRQ8, 0x500), INTC_VECT(IRQ9, 0x520), 221 223 INTC_VECT(IRQ10, 0x540), 222 - INTC_VECT(WDT0, 0x560), 223 224 INTC_VECT(TMU0, 0x580), INTC_VECT(TMU1, 0x5a0), 224 225 INTC_VECT(TMU2, 0x5c0), INTC_VECT(TMU2_TICPI, 0x5e0), 225 226 INTC_VECT(HUDI, 0x600), 226 227 INTC_VECT(ARC4, 0x620), 227 - INTC_VECT(DMAC0, 0x640), INTC_VECT(DMAC0, 0x660), 228 - INTC_VECT(DMAC0, 0x680), INTC_VECT(DMAC0, 0x6a0), 229 - INTC_VECT(DMAC0, 0x6c0), 228 + INTC_VECT(DMAC0_5, 0x640), INTC_VECT(DMAC0_5, 0x660), 229 + INTC_VECT(DMAC0_5, 0x680), INTC_VECT(DMAC0_5, 0x6a0), 230 + INTC_VECT(DMAC0_5, 0x6c0), 230 231 INTC_VECT(IRQ11, 0x6e0), 231 232 INTC_VECT(SCIF2, 0x700), INTC_VECT(SCIF2, 0x720), 232 233 INTC_VECT(SCIF2, 0x740), INTC_VECT(SCIF2, 0x760), 233 - INTC_VECT(DMAC0, 0x780), INTC_VECT(DMAC0, 0x7a0), 234 - INTC_VECT(DMAC1_6, 0x7c0), INTC_VECT(DMAC1_6, 0x7e0), 234 + INTC_VECT(DMAC0_5, 0x780), INTC_VECT(DMAC0_5, 0x7a0), 235 + INTC_VECT(DMAC6_7, 0x7c0), INTC_VECT(DMAC6_7, 0x7e0), 235 236 INTC_VECT(USB0, 0x840), 236 237 INTC_VECT(IRQ12, 0x880), 237 238 INTC_VECT(JMC, 0x8a0), ··· 239 242 INTC_VECT(USB1, 0x920), 240 243 INTC_VECT(TMR01, 0xa00), INTC_VECT(TMR23, 0xa20), 241 244 INTC_VECT(TMR45, 0xa40), 242 - INTC_VECT(WDT1, 0xa60), 243 245 INTC_VECT(FRT, 0xa80), 244 246 INTC_VECT(LPC, 0xaa0), INTC_VECT(LPC, 0xac0), 245 247 INTC_VECT(LPC, 0xae0), INTC_VECT(LPC, 0xb00), ··· 246 250 INTC_VECT(SCIF0, 0xb40), INTC_VECT(SCIF1, 0xb60), 247 251 INTC_VECT(SCIF3, 0xb80), INTC_VECT(SCIF3, 0xba0), 248 252 INTC_VECT(SCIF3, 0xbc0), INTC_VECT(SCIF3, 0xbe0), 249 - INTC_VECT(PECI0I, 0xc00), INTC_VECT(PECI1I, 0xc20), 250 - INTC_VECT(PECI2I, 0xc40), 253 + INTC_VECT(PECI0, 0xc00), INTC_VECT(PECI1, 0xc20), 254 + INTC_VECT(PECI2, 0xc40), 251 255 INTC_VECT(IRQ15, 0xc60), 252 256 INTC_VECT(ETHERC, 0xc80), INTC_VECT(ETHERC, 0xca0), 253 257 INTC_VECT(SPI0, 0xcc0), 254 258 INTC_VECT(ADC1, 0xce0), 255 - INTC_VECT(DMAC1_8, 0xd00), INTC_VECT(DMAC1_8, 0xd20), 256 - INTC_VECT(DMAC1_8, 0xd40), INTC_VECT(DMAC1_8, 0xd60), 259 + INTC_VECT(DMAC8_11, 0xd00), INTC_VECT(DMAC8_11, 0xd20), 260 + INTC_VECT(DMAC8_11, 0xd40), INTC_VECT(DMAC8_11, 0xd60), 257 261 INTC_VECT(SIM, 0xd80), INTC_VECT(SIM, 0xda0), 258 262 INTC_VECT(SIM, 0xdc0), INTC_VECT(SIM, 0xde0), 259 263 INTC_VECT(TMU3, 0xe00), INTC_VECT(TMU4, 0xe20), ··· 274 278 INTC_VECT(IIC5_0, 0x1860), INTC_VECT(IIC5_1, 0x1880), 275 279 INTC_VECT(IIC5_2, 0x18a0), INTC_VECT(IIC5_3, 0x18c0), 276 280 INTC_VECT(IIC6_0, 0x18e0), INTC_VECT(IIC6_1, 0x1900), 277 - INTC_VECT(IIC6_2, 0x1920), INTC_VECT(IIC6_3, 0x1980), 281 + INTC_VECT(IIC6_2, 0x1920), 282 + INTC_VECT(ONFICTL, 0x1960), 283 + INTC_VECT(IIC6_3, 0x1980), 278 284 INTC_VECT(IIC7_0, 0x19a0), INTC_VECT(IIC7_1, 0x1a00), 279 285 INTC_VECT(IIC7_2, 0x1a20), INTC_VECT(IIC7_3, 0x1a40), 280 286 INTC_VECT(IIC8_0, 0x1a60), INTC_VECT(IIC8_1, 0x1a80), 281 287 INTC_VECT(IIC8_2, 0x1aa0), INTC_VECT(IIC8_3, 0x1b40), 282 288 INTC_VECT(IIC9_0, 0x1b60), INTC_VECT(IIC9_1, 0x1b80), 283 289 INTC_VECT(IIC9_2, 0x1c00), INTC_VECT(IIC9_3, 0x1c20), 284 - INTC_VECT(PCIINTA, 0x1ce0), 285 - INTC_VECT(PCIE, 0x1e00), 286 - INTC_VECT(SGPIO, 0x1f80), 287 - INTC_VECT(SGPIO, 0x1fa0), 290 + INTC_VECT(MMC1, 0x1c60), INTC_VECT(MMC2, 0x1c80), 291 + INTC_VECT(ECCU, 0x1cc0), 292 + INTC_VECT(PCIC, 0x1ce0), 293 + INTC_VECT(G200, 0x1d00), 294 + INTC_VECT(RSPI, 0x1d80), INTC_VECT(RSPI, 0x1da0), 295 + INTC_VECT(RSPI, 0x1dc0), INTC_VECT(RSPI, 0x1de0), 296 + INTC_VECT(PECI3, 0x1ec0), INTC_VECT(PECI4, 0x1ee0), 297 + INTC_VECT(PECI5, 0x1f00), 298 + INTC_VECT(SGPIO, 0x1f80), INTC_VECT(SGPIO, 0x1fa0), 299 + INTC_VECT(SGPIO, 0x1fc0), 300 + INTC_VECT(DMINT12, 0x2400), INTC_VECT(DMINT13, 0x2420), 301 + INTC_VECT(DMINT14, 0x2440), INTC_VECT(DMINT15, 0x2460), 302 + INTC_VECT(DMINT16, 0x2480), INTC_VECT(DMINT17, 0x24e0), 303 + INTC_VECT(DMINT18, 0x2500), INTC_VECT(DMINT19, 0x2520), 304 + INTC_VECT(DMINT20, 0x2540), INTC_VECT(DMINT21, 0x2560), 305 + INTC_VECT(DMINT22, 0x2580), INTC_VECT(DMINT23, 0x2600), 306 + INTC_VECT(DDRECC, 0x2620), 307 + INTC_VECT(TSIP, 0x2640), 308 + INTC_VECT(PCIE_BRIDGE, 0x27c0), 309 + INTC_VECT(WDT0B, 0x2800), INTC_VECT(WDT1B, 0x2820), 310 + INTC_VECT(WDT2B, 0x2840), INTC_VECT(WDT3B, 0x2860), 311 + INTC_VECT(WDT4B, 0x2880), INTC_VECT(WDT5B, 0x28a0), 312 + INTC_VECT(WDT6B, 0x28c0), INTC_VECT(WDT7B, 0x28e0), 313 + INTC_VECT(WDT8B, 0x2900), 314 + INTC_VECT(GETHER0, 0x2960), INTC_VECT(GETHER1, 0x2980), 315 + INTC_VECT(GETHER2, 0x29a0), 316 + INTC_VECT(PBIA, 0x2a00), INTC_VECT(PBIB, 0x2a20), 317 + INTC_VECT(PBIC, 0x2a40), 318 + INTC_VECT(DMAE2, 0x2a60), INTC_VECT(DMAE3, 0x2a80), 319 + INTC_VECT(SERMUX2, 0x2aa0), INTC_VECT(SERMUX3, 0x2b40), 320 + INTC_VECT(LPC5, 0x2b60), INTC_VECT(LPC6, 0x2b80), 321 + INTC_VECT(LPC7, 0x2c00), INTC_VECT(LPC8, 0x2c20), 288 322 }; 289 323 290 324 static struct intc_group groups[] __initdata = { ··· 338 312 339 313 { 0xffd40038, 0xffd4003c, 32, /* INT2MSKR / INT2MSKCR */ 340 314 { 0, 0, 0, 0, 0, 0, 0, 0, 341 - 0, DMAC1_8, 0, PECI0I, LPC, FRT, WDT1, TMR45, 342 - TMR23, TMR01, 0, 0, 0, 0, 0, DMAC0, 343 - HUDI, 0, WDT0, SCIF3, SCIF2, SDHI, TMU345, TMU012 315 + 0, DMAC8_11, 0, PECI0, LPC, FRT, 0, TMR45, 316 + TMR23, TMR01, 0, 0, 0, 0, 0, DMAC0_5, 317 + HUDI, 0, 0, SCIF3, SCIF2, SDHI, TMU345, TMU012 344 318 } }, 345 319 346 320 { 0xffd400d0, 0xffd400d4, 32, /* INT2MSKR1 / INT2MSKCR1 */ 347 321 { IRQ15, IRQ14, IRQ13, IRQ12, IRQ11, IRQ10, SCIF4, ETHERC, 348 322 IRQ9, IRQ8, SCIF1, SCIF0, USB0, 0, 0, USB1, 349 - ADC1, 0, DMAC1_6, ADC0, SPI0, SIM, PECI2I, PECI1I, 323 + ADC1, 0, DMAC6_7, ADC0, SPI0, SIM, PECI2, PECI1, 350 324 ARC4, 0, SPI1, JMC, 0, 0, 0, DVC 351 325 } }, 352 326 353 327 { 0xffd10038, 0xffd1003c, 32, /* INT2MSKR2 / INT2MSKCR2 */ 354 - { IIC4_1, IIC4_2, IIC5_0, 0, 0, 0, SGPIO, 0, 355 - 0, 0, 0, IIC9_2, IIC8_2, IIC8_1, IIC8_0, IIC7_3, 328 + { IIC4_1, IIC4_2, IIC5_0, ONFICTL, 0, 0, SGPIO, 0, 329 + 0, G200, 0, IIC9_2, IIC8_2, IIC8_1, IIC8_0, IIC7_3, 356 330 IIC7_2, IIC7_1, IIC6_3, IIC0_0, IIC0_1, IIC0_2, IIC0_3, IIC3_1, 357 - IIC2_3, 0, IIC2_1, IIC9_1, IIC3_3, IIC1_0, PCIE, IIC2_2 331 + IIC2_3, 0, IIC2_1, IIC9_1, IIC3_3, IIC1_0, 0, IIC2_2 358 332 } }, 359 333 360 - { 0xffd100d0, 0xff1400d4, 32, /* INT2MSKR3 / INT2MSKCR4 */ 361 - { 0, IIC6_1, IIC6_0, IIC5_1, IIC3_2, IIC2_0, 0, 0, 334 + { 0xffd100d0, 0xffd100d4, 32, /* INT2MSKR3 / INT2MSKCR3 */ 335 + { MMC1, IIC6_1, IIC6_0, IIC5_1, IIC3_2, IIC2_0, PECI5, MMC2, 362 336 IIC1_3, IIC1_2, IIC9_0, IIC8_3, IIC4_3, IIC7_0, 0, IIC6_2, 363 - PCIINTA, 0, IIC4_0, 0, 0, 0, 0, IIC9_3, 337 + PCIC, 0, IIC4_0, 0, ECCU, RSPI, 0, IIC9_3, 364 338 IIC3_0, 0, IIC5_3, IIC5_2, 0, 0, 0, IIC1_1 339 + } }, 340 + 341 + { 0xffd20038, 0xffd2003c, 32, /* INT2MSKR4 / INT2MSKCR4 */ 342 + { WDT0B, WDT1B, WDT3B, GETHER0, 0, 0, 0, 0, 343 + 0, 0, 0, LPC7, SERMUX2, DMAE3, DMAE2, PBIC, 344 + PBIB, PBIA, GETHER1, DMINT12, DMINT13, DMINT14, DMINT15, TSIP, 345 + DMINT23, 0, DMINT21, LPC6, 0, DMINT16, 0, DMINT22 346 + } }, 347 + 348 + { 0xffd200d0, 0xffd200d4, 32, /* INT2MSKR5 / INT2MSKCR5 */ 349 + { 0, WDT8B, WDT7B, WDT4B, 0, DMINT20, 0, 0, 350 + DMINT19, DMINT18, LPC5, SERMUX3, WDT2B, GETHER2, 0, 0, 351 + 0, 0, PCIE_BRIDGE, 0, 0, 0, 0, LPC8, 352 + DDRECC, 0, WDT6B, WDT5B, 0, 0, 0, DMINT17 365 353 } }, 366 354 }; 367 355 ··· 412 372 #define INT2PRI29 0xffd100b4 413 373 #define INT2PRI30 0xffd100b8 414 374 #define INT2PRI31 0xffd100bc 375 + #define INT2PRI32 0xffd20000 376 + #define INT2PRI33 0xffd20004 377 + #define INT2PRI34 0xffd20008 378 + #define INT2PRI35 0xffd2000c 379 + #define INT2PRI36 0xffd20010 380 + #define INT2PRI37 0xffd20014 381 + #define INT2PRI38 0xffd20018 382 + #define INT2PRI39 0xffd2001c 383 + #define INT2PRI40 0xffd200a0 384 + #define INT2PRI41 0xffd200a4 385 + #define INT2PRI42 0xffd200a8 386 + #define INT2PRI43 0xffd200ac 387 + #define INT2PRI44 0xffd200b0 388 + #define INT2PRI45 0xffd200b4 389 + #define INT2PRI46 0xffd200b8 390 + #define INT2PRI47 0xffd200bc 415 391 416 392 static struct intc_prio_reg prio_registers[] __initdata = { 417 393 { INTPRI, 0, 32, 4, { IRQ0, IRQ1, IRQ2, IRQ3, ··· 435 379 436 380 { INT2PRI0, 0, 32, 8, { TMU0, TMU1, TMU2, TMU2_TICPI } }, 437 381 { INT2PRI1, 0, 32, 8, { TMU3, TMU4, TMU5, SDHI } }, 438 - { INT2PRI2, 0, 32, 8, { SCIF2, SCIF3, WDT0, IRQ8 } }, 439 - { INT2PRI3, 0, 32, 8, { HUDI, DMAC0, ADC0, IRQ9 } }, 382 + { INT2PRI2, 0, 32, 8, { SCIF2, SCIF3, 0, IRQ8 } }, 383 + { INT2PRI3, 0, 32, 8, { HUDI, DMAC0_5, ADC0, IRQ9 } }, 440 384 { INT2PRI4, 0, 32, 8, { IRQ10, 0, TMR01, TMR23 } }, 441 - { INT2PRI5, 0, 32, 8, { TMR45, WDT1, FRT, LPC } }, 442 - { INT2PRI6, 0, 32, 8, { PECI0I, ETHERC, DMAC1_8, 0 } }, 385 + { INT2PRI5, 0, 32, 8, { TMR45, 0, FRT, LPC } }, 386 + { INT2PRI6, 0, 32, 8, { PECI0, ETHERC, DMAC8_11, 0 } }, 443 387 { INT2PRI7, 0, 32, 8, { SCIF4, 0, IRQ11, IRQ12 } }, 444 388 { INT2PRI8, 0, 32, 8, { 0, 0, 0, DVC } }, 445 389 { INT2PRI9, 0, 32, 8, { ARC4, 0, SPI1, JMC } }, 446 - { INT2PRI10, 0, 32, 8, { SPI0, SIM, PECI2I, PECI1I } }, 447 - { INT2PRI11, 0, 32, 8, { ADC1, IRQ13, DMAC1_6, IRQ14 } }, 390 + { INT2PRI10, 0, 32, 8, { SPI0, SIM, PECI2, PECI1 } }, 391 + { INT2PRI11, 0, 32, 8, { ADC1, IRQ13, DMAC6_7, IRQ14 } }, 448 392 { INT2PRI12, 0, 32, 8, { USB0, 0, IRQ15, USB1 } }, 449 393 { INT2PRI13, 0, 32, 8, { 0, 0, SCIF1, SCIF0 } }, 450 394 451 395 { INT2PRI16, 0, 32, 8, { IIC2_2, 0, 0, 0 } }, 452 - { INT2PRI17, 0, 32, 8, { PCIE, 0, 0, IIC1_0 } }, 396 + { INT2PRI17, 0, 32, 8, { 0, 0, 0, IIC1_0 } }, 453 397 { INT2PRI18, 0, 32, 8, { IIC3_3, IIC9_1, IIC2_1, IIC1_2 } }, 454 398 { INT2PRI19, 0, 32, 8, { IIC2_3, IIC3_1, 0, IIC1_3 } }, 455 399 { INT2PRI20, 0, 32, 8, { IIC2_0, IIC6_3, IIC7_1, IIC7_2 } }, 456 400 { INT2PRI21, 0, 32, 8, { IIC7_3, IIC8_0, IIC8_1, IIC8_2 } }, 457 - { INT2PRI22, 0, 32, 8, { IIC9_2, 0, 0, 0 } }, 458 - { INT2PRI23, 0, 32, 8, { 0, SGPIO, IIC3_2, IIC5_1 } }, 459 - { INT2PRI24, 0, 32, 8, { 0, 0, 0, IIC1_1 } }, 401 + { INT2PRI22, 0, 32, 8, { IIC9_2, MMC2, G200, 0 } }, 402 + { INT2PRI23, 0, 32, 8, { PECI5, SGPIO, IIC3_2, IIC5_1 } }, 403 + { INT2PRI24, 0, 32, 8, { PECI4, PECI3, 0, IIC1_1 } }, 460 404 { INT2PRI25, 0, 32, 8, { IIC3_0, 0, IIC5_3, IIC5_2 } }, 461 - { INT2PRI26, 0, 32, 8, { 0, 0, 0, IIC9_3 } }, 462 - { INT2PRI27, 0, 32, 8, { PCIINTA, IIC6_0, IIC4_0, IIC6_1 } }, 463 - { INT2PRI28, 0, 32, 8, { IIC4_3, IIC7_0, 0, IIC6_2 } }, 405 + { INT2PRI26, 0, 32, 8, { ECCU, RSPI, 0, IIC9_3 } }, 406 + { INT2PRI27, 0, 32, 8, { PCIC, IIC6_0, IIC4_0, IIC6_1 } }, 407 + { INT2PRI28, 0, 32, 8, { IIC4_3, IIC7_0, MMC1, IIC6_2 } }, 464 408 { INT2PRI29, 0, 32, 8, { 0, 0, IIC9_0, IIC8_3 } }, 465 - { INT2PRI30, 0, 32, 8, { IIC4_1, IIC4_2, IIC5_0, 0 } }, 409 + { INT2PRI30, 0, 32, 8, { IIC4_1, IIC4_2, IIC5_0, ONFICTL } }, 466 410 { INT2PRI31, 0, 32, 8, { IIC0_0, IIC0_1, IIC0_2, IIC0_3 } }, 411 + { INT2PRI32, 0, 32, 8, { DMINT22, 0, 0, 0 } }, 412 + { INT2PRI33, 0, 32, 8, { 0, 0, 0, DMINT16 } }, 413 + { INT2PRI34, 0, 32, 8, { 0, LPC6, DMINT21, DMINT18 } }, 414 + { INT2PRI35, 0, 32, 8, { DMINT23, TSIP, 0, DMINT19 } }, 415 + { INT2PRI36, 0, 32, 8, { DMINT20, GETHER1, PBIA, PBIB } }, 416 + { INT2PRI37, 0, 32, 8, { PBIC, DMAE2, DMAE3, SERMUX2 } }, 417 + { INT2PRI38, 0, 32, 8, { LPC7, 0, 0, 0 } }, 418 + { INT2PRI39, 0, 32, 8, { 0, 0, 0, WDT4B } }, 419 + { INT2PRI40, 0, 32, 8, { 0, 0, 0, DMINT17 } }, 420 + { INT2PRI41, 0, 32, 8, { DDRECC, 0, WDT6B, WDT5B } }, 421 + { INT2PRI42, 0, 32, 8, { 0, 0, 0, LPC8 } }, 422 + { INT2PRI43, 0, 32, 8, { 0, WDT7B, PCIE_BRIDGE, WDT8B } }, 423 + { INT2PRI44, 0, 32, 8, { WDT2B, GETHER2, 0, 0 } }, 424 + { INT2PRI45, 0, 32, 8, { 0, 0, LPC5, SERMUX3 } }, 425 + { INT2PRI46, 0, 32, 8, { WDT0B, WDT1B, WDT3B, GETHER0 } }, 426 + { INT2PRI47, 0, 32, 8, { DMINT12, DMINT13, DMINT14, DMINT15 } }, 427 + }; 428 + 429 + static struct intc_sense_reg sense_registers_irq8to15[] __initdata = { 430 + { 0xffd100f8, 32, 2, /* ICR2 */ { IRQ15, IRQ14, IRQ13, IRQ12, 431 + IRQ11, IRQ10, IRQ9, IRQ8 } }, 467 432 }; 468 433 469 434 static DECLARE_INTC_DESC(intc_desc, "sh7757", vectors, groups, 470 - mask_registers, prio_registers, NULL); 435 + mask_registers, prio_registers, 436 + sense_registers_irq8to15); 471 437 472 438 /* Support for external interrupt pins in IRQ mode */ 473 439 static struct intc_vect vectors_irq0123[] __initdata = {
+72 -54
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
··· 629 629 } 630 630 } 631 631 632 - static int __init sh7786_devices_setup(void) 633 - { 634 - int ret; 635 - 636 - sh7786_usb_setup(); 637 - 638 - ret = platform_add_devices(sh7786_early_devices, 639 - ARRAY_SIZE(sh7786_early_devices)); 640 - if (unlikely(ret != 0)) 641 - return ret; 642 - 643 - return platform_add_devices(sh7786_devices, 644 - ARRAY_SIZE(sh7786_devices)); 645 - } 646 - arch_initcall(sh7786_devices_setup); 647 - 648 - void __init plat_early_device_setup(void) 649 - { 650 - early_platform_add_devices(sh7786_early_devices, 651 - ARRAY_SIZE(sh7786_early_devices)); 652 - } 653 - 654 632 enum { 655 633 UNUSED = 0, 656 634 657 635 /* interrupt sources */ 658 - 659 636 IRL0_LLLL, IRL0_LLLH, IRL0_LLHL, IRL0_LLHH, 660 637 IRL0_LHLL, IRL0_LHLH, IRL0_LHHL, IRL0_LHHH, 661 638 IRL0_HLLL, IRL0_HLLH, IRL0_HLHL, IRL0_HLHH, ··· 670 693 Thermal, 671 694 INTICI0, INTICI1, INTICI2, INTICI3, 672 695 INTICI4, INTICI5, INTICI6, INTICI7, 696 + 697 + /* Muxed sub-events */ 698 + TXI1, BRI1, RXI1, ERI1, 673 699 }; 674 700 675 - static struct intc_vect vectors[] __initdata = { 701 + static struct intc_vect sh7786_vectors[] __initdata = { 676 702 INTC_VECT(WDT, 0x3e0), 677 703 INTC_VECT(TMU0_0, 0x400), INTC_VECT(TMU0_1, 0x420), 678 704 INTC_VECT(TMU0_2, 0x440), INTC_VECT(TMU0_3, 0x460), ··· 736 756 737 757 #define INTDISTCR0 0xfe4100b0 738 758 #define INTDISTCR1 0xfe4100b4 739 - #define INTACK 0xfe4100b8 740 - #define INTACKCLR 0xfe4100bc 741 759 #define INT2DISTCR0 0xfe410900 742 760 #define INT2DISTCR1 0xfe410904 743 761 #define INT2DISTCR2 0xfe410908 744 762 #define INT2DISTCR3 0xfe41090c 745 763 746 - static struct intc_mask_reg mask_registers[] __initdata = { 764 + static struct intc_mask_reg sh7786_mask_registers[] __initdata = { 747 765 { CnINTMSK0, CnINTMSKCLR0, 32, 748 766 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 }, 749 767 INTC_SMP_BALANCING(INTDISTCR0) }, ··· 785 807 0, 0, 0, 0, 0, 0, 0, 0 }, INTC_SMP_BALANCING(INT2DISTCR3) }, 786 808 }; 787 809 788 - static struct intc_prio_reg prio_registers[] __initdata = { 810 + static struct intc_prio_reg sh7786_prio_registers[] __initdata = { 789 811 { 0xfe410010, 0, 32, 4, /* INTPRI */ { IRQ0, IRQ1, IRQ2, IRQ3, 790 812 IRQ4, IRQ5, IRQ6, IRQ7 } }, 791 813 { 0xfe410800, 0, 32, 8, /* INT2PRI0 */ { 0, 0, 0, WDT } }, ··· 829 851 INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 2) }, 830 852 }; 831 853 832 - static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL, 833 - mask_registers, prio_registers, NULL); 854 + static struct intc_subgroup sh7786_subgroups[] __initdata = { 855 + { 0xfe410c20, 32, SCIF1, 856 + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 857 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TXI1, BRI1, RXI1, ERI1 } }, 858 + }; 859 + 860 + static struct intc_desc sh7786_intc_desc __initdata = { 861 + .name = "sh7786", 862 + .hw = { 863 + .vectors = sh7786_vectors, 864 + .nr_vectors = ARRAY_SIZE(sh7786_vectors), 865 + .mask_regs = sh7786_mask_registers, 866 + .nr_mask_regs = ARRAY_SIZE(sh7786_mask_registers), 867 + .subgroups = sh7786_subgroups, 868 + .nr_subgroups = ARRAY_SIZE(sh7786_subgroups), 869 + .prio_regs = sh7786_prio_registers, 870 + .nr_prio_regs = ARRAY_SIZE(sh7786_prio_registers), 871 + }, 872 + }; 834 873 835 874 /* Support for external interrupt pins in IRQ mode */ 836 - 837 875 static struct intc_vect vectors_irq0123[] __initdata = { 838 876 INTC_VECT(IRQ0, 0x200), INTC_VECT(IRQ1, 0x240), 839 877 INTC_VECT(IRQ2, 0x280), INTC_VECT(IRQ3, 0x2c0), ··· 860 866 INTC_VECT(IRQ6, 0x380), INTC_VECT(IRQ7, 0x3c0), 861 867 }; 862 868 863 - static struct intc_sense_reg sense_registers[] __initdata = { 869 + static struct intc_sense_reg sh7786_sense_registers[] __initdata = { 864 870 { 0xfe41001c, 32, 2, /* ICR1 */ { IRQ0, IRQ1, IRQ2, IRQ3, 865 871 IRQ4, IRQ5, IRQ6, IRQ7 } }, 866 872 }; 867 873 868 - static struct intc_mask_reg ack_registers[] __initdata = { 874 + static struct intc_mask_reg sh7786_ack_registers[] __initdata = { 869 875 { 0xfe410024, 0, 32, /* INTREQ */ 870 876 { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } }, 871 877 }; 872 878 873 879 static DECLARE_INTC_DESC_ACK(intc_desc_irq0123, "sh7786-irq0123", 874 - vectors_irq0123, NULL, mask_registers, 875 - prio_registers, sense_registers, ack_registers); 880 + vectors_irq0123, NULL, sh7786_mask_registers, 881 + sh7786_prio_registers, sh7786_sense_registers, 882 + sh7786_ack_registers); 876 883 877 884 static DECLARE_INTC_DESC_ACK(intc_desc_irq4567, "sh7786-irq4567", 878 - vectors_irq4567, NULL, mask_registers, 879 - prio_registers, sense_registers, ack_registers); 885 + vectors_irq4567, NULL, sh7786_mask_registers, 886 + sh7786_prio_registers, sh7786_sense_registers, 887 + sh7786_ack_registers); 880 888 881 889 /* External interrupt pins in IRL mode */ 882 890 ··· 905 909 }; 906 910 907 911 static DECLARE_INTC_DESC(intc_desc_irl0123, "sh7786-irl0123", vectors_irl0123, 908 - NULL, mask_registers, NULL, NULL); 912 + NULL, sh7786_mask_registers, NULL, NULL); 909 913 910 914 static DECLARE_INTC_DESC(intc_desc_irl4567, "sh7786-irl4567", vectors_irl4567, 911 - NULL, mask_registers, NULL, NULL); 915 + NULL, sh7786_mask_registers, NULL, NULL); 912 916 913 917 #define INTC_ICR0 0xfe410000 914 918 #define INTC_INTMSK0 CnINTMSK0 ··· 916 920 #define INTC_INTMSK2 INTMSK2 917 921 #define INTC_INTMSKCLR1 CnINTMSKCLR1 918 922 #define INTC_INTMSKCLR2 INTMSKCLR2 919 - #define INTC_USERIMASK 0xfe411000 920 - 921 - #ifdef CONFIG_INTC_BALANCING 922 - unsigned int irq_lookup(unsigned int irq) 923 - { 924 - return __raw_readl(INTACK) & 1 ? irq : NO_IRQ_IGNORE; 925 - } 926 - 927 - void irq_finish(unsigned int irq) 928 - { 929 - __raw_writel(irq2evt(irq), INTACKCLR); 930 - } 931 - #endif 932 923 933 924 void __init plat_irq_setup(void) 934 925 { ··· 929 946 /* select IRL mode for IRL3-0 + IRL7-4 */ 930 947 __raw_writel(__raw_readl(INTC_ICR0) & ~0x00c00000, INTC_ICR0); 931 948 932 - register_intc_controller(&intc_desc); 933 - register_intc_userimask(INTC_USERIMASK); 949 + register_intc_controller(&sh7786_intc_desc); 934 950 } 935 951 936 952 void __init plat_irq_setup_pins(int mode) ··· 972 990 973 991 void __init plat_mem_setup(void) 974 992 { 993 + } 994 + 995 + static int __init sh7786_devices_setup(void) 996 + { 997 + int ret, irq; 998 + 999 + sh7786_usb_setup(); 1000 + 1001 + /* 1002 + * De-mux SCIF1 IRQs if possible 1003 + */ 1004 + irq = intc_irq_lookup(sh7786_intc_desc.name, TXI1); 1005 + if (irq > 0) { 1006 + scif1_platform_data.irqs[SCIx_TXI_IRQ] = irq; 1007 + scif1_platform_data.irqs[SCIx_ERI_IRQ] = 1008 + intc_irq_lookup(sh7786_intc_desc.name, ERI1); 1009 + scif1_platform_data.irqs[SCIx_BRI_IRQ] = 1010 + intc_irq_lookup(sh7786_intc_desc.name, BRI1); 1011 + scif1_platform_data.irqs[SCIx_RXI_IRQ] = 1012 + intc_irq_lookup(sh7786_intc_desc.name, RXI1); 1013 + } 1014 + 1015 + ret = platform_add_devices(sh7786_early_devices, 1016 + ARRAY_SIZE(sh7786_early_devices)); 1017 + if (unlikely(ret != 0)) 1018 + return ret; 1019 + 1020 + return platform_add_devices(sh7786_devices, 1021 + ARRAY_SIZE(sh7786_devices)); 1022 + } 1023 + arch_initcall(sh7786_devices_setup); 1024 + 1025 + void __init plat_early_device_setup(void) 1026 + { 1027 + early_platform_add_devices(sh7786_early_devices, 1028 + ARRAY_SIZE(sh7786_early_devices)); 975 1029 }
+38 -4
arch/sh/kernel/cpu/sh4a/setup-shx3.c
··· 1 1 /* 2 2 * SH-X3 Prototype Setup 3 3 * 4 - * Copyright (C) 2007 - 2009 Paul Mundt 4 + * Copyright (C) 2007 - 2010 Paul Mundt 5 5 * 6 6 * This file is subject to the terms and conditions of the GNU General Public 7 7 * License. See the file "COPYING" in the main directory of this archive ··· 12 12 #include <linux/serial.h> 13 13 #include <linux/serial_sci.h> 14 14 #include <linux/io.h> 15 + #include <linux/gpio.h> 15 16 #include <linux/sh_timer.h> 17 + #include <cpu/shx3.h> 16 18 #include <asm/mmzone.h> 17 19 18 20 /* ··· 356 354 DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11), 357 355 }; 358 356 357 + #define INT2DISTCR0 0xfe4108a0 358 + #define INT2DISTCR1 0xfe4108a4 359 + #define INT2DISTCR2 0xfe4108a8 360 + 359 361 static struct intc_mask_reg mask_registers[] __initdata = { 360 362 { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ 361 363 { IRQ0, IRQ1, IRQ2, IRQ3 } }, ··· 369 363 { FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC, 370 364 DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0, 371 365 0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */ 372 - 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, } }, 366 + 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, }, 367 + INTC_SMP_BALANCING(INT2DISTCR0) }, 373 368 { 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */ 374 369 { 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */ 375 370 PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2, 376 371 PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11, 377 372 DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7, 378 373 DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4, 379 - DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 } }, 374 + DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 }, 375 + INTC_SMP_BALANCING(INT2DISTCR1) }, 380 376 { 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */ 381 377 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 382 378 SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI, 383 379 SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI, 384 380 SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI, 385 - SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI } }, 381 + SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI }, 382 + INTC_SMP_BALANCING(INT2DISTCR2) }, 386 383 }; 387 384 388 385 static struct intc_prio_reg prio_registers[] __initdata = { ··· 442 433 443 434 void __init plat_irq_setup_pins(int mode) 444 435 { 436 + int ret = 0; 437 + 445 438 switch (mode) { 446 439 case IRQ_MODE_IRQ: 440 + ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name); 441 + ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name); 442 + ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name); 443 + ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name); 444 + 445 + if (unlikely(ret)) { 446 + pr_err("Failed to set IRQ mode\n"); 447 + return; 448 + } 449 + 447 450 register_intc_controller(&intc_desc_irq); 448 451 break; 449 452 case IRQ_MODE_IRL3210: 453 + ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name); 454 + ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name); 455 + ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name); 456 + ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name); 457 + 458 + if (unlikely(ret)) { 459 + pr_err("Failed to set IRL mode\n"); 460 + return; 461 + } 462 + 450 463 register_intc_controller(&intc_desc_irl); 451 464 break; 452 465 default: ··· 478 447 479 448 void __init plat_irq_setup(void) 480 449 { 450 + reserve_intc_vectors(vectors_irq, ARRAY_SIZE(vectors_irq)); 451 + reserve_intc_vectors(vectors_irl, ARRAY_SIZE(vectors_irl)); 452 + 481 453 register_intc_controller(&intc_desc); 482 454 } 483 455
+1 -1
arch/sh/kernel/head_32.S
··· 330 330 #if defined(CONFIG_CPU_SH2) 331 331 1: .long 0x000000F0 ! IMASK=0xF 332 332 #else 333 - 1: .long 0x400080F0 ! MD=1, RB=0, BL=0, FD=1, IMASK=0xF 333 + 1: .long 0x500080F0 ! MD=1, RB=0, BL=1, FD=1, IMASK=0xF 334 334 #endif 335 335 ENTRY(stack_start) 336 336 2: .long init_thread_union+THREAD_SIZE
+1 -1
arch/sh/kernel/io_trapped.c
··· 291 291 } 292 292 293 293 tmp = handle_unaligned_access(instruction, regs, 294 - &trapped_io_access, 1); 294 + &trapped_io_access, 1, address); 295 295 set_fs(oldfs); 296 296 return tmp == 0; 297 297 }
+2
arch/sh/kernel/irq.c
··· 283 283 if (sh_mv.mv_init_irq) 284 284 sh_mv.mv_init_irq(); 285 285 286 + intc_finalize(); 287 + 286 288 irq_ctx_init(smp_processor_id()); 287 289 } 288 290
+16
arch/sh/kernel/kdebugfs.c
··· 1 + #include <linux/module.h> 2 + #include <linux/init.h> 3 + #include <linux/debugfs.h> 4 + 5 + struct dentry *arch_debugfs_dir; 6 + EXPORT_SYMBOL(arch_debugfs_dir); 7 + 8 + static int __init arch_kdebugfs_init(void) 9 + { 10 + arch_debugfs_dir = debugfs_create_dir("sh", NULL); 11 + if (!arch_debugfs_dir) 12 + return -ENOMEM; 13 + 14 + return 0; 15 + } 16 + arch_initcall(arch_kdebugfs_init);
+50 -50
arch/sh/kernel/kprobes.c
··· 20 20 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 21 21 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 22 22 23 - static struct kprobe saved_current_opcode; 24 - static struct kprobe saved_next_opcode; 25 - static struct kprobe saved_next_opcode2; 23 + static DEFINE_PER_CPU(struct kprobe, saved_current_opcode); 24 + static DEFINE_PER_CPU(struct kprobe, saved_next_opcode); 25 + static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2); 26 26 27 27 #define OPCODE_JMP(x) (((x) & 0xF0FF) == 0x402b) 28 28 #define OPCODE_JSR(x) (((x) & 0xF0FF) == 0x400b) ··· 102 102 103 103 void __kprobes arch_remove_kprobe(struct kprobe *p) 104 104 { 105 - if (saved_next_opcode.addr != 0x0) { 106 - arch_disarm_kprobe(p); 107 - arch_disarm_kprobe(&saved_next_opcode); 108 - saved_next_opcode.addr = 0x0; 109 - saved_next_opcode.opcode = 0x0; 105 + struct kprobe *saved = &__get_cpu_var(saved_next_opcode); 110 106 111 - if (saved_next_opcode2.addr != 0x0) { 112 - arch_disarm_kprobe(&saved_next_opcode2); 113 - saved_next_opcode2.addr = 0x0; 114 - saved_next_opcode2.opcode = 0x0; 107 + if (saved->addr) { 108 + arch_disarm_kprobe(p); 109 + arch_disarm_kprobe(saved); 110 + 111 + saved->addr = NULL; 112 + saved->opcode = 0; 113 + 114 + saved = &__get_cpu_var(saved_next_opcode2); 115 + if (saved->addr) { 116 + arch_disarm_kprobe(saved); 117 + 118 + saved->addr = NULL; 119 + saved->opcode = 0; 115 120 } 116 121 } 117 122 } ··· 146 141 */ 147 142 static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 148 143 { 149 - kprobe_opcode_t *addr = NULL; 150 - saved_current_opcode.addr = (kprobe_opcode_t *) (regs->pc); 151 - addr = saved_current_opcode.addr; 144 + __get_cpu_var(saved_current_opcode).addr = (kprobe_opcode_t *)regs->pc; 152 145 153 146 if (p != NULL) { 147 + struct kprobe *op1, *op2; 148 + 154 149 arch_disarm_kprobe(p); 150 + 151 + op1 = &__get_cpu_var(saved_next_opcode); 152 + op2 = &__get_cpu_var(saved_next_opcode2); 155 153 156 154 if (OPCODE_JSR(p->opcode) || OPCODE_JMP(p->opcode)) { 157 155 unsigned int reg_nr = ((p->opcode >> 8) & 0x000F); 158 - saved_next_opcode.addr = 159 - (kprobe_opcode_t *) regs->regs[reg_nr]; 156 + op1->addr = (kprobe_opcode_t *) regs->regs[reg_nr]; 160 157 } else if (OPCODE_BRA(p->opcode) || OPCODE_BSR(p->opcode)) { 161 158 unsigned long disp = (p->opcode & 0x0FFF); 162 - saved_next_opcode.addr = 159 + op1->addr = 163 160 (kprobe_opcode_t *) (regs->pc + 4 + disp * 2); 164 161 165 162 } else if (OPCODE_BRAF(p->opcode) || OPCODE_BSRF(p->opcode)) { 166 163 unsigned int reg_nr = ((p->opcode >> 8) & 0x000F); 167 - saved_next_opcode.addr = 164 + op1->addr = 168 165 (kprobe_opcode_t *) (regs->pc + 4 + 169 166 regs->regs[reg_nr]); 170 167 171 168 } else if (OPCODE_RTS(p->opcode)) { 172 - saved_next_opcode.addr = (kprobe_opcode_t *) regs->pr; 169 + op1->addr = (kprobe_opcode_t *) regs->pr; 173 170 174 171 } else if (OPCODE_BF(p->opcode) || OPCODE_BT(p->opcode)) { 175 172 unsigned long disp = (p->opcode & 0x00FF); 176 173 /* case 1 */ 177 - saved_next_opcode.addr = p->addr + 1; 174 + op1->addr = p->addr + 1; 178 175 /* case 2 */ 179 - saved_next_opcode2.addr = 176 + op2->addr = 180 177 (kprobe_opcode_t *) (regs->pc + 4 + disp * 2); 181 - saved_next_opcode2.opcode = *(saved_next_opcode2.addr); 182 - arch_arm_kprobe(&saved_next_opcode2); 178 + op2->opcode = *(op2->addr); 179 + arch_arm_kprobe(op2); 183 180 184 181 } else if (OPCODE_BF_S(p->opcode) || OPCODE_BT_S(p->opcode)) { 185 182 unsigned long disp = (p->opcode & 0x00FF); 186 183 /* case 1 */ 187 - saved_next_opcode.addr = p->addr + 2; 184 + op1->addr = p->addr + 2; 188 185 /* case 2 */ 189 - saved_next_opcode2.addr = 186 + op2->addr = 190 187 (kprobe_opcode_t *) (regs->pc + 4 + disp * 2); 191 - saved_next_opcode2.opcode = *(saved_next_opcode2.addr); 192 - arch_arm_kprobe(&saved_next_opcode2); 188 + op2->opcode = *(op2->addr); 189 + arch_arm_kprobe(op2); 193 190 194 191 } else { 195 - saved_next_opcode.addr = p->addr + 1; 192 + op1->addr = p->addr + 1; 196 193 } 197 194 198 - saved_next_opcode.opcode = *(saved_next_opcode.addr); 199 - arch_arm_kprobe(&saved_next_opcode); 195 + op1->opcode = *(op1->addr); 196 + arch_arm_kprobe(op1); 200 197 } 201 198 } 202 199 ··· 383 376 cur->post_handler(cur, regs, 0); 384 377 } 385 378 386 - if (saved_next_opcode.addr != 0x0) { 387 - arch_disarm_kprobe(&saved_next_opcode); 388 - saved_next_opcode.addr = 0x0; 389 - saved_next_opcode.opcode = 0x0; 379 + p = &__get_cpu_var(saved_next_opcode); 380 + if (p->addr) { 381 + arch_disarm_kprobe(p); 382 + p->addr = NULL; 383 + p->opcode = 0; 390 384 391 - addr = saved_current_opcode.addr; 392 - saved_current_opcode.addr = 0x0; 385 + addr = __get_cpu_var(saved_current_opcode).addr; 386 + __get_cpu_var(saved_current_opcode).addr = NULL; 393 387 394 388 p = get_kprobe(addr); 395 389 arch_arm_kprobe(p); 396 390 397 - if (saved_next_opcode2.addr != 0x0) { 398 - arch_disarm_kprobe(&saved_next_opcode2); 399 - saved_next_opcode2.addr = 0x0; 400 - saved_next_opcode2.opcode = 0x0; 391 + p = &__get_cpu_var(saved_next_opcode2); 392 + if (p->addr) { 393 + arch_disarm_kprobe(p); 394 + p->addr = NULL; 395 + p->opcode = 0; 401 396 } 402 397 } 403 398 ··· 581 572 582 573 int __init arch_init_kprobes(void) 583 574 { 584 - saved_next_opcode.addr = 0x0; 585 - saved_next_opcode.opcode = 0x0; 586 - 587 - saved_current_opcode.addr = 0x0; 588 - saved_current_opcode.opcode = 0x0; 589 - 590 - saved_next_opcode2.addr = 0x0; 591 - saved_next_opcode2.opcode = 0x0; 592 - 593 575 return register_kprobe(&trampoline_p); 594 576 }
+33
arch/sh/kernel/ptrace.c
··· 1 + #include <linux/ptrace.h> 2 + 3 + /** 4 + * regs_query_register_offset() - query register offset from its name 5 + * @name: the name of a register 6 + * 7 + * regs_query_register_offset() returns the offset of a register in struct 8 + * pt_regs from its name. If the name is invalid, this returns -EINVAL; 9 + */ 10 + int regs_query_register_offset(const char *name) 11 + { 12 + const struct pt_regs_offset *roff; 13 + for (roff = regoffset_table; roff->name != NULL; roff++) 14 + if (!strcmp(roff->name, name)) 15 + return roff->offset; 16 + return -EINVAL; 17 + } 18 + 19 + /** 20 + * regs_query_register_name() - query register name from its offset 21 + * @offset: the offset of a register in struct pt_regs. 22 + * 23 + * regs_query_register_name() returns the name of a register from its 24 + * offset in struct pt_regs. If the @offset is invalid, this returns NULL; 25 + */ 26 + const char *regs_query_register_name(unsigned int offset) 27 + { 28 + const struct pt_regs_offset *roff; 29 + for (roff = regoffset_table; roff->name != NULL; roff++) 30 + if (roff->offset == offset) 31 + return roff->name; 32 + return NULL; 33 + }
+27
arch/sh/kernel/ptrace_32.c
··· 274 274 } 275 275 #endif 276 276 277 + const struct pt_regs_offset regoffset_table[] = { 278 + REGS_OFFSET_NAME(0), 279 + REGS_OFFSET_NAME(1), 280 + REGS_OFFSET_NAME(2), 281 + REGS_OFFSET_NAME(3), 282 + REGS_OFFSET_NAME(4), 283 + REGS_OFFSET_NAME(5), 284 + REGS_OFFSET_NAME(6), 285 + REGS_OFFSET_NAME(7), 286 + REGS_OFFSET_NAME(8), 287 + REGS_OFFSET_NAME(9), 288 + REGS_OFFSET_NAME(10), 289 + REGS_OFFSET_NAME(11), 290 + REGS_OFFSET_NAME(12), 291 + REGS_OFFSET_NAME(13), 292 + REGS_OFFSET_NAME(14), 293 + REGS_OFFSET_NAME(15), 294 + REG_OFFSET_NAME(pc), 295 + REG_OFFSET_NAME(pr), 296 + REG_OFFSET_NAME(sr), 297 + REG_OFFSET_NAME(gbr), 298 + REG_OFFSET_NAME(mach), 299 + REG_OFFSET_NAME(macl), 300 + REG_OFFSET_NAME(tra), 301 + REG_OFFSET_END, 302 + }; 303 + 277 304 /* 278 305 * These are our native regset flavours. 279 306 */
+82 -6
arch/sh/kernel/ptrace_64.c
··· 20 20 #include <linux/sched.h> 21 21 #include <linux/mm.h> 22 22 #include <linux/smp.h> 23 - #include <linux/smp_lock.h> 23 + #include <linux/bitops.h> 24 24 #include <linux/errno.h> 25 25 #include <linux/ptrace.h> 26 26 #include <linux/user.h> ··· 252 252 } 253 253 #endif 254 254 255 + const struct pt_regs_offset regoffset_table[] = { 256 + REG_OFFSET_NAME(pc), 257 + REG_OFFSET_NAME(sr), 258 + REG_OFFSET_NAME(syscall_nr), 259 + REGS_OFFSET_NAME(0), 260 + REGS_OFFSET_NAME(1), 261 + REGS_OFFSET_NAME(2), 262 + REGS_OFFSET_NAME(3), 263 + REGS_OFFSET_NAME(4), 264 + REGS_OFFSET_NAME(5), 265 + REGS_OFFSET_NAME(6), 266 + REGS_OFFSET_NAME(7), 267 + REGS_OFFSET_NAME(8), 268 + REGS_OFFSET_NAME(9), 269 + REGS_OFFSET_NAME(10), 270 + REGS_OFFSET_NAME(11), 271 + REGS_OFFSET_NAME(12), 272 + REGS_OFFSET_NAME(13), 273 + REGS_OFFSET_NAME(14), 274 + REGS_OFFSET_NAME(15), 275 + REGS_OFFSET_NAME(16), 276 + REGS_OFFSET_NAME(17), 277 + REGS_OFFSET_NAME(18), 278 + REGS_OFFSET_NAME(19), 279 + REGS_OFFSET_NAME(20), 280 + REGS_OFFSET_NAME(21), 281 + REGS_OFFSET_NAME(22), 282 + REGS_OFFSET_NAME(23), 283 + REGS_OFFSET_NAME(24), 284 + REGS_OFFSET_NAME(25), 285 + REGS_OFFSET_NAME(26), 286 + REGS_OFFSET_NAME(27), 287 + REGS_OFFSET_NAME(28), 288 + REGS_OFFSET_NAME(29), 289 + REGS_OFFSET_NAME(30), 290 + REGS_OFFSET_NAME(31), 291 + REGS_OFFSET_NAME(32), 292 + REGS_OFFSET_NAME(33), 293 + REGS_OFFSET_NAME(34), 294 + REGS_OFFSET_NAME(35), 295 + REGS_OFFSET_NAME(36), 296 + REGS_OFFSET_NAME(37), 297 + REGS_OFFSET_NAME(38), 298 + REGS_OFFSET_NAME(39), 299 + REGS_OFFSET_NAME(40), 300 + REGS_OFFSET_NAME(41), 301 + REGS_OFFSET_NAME(42), 302 + REGS_OFFSET_NAME(43), 303 + REGS_OFFSET_NAME(44), 304 + REGS_OFFSET_NAME(45), 305 + REGS_OFFSET_NAME(46), 306 + REGS_OFFSET_NAME(47), 307 + REGS_OFFSET_NAME(48), 308 + REGS_OFFSET_NAME(49), 309 + REGS_OFFSET_NAME(50), 310 + REGS_OFFSET_NAME(51), 311 + REGS_OFFSET_NAME(52), 312 + REGS_OFFSET_NAME(53), 313 + REGS_OFFSET_NAME(54), 314 + REGS_OFFSET_NAME(55), 315 + REGS_OFFSET_NAME(56), 316 + REGS_OFFSET_NAME(57), 317 + REGS_OFFSET_NAME(58), 318 + REGS_OFFSET_NAME(59), 319 + REGS_OFFSET_NAME(60), 320 + REGS_OFFSET_NAME(61), 321 + REGS_OFFSET_NAME(62), 322 + REGS_OFFSET_NAME(63), 323 + TREGS_OFFSET_NAME(0), 324 + TREGS_OFFSET_NAME(1), 325 + TREGS_OFFSET_NAME(2), 326 + TREGS_OFFSET_NAME(3), 327 + TREGS_OFFSET_NAME(4), 328 + TREGS_OFFSET_NAME(5), 329 + TREGS_OFFSET_NAME(6), 330 + TREGS_OFFSET_NAME(7), 331 + REG_OFFSET_END, 332 + }; 333 + 255 334 /* 256 335 * These are our native regset flavours. 257 336 */ ··· 474 395 asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) 475 396 { 476 397 #define WPC_DBRMODE 0x0d104008 477 - static int first_call = 1; 398 + static unsigned long first_call; 478 399 479 - lock_kernel(); 480 - if (first_call) { 400 + if (!test_and_set_bit(0, &first_call)) { 481 401 /* Set WPC.DBRMODE to 0. This makes all debug events get 482 402 * delivered through RESVEC, i.e. into the handlers in entry.S. 483 403 * (If the kernel was downloaded using a remote gdb, WPC.DBRMODE ··· 486 408 * the remote gdb.) */ 487 409 printk("DBRMODE set to 0 to permit native debugging\n"); 488 410 poke_real_address_q(WPC_DBRMODE, 0); 489 - first_call = 0; 490 411 } 491 - unlock_kernel(); 492 412 493 413 return sys_ptrace(request, pid, addr, data); 494 414 }
+4
arch/sh/kernel/reboot.c
··· 9 9 #include <asm/addrspace.h> 10 10 #include <asm/reboot.h> 11 11 #include <asm/system.h> 12 + #include <asm/tlbflush.h> 12 13 13 14 void (*pm_power_off)(void); 14 15 EXPORT_SYMBOL(pm_power_off); ··· 25 24 static void native_machine_restart(char * __unused) 26 25 { 27 26 local_irq_disable(); 27 + 28 + /* Destroy all of the TLBs in preparation for reset by MMU */ 29 + __flush_tlb_global(); 28 30 29 31 /* Address error with SR.BL=1 first. */ 30 32 trigger_address_error();
+4 -18
arch/sh/kernel/setup.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/smp.h> 26 26 #include <linux/err.h> 27 - #include <linux/debugfs.h> 28 27 #include <linux/crash_dump.h> 29 28 #include <linux/mmzone.h> 30 29 #include <linux/clk.h> ··· 135 136 goto disable; 136 137 } 137 138 138 - if (unlikely(start < PAGE_OFFSET)) { 139 - pr_err("initrd start < PAGE_OFFSET\n"); 139 + if (unlikely(start < __MEMORY_START)) { 140 + pr_err("initrd start (%08lx) < __MEMORY_START(%x)\n", 141 + start, __MEMORY_START); 140 142 goto disable; 141 143 } 142 144 ··· 158 158 /* 159 159 * Address sanitization 160 160 */ 161 - initrd_start = (unsigned long)__va(__pa(start)); 161 + initrd_start = (unsigned long)__va(start); 162 162 initrd_end = initrd_start + INITRD_SIZE; 163 163 164 164 memblock_reserve(__pa(initrd_start), INITRD_SIZE); ··· 458 458 .show = show_cpuinfo, 459 459 }; 460 460 #endif /* CONFIG_PROC_FS */ 461 - 462 - struct dentry *sh_debugfs_root; 463 - 464 - static int __init sh_debugfs_init(void) 465 - { 466 - sh_debugfs_root = debugfs_create_dir("sh", NULL); 467 - if (!sh_debugfs_root) 468 - return -ENOMEM; 469 - if (IS_ERR(sh_debugfs_root)) 470 - return PTR_ERR(sh_debugfs_root); 471 - 472 - return 0; 473 - } 474 - arch_initcall(sh_debugfs_init);
+22
arch/sh/kernel/syscalls_32.S
··· 353 353 .long sys_pwritev 354 354 .long sys_rt_tgsigqueueinfo /* 335 */ 355 355 .long sys_perf_event_open 356 + .long sys_fanotify_init 357 + .long sys_fanotify_mark 358 + .long sys_prlimit64 359 + /* Broken-out socket family */ 360 + .long sys_socket /* 340 */ 361 + .long sys_bind 362 + .long sys_connect 363 + .long sys_listen 364 + .long sys_accept 365 + .long sys_getsockname /* 345 */ 366 + .long sys_getpeername 367 + .long sys_socketpair 368 + .long sys_send 369 + .long sys_sendto 370 + .long sys_recv /* 350 */ 371 + .long sys_recvfrom 372 + .long sys_shutdown 373 + .long sys_setsockopt 374 + .long sys_getsockopt 375 + .long sys_sendmsg /* 355 */ 376 + .long sys_recvmsg 377 + .long sys_recvmmsg
+3
arch/sh/kernel/syscalls_64.S
··· 393 393 .long sys_perf_event_open 394 394 .long sys_recvmmsg /* 365 */ 395 395 .long sys_accept4 396 + .long sys_fanotify_init 397 + .long sys_fanotify_mark 398 + .long sys_prlimit64
+22 -7
arch/sh/kernel/traps_32.c
··· 5 5 * SuperH version: Copyright (C) 1999 Niibe Yutaka 6 6 * Copyright (C) 2000 Philipp Rumpf 7 7 * Copyright (C) 2000 David Howells 8 - * Copyright (C) 2002 - 2007 Paul Mundt 8 + * Copyright (C) 2002 - 2010 Paul Mundt 9 9 * 10 10 * This file is subject to the terms and conditions of the GNU General Public 11 11 * License. See the file "COPYING" in the main directory of this archive ··· 26 26 #include <linux/limits.h> 27 27 #include <linux/sysfs.h> 28 28 #include <linux/uaccess.h> 29 + #include <linux/perf_event.h> 29 30 #include <asm/system.h> 30 31 #include <asm/alignment.h> 31 32 #include <asm/fpu.h> ··· 370 369 #define SH_PC_12BIT_OFFSET(instr) ((((signed short)(instr<<4))>>3) + 4) 371 370 372 371 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, 373 - struct mem_access *ma, int expected) 372 + struct mem_access *ma, int expected, 373 + unsigned long address) 374 374 { 375 375 u_int rm; 376 376 int ret, index; ··· 385 383 index = (instruction>>8)&15; /* 0x0F00 */ 386 384 rm = regs->regs[index]; 387 385 388 - /* shout about fixups */ 389 - if (!expected) 386 + /* 387 + * Log the unexpected fixups, and then pass them on to perf. 388 + * 389 + * We intentionally don't report the expected cases to perf as 390 + * otherwise the trapped I/O case will skew the results too much 391 + * to be useful. 392 + */ 393 + if (!expected) { 390 394 unaligned_fixups_notify(current, instruction, regs); 395 + perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, 396 + regs, address); 397 + } 391 398 392 399 ret = -EFAULT; 393 400 switch (instruction&0xF000) { ··· 585 574 586 575 set_fs(USER_DS); 587 576 tmp = handle_unaligned_access(instruction, regs, 588 - &user_mem_access, 0); 577 + &user_mem_access, 0, 578 + address); 589 579 set_fs(oldfs); 590 580 591 581 if (tmp == 0) ··· 619 607 620 608 unaligned_fixups_notify(current, instruction, regs); 621 609 622 - handle_unaligned_access(instruction, regs, 623 - &user_mem_access, 0); 610 + handle_unaligned_access(instruction, regs, &user_mem_access, 611 + 0, address); 624 612 set_fs(oldfs); 625 613 } 626 614 } ··· 814 802 : /* no output */ 815 803 : "r" (&vbr_base) 816 804 : "memory"); 805 + 806 + /* disable exception blocking now when the vbr has been setup */ 807 + clear_bl_bit(); 817 808 } 818 809 819 810 void *set_exception_table_vec(unsigned int vec, void *handler)
+10 -1
arch/sh/kernel/traps_64.c
··· 24 24 #include <linux/interrupt.h> 25 25 #include <linux/sysctl.h> 26 26 #include <linux/module.h> 27 + #include <linux/perf_event.h> 27 28 #include <asm/system.h> 28 29 #include <asm/uaccess.h> 29 30 #include <asm/io.h> ··· 51 50 do_unhandled_exception(trapnr, signr, str, __stringify(name), error_code, regs, current); \ 52 51 } 53 52 54 - spinlock_t die_lock; 53 + static DEFINE_SPINLOCK(die_lock); 55 54 56 55 void die(const char * str, struct pt_regs * regs, long err) 57 56 { ··· 434 433 return error; 435 434 } 436 435 436 + perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address); 437 + 437 438 destreg = (opcode >> 4) & 0x3f; 438 439 if (user_mode(regs)) { 439 440 __u64 buffer; ··· 512 509 return error; 513 510 } 514 511 512 + perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, address); 513 + 515 514 srcreg = (opcode >> 4) & 0x3f; 516 515 if (user_mode(regs)) { 517 516 __u64 buffer; ··· 587 582 if (error < 0) { 588 583 return error; 589 584 } 585 + 586 + perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address); 590 587 591 588 destreg = (opcode >> 4) & 0x3f; 592 589 if (user_mode(regs)) { ··· 664 657 if (error < 0) { 665 658 return error; 666 659 } 660 + 661 + perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, address); 667 662 668 663 srcreg = (opcode >> 4) & 0x3f; 669 664 if (user_mode(regs)) {
+1 -1
arch/sh/lib/Makefile
··· 30 30 lib-$(CONFIG_MCOUNT) += mcount.o 31 31 lib-y += $(memcpy-y) $(memset-y) $(udivsi3-y) 32 32 33 - EXTRA_CFLAGS += -Werror 33 + ccflags-y := -Werror
+3
arch/sh/math-emu/math.c
··· 12 12 #include <linux/types.h> 13 13 #include <linux/sched.h> 14 14 #include <linux/signal.h> 15 + #include <linux/perf_event.h> 15 16 16 17 #include <asm/system.h> 17 18 #include <asm/uaccess.h> ··· 619 618 { 620 619 struct task_struct *tsk = current; 621 620 struct sh_fpu_soft_struct *fpu = &(tsk->thread.xstate->softfpu); 621 + 622 + perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, 0); 622 623 623 624 if (!(task_thread_info(tsk)->status & TS_USEDFPU)) { 624 625 /* initialize once. */
+4
arch/sh/mm/Kconfig
··· 168 168 config UNCACHED_MAPPING 169 169 bool 170 170 171 + config HAVE_SRAM_POOL 172 + bool 173 + select GENERIC_ALLOCATOR 174 + 171 175 choice 172 176 prompt "Kernel page size" 173 177 default PAGE_SIZE_4KB
+2 -1
arch/sh/mm/Makefile
··· 40 40 obj-$(CONFIG_NUMA) += numa.o 41 41 obj-$(CONFIG_IOREMAP_FIXED) += ioremap_fixed.o 42 42 obj-$(CONFIG_UNCACHED_MAPPING) += uncached.o 43 + obj-$(CONFIG_HAVE_SRAM_POOL) += sram.o 43 44 44 45 # Special flags for fault_64.o. This puts restrictions on the number of 45 46 # caller-save registers that the compiler can target when building this file. ··· 67 66 -ffixed-r60 -ffixed-r61 -ffixed-r62 \ 68 67 -fomit-frame-pointer 69 68 70 - EXTRA_CFLAGS += -Werror 69 + ccflags-y := -Werror
+1 -1
arch/sh/mm/asids-debugfs.c
··· 63 63 { 64 64 struct dentry *asids_dentry; 65 65 66 - asids_dentry = debugfs_create_file("asids", S_IRUSR, sh_debugfs_root, 66 + asids_dentry = debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, 67 67 NULL, &asids_debugfs_fops); 68 68 if (!asids_dentry) 69 69 return -ENOMEM;
+2 -8
arch/sh/mm/cache-debugfs.c
··· 126 126 { 127 127 struct dentry *dcache_dentry, *icache_dentry; 128 128 129 - dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root, 129 + dcache_dentry = debugfs_create_file("dcache", S_IRUSR, arch_debugfs_dir, 130 130 (unsigned int *)CACHE_TYPE_DCACHE, 131 131 &cache_debugfs_fops); 132 132 if (!dcache_dentry) 133 133 return -ENOMEM; 134 - if (IS_ERR(dcache_dentry)) 135 - return PTR_ERR(dcache_dentry); 136 134 137 - icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root, 135 + icache_dentry = debugfs_create_file("icache", S_IRUSR, arch_debugfs_dir, 138 136 (unsigned int *)CACHE_TYPE_ICACHE, 139 137 &cache_debugfs_fops); 140 138 if (!icache_dentry) { 141 139 debugfs_remove(dcache_dentry); 142 140 return -ENOMEM; 143 - } 144 - if (IS_ERR(icache_dentry)) { 145 - debugfs_remove(dcache_dentry); 146 - return PTR_ERR(icache_dentry); 147 141 } 148 142 149 143 return 0;
+2 -1
arch/sh/mm/consistent.c
··· 38 38 void *ret, *ret_nocache; 39 39 int order = get_order(size); 40 40 41 + gfp |= __GFP_ZERO; 42 + 41 43 ret = (void *)__get_free_pages(gfp, order); 42 44 if (!ret) 43 45 return NULL; 44 46 45 - memset(ret, 0, size); 46 47 /* 47 48 * Pages from the page allocator may have data present in 48 49 * cache. So flush the cache before using uncached memory.
+38 -14
arch/sh/mm/init.c
··· 47 47 pgd_t *pgd; 48 48 pud_t *pud; 49 49 pmd_t *pmd; 50 - pte_t *pte; 51 50 52 51 pgd = pgd_offset_k(addr); 53 52 if (pgd_none(*pgd)) { ··· 66 67 return NULL; 67 68 } 68 69 69 - pte = pte_offset_kernel(pmd, addr); 70 - return pte; 70 + return pte_offset_kernel(pmd, addr); 71 71 } 72 72 73 73 static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) ··· 123 125 clear_pte_phys(address, prot); 124 126 } 125 127 128 + static pmd_t * __init one_md_table_init(pud_t *pud) 129 + { 130 + if (pud_none(*pud)) { 131 + pmd_t *pmd; 132 + 133 + pmd = alloc_bootmem_pages(PAGE_SIZE); 134 + pud_populate(&init_mm, pud, pmd); 135 + BUG_ON(pmd != pmd_offset(pud, 0)); 136 + } 137 + 138 + return pmd_offset(pud, 0); 139 + } 140 + 141 + static pte_t * __init one_page_table_init(pmd_t *pmd) 142 + { 143 + if (pmd_none(*pmd)) { 144 + pte_t *pte; 145 + 146 + pte = alloc_bootmem_pages(PAGE_SIZE); 147 + pmd_populate_kernel(&init_mm, pmd, pte); 148 + BUG_ON(pte != pte_offset_kernel(pmd, 0)); 149 + } 150 + 151 + return pte_offset_kernel(pmd, 0); 152 + } 153 + 154 + static pte_t * __init page_table_kmap_check(pte_t *pte, pmd_t *pmd, 155 + unsigned long vaddr, pte_t *lastpte) 156 + { 157 + return pte; 158 + } 159 + 126 160 void __init page_table_range_init(unsigned long start, unsigned long end, 127 161 pgd_t *pgd_base) 128 162 { 129 163 pgd_t *pgd; 130 164 pud_t *pud; 131 165 pmd_t *pmd; 132 - pte_t *pte; 166 + pte_t *pte = NULL; 133 167 int i, j, k; 134 168 unsigned long vaddr; 135 169 ··· 174 144 for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { 175 145 pud = (pud_t *)pgd; 176 146 for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { 177 - #ifdef __PAGETABLE_PMD_FOLDED 178 - pmd = (pmd_t *)pud; 179 - #else 180 - pmd = (pmd_t *)alloc_bootmem_low_pages(PAGE_SIZE); 181 - pud_populate(&init_mm, pud, pmd); 147 + pmd = one_md_table_init(pud); 148 + #ifndef __PAGETABLE_PMD_FOLDED 182 149 pmd += k; 183 150 #endif 184 151 for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { 185 - if (pmd_none(*pmd)) { 186 - pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); 187 - pmd_populate_kernel(&init_mm, pmd, pte); 188 - BUG_ON(pte != pte_offset_kernel(pmd, 0)); 189 - } 152 + pte = page_table_kmap_check(one_page_table_init(pmd), 153 + pmd, vaddr, pte); 190 154 vaddr += PMD_SIZE; 191 155 } 192 156 k = 0;
+4
arch/sh/mm/nommu.c
··· 67 67 BUG(); 68 68 } 69 69 70 + void __flush_tlb_global(void) 71 + { 72 + } 73 + 70 74 void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) 71 75 { 72 76 }
+16 -19
arch/sh/mm/pmb.c
··· 40 40 unsigned long flags; 41 41 unsigned long size; 42 42 43 - spinlock_t lock; 43 + raw_spinlock_t lock; 44 44 45 45 /* 46 46 * 0 .. NR_PMB_ENTRIES for specific entry selection, or ··· 265 265 266 266 memset(pmbe, 0, sizeof(struct pmb_entry)); 267 267 268 - spin_lock_init(&pmbe->lock); 268 + raw_spin_lock_init(&pmbe->lock); 269 269 270 270 pmbe->vpn = vpn; 271 271 pmbe->ppn = ppn; ··· 327 327 { 328 328 unsigned long flags; 329 329 330 - spin_lock_irqsave(&pmbe->lock, flags); 330 + raw_spin_lock_irqsave(&pmbe->lock, flags); 331 331 __set_pmb_entry(pmbe); 332 - spin_unlock_irqrestore(&pmbe->lock, flags); 332 + raw_spin_unlock_irqrestore(&pmbe->lock, flags); 333 333 } 334 334 #endif /* CONFIG_PM */ 335 335 ··· 368 368 return PTR_ERR(pmbe); 369 369 } 370 370 371 - spin_lock_irqsave(&pmbe->lock, flags); 371 + raw_spin_lock_irqsave(&pmbe->lock, flags); 372 372 373 373 pmbe->size = pmb_sizes[i].size; 374 374 ··· 383 383 * entries for easier tear-down. 384 384 */ 385 385 if (likely(pmbp)) { 386 - spin_lock(&pmbp->lock); 386 + raw_spin_lock_nested(&pmbp->lock, 387 + SINGLE_DEPTH_NESTING); 387 388 pmbp->link = pmbe; 388 - spin_unlock(&pmbp->lock); 389 + raw_spin_unlock(&pmbp->lock); 389 390 } 390 391 391 392 pmbp = pmbe; ··· 399 398 i--; 400 399 mapped++; 401 400 402 - spin_unlock_irqrestore(&pmbe->lock, flags); 401 + raw_spin_unlock_irqrestore(&pmbe->lock, flags); 403 402 } 404 403 } while (size >= SZ_16M); 405 404 ··· 628 627 continue; 629 628 } 630 629 631 - spin_lock_irqsave(&pmbe->lock, irqflags); 630 + raw_spin_lock_irqsave(&pmbe->lock, irqflags); 632 631 633 632 for (j = 0; j < ARRAY_SIZE(pmb_sizes); j++) 634 633 if (pmb_sizes[j].flag == size) 635 634 pmbe->size = pmb_sizes[j].size; 636 635 637 636 if (pmbp) { 638 - spin_lock(&pmbp->lock); 639 - 637 + raw_spin_lock_nested(&pmbp->lock, SINGLE_DEPTH_NESTING); 640 638 /* 641 639 * Compare the previous entry against the current one to 642 640 * see if the entries span a contiguous mapping. If so, ··· 644 644 */ 645 645 if (pmb_can_merge(pmbp, pmbe)) 646 646 pmbp->link = pmbe; 647 - 648 - spin_unlock(&pmbp->lock); 647 + raw_spin_unlock(&pmbp->lock); 649 648 } 650 649 651 650 pmbp = pmbe; 652 651 653 - spin_unlock_irqrestore(&pmbe->lock, irqflags); 652 + raw_spin_unlock_irqrestore(&pmbe->lock, irqflags); 654 653 } 655 654 } 656 655 ··· 756 757 /* 757 758 * Found it, now resize it. 758 759 */ 759 - spin_lock_irqsave(&pmbe->lock, flags); 760 + raw_spin_lock_irqsave(&pmbe->lock, flags); 760 761 761 762 pmbe->size = SZ_16M; 762 763 pmbe->flags &= ~PMB_SZ_MASK; ··· 766 767 767 768 __set_pmb_entry(pmbe); 768 769 769 - spin_unlock_irqrestore(&pmbe->lock, flags); 770 + raw_spin_unlock_irqrestore(&pmbe->lock, flags); 770 771 } 771 772 772 773 read_unlock(&pmb_rwlock); ··· 865 866 struct dentry *dentry; 866 867 867 868 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO, 868 - sh_debugfs_root, NULL, &pmb_debugfs_fops); 869 + arch_debugfs_dir, NULL, &pmb_debugfs_fops); 869 870 if (!dentry) 870 871 return -ENOMEM; 871 - if (IS_ERR(dentry)) 872 - return PTR_ERR(dentry); 873 872 874 873 return 0; 875 874 }
+34
arch/sh/mm/sram.c
··· 1 + /* 2 + * SRAM pool for tiny memories not otherwise managed. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include <linux/init.h> 11 + #include <linux/kernel.h> 12 + #include <asm/sram.h> 13 + 14 + /* 15 + * This provides a standard SRAM pool for tiny memories that can be 16 + * added either by the CPU or the platform code. Typical SRAM sizes 17 + * to be inserted in to the pool will generally be less than the page 18 + * size, with anything more reasonably sized handled as a NUMA memory 19 + * node. 20 + */ 21 + struct gen_pool *sram_pool; 22 + 23 + static int __init sram_pool_init(void) 24 + { 25 + /* 26 + * This is a global pool, we don't care about node locality. 27 + */ 28 + sram_pool = gen_pool_create(1, -1); 29 + if (unlikely(!sram_pool)) 30 + return -ENOMEM; 31 + 32 + return 0; 33 + } 34 + core_initcall(sram_pool_init);
+2 -9
arch/sh/mm/tlb-debugfs.c
··· 151 151 { 152 152 struct dentry *itlb, *utlb; 153 153 154 - itlb = debugfs_create_file("itlb", S_IRUSR, sh_debugfs_root, 154 + itlb = debugfs_create_file("itlb", S_IRUSR, arch_debugfs_dir, 155 155 (unsigned int *)TLB_TYPE_ITLB, 156 156 &tlb_debugfs_fops); 157 157 if (unlikely(!itlb)) 158 158 return -ENOMEM; 159 - if (IS_ERR(itlb)) 160 - return PTR_ERR(itlb); 161 159 162 - utlb = debugfs_create_file("utlb", S_IRUSR, sh_debugfs_root, 160 + utlb = debugfs_create_file("utlb", S_IRUSR, arch_debugfs_dir, 163 161 (unsigned int *)TLB_TYPE_UTLB, 164 162 &tlb_debugfs_fops); 165 163 if (unlikely(!utlb)) { 166 164 debugfs_remove(itlb); 167 165 return -ENOMEM; 168 - } 169 - 170 - if (IS_ERR(utlb)) { 171 - debugfs_remove(itlb); 172 - return PTR_ERR(utlb); 173 166 } 174 167 175 168 return 0;
+16
arch/sh/mm/tlbflush_32.c
··· 119 119 local_irq_restore(flags); 120 120 } 121 121 } 122 + 123 + void __flush_tlb_global(void) 124 + { 125 + unsigned long flags; 126 + 127 + local_irq_save(flags); 128 + 129 + /* 130 + * This is the most destructive of the TLB flushing options, 131 + * and will tear down all of the UTLB/ITLB mappings, including 132 + * wired entries. 133 + */ 134 + __raw_writel(__raw_readl(MMUCR) | MMUCR_TI, MMUCR); 135 + 136 + local_irq_restore(flags); 137 + }
+5
arch/sh/mm/tlbflush_64.c
··· 455 455 flush_tlb_all(); 456 456 } 457 457 458 + void __flush_tlb_global(void) 459 + { 460 + flush_tlb_all(); 461 + } 462 + 458 463 void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t pte) 459 464 { 460 465 }
+2
arch/sh/tools/mach-types
··· 52 52 RSK7201 SH_RSK7201 53 53 RSK7203 SH_RSK7203 54 54 AP325RXA SH_AP325RXA 55 + SH2007 SH_SH2007 56 + SH7757LCR SH_SH7757LCR 55 57 SH7763RDP SH_SH7763RDP 56 58 SH7785LCR SH_SH7785LCR 57 59 SH7785LCR_PT SH_SH7785LCR_PT
+1 -1
drivers/Makefile
··· 92 92 obj-y += lguest/ 93 93 obj-$(CONFIG_CPU_FREQ) += cpufreq/ 94 94 obj-$(CONFIG_CPU_IDLE) += cpuidle/ 95 + obj-$(CONFIG_DMA_ENGINE) += dma/ 95 96 obj-$(CONFIG_MMC) += mmc/ 96 97 obj-$(CONFIG_MEMSTICK) += memstick/ 97 98 obj-$(CONFIG_NEW_LEDS) += leds/ ··· 105 104 ifndef CONFIG_ARCH_USES_GETTIMEOFFSET 106 105 obj-y += clocksource/ 107 106 endif 108 - obj-$(CONFIG_DMA_ENGINE) += dma/ 109 107 obj-$(CONFIG_DCA) += dca/ 110 108 obj-$(CONFIG_HID) += hid/ 111 109 obj-$(CONFIG_PPC_PS3) += ps3/
+6 -6
drivers/clocksource/sh_cmt.c
··· 308 308 * isr before we end up here. 309 309 */ 310 310 if (p->flags & FLAG_CLOCKSOURCE) 311 - p->total_cycles += p->match_value; 311 + p->total_cycles += p->match_value + 1; 312 312 313 313 if (!(p->flags & FLAG_REPROGRAM)) 314 314 p->next_match_value = p->max_match_value; ··· 403 403 raw = sh_cmt_get_counter(p, &has_wrapped); 404 404 405 405 if (unlikely(has_wrapped)) 406 - raw += p->match_value; 406 + raw += p->match_value + 1; 407 407 spin_unlock_irqrestore(&p->lock, flags); 408 408 409 409 return value + raw; ··· 445 445 446 446 /* clk_get_rate() needs an enabled clock */ 447 447 clk_enable(p->clk); 448 - p->rate = clk_get_rate(p->clk) / (p->width == 16) ? 512 : 8; 448 + p->rate = clk_get_rate(p->clk) / ((p->width == 16) ? 512 : 8); 449 449 clk_disable(p->clk); 450 450 451 451 /* TODO: calculate good shift from rate and counter bit width */ ··· 478 478 ced->min_delta_ns = clockevent_delta2ns(0x1f, ced); 479 479 480 480 if (periodic) 481 - sh_cmt_set_next(p, (p->rate + HZ/2) / HZ); 481 + sh_cmt_set_next(p, ((p->rate + HZ/2) / HZ) - 1); 482 482 else 483 483 sh_cmt_set_next(p, p->max_match_value); 484 484 } ··· 523 523 524 524 BUG_ON(ced->mode != CLOCK_EVT_MODE_ONESHOT); 525 525 if (likely(p->flags & FLAG_IRQCONTEXT)) 526 - p->next_match_value = delta; 526 + p->next_match_value = delta - 1; 527 527 else 528 - sh_cmt_set_next(p, delta); 528 + sh_cmt_set_next(p, delta - 1); 529 529 530 530 return 0; 531 531 }
+2 -2
drivers/i2c/busses/i2c-sh7760.c
··· 101 101 102 102 static inline void OUT32(struct cami2c *cam, int reg, unsigned long val) 103 103 { 104 - ctrl_outl(val, (unsigned long)cam->iobase + reg); 104 + __raw_writel(val, (unsigned long)cam->iobase + reg); 105 105 } 106 106 107 107 static inline unsigned long IN32(struct cami2c *cam, int reg) 108 108 { 109 - return ctrl_inl((unsigned long)cam->iobase + reg); 109 + return __raw_readl((unsigned long)cam->iobase + reg); 110 110 } 111 111 112 112 static irqreturn_t sh7760_i2c_irq(int irq, void *ptr)
+13 -10
drivers/i2c/busses/i2c-sh_mobile.c
··· 538 538 { 539 539 struct resource *res; 540 540 int ret = -ENXIO; 541 - int q, m; 542 - int k = 0; 543 - int n = 0; 541 + int n, k = 0; 544 542 545 543 while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { 546 544 for (n = res->start; hook && n <= res->end; n++) { 547 545 if (request_irq(n, sh_mobile_i2c_isr, IRQF_DISABLED, 548 - dev_name(&dev->dev), dev)) 546 + dev_name(&dev->dev), dev)) { 547 + for (n--; n >= res->start; n--) 548 + free_irq(n, dev); 549 + 549 550 goto rollback; 551 + } 550 552 } 551 553 k++; 552 554 } ··· 556 554 if (hook) 557 555 return k > 0 ? 0 : -ENOENT; 558 556 559 - k--; 560 557 ret = 0; 561 558 562 559 rollback: 563 - for (q = k; k >= 0; k--) { 564 - for (m = n; m >= res->start; m--) 565 - free_irq(m, dev); 560 + k--; 566 561 567 - res = platform_get_resource(dev, IORESOURCE_IRQ, k - 1); 568 - m = res->end; 562 + while (k >= 0) { 563 + res = platform_get_resource(dev, IORESOURCE_IRQ, k); 564 + for (n = res->start; n <= res->end; n++) 565 + free_irq(n, dev); 566 + 567 + k--; 569 568 } 570 569 571 570 return ret;
+1 -1
drivers/mfd/sh_mobile_sdhi.c
··· 65 65 p->set_pwr(pdev, state); 66 66 } 67 67 68 - static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) 68 + static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) 69 69 { 70 70 struct sh_mobile_sdhi *priv; 71 71 struct tmio_mmc_data *mmc_data;
+13 -4
drivers/serial/sh-sci.h
··· 140 140 # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ 141 141 # define SCSPTR1 0xffe10024 /* 16 bit SCIF */ 142 142 # define SCIF_ORER 0x0001 /* Overrun error bit */ 143 - # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ 143 + 144 + #if defined(CONFIG_SH_SH2007) 145 + /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=0 */ 146 + # define SCSCR_INIT(port) 0x38 147 + #else 148 + /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,CKE1=1 */ 149 + # define SCSCR_INIT(port) 0x3a 150 + #endif 151 + 144 152 #elif defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 145 153 defined(CONFIG_CPU_SUBTYPE_SH7786) 146 154 # define SCSPTR0 0xffea0024 /* 16 bit SCIF */ ··· 624 616 * -- Mitch Davis - 15 Jul 2000 625 617 */ 626 618 627 - #if defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 628 - defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 629 - defined(CONFIG_CPU_SUBTYPE_SH7786) 619 + #if (defined(CONFIG_CPU_SUBTYPE_SH7780) || \ 620 + defined(CONFIG_CPU_SUBTYPE_SH7785) || \ 621 + defined(CONFIG_CPU_SUBTYPE_SH7786)) && \ 622 + !defined(CONFIG_SH_SH2007) 630 623 #define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) 631 624 #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 632 625 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
+3 -22
drivers/sh/Kconfig
··· 1 - config INTC_USERIMASK 2 - bool "Userspace interrupt masking support" 3 - depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) 4 - help 5 - This enables support for hardware-assisted userspace hardirq 6 - masking. 1 + menu "SuperH / SH-Mobile Driver Options" 7 2 8 - SH-4A and newer interrupt blocks all support a special shadowed 9 - page with all non-masking registers obscured when mapped in to 10 - userspace. This is primarily for use by userspace device 11 - drivers that are using special priority levels. 3 + source "drivers/sh/intc/Kconfig" 12 4 13 - If in doubt, say N. 14 - 15 - config INTC_BALANCING 16 - bool "Hardware IRQ balancing support" 17 - depends on SMP && SUPERH && CPU_SUBTYPE_SH7786 18 - help 19 - This enables support for IRQ auto-distribution mode on SH-X3 20 - SMP parts. All of the balancing and CPU wakeup decisions are 21 - taken care of automatically by hardware for distributed 22 - vectors. 23 - 24 - If in doubt, say N. 5 + endmenu
+3 -4
drivers/sh/Makefile
··· 1 1 # 2 2 # Makefile for the SuperH specific drivers. 3 3 # 4 - obj-y := clk.o intc.o 4 + obj-y := intc/ 5 5 6 - obj-$(CONFIG_SUPERHYWAY) += superhyway/ 6 + obj-$(CONFIG_HAVE_CLK) += clk/ 7 7 obj-$(CONFIG_MAPLE) += maple/ 8 - 8 + obj-$(CONFIG_SUPERHYWAY) += superhyway/ 9 9 obj-$(CONFIG_GENERIC_GPIO) += pfc.o 10 - obj-$(CONFIG_SH_CLK_CPG) += clk-cpg.o
+9 -2
drivers/sh/clk-cpg.c drivers/sh/clk/cpg.c
··· 1 + /* 2 + * Helper routines for SuperH Clock Pulse Generator blocks (CPG). 3 + * 4 + * Copyright (C) 2010 Magnus Damm 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 1 10 #include <linux/clk.h> 2 11 #include <linux/compiler.h> 3 12 #include <linux/slab.h> ··· 189 180 clkp = clks + k; 190 181 191 182 clkp->ops = ops; 192 - clkp->id = -1; 193 183 clkp->freq_table = freq_table + (k * freq_table_size); 194 184 clkp->freq_table[nr_divs].frequency = CPUFREQ_TABLE_END; 195 185 ··· 327 319 clkp = clks + k; 328 320 329 321 clkp->ops = ops; 330 - clkp->id = -1; 331 322 clkp->priv = table; 332 323 333 324 clkp->freq_table = freq_table + (k * freq_table_size);
+176 -27
drivers/sh/clk.c drivers/sh/clk/core.c
··· 1 1 /* 2 - * drivers/sh/clk.c - SuperH clock framework 2 + * SuperH clock framework 3 3 * 4 - * Copyright (C) 2005 - 2009 Paul Mundt 4 + * Copyright (C) 2005 - 2010 Paul Mundt 5 5 * 6 6 * This clock framework is derived from the OMAP version by: 7 7 * ··· 14 14 * License. See the file "COPYING" in the main directory of this archive 15 15 * for more details. 16 16 */ 17 + #define pr_fmt(fmt) "clock: " fmt 18 + 17 19 #include <linux/kernel.h> 18 20 #include <linux/init.h> 19 21 #include <linux/module.h> ··· 25 23 #include <linux/sysdev.h> 26 24 #include <linux/seq_file.h> 27 25 #include <linux/err.h> 28 - #include <linux/platform_device.h> 26 + #include <linux/io.h> 29 27 #include <linux/debugfs.h> 30 28 #include <linux/cpufreq.h> 31 29 #include <linux/clk.h> ··· 44 42 unsigned long mult, div; 45 43 unsigned long freq; 46 44 int i; 45 + 46 + clk->nr_freqs = nr_freqs; 47 47 48 48 for (i = 0; i < nr_freqs; i++) { 49 49 div = 1; ··· 71 67 freq_table[i].frequency = CPUFREQ_TABLE_END; 72 68 } 73 69 74 - long clk_rate_table_round(struct clk *clk, 75 - struct cpufreq_frequency_table *freq_table, 76 - unsigned long rate) 70 + struct clk_rate_round_data; 71 + 72 + struct clk_rate_round_data { 73 + unsigned long rate; 74 + unsigned int min, max; 75 + long (*func)(unsigned int, struct clk_rate_round_data *); 76 + void *arg; 77 + }; 78 + 79 + #define for_each_frequency(pos, r, freq) \ 80 + for (pos = r->min, freq = r->func(pos, r); \ 81 + pos <= r->max; pos++, freq = r->func(pos, r)) \ 82 + if (unlikely(freq == 0)) \ 83 + ; \ 84 + else 85 + 86 + static long clk_rate_round_helper(struct clk_rate_round_data *rounder) 77 87 { 78 88 unsigned long rate_error, rate_error_prev = ~0UL; 79 - unsigned long rate_best_fit = rate; 80 - unsigned long highest, lowest; 89 + unsigned long rate_best_fit = rounder->rate; 90 + unsigned long highest, lowest, freq; 81 91 int i; 82 92 83 - highest = lowest = 0; 93 + highest = 0; 94 + lowest = ~0UL; 84 95 85 - for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) { 86 - unsigned long freq = freq_table[i].frequency; 87 - 88 - if (freq == CPUFREQ_ENTRY_INVALID) 89 - continue; 90 - 96 + for_each_frequency(i, rounder, freq) { 91 97 if (freq > highest) 92 98 highest = freq; 93 99 if (freq < lowest) 94 100 lowest = freq; 95 101 96 - rate_error = abs(freq - rate); 102 + rate_error = abs(freq - rounder->rate); 97 103 if (rate_error < rate_error_prev) { 98 104 rate_best_fit = freq; 99 105 rate_error_prev = rate_error; ··· 113 99 break; 114 100 } 115 101 116 - if (rate >= highest) 102 + if (rounder->rate >= highest) 117 103 rate_best_fit = highest; 118 - if (rate <= lowest) 104 + if (rounder->rate <= lowest) 119 105 rate_best_fit = lowest; 120 106 121 107 return rate_best_fit; 108 + } 109 + 110 + static long clk_rate_table_iter(unsigned int pos, 111 + struct clk_rate_round_data *rounder) 112 + { 113 + struct cpufreq_frequency_table *freq_table = rounder->arg; 114 + unsigned long freq = freq_table[pos].frequency; 115 + 116 + if (freq == CPUFREQ_ENTRY_INVALID) 117 + freq = 0; 118 + 119 + return freq; 120 + } 121 + 122 + long clk_rate_table_round(struct clk *clk, 123 + struct cpufreq_frequency_table *freq_table, 124 + unsigned long rate) 125 + { 126 + struct clk_rate_round_data table_round = { 127 + .min = 0, 128 + .max = clk->nr_freqs - 1, 129 + .func = clk_rate_table_iter, 130 + .arg = freq_table, 131 + .rate = rate, 132 + }; 133 + 134 + if (clk->nr_freqs < 1) 135 + return 0; 136 + 137 + return clk_rate_round_helper(&table_round); 138 + } 139 + 140 + static long clk_rate_div_range_iter(unsigned int pos, 141 + struct clk_rate_round_data *rounder) 142 + { 143 + return clk_get_rate(rounder->arg) / pos; 144 + } 145 + 146 + long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, 147 + unsigned int div_max, unsigned long rate) 148 + { 149 + struct clk_rate_round_data div_range_round = { 150 + .min = div_min, 151 + .max = div_max, 152 + .func = clk_rate_div_range_iter, 153 + .arg = clk_get_parent(clk), 154 + .rate = rate, 155 + }; 156 + 157 + return clk_rate_round_helper(&div_range_round); 122 158 } 123 159 124 160 int clk_rate_table_find(struct clk *clk, ··· 224 160 225 161 static void __clk_disable(struct clk *clk) 226 162 { 227 - if (WARN(!clk->usecount, "Trying to disable clock %s with 0 usecount\n", 228 - clk->name)) 163 + if (WARN(!clk->usecount, "Trying to disable clock %p with 0 usecount\n", 164 + clk)) 229 165 return; 230 166 231 167 if (!(--clk->usecount)) { ··· 312 248 } 313 249 } 314 250 251 + static struct clk_mapping dummy_mapping; 252 + 253 + static struct clk *lookup_root_clock(struct clk *clk) 254 + { 255 + while (clk->parent) 256 + clk = clk->parent; 257 + 258 + return clk; 259 + } 260 + 261 + static int clk_establish_mapping(struct clk *clk) 262 + { 263 + struct clk_mapping *mapping = clk->mapping; 264 + 265 + /* 266 + * Propagate mappings. 267 + */ 268 + if (!mapping) { 269 + struct clk *clkp; 270 + 271 + /* 272 + * dummy mapping for root clocks with no specified ranges 273 + */ 274 + if (!clk->parent) { 275 + clk->mapping = &dummy_mapping; 276 + return 0; 277 + } 278 + 279 + /* 280 + * If we're on a child clock and it provides no mapping of its 281 + * own, inherit the mapping from its root clock. 282 + */ 283 + clkp = lookup_root_clock(clk); 284 + mapping = clkp->mapping; 285 + BUG_ON(!mapping); 286 + } 287 + 288 + /* 289 + * Establish initial mapping. 290 + */ 291 + if (!mapping->base && mapping->phys) { 292 + kref_init(&mapping->ref); 293 + 294 + mapping->base = ioremap_nocache(mapping->phys, mapping->len); 295 + if (unlikely(!mapping->base)) 296 + return -ENXIO; 297 + } else if (mapping->base) { 298 + /* 299 + * Bump the refcount for an existing mapping 300 + */ 301 + kref_get(&mapping->ref); 302 + } 303 + 304 + clk->mapping = mapping; 305 + return 0; 306 + } 307 + 308 + static void clk_destroy_mapping(struct kref *kref) 309 + { 310 + struct clk_mapping *mapping; 311 + 312 + mapping = container_of(kref, struct clk_mapping, ref); 313 + 314 + iounmap(mapping->base); 315 + } 316 + 317 + static void clk_teardown_mapping(struct clk *clk) 318 + { 319 + struct clk_mapping *mapping = clk->mapping; 320 + 321 + /* Nothing to do */ 322 + if (mapping == &dummy_mapping) 323 + return; 324 + 325 + kref_put(&mapping->ref, clk_destroy_mapping); 326 + clk->mapping = NULL; 327 + } 328 + 315 329 int clk_register(struct clk *clk) 316 330 { 331 + int ret; 332 + 317 333 if (clk == NULL || IS_ERR(clk)) 318 334 return -EINVAL; 319 335 ··· 408 264 INIT_LIST_HEAD(&clk->children); 409 265 clk->usecount = 0; 410 266 267 + ret = clk_establish_mapping(clk); 268 + if (unlikely(ret)) 269 + goto out_unlock; 270 + 411 271 if (clk->parent) 412 272 list_add(&clk->sibling, &clk->parent->children); 413 273 else ··· 420 272 list_add(&clk->node, &clock_list); 421 273 if (clk->ops && clk->ops->init) 422 274 clk->ops->init(clk); 275 + 276 + out_unlock: 423 277 mutex_unlock(&clock_list_sem); 424 278 425 - return 0; 279 + return ret; 426 280 } 427 281 EXPORT_SYMBOL_GPL(clk_register); 428 282 ··· 433 283 mutex_lock(&clock_list_sem); 434 284 list_del(&clk->sibling); 435 285 list_del(&clk->node); 286 + clk_teardown_mapping(clk); 436 287 mutex_unlock(&clock_list_sem); 437 288 } 438 289 EXPORT_SYMBOL_GPL(clk_unregister); ··· 505 354 ret = clk_reparent(clk, parent); 506 355 507 356 if (ret == 0) { 508 - pr_debug("clock: set parent of %s to %s (new rate %ld)\n", 509 - clk->name, clk->parent->name, clk->rate); 510 357 if (clk->ops->recalc) 511 358 clk->rate = clk->ops->recalc(clk); 359 + pr_debug("set parent of %p to %p (new rate %ld)\n", 360 + clk, clk->parent, clk->rate); 512 361 propagate_rate(clk); 513 362 } 514 363 } else ··· 620 469 char s[255]; 621 470 char *p = s; 622 471 623 - p += sprintf(p, "%s", c->name); 624 - if (c->id >= 0) 625 - sprintf(p, ":%d", c->id); 472 + p += sprintf(p, "%p", c); 626 473 d = debugfs_create_dir(s, pa ? pa->dentry : clk_debugfs_root); 627 474 if (!d) 628 475 return -ENOMEM; ··· 662 513 return err; 663 514 } 664 515 665 - if (!c->dentry && c->name) { 516 + if (!c->dentry) { 666 517 err = clk_debugfs_register_one(c); 667 518 if (err) 668 519 return err;
+3
drivers/sh/clk/Makefile
··· 1 + obj-y := core.o 2 + 3 + obj-$(CONFIG_SH_CLK_CPG) += cpg.o
-1390
drivers/sh/intc.c
··· 1 - /* 2 - * Shared interrupt handling code for IPR and INTC2 types of IRQs. 3 - * 4 - * Copyright (C) 2007, 2008 Magnus Damm 5 - * Copyright (C) 2009, 2010 Paul Mundt 6 - * 7 - * Based on intc2.c and ipr.c 8 - * 9 - * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi 10 - * Copyright (C) 2000 Kazumoto Kojima 11 - * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) 12 - * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> 13 - * Copyright (C) 2005, 2006 Paul Mundt 14 - * 15 - * This file is subject to the terms and conditions of the GNU General Public 16 - * License. See the file "COPYING" in the main directory of this archive 17 - * for more details. 18 - */ 19 - #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 - 21 - #include <linux/init.h> 22 - #include <linux/irq.h> 23 - #include <linux/module.h> 24 - #include <linux/io.h> 25 - #include <linux/slab.h> 26 - #include <linux/interrupt.h> 27 - #include <linux/sh_intc.h> 28 - #include <linux/sysdev.h> 29 - #include <linux/list.h> 30 - #include <linux/topology.h> 31 - #include <linux/bitmap.h> 32 - #include <linux/cpumask.h> 33 - #include <asm/sizes.h> 34 - 35 - #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ 36 - ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ 37 - ((addr_e) << 16) | ((addr_d << 24))) 38 - 39 - #define _INTC_SHIFT(h) (h & 0x1f) 40 - #define _INTC_WIDTH(h) ((h >> 5) & 0xf) 41 - #define _INTC_FN(h) ((h >> 9) & 0xf) 42 - #define _INTC_MODE(h) ((h >> 13) & 0x7) 43 - #define _INTC_ADDR_E(h) ((h >> 16) & 0xff) 44 - #define _INTC_ADDR_D(h) ((h >> 24) & 0xff) 45 - 46 - struct intc_handle_int { 47 - unsigned int irq; 48 - unsigned long handle; 49 - }; 50 - 51 - struct intc_window { 52 - phys_addr_t phys; 53 - void __iomem *virt; 54 - unsigned long size; 55 - }; 56 - 57 - struct intc_desc_int { 58 - struct list_head list; 59 - struct sys_device sysdev; 60 - pm_message_t state; 61 - unsigned long *reg; 62 - #ifdef CONFIG_SMP 63 - unsigned long *smp; 64 - #endif 65 - unsigned int nr_reg; 66 - struct intc_handle_int *prio; 67 - unsigned int nr_prio; 68 - struct intc_handle_int *sense; 69 - unsigned int nr_sense; 70 - struct intc_window *window; 71 - unsigned int nr_windows; 72 - struct irq_chip chip; 73 - }; 74 - 75 - static LIST_HEAD(intc_list); 76 - 77 - /* 78 - * The intc_irq_map provides a global map of bound IRQ vectors for a 79 - * given platform. Allocation of IRQs are either static through the CPU 80 - * vector map, or dynamic in the case of board mux vectors or MSI. 81 - * 82 - * As this is a central point for all IRQ controllers on the system, 83 - * each of the available sources are mapped out here. This combined with 84 - * sparseirq makes it quite trivial to keep the vector map tightly packed 85 - * when dynamically creating IRQs, as well as tying in to otherwise 86 - * unused irq_desc positions in the sparse array. 87 - */ 88 - static DECLARE_BITMAP(intc_irq_map, NR_IRQS); 89 - static DEFINE_SPINLOCK(vector_lock); 90 - 91 - #ifdef CONFIG_SMP 92 - #define IS_SMP(x) x.smp 93 - #define INTC_REG(d, x, c) (d->reg[(x)] + ((d->smp[(x)] & 0xff) * c)) 94 - #define SMP_NR(d, x) ((d->smp[(x)] >> 8) ? (d->smp[(x)] >> 8) : 1) 95 - #else 96 - #define IS_SMP(x) 0 97 - #define INTC_REG(d, x, c) (d->reg[(x)]) 98 - #define SMP_NR(d, x) 1 99 - #endif 100 - 101 - static unsigned int intc_prio_level[NR_IRQS]; /* for now */ 102 - static unsigned int default_prio_level = 2; /* 2 - 16 */ 103 - static unsigned long ack_handle[NR_IRQS]; 104 - #ifdef CONFIG_INTC_BALANCING 105 - static unsigned long dist_handle[NR_IRQS]; 106 - #endif 107 - 108 - static inline struct intc_desc_int *get_intc_desc(unsigned int irq) 109 - { 110 - struct irq_chip *chip = get_irq_chip(irq); 111 - return container_of(chip, struct intc_desc_int, chip); 112 - } 113 - 114 - static unsigned long intc_phys_to_virt(struct intc_desc_int *d, 115 - unsigned long address) 116 - { 117 - struct intc_window *window; 118 - int k; 119 - 120 - /* scan through physical windows and convert address */ 121 - for (k = 0; k < d->nr_windows; k++) { 122 - window = d->window + k; 123 - 124 - if (address < window->phys) 125 - continue; 126 - 127 - if (address >= (window->phys + window->size)) 128 - continue; 129 - 130 - address -= window->phys; 131 - address += (unsigned long)window->virt; 132 - 133 - return address; 134 - } 135 - 136 - /* no windows defined, register must be 1:1 mapped virt:phys */ 137 - return address; 138 - } 139 - 140 - static unsigned int intc_get_reg(struct intc_desc_int *d, unsigned long address) 141 - { 142 - unsigned int k; 143 - 144 - address = intc_phys_to_virt(d, address); 145 - 146 - for (k = 0; k < d->nr_reg; k++) { 147 - if (d->reg[k] == address) 148 - return k; 149 - } 150 - 151 - BUG(); 152 - return 0; 153 - } 154 - 155 - static inline unsigned int set_field(unsigned int value, 156 - unsigned int field_value, 157 - unsigned int handle) 158 - { 159 - unsigned int width = _INTC_WIDTH(handle); 160 - unsigned int shift = _INTC_SHIFT(handle); 161 - 162 - value &= ~(((1 << width) - 1) << shift); 163 - value |= field_value << shift; 164 - return value; 165 - } 166 - 167 - static void write_8(unsigned long addr, unsigned long h, unsigned long data) 168 - { 169 - __raw_writeb(set_field(0, data, h), addr); 170 - (void)__raw_readb(addr); /* Defeat write posting */ 171 - } 172 - 173 - static void write_16(unsigned long addr, unsigned long h, unsigned long data) 174 - { 175 - __raw_writew(set_field(0, data, h), addr); 176 - (void)__raw_readw(addr); /* Defeat write posting */ 177 - } 178 - 179 - static void write_32(unsigned long addr, unsigned long h, unsigned long data) 180 - { 181 - __raw_writel(set_field(0, data, h), addr); 182 - (void)__raw_readl(addr); /* Defeat write posting */ 183 - } 184 - 185 - static void modify_8(unsigned long addr, unsigned long h, unsigned long data) 186 - { 187 - unsigned long flags; 188 - local_irq_save(flags); 189 - __raw_writeb(set_field(__raw_readb(addr), data, h), addr); 190 - (void)__raw_readb(addr); /* Defeat write posting */ 191 - local_irq_restore(flags); 192 - } 193 - 194 - static void modify_16(unsigned long addr, unsigned long h, unsigned long data) 195 - { 196 - unsigned long flags; 197 - local_irq_save(flags); 198 - __raw_writew(set_field(__raw_readw(addr), data, h), addr); 199 - (void)__raw_readw(addr); /* Defeat write posting */ 200 - local_irq_restore(flags); 201 - } 202 - 203 - static void modify_32(unsigned long addr, unsigned long h, unsigned long data) 204 - { 205 - unsigned long flags; 206 - local_irq_save(flags); 207 - __raw_writel(set_field(__raw_readl(addr), data, h), addr); 208 - (void)__raw_readl(addr); /* Defeat write posting */ 209 - local_irq_restore(flags); 210 - } 211 - 212 - enum { REG_FN_ERR = 0, REG_FN_WRITE_BASE = 1, REG_FN_MODIFY_BASE = 5 }; 213 - 214 - static void (*intc_reg_fns[])(unsigned long addr, 215 - unsigned long h, 216 - unsigned long data) = { 217 - [REG_FN_WRITE_BASE + 0] = write_8, 218 - [REG_FN_WRITE_BASE + 1] = write_16, 219 - [REG_FN_WRITE_BASE + 3] = write_32, 220 - [REG_FN_MODIFY_BASE + 0] = modify_8, 221 - [REG_FN_MODIFY_BASE + 1] = modify_16, 222 - [REG_FN_MODIFY_BASE + 3] = modify_32, 223 - }; 224 - 225 - enum { MODE_ENABLE_REG = 0, /* Bit(s) set -> interrupt enabled */ 226 - MODE_MASK_REG, /* Bit(s) set -> interrupt disabled */ 227 - MODE_DUAL_REG, /* Two registers, set bit to enable / disable */ 228 - MODE_PRIO_REG, /* Priority value written to enable interrupt */ 229 - MODE_PCLR_REG, /* Above plus all bits set to disable interrupt */ 230 - }; 231 - 232 - static void intc_mode_field(unsigned long addr, 233 - unsigned long handle, 234 - void (*fn)(unsigned long, 235 - unsigned long, 236 - unsigned long), 237 - unsigned int irq) 238 - { 239 - fn(addr, handle, ((1 << _INTC_WIDTH(handle)) - 1)); 240 - } 241 - 242 - static void intc_mode_zero(unsigned long addr, 243 - unsigned long handle, 244 - void (*fn)(unsigned long, 245 - unsigned long, 246 - unsigned long), 247 - unsigned int irq) 248 - { 249 - fn(addr, handle, 0); 250 - } 251 - 252 - static void intc_mode_prio(unsigned long addr, 253 - unsigned long handle, 254 - void (*fn)(unsigned long, 255 - unsigned long, 256 - unsigned long), 257 - unsigned int irq) 258 - { 259 - fn(addr, handle, intc_prio_level[irq]); 260 - } 261 - 262 - static void (*intc_enable_fns[])(unsigned long addr, 263 - unsigned long handle, 264 - void (*fn)(unsigned long, 265 - unsigned long, 266 - unsigned long), 267 - unsigned int irq) = { 268 - [MODE_ENABLE_REG] = intc_mode_field, 269 - [MODE_MASK_REG] = intc_mode_zero, 270 - [MODE_DUAL_REG] = intc_mode_field, 271 - [MODE_PRIO_REG] = intc_mode_prio, 272 - [MODE_PCLR_REG] = intc_mode_prio, 273 - }; 274 - 275 - static void (*intc_disable_fns[])(unsigned long addr, 276 - unsigned long handle, 277 - void (*fn)(unsigned long, 278 - unsigned long, 279 - unsigned long), 280 - unsigned int irq) = { 281 - [MODE_ENABLE_REG] = intc_mode_zero, 282 - [MODE_MASK_REG] = intc_mode_field, 283 - [MODE_DUAL_REG] = intc_mode_field, 284 - [MODE_PRIO_REG] = intc_mode_zero, 285 - [MODE_PCLR_REG] = intc_mode_field, 286 - }; 287 - 288 - #ifdef CONFIG_INTC_BALANCING 289 - static inline void intc_balancing_enable(unsigned int irq) 290 - { 291 - struct intc_desc_int *d = get_intc_desc(irq); 292 - unsigned long handle = dist_handle[irq]; 293 - unsigned long addr; 294 - 295 - if (irq_balancing_disabled(irq) || !handle) 296 - return; 297 - 298 - addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 299 - intc_reg_fns[_INTC_FN(handle)](addr, handle, 1); 300 - } 301 - 302 - static inline void intc_balancing_disable(unsigned int irq) 303 - { 304 - struct intc_desc_int *d = get_intc_desc(irq); 305 - unsigned long handle = dist_handle[irq]; 306 - unsigned long addr; 307 - 308 - if (irq_balancing_disabled(irq) || !handle) 309 - return; 310 - 311 - addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 312 - intc_reg_fns[_INTC_FN(handle)](addr, handle, 0); 313 - } 314 - 315 - static unsigned int intc_dist_data(struct intc_desc *desc, 316 - struct intc_desc_int *d, 317 - intc_enum enum_id) 318 - { 319 - struct intc_mask_reg *mr = desc->hw.mask_regs; 320 - unsigned int i, j, fn, mode; 321 - unsigned long reg_e, reg_d; 322 - 323 - for (i = 0; mr && enum_id && i < desc->hw.nr_mask_regs; i++) { 324 - mr = desc->hw.mask_regs + i; 325 - 326 - /* 327 - * Skip this entry if there's no auto-distribution 328 - * register associated with it. 329 - */ 330 - if (!mr->dist_reg) 331 - continue; 332 - 333 - for (j = 0; j < ARRAY_SIZE(mr->enum_ids); j++) { 334 - if (mr->enum_ids[j] != enum_id) 335 - continue; 336 - 337 - fn = REG_FN_MODIFY_BASE; 338 - mode = MODE_ENABLE_REG; 339 - reg_e = mr->dist_reg; 340 - reg_d = mr->dist_reg; 341 - 342 - fn += (mr->reg_width >> 3) - 1; 343 - return _INTC_MK(fn, mode, 344 - intc_get_reg(d, reg_e), 345 - intc_get_reg(d, reg_d), 346 - 1, 347 - (mr->reg_width - 1) - j); 348 - } 349 - } 350 - 351 - /* 352 - * It's possible we've gotten here with no distribution options 353 - * available for the IRQ in question, so we just skip over those. 354 - */ 355 - return 0; 356 - } 357 - #else 358 - static inline void intc_balancing_enable(unsigned int irq) 359 - { 360 - } 361 - 362 - static inline void intc_balancing_disable(unsigned int irq) 363 - { 364 - } 365 - #endif 366 - 367 - static inline void _intc_enable(unsigned int irq, unsigned long handle) 368 - { 369 - struct intc_desc_int *d = get_intc_desc(irq); 370 - unsigned long addr; 371 - unsigned int cpu; 372 - 373 - for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) { 374 - #ifdef CONFIG_SMP 375 - if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 376 - continue; 377 - #endif 378 - addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu); 379 - intc_enable_fns[_INTC_MODE(handle)](addr, handle, intc_reg_fns\ 380 - [_INTC_FN(handle)], irq); 381 - } 382 - 383 - intc_balancing_enable(irq); 384 - } 385 - 386 - static void intc_enable(unsigned int irq) 387 - { 388 - _intc_enable(irq, (unsigned long)get_irq_chip_data(irq)); 389 - } 390 - 391 - static void intc_disable(unsigned int irq) 392 - { 393 - struct intc_desc_int *d = get_intc_desc(irq); 394 - unsigned long handle = (unsigned long)get_irq_chip_data(irq); 395 - unsigned long addr; 396 - unsigned int cpu; 397 - 398 - intc_balancing_disable(irq); 399 - 400 - for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) { 401 - #ifdef CONFIG_SMP 402 - if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 403 - continue; 404 - #endif 405 - addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu); 406 - intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\ 407 - [_INTC_FN(handle)], irq); 408 - } 409 - } 410 - 411 - static void (*intc_enable_noprio_fns[])(unsigned long addr, 412 - unsigned long handle, 413 - void (*fn)(unsigned long, 414 - unsigned long, 415 - unsigned long), 416 - unsigned int irq) = { 417 - [MODE_ENABLE_REG] = intc_mode_field, 418 - [MODE_MASK_REG] = intc_mode_zero, 419 - [MODE_DUAL_REG] = intc_mode_field, 420 - [MODE_PRIO_REG] = intc_mode_field, 421 - [MODE_PCLR_REG] = intc_mode_field, 422 - }; 423 - 424 - static void intc_enable_disable(struct intc_desc_int *d, 425 - unsigned long handle, int do_enable) 426 - { 427 - unsigned long addr; 428 - unsigned int cpu; 429 - void (*fn)(unsigned long, unsigned long, 430 - void (*)(unsigned long, unsigned long, unsigned long), 431 - unsigned int); 432 - 433 - if (do_enable) { 434 - for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) { 435 - addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu); 436 - fn = intc_enable_noprio_fns[_INTC_MODE(handle)]; 437 - fn(addr, handle, intc_reg_fns[_INTC_FN(handle)], 0); 438 - } 439 - } else { 440 - for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) { 441 - addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu); 442 - fn = intc_disable_fns[_INTC_MODE(handle)]; 443 - fn(addr, handle, intc_reg_fns[_INTC_FN(handle)], 0); 444 - } 445 - } 446 - } 447 - 448 - static int intc_set_wake(unsigned int irq, unsigned int on) 449 - { 450 - return 0; /* allow wakeup, but setup hardware in intc_suspend() */ 451 - } 452 - 453 - #ifdef CONFIG_SMP 454 - /* 455 - * This is held with the irq desc lock held, so we don't require any 456 - * additional locking here at the intc desc level. The affinity mask is 457 - * later tested in the enable/disable paths. 458 - */ 459 - static int intc_set_affinity(unsigned int irq, const struct cpumask *cpumask) 460 - { 461 - if (!cpumask_intersects(cpumask, cpu_online_mask)) 462 - return -1; 463 - 464 - cpumask_copy(irq_to_desc(irq)->affinity, cpumask); 465 - 466 - return 0; 467 - } 468 - #endif 469 - 470 - static void intc_mask_ack(unsigned int irq) 471 - { 472 - struct intc_desc_int *d = get_intc_desc(irq); 473 - unsigned long handle = ack_handle[irq]; 474 - unsigned long addr; 475 - 476 - intc_disable(irq); 477 - 478 - /* read register and write zero only to the associated bit */ 479 - if (handle) { 480 - addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 481 - switch (_INTC_FN(handle)) { 482 - case REG_FN_MODIFY_BASE + 0: /* 8bit */ 483 - __raw_readb(addr); 484 - __raw_writeb(0xff ^ set_field(0, 1, handle), addr); 485 - break; 486 - case REG_FN_MODIFY_BASE + 1: /* 16bit */ 487 - __raw_readw(addr); 488 - __raw_writew(0xffff ^ set_field(0, 1, handle), addr); 489 - break; 490 - case REG_FN_MODIFY_BASE + 3: /* 32bit */ 491 - __raw_readl(addr); 492 - __raw_writel(0xffffffff ^ set_field(0, 1, handle), addr); 493 - break; 494 - default: 495 - BUG(); 496 - break; 497 - } 498 - } 499 - } 500 - 501 - static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp, 502 - unsigned int nr_hp, 503 - unsigned int irq) 504 - { 505 - int i; 506 - 507 - /* 508 - * this doesn't scale well, but... 509 - * 510 - * this function should only be used for cerain uncommon 511 - * operations such as intc_set_priority() and intc_set_sense() 512 - * and in those rare cases performance doesn't matter that much. 513 - * keeping the memory footprint low is more important. 514 - * 515 - * one rather simple way to speed this up and still keep the 516 - * memory footprint down is to make sure the array is sorted 517 - * and then perform a bisect to lookup the irq. 518 - */ 519 - for (i = 0; i < nr_hp; i++) { 520 - if ((hp + i)->irq != irq) 521 - continue; 522 - 523 - return hp + i; 524 - } 525 - 526 - return NULL; 527 - } 528 - 529 - int intc_set_priority(unsigned int irq, unsigned int prio) 530 - { 531 - struct intc_desc_int *d = get_intc_desc(irq); 532 - struct intc_handle_int *ihp; 533 - 534 - if (!intc_prio_level[irq] || prio <= 1) 535 - return -EINVAL; 536 - 537 - ihp = intc_find_irq(d->prio, d->nr_prio, irq); 538 - if (ihp) { 539 - if (prio >= (1 << _INTC_WIDTH(ihp->handle))) 540 - return -EINVAL; 541 - 542 - intc_prio_level[irq] = prio; 543 - 544 - /* 545 - * only set secondary masking method directly 546 - * primary masking method is using intc_prio_level[irq] 547 - * priority level will be set during next enable() 548 - */ 549 - if (_INTC_FN(ihp->handle) != REG_FN_ERR) 550 - _intc_enable(irq, ihp->handle); 551 - } 552 - return 0; 553 - } 554 - 555 - #define VALID(x) (x | 0x80) 556 - 557 - static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { 558 - [IRQ_TYPE_EDGE_FALLING] = VALID(0), 559 - [IRQ_TYPE_EDGE_RISING] = VALID(1), 560 - [IRQ_TYPE_LEVEL_LOW] = VALID(2), 561 - /* SH7706, SH7707 and SH7709 do not support high level triggered */ 562 - #if !defined(CONFIG_CPU_SUBTYPE_SH7706) && \ 563 - !defined(CONFIG_CPU_SUBTYPE_SH7707) && \ 564 - !defined(CONFIG_CPU_SUBTYPE_SH7709) 565 - [IRQ_TYPE_LEVEL_HIGH] = VALID(3), 566 - #endif 567 - }; 568 - 569 - static int intc_set_sense(unsigned int irq, unsigned int type) 570 - { 571 - struct intc_desc_int *d = get_intc_desc(irq); 572 - unsigned char value = intc_irq_sense_table[type & IRQ_TYPE_SENSE_MASK]; 573 - struct intc_handle_int *ihp; 574 - unsigned long addr; 575 - 576 - if (!value) 577 - return -EINVAL; 578 - 579 - ihp = intc_find_irq(d->sense, d->nr_sense, irq); 580 - if (ihp) { 581 - addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); 582 - intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value); 583 - } 584 - return 0; 585 - } 586 - 587 - static intc_enum __init intc_grp_id(struct intc_desc *desc, 588 - intc_enum enum_id) 589 - { 590 - struct intc_group *g = desc->hw.groups; 591 - unsigned int i, j; 592 - 593 - for (i = 0; g && enum_id && i < desc->hw.nr_groups; i++) { 594 - g = desc->hw.groups + i; 595 - 596 - for (j = 0; g->enum_ids[j]; j++) { 597 - if (g->enum_ids[j] != enum_id) 598 - continue; 599 - 600 - return g->enum_id; 601 - } 602 - } 603 - 604 - return 0; 605 - } 606 - 607 - static unsigned int __init _intc_mask_data(struct intc_desc *desc, 608 - struct intc_desc_int *d, 609 - intc_enum enum_id, 610 - unsigned int *reg_idx, 611 - unsigned int *fld_idx) 612 - { 613 - struct intc_mask_reg *mr = desc->hw.mask_regs; 614 - unsigned int fn, mode; 615 - unsigned long reg_e, reg_d; 616 - 617 - while (mr && enum_id && *reg_idx < desc->hw.nr_mask_regs) { 618 - mr = desc->hw.mask_regs + *reg_idx; 619 - 620 - for (; *fld_idx < ARRAY_SIZE(mr->enum_ids); (*fld_idx)++) { 621 - if (mr->enum_ids[*fld_idx] != enum_id) 622 - continue; 623 - 624 - if (mr->set_reg && mr->clr_reg) { 625 - fn = REG_FN_WRITE_BASE; 626 - mode = MODE_DUAL_REG; 627 - reg_e = mr->clr_reg; 628 - reg_d = mr->set_reg; 629 - } else { 630 - fn = REG_FN_MODIFY_BASE; 631 - if (mr->set_reg) { 632 - mode = MODE_ENABLE_REG; 633 - reg_e = mr->set_reg; 634 - reg_d = mr->set_reg; 635 - } else { 636 - mode = MODE_MASK_REG; 637 - reg_e = mr->clr_reg; 638 - reg_d = mr->clr_reg; 639 - } 640 - } 641 - 642 - fn += (mr->reg_width >> 3) - 1; 643 - return _INTC_MK(fn, mode, 644 - intc_get_reg(d, reg_e), 645 - intc_get_reg(d, reg_d), 646 - 1, 647 - (mr->reg_width - 1) - *fld_idx); 648 - } 649 - 650 - *fld_idx = 0; 651 - (*reg_idx)++; 652 - } 653 - 654 - return 0; 655 - } 656 - 657 - static unsigned int __init intc_mask_data(struct intc_desc *desc, 658 - struct intc_desc_int *d, 659 - intc_enum enum_id, int do_grps) 660 - { 661 - unsigned int i = 0; 662 - unsigned int j = 0; 663 - unsigned int ret; 664 - 665 - ret = _intc_mask_data(desc, d, enum_id, &i, &j); 666 - if (ret) 667 - return ret; 668 - 669 - if (do_grps) 670 - return intc_mask_data(desc, d, intc_grp_id(desc, enum_id), 0); 671 - 672 - return 0; 673 - } 674 - 675 - static unsigned int __init _intc_prio_data(struct intc_desc *desc, 676 - struct intc_desc_int *d, 677 - intc_enum enum_id, 678 - unsigned int *reg_idx, 679 - unsigned int *fld_idx) 680 - { 681 - struct intc_prio_reg *pr = desc->hw.prio_regs; 682 - unsigned int fn, n, mode, bit; 683 - unsigned long reg_e, reg_d; 684 - 685 - while (pr && enum_id && *reg_idx < desc->hw.nr_prio_regs) { 686 - pr = desc->hw.prio_regs + *reg_idx; 687 - 688 - for (; *fld_idx < ARRAY_SIZE(pr->enum_ids); (*fld_idx)++) { 689 - if (pr->enum_ids[*fld_idx] != enum_id) 690 - continue; 691 - 692 - if (pr->set_reg && pr->clr_reg) { 693 - fn = REG_FN_WRITE_BASE; 694 - mode = MODE_PCLR_REG; 695 - reg_e = pr->set_reg; 696 - reg_d = pr->clr_reg; 697 - } else { 698 - fn = REG_FN_MODIFY_BASE; 699 - mode = MODE_PRIO_REG; 700 - if (!pr->set_reg) 701 - BUG(); 702 - reg_e = pr->set_reg; 703 - reg_d = pr->set_reg; 704 - } 705 - 706 - fn += (pr->reg_width >> 3) - 1; 707 - n = *fld_idx + 1; 708 - 709 - BUG_ON(n * pr->field_width > pr->reg_width); 710 - 711 - bit = pr->reg_width - (n * pr->field_width); 712 - 713 - return _INTC_MK(fn, mode, 714 - intc_get_reg(d, reg_e), 715 - intc_get_reg(d, reg_d), 716 - pr->field_width, bit); 717 - } 718 - 719 - *fld_idx = 0; 720 - (*reg_idx)++; 721 - } 722 - 723 - return 0; 724 - } 725 - 726 - static unsigned int __init intc_prio_data(struct intc_desc *desc, 727 - struct intc_desc_int *d, 728 - intc_enum enum_id, int do_grps) 729 - { 730 - unsigned int i = 0; 731 - unsigned int j = 0; 732 - unsigned int ret; 733 - 734 - ret = _intc_prio_data(desc, d, enum_id, &i, &j); 735 - if (ret) 736 - return ret; 737 - 738 - if (do_grps) 739 - return intc_prio_data(desc, d, intc_grp_id(desc, enum_id), 0); 740 - 741 - return 0; 742 - } 743 - 744 - static void __init intc_enable_disable_enum(struct intc_desc *desc, 745 - struct intc_desc_int *d, 746 - intc_enum enum_id, int enable) 747 - { 748 - unsigned int i, j, data; 749 - 750 - /* go through and enable/disable all mask bits */ 751 - i = j = 0; 752 - do { 753 - data = _intc_mask_data(desc, d, enum_id, &i, &j); 754 - if (data) 755 - intc_enable_disable(d, data, enable); 756 - j++; 757 - } while (data); 758 - 759 - /* go through and enable/disable all priority fields */ 760 - i = j = 0; 761 - do { 762 - data = _intc_prio_data(desc, d, enum_id, &i, &j); 763 - if (data) 764 - intc_enable_disable(d, data, enable); 765 - 766 - j++; 767 - } while (data); 768 - } 769 - 770 - static unsigned int __init intc_ack_data(struct intc_desc *desc, 771 - struct intc_desc_int *d, 772 - intc_enum enum_id) 773 - { 774 - struct intc_mask_reg *mr = desc->hw.ack_regs; 775 - unsigned int i, j, fn, mode; 776 - unsigned long reg_e, reg_d; 777 - 778 - for (i = 0; mr && enum_id && i < desc->hw.nr_ack_regs; i++) { 779 - mr = desc->hw.ack_regs + i; 780 - 781 - for (j = 0; j < ARRAY_SIZE(mr->enum_ids); j++) { 782 - if (mr->enum_ids[j] != enum_id) 783 - continue; 784 - 785 - fn = REG_FN_MODIFY_BASE; 786 - mode = MODE_ENABLE_REG; 787 - reg_e = mr->set_reg; 788 - reg_d = mr->set_reg; 789 - 790 - fn += (mr->reg_width >> 3) - 1; 791 - return _INTC_MK(fn, mode, 792 - intc_get_reg(d, reg_e), 793 - intc_get_reg(d, reg_d), 794 - 1, 795 - (mr->reg_width - 1) - j); 796 - } 797 - } 798 - 799 - return 0; 800 - } 801 - 802 - static unsigned int __init intc_sense_data(struct intc_desc *desc, 803 - struct intc_desc_int *d, 804 - intc_enum enum_id) 805 - { 806 - struct intc_sense_reg *sr = desc->hw.sense_regs; 807 - unsigned int i, j, fn, bit; 808 - 809 - for (i = 0; sr && enum_id && i < desc->hw.nr_sense_regs; i++) { 810 - sr = desc->hw.sense_regs + i; 811 - 812 - for (j = 0; j < ARRAY_SIZE(sr->enum_ids); j++) { 813 - if (sr->enum_ids[j] != enum_id) 814 - continue; 815 - 816 - fn = REG_FN_MODIFY_BASE; 817 - fn += (sr->reg_width >> 3) - 1; 818 - 819 - BUG_ON((j + 1) * sr->field_width > sr->reg_width); 820 - 821 - bit = sr->reg_width - ((j + 1) * sr->field_width); 822 - 823 - return _INTC_MK(fn, 0, intc_get_reg(d, sr->reg), 824 - 0, sr->field_width, bit); 825 - } 826 - } 827 - 828 - return 0; 829 - } 830 - 831 - static void __init intc_register_irq(struct intc_desc *desc, 832 - struct intc_desc_int *d, 833 - intc_enum enum_id, 834 - unsigned int irq) 835 - { 836 - struct intc_handle_int *hp; 837 - unsigned int data[2], primary; 838 - 839 - /* 840 - * Register the IRQ position with the global IRQ map 841 - */ 842 - set_bit(irq, intc_irq_map); 843 - 844 - /* 845 - * Prefer single interrupt source bitmap over other combinations: 846 - * 847 - * 1. bitmap, single interrupt source 848 - * 2. priority, single interrupt source 849 - * 3. bitmap, multiple interrupt sources (groups) 850 - * 4. priority, multiple interrupt sources (groups) 851 - */ 852 - data[0] = intc_mask_data(desc, d, enum_id, 0); 853 - data[1] = intc_prio_data(desc, d, enum_id, 0); 854 - 855 - primary = 0; 856 - if (!data[0] && data[1]) 857 - primary = 1; 858 - 859 - if (!data[0] && !data[1]) 860 - pr_warning("missing unique irq mask for irq %d (vect 0x%04x)\n", 861 - irq, irq2evt(irq)); 862 - 863 - data[0] = data[0] ? data[0] : intc_mask_data(desc, d, enum_id, 1); 864 - data[1] = data[1] ? data[1] : intc_prio_data(desc, d, enum_id, 1); 865 - 866 - if (!data[primary]) 867 - primary ^= 1; 868 - 869 - BUG_ON(!data[primary]); /* must have primary masking method */ 870 - 871 - disable_irq_nosync(irq); 872 - set_irq_chip_and_handler_name(irq, &d->chip, 873 - handle_level_irq, "level"); 874 - set_irq_chip_data(irq, (void *)data[primary]); 875 - 876 - /* 877 - * set priority level 878 - * - this needs to be at least 2 for 5-bit priorities on 7780 879 - */ 880 - intc_prio_level[irq] = default_prio_level; 881 - 882 - /* enable secondary masking method if present */ 883 - if (data[!primary]) 884 - _intc_enable(irq, data[!primary]); 885 - 886 - /* add irq to d->prio list if priority is available */ 887 - if (data[1]) { 888 - hp = d->prio + d->nr_prio; 889 - hp->irq = irq; 890 - hp->handle = data[1]; 891 - 892 - if (primary) { 893 - /* 894 - * only secondary priority should access registers, so 895 - * set _INTC_FN(h) = REG_FN_ERR for intc_set_priority() 896 - */ 897 - hp->handle &= ~_INTC_MK(0x0f, 0, 0, 0, 0, 0); 898 - hp->handle |= _INTC_MK(REG_FN_ERR, 0, 0, 0, 0, 0); 899 - } 900 - d->nr_prio++; 901 - } 902 - 903 - /* add irq to d->sense list if sense is available */ 904 - data[0] = intc_sense_data(desc, d, enum_id); 905 - if (data[0]) { 906 - (d->sense + d->nr_sense)->irq = irq; 907 - (d->sense + d->nr_sense)->handle = data[0]; 908 - d->nr_sense++; 909 - } 910 - 911 - /* irq should be disabled by default */ 912 - d->chip.mask(irq); 913 - 914 - if (desc->hw.ack_regs) 915 - ack_handle[irq] = intc_ack_data(desc, d, enum_id); 916 - 917 - #ifdef CONFIG_INTC_BALANCING 918 - if (desc->hw.mask_regs) 919 - dist_handle[irq] = intc_dist_data(desc, d, enum_id); 920 - #endif 921 - 922 - #ifdef CONFIG_ARM 923 - set_irq_flags(irq, IRQF_VALID); /* Enable IRQ on ARM systems */ 924 - #endif 925 - } 926 - 927 - static unsigned int __init save_reg(struct intc_desc_int *d, 928 - unsigned int cnt, 929 - unsigned long value, 930 - unsigned int smp) 931 - { 932 - if (value) { 933 - value = intc_phys_to_virt(d, value); 934 - 935 - d->reg[cnt] = value; 936 - #ifdef CONFIG_SMP 937 - d->smp[cnt] = smp; 938 - #endif 939 - return 1; 940 - } 941 - 942 - return 0; 943 - } 944 - 945 - static void intc_redirect_irq(unsigned int irq, struct irq_desc *desc) 946 - { 947 - generic_handle_irq((unsigned int)get_irq_data(irq)); 948 - } 949 - 950 - int __init register_intc_controller(struct intc_desc *desc) 951 - { 952 - unsigned int i, k, smp; 953 - struct intc_hw_desc *hw = &desc->hw; 954 - struct intc_desc_int *d; 955 - struct resource *res; 956 - 957 - pr_info("Registered controller '%s' with %u IRQs\n", 958 - desc->name, hw->nr_vectors); 959 - 960 - d = kzalloc(sizeof(*d), GFP_NOWAIT); 961 - if (!d) 962 - goto err0; 963 - 964 - INIT_LIST_HEAD(&d->list); 965 - list_add(&d->list, &intc_list); 966 - 967 - if (desc->num_resources) { 968 - d->nr_windows = desc->num_resources; 969 - d->window = kzalloc(d->nr_windows * sizeof(*d->window), 970 - GFP_NOWAIT); 971 - if (!d->window) 972 - goto err1; 973 - 974 - for (k = 0; k < d->nr_windows; k++) { 975 - res = desc->resource + k; 976 - WARN_ON(resource_type(res) != IORESOURCE_MEM); 977 - d->window[k].phys = res->start; 978 - d->window[k].size = resource_size(res); 979 - d->window[k].virt = ioremap_nocache(res->start, 980 - resource_size(res)); 981 - if (!d->window[k].virt) 982 - goto err2; 983 - } 984 - } 985 - 986 - d->nr_reg = hw->mask_regs ? hw->nr_mask_regs * 2 : 0; 987 - #ifdef CONFIG_INTC_BALANCING 988 - if (d->nr_reg) 989 - d->nr_reg += hw->nr_mask_regs; 990 - #endif 991 - d->nr_reg += hw->prio_regs ? hw->nr_prio_regs * 2 : 0; 992 - d->nr_reg += hw->sense_regs ? hw->nr_sense_regs : 0; 993 - d->nr_reg += hw->ack_regs ? hw->nr_ack_regs : 0; 994 - 995 - d->reg = kzalloc(d->nr_reg * sizeof(*d->reg), GFP_NOWAIT); 996 - if (!d->reg) 997 - goto err2; 998 - 999 - #ifdef CONFIG_SMP 1000 - d->smp = kzalloc(d->nr_reg * sizeof(*d->smp), GFP_NOWAIT); 1001 - if (!d->smp) 1002 - goto err3; 1003 - #endif 1004 - k = 0; 1005 - 1006 - if (hw->mask_regs) { 1007 - for (i = 0; i < hw->nr_mask_regs; i++) { 1008 - smp = IS_SMP(hw->mask_regs[i]); 1009 - k += save_reg(d, k, hw->mask_regs[i].set_reg, smp); 1010 - k += save_reg(d, k, hw->mask_regs[i].clr_reg, smp); 1011 - #ifdef CONFIG_INTC_BALANCING 1012 - k += save_reg(d, k, hw->mask_regs[i].dist_reg, 0); 1013 - #endif 1014 - } 1015 - } 1016 - 1017 - if (hw->prio_regs) { 1018 - d->prio = kzalloc(hw->nr_vectors * sizeof(*d->prio), 1019 - GFP_NOWAIT); 1020 - if (!d->prio) 1021 - goto err4; 1022 - 1023 - for (i = 0; i < hw->nr_prio_regs; i++) { 1024 - smp = IS_SMP(hw->prio_regs[i]); 1025 - k += save_reg(d, k, hw->prio_regs[i].set_reg, smp); 1026 - k += save_reg(d, k, hw->prio_regs[i].clr_reg, smp); 1027 - } 1028 - } 1029 - 1030 - if (hw->sense_regs) { 1031 - d->sense = kzalloc(hw->nr_vectors * sizeof(*d->sense), 1032 - GFP_NOWAIT); 1033 - if (!d->sense) 1034 - goto err5; 1035 - 1036 - for (i = 0; i < hw->nr_sense_regs; i++) 1037 - k += save_reg(d, k, hw->sense_regs[i].reg, 0); 1038 - } 1039 - 1040 - d->chip.name = desc->name; 1041 - d->chip.mask = intc_disable; 1042 - d->chip.unmask = intc_enable; 1043 - d->chip.mask_ack = intc_disable; 1044 - d->chip.enable = intc_enable; 1045 - d->chip.disable = intc_disable; 1046 - d->chip.shutdown = intc_disable; 1047 - d->chip.set_type = intc_set_sense; 1048 - d->chip.set_wake = intc_set_wake; 1049 - #ifdef CONFIG_SMP 1050 - d->chip.set_affinity = intc_set_affinity; 1051 - #endif 1052 - 1053 - if (hw->ack_regs) { 1054 - for (i = 0; i < hw->nr_ack_regs; i++) 1055 - k += save_reg(d, k, hw->ack_regs[i].set_reg, 0); 1056 - 1057 - d->chip.mask_ack = intc_mask_ack; 1058 - } 1059 - 1060 - /* disable bits matching force_disable before registering irqs */ 1061 - if (desc->force_disable) 1062 - intc_enable_disable_enum(desc, d, desc->force_disable, 0); 1063 - 1064 - /* disable bits matching force_enable before registering irqs */ 1065 - if (desc->force_enable) 1066 - intc_enable_disable_enum(desc, d, desc->force_enable, 0); 1067 - 1068 - BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ 1069 - 1070 - /* register the vectors one by one */ 1071 - for (i = 0; i < hw->nr_vectors; i++) { 1072 - struct intc_vect *vect = hw->vectors + i; 1073 - unsigned int irq = evt2irq(vect->vect); 1074 - struct irq_desc *irq_desc; 1075 - 1076 - if (!vect->enum_id) 1077 - continue; 1078 - 1079 - irq_desc = irq_to_desc_alloc_node(irq, numa_node_id()); 1080 - if (unlikely(!irq_desc)) { 1081 - pr_err("can't get irq_desc for %d\n", irq); 1082 - continue; 1083 - } 1084 - 1085 - intc_register_irq(desc, d, vect->enum_id, irq); 1086 - 1087 - for (k = i + 1; k < hw->nr_vectors; k++) { 1088 - struct intc_vect *vect2 = hw->vectors + k; 1089 - unsigned int irq2 = evt2irq(vect2->vect); 1090 - 1091 - if (vect->enum_id != vect2->enum_id) 1092 - continue; 1093 - 1094 - /* 1095 - * In the case of multi-evt handling and sparse 1096 - * IRQ support, each vector still needs to have 1097 - * its own backing irq_desc. 1098 - */ 1099 - irq_desc = irq_to_desc_alloc_node(irq2, numa_node_id()); 1100 - if (unlikely(!irq_desc)) { 1101 - pr_err("can't get irq_desc for %d\n", irq2); 1102 - continue; 1103 - } 1104 - 1105 - vect2->enum_id = 0; 1106 - 1107 - /* redirect this interrupts to the first one */ 1108 - set_irq_chip(irq2, &dummy_irq_chip); 1109 - set_irq_chained_handler(irq2, intc_redirect_irq); 1110 - set_irq_data(irq2, (void *)irq); 1111 - } 1112 - } 1113 - 1114 - /* enable bits matching force_enable after registering irqs */ 1115 - if (desc->force_enable) 1116 - intc_enable_disable_enum(desc, d, desc->force_enable, 1); 1117 - 1118 - return 0; 1119 - err5: 1120 - kfree(d->prio); 1121 - err4: 1122 - #ifdef CONFIG_SMP 1123 - kfree(d->smp); 1124 - err3: 1125 - #endif 1126 - kfree(d->reg); 1127 - err2: 1128 - for (k = 0; k < d->nr_windows; k++) 1129 - if (d->window[k].virt) 1130 - iounmap(d->window[k].virt); 1131 - 1132 - kfree(d->window); 1133 - err1: 1134 - kfree(d); 1135 - err0: 1136 - pr_err("unable to allocate INTC memory\n"); 1137 - 1138 - return -ENOMEM; 1139 - } 1140 - 1141 - #ifdef CONFIG_INTC_USERIMASK 1142 - static void __iomem *uimask; 1143 - 1144 - int register_intc_userimask(unsigned long addr) 1145 - { 1146 - if (unlikely(uimask)) 1147 - return -EBUSY; 1148 - 1149 - uimask = ioremap_nocache(addr, SZ_4K); 1150 - if (unlikely(!uimask)) 1151 - return -ENOMEM; 1152 - 1153 - pr_info("userimask support registered for levels 0 -> %d\n", 1154 - default_prio_level - 1); 1155 - 1156 - return 0; 1157 - } 1158 - 1159 - static ssize_t 1160 - show_intc_userimask(struct sysdev_class *cls, 1161 - struct sysdev_class_attribute *attr, char *buf) 1162 - { 1163 - return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); 1164 - } 1165 - 1166 - static ssize_t 1167 - store_intc_userimask(struct sysdev_class *cls, 1168 - struct sysdev_class_attribute *attr, 1169 - const char *buf, size_t count) 1170 - { 1171 - unsigned long level; 1172 - 1173 - level = simple_strtoul(buf, NULL, 10); 1174 - 1175 - /* 1176 - * Minimal acceptable IRQ levels are in the 2 - 16 range, but 1177 - * these are chomped so as to not interfere with normal IRQs. 1178 - * 1179 - * Level 1 is a special case on some CPUs in that it's not 1180 - * directly settable, but given that USERIMASK cuts off below a 1181 - * certain level, we don't care about this limitation here. 1182 - * Level 0 on the other hand equates to user masking disabled. 1183 - * 1184 - * We use default_prio_level as a cut off so that only special 1185 - * case opt-in IRQs can be mangled. 1186 - */ 1187 - if (level >= default_prio_level) 1188 - return -EINVAL; 1189 - 1190 - __raw_writel(0xa5 << 24 | level << 4, uimask); 1191 - 1192 - return count; 1193 - } 1194 - 1195 - static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR, 1196 - show_intc_userimask, store_intc_userimask); 1197 - #endif 1198 - 1199 - static ssize_t 1200 - show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) 1201 - { 1202 - struct intc_desc_int *d; 1203 - 1204 - d = container_of(dev, struct intc_desc_int, sysdev); 1205 - 1206 - return sprintf(buf, "%s\n", d->chip.name); 1207 - } 1208 - 1209 - static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); 1210 - 1211 - static int intc_suspend(struct sys_device *dev, pm_message_t state) 1212 - { 1213 - struct intc_desc_int *d; 1214 - struct irq_desc *desc; 1215 - int irq; 1216 - 1217 - /* get intc controller associated with this sysdev */ 1218 - d = container_of(dev, struct intc_desc_int, sysdev); 1219 - 1220 - switch (state.event) { 1221 - case PM_EVENT_ON: 1222 - if (d->state.event != PM_EVENT_FREEZE) 1223 - break; 1224 - for_each_irq_desc(irq, desc) { 1225 - if (desc->handle_irq == intc_redirect_irq) 1226 - continue; 1227 - if (desc->chip != &d->chip) 1228 - continue; 1229 - if (desc->status & IRQ_DISABLED) 1230 - intc_disable(irq); 1231 - else 1232 - intc_enable(irq); 1233 - } 1234 - break; 1235 - case PM_EVENT_FREEZE: 1236 - /* nothing has to be done */ 1237 - break; 1238 - case PM_EVENT_SUSPEND: 1239 - /* enable wakeup irqs belonging to this intc controller */ 1240 - for_each_irq_desc(irq, desc) { 1241 - if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) 1242 - intc_enable(irq); 1243 - } 1244 - break; 1245 - } 1246 - d->state = state; 1247 - 1248 - return 0; 1249 - } 1250 - 1251 - static int intc_resume(struct sys_device *dev) 1252 - { 1253 - return intc_suspend(dev, PMSG_ON); 1254 - } 1255 - 1256 - static struct sysdev_class intc_sysdev_class = { 1257 - .name = "intc", 1258 - .suspend = intc_suspend, 1259 - .resume = intc_resume, 1260 - }; 1261 - 1262 - /* register this intc as sysdev to allow suspend/resume */ 1263 - static int __init register_intc_sysdevs(void) 1264 - { 1265 - struct intc_desc_int *d; 1266 - int error; 1267 - int id = 0; 1268 - 1269 - error = sysdev_class_register(&intc_sysdev_class); 1270 - #ifdef CONFIG_INTC_USERIMASK 1271 - if (!error && uimask) 1272 - error = sysdev_class_create_file(&intc_sysdev_class, 1273 - &attr_userimask); 1274 - #endif 1275 - if (!error) { 1276 - list_for_each_entry(d, &intc_list, list) { 1277 - d->sysdev.id = id; 1278 - d->sysdev.cls = &intc_sysdev_class; 1279 - error = sysdev_register(&d->sysdev); 1280 - if (error == 0) 1281 - error = sysdev_create_file(&d->sysdev, 1282 - &attr_name); 1283 - if (error) 1284 - break; 1285 - 1286 - id++; 1287 - } 1288 - } 1289 - 1290 - if (error) 1291 - pr_err("sysdev registration error\n"); 1292 - 1293 - return error; 1294 - } 1295 - device_initcall(register_intc_sysdevs); 1296 - 1297 - /* 1298 - * Dynamic IRQ allocation and deallocation 1299 - */ 1300 - unsigned int create_irq_nr(unsigned int irq_want, int node) 1301 - { 1302 - unsigned int irq = 0, new; 1303 - unsigned long flags; 1304 - struct irq_desc *desc; 1305 - 1306 - spin_lock_irqsave(&vector_lock, flags); 1307 - 1308 - /* 1309 - * First try the wanted IRQ 1310 - */ 1311 - if (test_and_set_bit(irq_want, intc_irq_map) == 0) { 1312 - new = irq_want; 1313 - } else { 1314 - /* .. then fall back to scanning. */ 1315 - new = find_first_zero_bit(intc_irq_map, nr_irqs); 1316 - if (unlikely(new == nr_irqs)) 1317 - goto out_unlock; 1318 - 1319 - __set_bit(new, intc_irq_map); 1320 - } 1321 - 1322 - desc = irq_to_desc_alloc_node(new, node); 1323 - if (unlikely(!desc)) { 1324 - pr_err("can't get irq_desc for %d\n", new); 1325 - goto out_unlock; 1326 - } 1327 - 1328 - desc = move_irq_desc(desc, node); 1329 - irq = new; 1330 - 1331 - out_unlock: 1332 - spin_unlock_irqrestore(&vector_lock, flags); 1333 - 1334 - if (irq > 0) { 1335 - dynamic_irq_init(irq); 1336 - #ifdef CONFIG_ARM 1337 - set_irq_flags(irq, IRQF_VALID); /* Enable IRQ on ARM systems */ 1338 - #endif 1339 - } 1340 - 1341 - return irq; 1342 - } 1343 - 1344 - int create_irq(void) 1345 - { 1346 - int nid = cpu_to_node(smp_processor_id()); 1347 - int irq; 1348 - 1349 - irq = create_irq_nr(NR_IRQS_LEGACY, nid); 1350 - if (irq == 0) 1351 - irq = -1; 1352 - 1353 - return irq; 1354 - } 1355 - 1356 - void destroy_irq(unsigned int irq) 1357 - { 1358 - unsigned long flags; 1359 - 1360 - dynamic_irq_cleanup(irq); 1361 - 1362 - spin_lock_irqsave(&vector_lock, flags); 1363 - __clear_bit(irq, intc_irq_map); 1364 - spin_unlock_irqrestore(&vector_lock, flags); 1365 - } 1366 - 1367 - int reserve_irq_vector(unsigned int irq) 1368 - { 1369 - unsigned long flags; 1370 - int ret = 0; 1371 - 1372 - spin_lock_irqsave(&vector_lock, flags); 1373 - if (test_and_set_bit(irq, intc_irq_map)) 1374 - ret = -EBUSY; 1375 - spin_unlock_irqrestore(&vector_lock, flags); 1376 - 1377 - return ret; 1378 - } 1379 - 1380 - void reserve_irq_legacy(void) 1381 - { 1382 - unsigned long flags; 1383 - int i, j; 1384 - 1385 - spin_lock_irqsave(&vector_lock, flags); 1386 - j = find_first_bit(intc_irq_map, nr_irqs); 1387 - for (i = 0; i < j; i++) 1388 - __set_bit(i, intc_irq_map); 1389 - spin_unlock_irqrestore(&vector_lock, flags); 1390 - }
+35
drivers/sh/intc/Kconfig
··· 1 + comment "Interrupt controller options" 2 + 3 + config INTC_USERIMASK 4 + bool "Userspace interrupt masking support" 5 + depends on ARCH_SHMOBILE || (SUPERH && CPU_SH4A) 6 + help 7 + This enables support for hardware-assisted userspace hardirq 8 + masking. 9 + 10 + SH-4A and newer interrupt blocks all support a special shadowed 11 + page with all non-masking registers obscured when mapped in to 12 + userspace. This is primarily for use by userspace device 13 + drivers that are using special priority levels. 14 + 15 + If in doubt, say N. 16 + 17 + config INTC_BALANCING 18 + bool "Hardware IRQ balancing support" 19 + depends on SMP && SUPERH && CPU_SHX3 20 + help 21 + This enables support for IRQ auto-distribution mode on SH-X3 22 + SMP parts. All of the balancing and CPU wakeup decisions are 23 + taken care of automatically by hardware for distributed 24 + vectors. 25 + 26 + If in doubt, say N. 27 + 28 + config INTC_MAPPING_DEBUG 29 + bool "Expose IRQ to per-controller id mapping via debugfs" 30 + depends on DEBUG_FS 31 + help 32 + This will create a debugfs entry for showing the relationship 33 + between system IRQs and the per-controller id tables. 34 + 35 + If in doubt, say N.
+5
drivers/sh/intc/Makefile
··· 1 + obj-y := access.o chip.o core.o dynamic.o handle.o virq.o 2 + 3 + obj-$(CONFIG_INTC_BALANCING) += balancing.o 4 + obj-$(CONFIG_INTC_USERIMASK) += userimask.o 5 + obj-$(CONFIG_INTC_MAPPING_DEBUG) += virq-debugfs.o
+237
drivers/sh/intc/access.c
··· 1 + /* 2 + * Common INTC2 register accessors 3 + * 4 + * Copyright (C) 2007, 2008 Magnus Damm 5 + * Copyright (C) 2009, 2010 Paul Mundt 6 + * 7 + * This file is subject to the terms and conditions of the GNU General Public 8 + * License. See the file "COPYING" in the main directory of this archive 9 + * for more details. 10 + */ 11 + #include <linux/io.h> 12 + #include "internals.h" 13 + 14 + unsigned long intc_phys_to_virt(struct intc_desc_int *d, unsigned long address) 15 + { 16 + struct intc_window *window; 17 + int k; 18 + 19 + /* scan through physical windows and convert address */ 20 + for (k = 0; k < d->nr_windows; k++) { 21 + window = d->window + k; 22 + 23 + if (address < window->phys) 24 + continue; 25 + 26 + if (address >= (window->phys + window->size)) 27 + continue; 28 + 29 + address -= window->phys; 30 + address += (unsigned long)window->virt; 31 + 32 + return address; 33 + } 34 + 35 + /* no windows defined, register must be 1:1 mapped virt:phys */ 36 + return address; 37 + } 38 + 39 + unsigned int intc_get_reg(struct intc_desc_int *d, unsigned long address) 40 + { 41 + unsigned int k; 42 + 43 + address = intc_phys_to_virt(d, address); 44 + 45 + for (k = 0; k < d->nr_reg; k++) { 46 + if (d->reg[k] == address) 47 + return k; 48 + } 49 + 50 + BUG(); 51 + return 0; 52 + } 53 + 54 + unsigned int intc_set_field_from_handle(unsigned int value, 55 + unsigned int field_value, 56 + unsigned int handle) 57 + { 58 + unsigned int width = _INTC_WIDTH(handle); 59 + unsigned int shift = _INTC_SHIFT(handle); 60 + 61 + value &= ~(((1 << width) - 1) << shift); 62 + value |= field_value << shift; 63 + return value; 64 + } 65 + 66 + unsigned long intc_get_field_from_handle(unsigned int value, unsigned int handle) 67 + { 68 + unsigned int width = _INTC_WIDTH(handle); 69 + unsigned int shift = _INTC_SHIFT(handle); 70 + unsigned int mask = ((1 << width) - 1) << shift; 71 + 72 + return (value & mask) >> shift; 73 + } 74 + 75 + static unsigned long test_8(unsigned long addr, unsigned long h, 76 + unsigned long ignore) 77 + { 78 + return intc_get_field_from_handle(__raw_readb(addr), h); 79 + } 80 + 81 + static unsigned long test_16(unsigned long addr, unsigned long h, 82 + unsigned long ignore) 83 + { 84 + return intc_get_field_from_handle(__raw_readw(addr), h); 85 + } 86 + 87 + static unsigned long test_32(unsigned long addr, unsigned long h, 88 + unsigned long ignore) 89 + { 90 + return intc_get_field_from_handle(__raw_readl(addr), h); 91 + } 92 + 93 + static unsigned long write_8(unsigned long addr, unsigned long h, 94 + unsigned long data) 95 + { 96 + __raw_writeb(intc_set_field_from_handle(0, data, h), addr); 97 + (void)__raw_readb(addr); /* Defeat write posting */ 98 + return 0; 99 + } 100 + 101 + static unsigned long write_16(unsigned long addr, unsigned long h, 102 + unsigned long data) 103 + { 104 + __raw_writew(intc_set_field_from_handle(0, data, h), addr); 105 + (void)__raw_readw(addr); /* Defeat write posting */ 106 + return 0; 107 + } 108 + 109 + static unsigned long write_32(unsigned long addr, unsigned long h, 110 + unsigned long data) 111 + { 112 + __raw_writel(intc_set_field_from_handle(0, data, h), addr); 113 + (void)__raw_readl(addr); /* Defeat write posting */ 114 + return 0; 115 + } 116 + 117 + static unsigned long modify_8(unsigned long addr, unsigned long h, 118 + unsigned long data) 119 + { 120 + unsigned long flags; 121 + unsigned int value; 122 + local_irq_save(flags); 123 + value = intc_set_field_from_handle(__raw_readb(addr), data, h); 124 + __raw_writeb(value, addr); 125 + (void)__raw_readb(addr); /* Defeat write posting */ 126 + local_irq_restore(flags); 127 + return 0; 128 + } 129 + 130 + static unsigned long modify_16(unsigned long addr, unsigned long h, 131 + unsigned long data) 132 + { 133 + unsigned long flags; 134 + unsigned int value; 135 + local_irq_save(flags); 136 + value = intc_set_field_from_handle(__raw_readw(addr), data, h); 137 + __raw_writew(value, addr); 138 + (void)__raw_readw(addr); /* Defeat write posting */ 139 + local_irq_restore(flags); 140 + return 0; 141 + } 142 + 143 + static unsigned long modify_32(unsigned long addr, unsigned long h, 144 + unsigned long data) 145 + { 146 + unsigned long flags; 147 + unsigned int value; 148 + local_irq_save(flags); 149 + value = intc_set_field_from_handle(__raw_readl(addr), data, h); 150 + __raw_writel(value, addr); 151 + (void)__raw_readl(addr); /* Defeat write posting */ 152 + local_irq_restore(flags); 153 + return 0; 154 + } 155 + 156 + static unsigned long intc_mode_field(unsigned long addr, 157 + unsigned long handle, 158 + unsigned long (*fn)(unsigned long, 159 + unsigned long, 160 + unsigned long), 161 + unsigned int irq) 162 + { 163 + return fn(addr, handle, ((1 << _INTC_WIDTH(handle)) - 1)); 164 + } 165 + 166 + static unsigned long intc_mode_zero(unsigned long addr, 167 + unsigned long handle, 168 + unsigned long (*fn)(unsigned long, 169 + unsigned long, 170 + unsigned long), 171 + unsigned int irq) 172 + { 173 + return fn(addr, handle, 0); 174 + } 175 + 176 + static unsigned long intc_mode_prio(unsigned long addr, 177 + unsigned long handle, 178 + unsigned long (*fn)(unsigned long, 179 + unsigned long, 180 + unsigned long), 181 + unsigned int irq) 182 + { 183 + return fn(addr, handle, intc_get_prio_level(irq)); 184 + } 185 + 186 + unsigned long (*intc_reg_fns[])(unsigned long addr, 187 + unsigned long h, 188 + unsigned long data) = { 189 + [REG_FN_TEST_BASE + 0] = test_8, 190 + [REG_FN_TEST_BASE + 1] = test_16, 191 + [REG_FN_TEST_BASE + 3] = test_32, 192 + [REG_FN_WRITE_BASE + 0] = write_8, 193 + [REG_FN_WRITE_BASE + 1] = write_16, 194 + [REG_FN_WRITE_BASE + 3] = write_32, 195 + [REG_FN_MODIFY_BASE + 0] = modify_8, 196 + [REG_FN_MODIFY_BASE + 1] = modify_16, 197 + [REG_FN_MODIFY_BASE + 3] = modify_32, 198 + }; 199 + 200 + unsigned long (*intc_enable_fns[])(unsigned long addr, 201 + unsigned long handle, 202 + unsigned long (*fn)(unsigned long, 203 + unsigned long, 204 + unsigned long), 205 + unsigned int irq) = { 206 + [MODE_ENABLE_REG] = intc_mode_field, 207 + [MODE_MASK_REG] = intc_mode_zero, 208 + [MODE_DUAL_REG] = intc_mode_field, 209 + [MODE_PRIO_REG] = intc_mode_prio, 210 + [MODE_PCLR_REG] = intc_mode_prio, 211 + }; 212 + 213 + unsigned long (*intc_disable_fns[])(unsigned long addr, 214 + unsigned long handle, 215 + unsigned long (*fn)(unsigned long, 216 + unsigned long, 217 + unsigned long), 218 + unsigned int irq) = { 219 + [MODE_ENABLE_REG] = intc_mode_zero, 220 + [MODE_MASK_REG] = intc_mode_field, 221 + [MODE_DUAL_REG] = intc_mode_field, 222 + [MODE_PRIO_REG] = intc_mode_zero, 223 + [MODE_PCLR_REG] = intc_mode_field, 224 + }; 225 + 226 + unsigned long (*intc_enable_noprio_fns[])(unsigned long addr, 227 + unsigned long handle, 228 + unsigned long (*fn)(unsigned long, 229 + unsigned long, 230 + unsigned long), 231 + unsigned int irq) = { 232 + [MODE_ENABLE_REG] = intc_mode_field, 233 + [MODE_MASK_REG] = intc_mode_zero, 234 + [MODE_DUAL_REG] = intc_mode_field, 235 + [MODE_PRIO_REG] = intc_mode_field, 236 + [MODE_PCLR_REG] = intc_mode_field, 237 + };
+97
drivers/sh/intc/balancing.c
··· 1 + /* 2 + * Support for hardware-managed IRQ auto-distribution. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #include "internals.h" 11 + 12 + static unsigned long dist_handle[NR_IRQS]; 13 + 14 + void intc_balancing_enable(unsigned int irq) 15 + { 16 + struct intc_desc_int *d = get_intc_desc(irq); 17 + unsigned long handle = dist_handle[irq]; 18 + unsigned long addr; 19 + 20 + if (irq_balancing_disabled(irq) || !handle) 21 + return; 22 + 23 + addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 24 + intc_reg_fns[_INTC_FN(handle)](addr, handle, 1); 25 + } 26 + 27 + void intc_balancing_disable(unsigned int irq) 28 + { 29 + struct intc_desc_int *d = get_intc_desc(irq); 30 + unsigned long handle = dist_handle[irq]; 31 + unsigned long addr; 32 + 33 + if (irq_balancing_disabled(irq) || !handle) 34 + return; 35 + 36 + addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 37 + intc_reg_fns[_INTC_FN(handle)](addr, handle, 0); 38 + } 39 + 40 + static unsigned int intc_dist_data(struct intc_desc *desc, 41 + struct intc_desc_int *d, 42 + intc_enum enum_id) 43 + { 44 + struct intc_mask_reg *mr = desc->hw.mask_regs; 45 + unsigned int i, j, fn, mode; 46 + unsigned long reg_e, reg_d; 47 + 48 + for (i = 0; mr && enum_id && i < desc->hw.nr_mask_regs; i++) { 49 + mr = desc->hw.mask_regs + i; 50 + 51 + /* 52 + * Skip this entry if there's no auto-distribution 53 + * register associated with it. 54 + */ 55 + if (!mr->dist_reg) 56 + continue; 57 + 58 + for (j = 0; j < ARRAY_SIZE(mr->enum_ids); j++) { 59 + if (mr->enum_ids[j] != enum_id) 60 + continue; 61 + 62 + fn = REG_FN_MODIFY_BASE; 63 + mode = MODE_ENABLE_REG; 64 + reg_e = mr->dist_reg; 65 + reg_d = mr->dist_reg; 66 + 67 + fn += (mr->reg_width >> 3) - 1; 68 + return _INTC_MK(fn, mode, 69 + intc_get_reg(d, reg_e), 70 + intc_get_reg(d, reg_d), 71 + 1, 72 + (mr->reg_width - 1) - j); 73 + } 74 + } 75 + 76 + /* 77 + * It's possible we've gotten here with no distribution options 78 + * available for the IRQ in question, so we just skip over those. 79 + */ 80 + return 0; 81 + } 82 + 83 + void intc_set_dist_handle(unsigned int irq, struct intc_desc *desc, 84 + struct intc_desc_int *d, intc_enum id) 85 + { 86 + unsigned long flags; 87 + 88 + /* 89 + * Nothing to do for this IRQ. 90 + */ 91 + if (!desc->hw.mask_regs) 92 + return; 93 + 94 + raw_spin_lock_irqsave(&intc_big_lock, flags); 95 + dist_handle[irq] = intc_dist_data(desc, d, id); 96 + raw_spin_unlock_irqrestore(&intc_big_lock, flags); 97 + }
+215
drivers/sh/intc/chip.c
··· 1 + /* 2 + * IRQ chip definitions for INTC IRQs. 3 + * 4 + * Copyright (C) 2007, 2008 Magnus Damm 5 + * Copyright (C) 2009, 2010 Paul Mundt 6 + * 7 + * This file is subject to the terms and conditions of the GNU General Public 8 + * License. See the file "COPYING" in the main directory of this archive 9 + * for more details. 10 + */ 11 + #include <linux/cpumask.h> 12 + #include <linux/io.h> 13 + #include "internals.h" 14 + 15 + void _intc_enable(unsigned int irq, unsigned long handle) 16 + { 17 + struct intc_desc_int *d = get_intc_desc(irq); 18 + unsigned long addr; 19 + unsigned int cpu; 20 + 21 + for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) { 22 + #ifdef CONFIG_SMP 23 + if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 24 + continue; 25 + #endif 26 + addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu); 27 + intc_enable_fns[_INTC_MODE(handle)](addr, handle, intc_reg_fns\ 28 + [_INTC_FN(handle)], irq); 29 + } 30 + 31 + intc_balancing_enable(irq); 32 + } 33 + 34 + static void intc_enable(unsigned int irq) 35 + { 36 + _intc_enable(irq, (unsigned long)get_irq_chip_data(irq)); 37 + } 38 + 39 + static void intc_disable(unsigned int irq) 40 + { 41 + struct intc_desc_int *d = get_intc_desc(irq); 42 + unsigned long handle = (unsigned long)get_irq_chip_data(irq); 43 + unsigned long addr; 44 + unsigned int cpu; 45 + 46 + intc_balancing_disable(irq); 47 + 48 + for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) { 49 + #ifdef CONFIG_SMP 50 + if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 51 + continue; 52 + #endif 53 + addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu); 54 + intc_disable_fns[_INTC_MODE(handle)](addr, handle,intc_reg_fns\ 55 + [_INTC_FN(handle)], irq); 56 + } 57 + } 58 + 59 + static int intc_set_wake(unsigned int irq, unsigned int on) 60 + { 61 + return 0; /* allow wakeup, but setup hardware in intc_suspend() */ 62 + } 63 + 64 + #ifdef CONFIG_SMP 65 + /* 66 + * This is held with the irq desc lock held, so we don't require any 67 + * additional locking here at the intc desc level. The affinity mask is 68 + * later tested in the enable/disable paths. 69 + */ 70 + static int intc_set_affinity(unsigned int irq, const struct cpumask *cpumask) 71 + { 72 + if (!cpumask_intersects(cpumask, cpu_online_mask)) 73 + return -1; 74 + 75 + cpumask_copy(irq_to_desc(irq)->affinity, cpumask); 76 + 77 + return 0; 78 + } 79 + #endif 80 + 81 + static void intc_mask_ack(unsigned int irq) 82 + { 83 + struct intc_desc_int *d = get_intc_desc(irq); 84 + unsigned long handle = intc_get_ack_handle(irq); 85 + unsigned long addr; 86 + 87 + intc_disable(irq); 88 + 89 + /* read register and write zero only to the associated bit */ 90 + if (handle) { 91 + unsigned int value; 92 + 93 + addr = INTC_REG(d, _INTC_ADDR_D(handle), 0); 94 + value = intc_set_field_from_handle(0, 1, handle); 95 + 96 + switch (_INTC_FN(handle)) { 97 + case REG_FN_MODIFY_BASE + 0: /* 8bit */ 98 + __raw_readb(addr); 99 + __raw_writeb(0xff ^ value, addr); 100 + break; 101 + case REG_FN_MODIFY_BASE + 1: /* 16bit */ 102 + __raw_readw(addr); 103 + __raw_writew(0xffff ^ value, addr); 104 + break; 105 + case REG_FN_MODIFY_BASE + 3: /* 32bit */ 106 + __raw_readl(addr); 107 + __raw_writel(0xffffffff ^ value, addr); 108 + break; 109 + default: 110 + BUG(); 111 + break; 112 + } 113 + } 114 + } 115 + 116 + static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp, 117 + unsigned int nr_hp, 118 + unsigned int irq) 119 + { 120 + int i; 121 + 122 + /* 123 + * this doesn't scale well, but... 124 + * 125 + * this function should only be used for cerain uncommon 126 + * operations such as intc_set_priority() and intc_set_type() 127 + * and in those rare cases performance doesn't matter that much. 128 + * keeping the memory footprint low is more important. 129 + * 130 + * one rather simple way to speed this up and still keep the 131 + * memory footprint down is to make sure the array is sorted 132 + * and then perform a bisect to lookup the irq. 133 + */ 134 + for (i = 0; i < nr_hp; i++) { 135 + if ((hp + i)->irq != irq) 136 + continue; 137 + 138 + return hp + i; 139 + } 140 + 141 + return NULL; 142 + } 143 + 144 + int intc_set_priority(unsigned int irq, unsigned int prio) 145 + { 146 + struct intc_desc_int *d = get_intc_desc(irq); 147 + struct intc_handle_int *ihp; 148 + 149 + if (!intc_get_prio_level(irq) || prio <= 1) 150 + return -EINVAL; 151 + 152 + ihp = intc_find_irq(d->prio, d->nr_prio, irq); 153 + if (ihp) { 154 + if (prio >= (1 << _INTC_WIDTH(ihp->handle))) 155 + return -EINVAL; 156 + 157 + intc_set_prio_level(irq, prio); 158 + 159 + /* 160 + * only set secondary masking method directly 161 + * primary masking method is using intc_prio_level[irq] 162 + * priority level will be set during next enable() 163 + */ 164 + if (_INTC_FN(ihp->handle) != REG_FN_ERR) 165 + _intc_enable(irq, ihp->handle); 166 + } 167 + return 0; 168 + } 169 + 170 + #define VALID(x) (x | 0x80) 171 + 172 + static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { 173 + [IRQ_TYPE_EDGE_FALLING] = VALID(0), 174 + [IRQ_TYPE_EDGE_RISING] = VALID(1), 175 + [IRQ_TYPE_LEVEL_LOW] = VALID(2), 176 + /* SH7706, SH7707 and SH7709 do not support high level triggered */ 177 + #if !defined(CONFIG_CPU_SUBTYPE_SH7706) && \ 178 + !defined(CONFIG_CPU_SUBTYPE_SH7707) && \ 179 + !defined(CONFIG_CPU_SUBTYPE_SH7709) 180 + [IRQ_TYPE_LEVEL_HIGH] = VALID(3), 181 + #endif 182 + }; 183 + 184 + static int intc_set_type(unsigned int irq, unsigned int type) 185 + { 186 + struct intc_desc_int *d = get_intc_desc(irq); 187 + unsigned char value = intc_irq_sense_table[type & IRQ_TYPE_SENSE_MASK]; 188 + struct intc_handle_int *ihp; 189 + unsigned long addr; 190 + 191 + if (!value) 192 + return -EINVAL; 193 + 194 + ihp = intc_find_irq(d->sense, d->nr_sense, irq); 195 + if (ihp) { 196 + addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); 197 + intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value); 198 + } 199 + 200 + return 0; 201 + } 202 + 203 + struct irq_chip intc_irq_chip = { 204 + .mask = intc_disable, 205 + .unmask = intc_enable, 206 + .mask_ack = intc_mask_ack, 207 + .enable = intc_enable, 208 + .disable = intc_disable, 209 + .shutdown = intc_disable, 210 + .set_type = intc_set_type, 211 + .set_wake = intc_set_wake, 212 + #ifdef CONFIG_SMP 213 + .set_affinity = intc_set_affinity, 214 + #endif 215 + };
+469
drivers/sh/intc/core.c
··· 1 + /* 2 + * Shared interrupt handling code for IPR and INTC2 types of IRQs. 3 + * 4 + * Copyright (C) 2007, 2008 Magnus Damm 5 + * Copyright (C) 2009, 2010 Paul Mundt 6 + * 7 + * Based on intc2.c and ipr.c 8 + * 9 + * Copyright (C) 1999 Niibe Yutaka & Takeshi Yaegashi 10 + * Copyright (C) 2000 Kazumoto Kojima 11 + * Copyright (C) 2001 David J. Mckay (david.mckay@st.com) 12 + * Copyright (C) 2003 Takashi Kusuda <kusuda-takashi@hitachi-ul.co.jp> 13 + * Copyright (C) 2005, 2006 Paul Mundt 14 + * 15 + * This file is subject to the terms and conditions of the GNU General Public 16 + * License. See the file "COPYING" in the main directory of this archive 17 + * for more details. 18 + */ 19 + #define pr_fmt(fmt) "intc: " fmt 20 + 21 + #include <linux/init.h> 22 + #include <linux/irq.h> 23 + #include <linux/io.h> 24 + #include <linux/slab.h> 25 + #include <linux/interrupt.h> 26 + #include <linux/sh_intc.h> 27 + #include <linux/sysdev.h> 28 + #include <linux/list.h> 29 + #include <linux/spinlock.h> 30 + #include <linux/radix-tree.h> 31 + #include "internals.h" 32 + 33 + LIST_HEAD(intc_list); 34 + DEFINE_RAW_SPINLOCK(intc_big_lock); 35 + unsigned int nr_intc_controllers; 36 + 37 + /* 38 + * Default priority level 39 + * - this needs to be at least 2 for 5-bit priorities on 7780 40 + */ 41 + static unsigned int default_prio_level = 2; /* 2 - 16 */ 42 + static unsigned int intc_prio_level[NR_IRQS]; /* for now */ 43 + 44 + unsigned int intc_get_dfl_prio_level(void) 45 + { 46 + return default_prio_level; 47 + } 48 + 49 + unsigned int intc_get_prio_level(unsigned int irq) 50 + { 51 + return intc_prio_level[irq]; 52 + } 53 + 54 + void intc_set_prio_level(unsigned int irq, unsigned int level) 55 + { 56 + unsigned long flags; 57 + 58 + raw_spin_lock_irqsave(&intc_big_lock, flags); 59 + intc_prio_level[irq] = level; 60 + raw_spin_unlock_irqrestore(&intc_big_lock, flags); 61 + } 62 + 63 + static void intc_redirect_irq(unsigned int irq, struct irq_desc *desc) 64 + { 65 + generic_handle_irq((unsigned int)get_irq_data(irq)); 66 + } 67 + 68 + static void __init intc_register_irq(struct intc_desc *desc, 69 + struct intc_desc_int *d, 70 + intc_enum enum_id, 71 + unsigned int irq) 72 + { 73 + struct intc_handle_int *hp; 74 + unsigned int data[2], primary; 75 + unsigned long flags; 76 + 77 + /* 78 + * Register the IRQ position with the global IRQ map, then insert 79 + * it in to the radix tree. 80 + */ 81 + reserve_irq_vector(irq); 82 + 83 + raw_spin_lock_irqsave(&intc_big_lock, flags); 84 + radix_tree_insert(&d->tree, enum_id, intc_irq_xlate_get(irq)); 85 + raw_spin_unlock_irqrestore(&intc_big_lock, flags); 86 + 87 + /* 88 + * Prefer single interrupt source bitmap over other combinations: 89 + * 90 + * 1. bitmap, single interrupt source 91 + * 2. priority, single interrupt source 92 + * 3. bitmap, multiple interrupt sources (groups) 93 + * 4. priority, multiple interrupt sources (groups) 94 + */ 95 + data[0] = intc_get_mask_handle(desc, d, enum_id, 0); 96 + data[1] = intc_get_prio_handle(desc, d, enum_id, 0); 97 + 98 + primary = 0; 99 + if (!data[0] && data[1]) 100 + primary = 1; 101 + 102 + if (!data[0] && !data[1]) 103 + pr_warning("missing unique irq mask for irq %d (vect 0x%04x)\n", 104 + irq, irq2evt(irq)); 105 + 106 + data[0] = data[0] ? data[0] : intc_get_mask_handle(desc, d, enum_id, 1); 107 + data[1] = data[1] ? data[1] : intc_get_prio_handle(desc, d, enum_id, 1); 108 + 109 + if (!data[primary]) 110 + primary ^= 1; 111 + 112 + BUG_ON(!data[primary]); /* must have primary masking method */ 113 + 114 + disable_irq_nosync(irq); 115 + set_irq_chip_and_handler_name(irq, &d->chip, 116 + handle_level_irq, "level"); 117 + set_irq_chip_data(irq, (void *)data[primary]); 118 + 119 + /* 120 + * set priority level 121 + */ 122 + intc_set_prio_level(irq, intc_get_dfl_prio_level()); 123 + 124 + /* enable secondary masking method if present */ 125 + if (data[!primary]) 126 + _intc_enable(irq, data[!primary]); 127 + 128 + /* add irq to d->prio list if priority is available */ 129 + if (data[1]) { 130 + hp = d->prio + d->nr_prio; 131 + hp->irq = irq; 132 + hp->handle = data[1]; 133 + 134 + if (primary) { 135 + /* 136 + * only secondary priority should access registers, so 137 + * set _INTC_FN(h) = REG_FN_ERR for intc_set_priority() 138 + */ 139 + hp->handle &= ~_INTC_MK(0x0f, 0, 0, 0, 0, 0); 140 + hp->handle |= _INTC_MK(REG_FN_ERR, 0, 0, 0, 0, 0); 141 + } 142 + d->nr_prio++; 143 + } 144 + 145 + /* add irq to d->sense list if sense is available */ 146 + data[0] = intc_get_sense_handle(desc, d, enum_id); 147 + if (data[0]) { 148 + (d->sense + d->nr_sense)->irq = irq; 149 + (d->sense + d->nr_sense)->handle = data[0]; 150 + d->nr_sense++; 151 + } 152 + 153 + /* irq should be disabled by default */ 154 + d->chip.mask(irq); 155 + 156 + intc_set_ack_handle(irq, desc, d, enum_id); 157 + intc_set_dist_handle(irq, desc, d, enum_id); 158 + 159 + activate_irq(irq); 160 + } 161 + 162 + static unsigned int __init save_reg(struct intc_desc_int *d, 163 + unsigned int cnt, 164 + unsigned long value, 165 + unsigned int smp) 166 + { 167 + if (value) { 168 + value = intc_phys_to_virt(d, value); 169 + 170 + d->reg[cnt] = value; 171 + #ifdef CONFIG_SMP 172 + d->smp[cnt] = smp; 173 + #endif 174 + return 1; 175 + } 176 + 177 + return 0; 178 + } 179 + 180 + int __init register_intc_controller(struct intc_desc *desc) 181 + { 182 + unsigned int i, k, smp; 183 + struct intc_hw_desc *hw = &desc->hw; 184 + struct intc_desc_int *d; 185 + struct resource *res; 186 + 187 + pr_info("Registered controller '%s' with %u IRQs\n", 188 + desc->name, hw->nr_vectors); 189 + 190 + d = kzalloc(sizeof(*d), GFP_NOWAIT); 191 + if (!d) 192 + goto err0; 193 + 194 + INIT_LIST_HEAD(&d->list); 195 + list_add_tail(&d->list, &intc_list); 196 + 197 + raw_spin_lock_init(&d->lock); 198 + 199 + d->index = nr_intc_controllers; 200 + 201 + if (desc->num_resources) { 202 + d->nr_windows = desc->num_resources; 203 + d->window = kzalloc(d->nr_windows * sizeof(*d->window), 204 + GFP_NOWAIT); 205 + if (!d->window) 206 + goto err1; 207 + 208 + for (k = 0; k < d->nr_windows; k++) { 209 + res = desc->resource + k; 210 + WARN_ON(resource_type(res) != IORESOURCE_MEM); 211 + d->window[k].phys = res->start; 212 + d->window[k].size = resource_size(res); 213 + d->window[k].virt = ioremap_nocache(res->start, 214 + resource_size(res)); 215 + if (!d->window[k].virt) 216 + goto err2; 217 + } 218 + } 219 + 220 + d->nr_reg = hw->mask_regs ? hw->nr_mask_regs * 2 : 0; 221 + #ifdef CONFIG_INTC_BALANCING 222 + if (d->nr_reg) 223 + d->nr_reg += hw->nr_mask_regs; 224 + #endif 225 + d->nr_reg += hw->prio_regs ? hw->nr_prio_regs * 2 : 0; 226 + d->nr_reg += hw->sense_regs ? hw->nr_sense_regs : 0; 227 + d->nr_reg += hw->ack_regs ? hw->nr_ack_regs : 0; 228 + d->nr_reg += hw->subgroups ? hw->nr_subgroups : 0; 229 + 230 + d->reg = kzalloc(d->nr_reg * sizeof(*d->reg), GFP_NOWAIT); 231 + if (!d->reg) 232 + goto err2; 233 + 234 + #ifdef CONFIG_SMP 235 + d->smp = kzalloc(d->nr_reg * sizeof(*d->smp), GFP_NOWAIT); 236 + if (!d->smp) 237 + goto err3; 238 + #endif 239 + k = 0; 240 + 241 + if (hw->mask_regs) { 242 + for (i = 0; i < hw->nr_mask_regs; i++) { 243 + smp = IS_SMP(hw->mask_regs[i]); 244 + k += save_reg(d, k, hw->mask_regs[i].set_reg, smp); 245 + k += save_reg(d, k, hw->mask_regs[i].clr_reg, smp); 246 + #ifdef CONFIG_INTC_BALANCING 247 + k += save_reg(d, k, hw->mask_regs[i].dist_reg, 0); 248 + #endif 249 + } 250 + } 251 + 252 + if (hw->prio_regs) { 253 + d->prio = kzalloc(hw->nr_vectors * sizeof(*d->prio), 254 + GFP_NOWAIT); 255 + if (!d->prio) 256 + goto err4; 257 + 258 + for (i = 0; i < hw->nr_prio_regs; i++) { 259 + smp = IS_SMP(hw->prio_regs[i]); 260 + k += save_reg(d, k, hw->prio_regs[i].set_reg, smp); 261 + k += save_reg(d, k, hw->prio_regs[i].clr_reg, smp); 262 + } 263 + } 264 + 265 + if (hw->sense_regs) { 266 + d->sense = kzalloc(hw->nr_vectors * sizeof(*d->sense), 267 + GFP_NOWAIT); 268 + if (!d->sense) 269 + goto err5; 270 + 271 + for (i = 0; i < hw->nr_sense_regs; i++) 272 + k += save_reg(d, k, hw->sense_regs[i].reg, 0); 273 + } 274 + 275 + if (hw->subgroups) 276 + for (i = 0; i < hw->nr_subgroups; i++) 277 + if (hw->subgroups[i].reg) 278 + k+= save_reg(d, k, hw->subgroups[i].reg, 0); 279 + 280 + memcpy(&d->chip, &intc_irq_chip, sizeof(struct irq_chip)); 281 + d->chip.name = desc->name; 282 + 283 + if (hw->ack_regs) 284 + for (i = 0; i < hw->nr_ack_regs; i++) 285 + k += save_reg(d, k, hw->ack_regs[i].set_reg, 0); 286 + else 287 + d->chip.mask_ack = d->chip.disable; 288 + 289 + /* disable bits matching force_disable before registering irqs */ 290 + if (desc->force_disable) 291 + intc_enable_disable_enum(desc, d, desc->force_disable, 0); 292 + 293 + /* disable bits matching force_enable before registering irqs */ 294 + if (desc->force_enable) 295 + intc_enable_disable_enum(desc, d, desc->force_enable, 0); 296 + 297 + BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ 298 + 299 + /* register the vectors one by one */ 300 + for (i = 0; i < hw->nr_vectors; i++) { 301 + struct intc_vect *vect = hw->vectors + i; 302 + unsigned int irq = evt2irq(vect->vect); 303 + struct irq_desc *irq_desc; 304 + 305 + if (!vect->enum_id) 306 + continue; 307 + 308 + irq_desc = irq_to_desc_alloc_node(irq, numa_node_id()); 309 + if (unlikely(!irq_desc)) { 310 + pr_err("can't get irq_desc for %d\n", irq); 311 + continue; 312 + } 313 + 314 + intc_irq_xlate_set(irq, vect->enum_id, d); 315 + intc_register_irq(desc, d, vect->enum_id, irq); 316 + 317 + for (k = i + 1; k < hw->nr_vectors; k++) { 318 + struct intc_vect *vect2 = hw->vectors + k; 319 + unsigned int irq2 = evt2irq(vect2->vect); 320 + 321 + if (vect->enum_id != vect2->enum_id) 322 + continue; 323 + 324 + /* 325 + * In the case of multi-evt handling and sparse 326 + * IRQ support, each vector still needs to have 327 + * its own backing irq_desc. 328 + */ 329 + irq_desc = irq_to_desc_alloc_node(irq2, numa_node_id()); 330 + if (unlikely(!irq_desc)) { 331 + pr_err("can't get irq_desc for %d\n", irq2); 332 + continue; 333 + } 334 + 335 + vect2->enum_id = 0; 336 + 337 + /* redirect this interrupts to the first one */ 338 + set_irq_chip(irq2, &dummy_irq_chip); 339 + set_irq_chained_handler(irq2, intc_redirect_irq); 340 + set_irq_data(irq2, (void *)irq); 341 + } 342 + } 343 + 344 + intc_subgroup_init(desc, d); 345 + 346 + /* enable bits matching force_enable after registering irqs */ 347 + if (desc->force_enable) 348 + intc_enable_disable_enum(desc, d, desc->force_enable, 1); 349 + 350 + nr_intc_controllers++; 351 + 352 + return 0; 353 + err5: 354 + kfree(d->prio); 355 + err4: 356 + #ifdef CONFIG_SMP 357 + kfree(d->smp); 358 + err3: 359 + #endif 360 + kfree(d->reg); 361 + err2: 362 + for (k = 0; k < d->nr_windows; k++) 363 + if (d->window[k].virt) 364 + iounmap(d->window[k].virt); 365 + 366 + kfree(d->window); 367 + err1: 368 + kfree(d); 369 + err0: 370 + pr_err("unable to allocate INTC memory\n"); 371 + 372 + return -ENOMEM; 373 + } 374 + 375 + static ssize_t 376 + show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) 377 + { 378 + struct intc_desc_int *d; 379 + 380 + d = container_of(dev, struct intc_desc_int, sysdev); 381 + 382 + return sprintf(buf, "%s\n", d->chip.name); 383 + } 384 + 385 + static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); 386 + 387 + static int intc_suspend(struct sys_device *dev, pm_message_t state) 388 + { 389 + struct intc_desc_int *d; 390 + struct irq_desc *desc; 391 + int irq; 392 + 393 + /* get intc controller associated with this sysdev */ 394 + d = container_of(dev, struct intc_desc_int, sysdev); 395 + 396 + switch (state.event) { 397 + case PM_EVENT_ON: 398 + if (d->state.event != PM_EVENT_FREEZE) 399 + break; 400 + 401 + for_each_irq_desc(irq, desc) { 402 + /* 403 + * This will catch the redirect and VIRQ cases 404 + * due to the dummy_irq_chip being inserted. 405 + */ 406 + if (desc->chip != &d->chip) 407 + continue; 408 + if (desc->status & IRQ_DISABLED) 409 + desc->chip->disable(irq); 410 + else 411 + desc->chip->enable(irq); 412 + } 413 + break; 414 + case PM_EVENT_FREEZE: 415 + /* nothing has to be done */ 416 + break; 417 + case PM_EVENT_SUSPEND: 418 + /* enable wakeup irqs belonging to this intc controller */ 419 + for_each_irq_desc(irq, desc) { 420 + if (desc->chip != &d->chip) 421 + continue; 422 + if ((desc->status & IRQ_WAKEUP)) 423 + desc->chip->enable(irq); 424 + } 425 + break; 426 + } 427 + 428 + d->state = state; 429 + 430 + return 0; 431 + } 432 + 433 + static int intc_resume(struct sys_device *dev) 434 + { 435 + return intc_suspend(dev, PMSG_ON); 436 + } 437 + 438 + struct sysdev_class intc_sysdev_class = { 439 + .name = "intc", 440 + .suspend = intc_suspend, 441 + .resume = intc_resume, 442 + }; 443 + 444 + /* register this intc as sysdev to allow suspend/resume */ 445 + static int __init register_intc_sysdevs(void) 446 + { 447 + struct intc_desc_int *d; 448 + int error; 449 + 450 + error = sysdev_class_register(&intc_sysdev_class); 451 + if (!error) { 452 + list_for_each_entry(d, &intc_list, list) { 453 + d->sysdev.id = d->index; 454 + d->sysdev.cls = &intc_sysdev_class; 455 + error = sysdev_register(&d->sysdev); 456 + if (error == 0) 457 + error = sysdev_create_file(&d->sysdev, 458 + &attr_name); 459 + if (error) 460 + break; 461 + } 462 + } 463 + 464 + if (error) 465 + pr_err("sysdev registration error\n"); 466 + 467 + return error; 468 + } 469 + device_initcall(register_intc_sysdevs);
+135
drivers/sh/intc/dynamic.c
··· 1 + /* 2 + * Dynamic IRQ management 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * Modelled after arch/x86/kernel/apic/io_apic.c 7 + * 8 + * This file is subject to the terms and conditions of the GNU General Public 9 + * License. See the file "COPYING" in the main directory of this archive 10 + * for more details. 11 + */ 12 + #define pr_fmt(fmt) "intc: " fmt 13 + 14 + #include <linux/irq.h> 15 + #include <linux/bitmap.h> 16 + #include <linux/spinlock.h> 17 + #include "internals.h" /* only for activate_irq() damage.. */ 18 + 19 + /* 20 + * The intc_irq_map provides a global map of bound IRQ vectors for a 21 + * given platform. Allocation of IRQs are either static through the CPU 22 + * vector map, or dynamic in the case of board mux vectors or MSI. 23 + * 24 + * As this is a central point for all IRQ controllers on the system, 25 + * each of the available sources are mapped out here. This combined with 26 + * sparseirq makes it quite trivial to keep the vector map tightly packed 27 + * when dynamically creating IRQs, as well as tying in to otherwise 28 + * unused irq_desc positions in the sparse array. 29 + */ 30 + static DECLARE_BITMAP(intc_irq_map, NR_IRQS); 31 + static DEFINE_RAW_SPINLOCK(vector_lock); 32 + 33 + /* 34 + * Dynamic IRQ allocation and deallocation 35 + */ 36 + unsigned int create_irq_nr(unsigned int irq_want, int node) 37 + { 38 + unsigned int irq = 0, new; 39 + unsigned long flags; 40 + struct irq_desc *desc; 41 + 42 + raw_spin_lock_irqsave(&vector_lock, flags); 43 + 44 + /* 45 + * First try the wanted IRQ 46 + */ 47 + if (test_and_set_bit(irq_want, intc_irq_map) == 0) { 48 + new = irq_want; 49 + } else { 50 + /* .. then fall back to scanning. */ 51 + new = find_first_zero_bit(intc_irq_map, nr_irqs); 52 + if (unlikely(new == nr_irqs)) 53 + goto out_unlock; 54 + 55 + __set_bit(new, intc_irq_map); 56 + } 57 + 58 + desc = irq_to_desc_alloc_node(new, node); 59 + if (unlikely(!desc)) { 60 + pr_err("can't get irq_desc for %d\n", new); 61 + goto out_unlock; 62 + } 63 + 64 + desc = move_irq_desc(desc, node); 65 + irq = new; 66 + 67 + out_unlock: 68 + raw_spin_unlock_irqrestore(&vector_lock, flags); 69 + 70 + if (irq > 0) { 71 + dynamic_irq_init(irq); 72 + activate_irq(irq); 73 + } 74 + 75 + return irq; 76 + } 77 + 78 + int create_irq(void) 79 + { 80 + int nid = cpu_to_node(smp_processor_id()); 81 + int irq; 82 + 83 + irq = create_irq_nr(NR_IRQS_LEGACY, nid); 84 + if (irq == 0) 85 + irq = -1; 86 + 87 + return irq; 88 + } 89 + 90 + void destroy_irq(unsigned int irq) 91 + { 92 + unsigned long flags; 93 + 94 + dynamic_irq_cleanup(irq); 95 + 96 + raw_spin_lock_irqsave(&vector_lock, flags); 97 + __clear_bit(irq, intc_irq_map); 98 + raw_spin_unlock_irqrestore(&vector_lock, flags); 99 + } 100 + 101 + int reserve_irq_vector(unsigned int irq) 102 + { 103 + unsigned long flags; 104 + int ret = 0; 105 + 106 + raw_spin_lock_irqsave(&vector_lock, flags); 107 + if (test_and_set_bit(irq, intc_irq_map)) 108 + ret = -EBUSY; 109 + raw_spin_unlock_irqrestore(&vector_lock, flags); 110 + 111 + return ret; 112 + } 113 + 114 + void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs) 115 + { 116 + unsigned long flags; 117 + int i; 118 + 119 + raw_spin_lock_irqsave(&vector_lock, flags); 120 + for (i = 0; i < nr_vecs; i++) 121 + __set_bit(evt2irq(vectors[i].vect), intc_irq_map); 122 + raw_spin_unlock_irqrestore(&vector_lock, flags); 123 + } 124 + 125 + void reserve_irq_legacy(void) 126 + { 127 + unsigned long flags; 128 + int i, j; 129 + 130 + raw_spin_lock_irqsave(&vector_lock, flags); 131 + j = find_first_bit(intc_irq_map, nr_irqs); 132 + for (i = 0; i < j; i++) 133 + __set_bit(i, intc_irq_map); 134 + raw_spin_unlock_irqrestore(&vector_lock, flags); 135 + }
+307
drivers/sh/intc/handle.c
··· 1 + /* 2 + * Shared interrupt handling code for IPR and INTC2 types of IRQs. 3 + * 4 + * Copyright (C) 2007, 2008 Magnus Damm 5 + * Copyright (C) 2009, 2010 Paul Mundt 6 + * 7 + * This file is subject to the terms and conditions of the GNU General Public 8 + * License. See the file "COPYING" in the main directory of this archive 9 + * for more details. 10 + */ 11 + #include <linux/init.h> 12 + #include <linux/irq.h> 13 + #include <linux/spinlock.h> 14 + #include "internals.h" 15 + 16 + static unsigned long ack_handle[NR_IRQS]; 17 + 18 + static intc_enum __init intc_grp_id(struct intc_desc *desc, 19 + intc_enum enum_id) 20 + { 21 + struct intc_group *g = desc->hw.groups; 22 + unsigned int i, j; 23 + 24 + for (i = 0; g && enum_id && i < desc->hw.nr_groups; i++) { 25 + g = desc->hw.groups + i; 26 + 27 + for (j = 0; g->enum_ids[j]; j++) { 28 + if (g->enum_ids[j] != enum_id) 29 + continue; 30 + 31 + return g->enum_id; 32 + } 33 + } 34 + 35 + return 0; 36 + } 37 + 38 + static unsigned int __init _intc_mask_data(struct intc_desc *desc, 39 + struct intc_desc_int *d, 40 + intc_enum enum_id, 41 + unsigned int *reg_idx, 42 + unsigned int *fld_idx) 43 + { 44 + struct intc_mask_reg *mr = desc->hw.mask_regs; 45 + unsigned int fn, mode; 46 + unsigned long reg_e, reg_d; 47 + 48 + while (mr && enum_id && *reg_idx < desc->hw.nr_mask_regs) { 49 + mr = desc->hw.mask_regs + *reg_idx; 50 + 51 + for (; *fld_idx < ARRAY_SIZE(mr->enum_ids); (*fld_idx)++) { 52 + if (mr->enum_ids[*fld_idx] != enum_id) 53 + continue; 54 + 55 + if (mr->set_reg && mr->clr_reg) { 56 + fn = REG_FN_WRITE_BASE; 57 + mode = MODE_DUAL_REG; 58 + reg_e = mr->clr_reg; 59 + reg_d = mr->set_reg; 60 + } else { 61 + fn = REG_FN_MODIFY_BASE; 62 + if (mr->set_reg) { 63 + mode = MODE_ENABLE_REG; 64 + reg_e = mr->set_reg; 65 + reg_d = mr->set_reg; 66 + } else { 67 + mode = MODE_MASK_REG; 68 + reg_e = mr->clr_reg; 69 + reg_d = mr->clr_reg; 70 + } 71 + } 72 + 73 + fn += (mr->reg_width >> 3) - 1; 74 + return _INTC_MK(fn, mode, 75 + intc_get_reg(d, reg_e), 76 + intc_get_reg(d, reg_d), 77 + 1, 78 + (mr->reg_width - 1) - *fld_idx); 79 + } 80 + 81 + *fld_idx = 0; 82 + (*reg_idx)++; 83 + } 84 + 85 + return 0; 86 + } 87 + 88 + unsigned int __init 89 + intc_get_mask_handle(struct intc_desc *desc, struct intc_desc_int *d, 90 + intc_enum enum_id, int do_grps) 91 + { 92 + unsigned int i = 0; 93 + unsigned int j = 0; 94 + unsigned int ret; 95 + 96 + ret = _intc_mask_data(desc, d, enum_id, &i, &j); 97 + if (ret) 98 + return ret; 99 + 100 + if (do_grps) 101 + return intc_get_mask_handle(desc, d, intc_grp_id(desc, enum_id), 0); 102 + 103 + return 0; 104 + } 105 + 106 + static unsigned int __init _intc_prio_data(struct intc_desc *desc, 107 + struct intc_desc_int *d, 108 + intc_enum enum_id, 109 + unsigned int *reg_idx, 110 + unsigned int *fld_idx) 111 + { 112 + struct intc_prio_reg *pr = desc->hw.prio_regs; 113 + unsigned int fn, n, mode, bit; 114 + unsigned long reg_e, reg_d; 115 + 116 + while (pr && enum_id && *reg_idx < desc->hw.nr_prio_regs) { 117 + pr = desc->hw.prio_regs + *reg_idx; 118 + 119 + for (; *fld_idx < ARRAY_SIZE(pr->enum_ids); (*fld_idx)++) { 120 + if (pr->enum_ids[*fld_idx] != enum_id) 121 + continue; 122 + 123 + if (pr->set_reg && pr->clr_reg) { 124 + fn = REG_FN_WRITE_BASE; 125 + mode = MODE_PCLR_REG; 126 + reg_e = pr->set_reg; 127 + reg_d = pr->clr_reg; 128 + } else { 129 + fn = REG_FN_MODIFY_BASE; 130 + mode = MODE_PRIO_REG; 131 + if (!pr->set_reg) 132 + BUG(); 133 + reg_e = pr->set_reg; 134 + reg_d = pr->set_reg; 135 + } 136 + 137 + fn += (pr->reg_width >> 3) - 1; 138 + n = *fld_idx + 1; 139 + 140 + BUG_ON(n * pr->field_width > pr->reg_width); 141 + 142 + bit = pr->reg_width - (n * pr->field_width); 143 + 144 + return _INTC_MK(fn, mode, 145 + intc_get_reg(d, reg_e), 146 + intc_get_reg(d, reg_d), 147 + pr->field_width, bit); 148 + } 149 + 150 + *fld_idx = 0; 151 + (*reg_idx)++; 152 + } 153 + 154 + return 0; 155 + } 156 + 157 + unsigned int __init 158 + intc_get_prio_handle(struct intc_desc *desc, struct intc_desc_int *d, 159 + intc_enum enum_id, int do_grps) 160 + { 161 + unsigned int i = 0; 162 + unsigned int j = 0; 163 + unsigned int ret; 164 + 165 + ret = _intc_prio_data(desc, d, enum_id, &i, &j); 166 + if (ret) 167 + return ret; 168 + 169 + if (do_grps) 170 + return intc_get_prio_handle(desc, d, intc_grp_id(desc, enum_id), 0); 171 + 172 + return 0; 173 + } 174 + 175 + static unsigned int __init intc_ack_data(struct intc_desc *desc, 176 + struct intc_desc_int *d, 177 + intc_enum enum_id) 178 + { 179 + struct intc_mask_reg *mr = desc->hw.ack_regs; 180 + unsigned int i, j, fn, mode; 181 + unsigned long reg_e, reg_d; 182 + 183 + for (i = 0; mr && enum_id && i < desc->hw.nr_ack_regs; i++) { 184 + mr = desc->hw.ack_regs + i; 185 + 186 + for (j = 0; j < ARRAY_SIZE(mr->enum_ids); j++) { 187 + if (mr->enum_ids[j] != enum_id) 188 + continue; 189 + 190 + fn = REG_FN_MODIFY_BASE; 191 + mode = MODE_ENABLE_REG; 192 + reg_e = mr->set_reg; 193 + reg_d = mr->set_reg; 194 + 195 + fn += (mr->reg_width >> 3) - 1; 196 + return _INTC_MK(fn, mode, 197 + intc_get_reg(d, reg_e), 198 + intc_get_reg(d, reg_d), 199 + 1, 200 + (mr->reg_width - 1) - j); 201 + } 202 + } 203 + 204 + return 0; 205 + } 206 + 207 + static void intc_enable_disable(struct intc_desc_int *d, 208 + unsigned long handle, int do_enable) 209 + { 210 + unsigned long addr; 211 + unsigned int cpu; 212 + unsigned long (*fn)(unsigned long, unsigned long, 213 + unsigned long (*)(unsigned long, unsigned long, 214 + unsigned long), 215 + unsigned int); 216 + 217 + if (do_enable) { 218 + for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) { 219 + addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu); 220 + fn = intc_enable_noprio_fns[_INTC_MODE(handle)]; 221 + fn(addr, handle, intc_reg_fns[_INTC_FN(handle)], 0); 222 + } 223 + } else { 224 + for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) { 225 + addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu); 226 + fn = intc_disable_fns[_INTC_MODE(handle)]; 227 + fn(addr, handle, intc_reg_fns[_INTC_FN(handle)], 0); 228 + } 229 + } 230 + } 231 + 232 + void __init intc_enable_disable_enum(struct intc_desc *desc, 233 + struct intc_desc_int *d, 234 + intc_enum enum_id, int enable) 235 + { 236 + unsigned int i, j, data; 237 + 238 + /* go through and enable/disable all mask bits */ 239 + i = j = 0; 240 + do { 241 + data = _intc_mask_data(desc, d, enum_id, &i, &j); 242 + if (data) 243 + intc_enable_disable(d, data, enable); 244 + j++; 245 + } while (data); 246 + 247 + /* go through and enable/disable all priority fields */ 248 + i = j = 0; 249 + do { 250 + data = _intc_prio_data(desc, d, enum_id, &i, &j); 251 + if (data) 252 + intc_enable_disable(d, data, enable); 253 + 254 + j++; 255 + } while (data); 256 + } 257 + 258 + unsigned int __init 259 + intc_get_sense_handle(struct intc_desc *desc, struct intc_desc_int *d, 260 + intc_enum enum_id) 261 + { 262 + struct intc_sense_reg *sr = desc->hw.sense_regs; 263 + unsigned int i, j, fn, bit; 264 + 265 + for (i = 0; sr && enum_id && i < desc->hw.nr_sense_regs; i++) { 266 + sr = desc->hw.sense_regs + i; 267 + 268 + for (j = 0; j < ARRAY_SIZE(sr->enum_ids); j++) { 269 + if (sr->enum_ids[j] != enum_id) 270 + continue; 271 + 272 + fn = REG_FN_MODIFY_BASE; 273 + fn += (sr->reg_width >> 3) - 1; 274 + 275 + BUG_ON((j + 1) * sr->field_width > sr->reg_width); 276 + 277 + bit = sr->reg_width - ((j + 1) * sr->field_width); 278 + 279 + return _INTC_MK(fn, 0, intc_get_reg(d, sr->reg), 280 + 0, sr->field_width, bit); 281 + } 282 + } 283 + 284 + return 0; 285 + } 286 + 287 + 288 + void intc_set_ack_handle(unsigned int irq, struct intc_desc *desc, 289 + struct intc_desc_int *d, intc_enum id) 290 + { 291 + unsigned long flags; 292 + 293 + /* 294 + * Nothing to do for this IRQ. 295 + */ 296 + if (!desc->hw.ack_regs) 297 + return; 298 + 299 + raw_spin_lock_irqsave(&intc_big_lock, flags); 300 + ack_handle[irq] = intc_ack_data(desc, d, id); 301 + raw_spin_unlock_irqrestore(&intc_big_lock, flags); 302 + } 303 + 304 + unsigned long intc_get_ack_handle(unsigned int irq) 305 + { 306 + return ack_handle[irq]; 307 + }
+186
drivers/sh/intc/internals.h
··· 1 + #include <linux/sh_intc.h> 2 + #include <linux/irq.h> 3 + #include <linux/list.h> 4 + #include <linux/kernel.h> 5 + #include <linux/types.h> 6 + #include <linux/radix-tree.h> 7 + #include <linux/sysdev.h> 8 + 9 + #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ 10 + ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ 11 + ((addr_e) << 16) | ((addr_d << 24))) 12 + 13 + #define _INTC_SHIFT(h) (h & 0x1f) 14 + #define _INTC_WIDTH(h) ((h >> 5) & 0xf) 15 + #define _INTC_FN(h) ((h >> 9) & 0xf) 16 + #define _INTC_MODE(h) ((h >> 13) & 0x7) 17 + #define _INTC_ADDR_E(h) ((h >> 16) & 0xff) 18 + #define _INTC_ADDR_D(h) ((h >> 24) & 0xff) 19 + 20 + #ifdef CONFIG_SMP 21 + #define IS_SMP(x) (x.smp) 22 + #define INTC_REG(d, x, c) (d->reg[(x)] + ((d->smp[(x)] & 0xff) * c)) 23 + #define SMP_NR(d, x) ((d->smp[(x)] >> 8) ? (d->smp[(x)] >> 8) : 1) 24 + #else 25 + #define IS_SMP(x) 0 26 + #define INTC_REG(d, x, c) (d->reg[(x)]) 27 + #define SMP_NR(d, x) 1 28 + #endif 29 + 30 + struct intc_handle_int { 31 + unsigned int irq; 32 + unsigned long handle; 33 + }; 34 + 35 + struct intc_window { 36 + phys_addr_t phys; 37 + void __iomem *virt; 38 + unsigned long size; 39 + }; 40 + 41 + struct intc_map_entry { 42 + intc_enum enum_id; 43 + struct intc_desc_int *desc; 44 + }; 45 + 46 + struct intc_subgroup_entry { 47 + unsigned int pirq; 48 + intc_enum enum_id; 49 + unsigned long handle; 50 + }; 51 + 52 + struct intc_desc_int { 53 + struct list_head list; 54 + struct sys_device sysdev; 55 + struct radix_tree_root tree; 56 + pm_message_t state; 57 + raw_spinlock_t lock; 58 + unsigned int index; 59 + unsigned long *reg; 60 + #ifdef CONFIG_SMP 61 + unsigned long *smp; 62 + #endif 63 + unsigned int nr_reg; 64 + struct intc_handle_int *prio; 65 + unsigned int nr_prio; 66 + struct intc_handle_int *sense; 67 + unsigned int nr_sense; 68 + struct intc_window *window; 69 + unsigned int nr_windows; 70 + struct irq_chip chip; 71 + }; 72 + 73 + 74 + enum { 75 + REG_FN_ERR = 0, 76 + REG_FN_TEST_BASE = 1, 77 + REG_FN_WRITE_BASE = 5, 78 + REG_FN_MODIFY_BASE = 9 79 + }; 80 + 81 + enum { MODE_ENABLE_REG = 0, /* Bit(s) set -> interrupt enabled */ 82 + MODE_MASK_REG, /* Bit(s) set -> interrupt disabled */ 83 + MODE_DUAL_REG, /* Two registers, set bit to enable / disable */ 84 + MODE_PRIO_REG, /* Priority value written to enable interrupt */ 85 + MODE_PCLR_REG, /* Above plus all bits set to disable interrupt */ 86 + }; 87 + 88 + static inline struct intc_desc_int *get_intc_desc(unsigned int irq) 89 + { 90 + struct irq_chip *chip = get_irq_chip(irq); 91 + 92 + return container_of(chip, struct intc_desc_int, chip); 93 + } 94 + 95 + /* 96 + * Grumble. 97 + */ 98 + static inline void activate_irq(int irq) 99 + { 100 + #ifdef CONFIG_ARM 101 + /* ARM requires an extra step to clear IRQ_NOREQUEST, which it 102 + * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE. 103 + */ 104 + set_irq_flags(irq, IRQF_VALID); 105 + #else 106 + /* same effect on other architectures */ 107 + set_irq_noprobe(irq); 108 + #endif 109 + } 110 + 111 + /* access.c */ 112 + extern unsigned long 113 + (*intc_reg_fns[])(unsigned long addr, unsigned long h, unsigned long data); 114 + 115 + extern unsigned long 116 + (*intc_enable_fns[])(unsigned long addr, unsigned long handle, 117 + unsigned long (*fn)(unsigned long, 118 + unsigned long, unsigned long), 119 + unsigned int irq); 120 + extern unsigned long 121 + (*intc_disable_fns[])(unsigned long addr, unsigned long handle, 122 + unsigned long (*fn)(unsigned long, 123 + unsigned long, unsigned long), 124 + unsigned int irq); 125 + extern unsigned long 126 + (*intc_enable_noprio_fns[])(unsigned long addr, unsigned long handle, 127 + unsigned long (*fn)(unsigned long, 128 + unsigned long, unsigned long), 129 + unsigned int irq); 130 + 131 + unsigned long intc_phys_to_virt(struct intc_desc_int *d, unsigned long address); 132 + unsigned int intc_get_reg(struct intc_desc_int *d, unsigned long address); 133 + unsigned int intc_set_field_from_handle(unsigned int value, 134 + unsigned int field_value, 135 + unsigned int handle); 136 + unsigned long intc_get_field_from_handle(unsigned int value, 137 + unsigned int handle); 138 + 139 + /* balancing.c */ 140 + #ifdef CONFIG_INTC_BALANCING 141 + void intc_balancing_enable(unsigned int irq); 142 + void intc_balancing_disable(unsigned int irq); 143 + void intc_set_dist_handle(unsigned int irq, struct intc_desc *desc, 144 + struct intc_desc_int *d, intc_enum id); 145 + #else 146 + static inline void intc_balancing_enable(unsigned int irq) { } 147 + static inline void intc_balancing_disable(unsigned int irq) { } 148 + static inline void 149 + intc_set_dist_handle(unsigned int irq, struct intc_desc *desc, 150 + struct intc_desc_int *d, intc_enum id) { } 151 + #endif 152 + 153 + /* chip.c */ 154 + extern struct irq_chip intc_irq_chip; 155 + void _intc_enable(unsigned int irq, unsigned long handle); 156 + 157 + /* core.c */ 158 + extern struct list_head intc_list; 159 + extern raw_spinlock_t intc_big_lock; 160 + extern unsigned int nr_intc_controllers; 161 + extern struct sysdev_class intc_sysdev_class; 162 + 163 + unsigned int intc_get_dfl_prio_level(void); 164 + unsigned int intc_get_prio_level(unsigned int irq); 165 + void intc_set_prio_level(unsigned int irq, unsigned int level); 166 + 167 + /* handle.c */ 168 + unsigned int intc_get_mask_handle(struct intc_desc *desc, 169 + struct intc_desc_int *d, 170 + intc_enum enum_id, int do_grps); 171 + unsigned int intc_get_prio_handle(struct intc_desc *desc, 172 + struct intc_desc_int *d, 173 + intc_enum enum_id, int do_grps); 174 + unsigned int intc_get_sense_handle(struct intc_desc *desc, 175 + struct intc_desc_int *d, 176 + intc_enum enum_id); 177 + void intc_set_ack_handle(unsigned int irq, struct intc_desc *desc, 178 + struct intc_desc_int *d, intc_enum id); 179 + unsigned long intc_get_ack_handle(unsigned int irq); 180 + void intc_enable_disable_enum(struct intc_desc *desc, struct intc_desc_int *d, 181 + intc_enum enum_id, int enable); 182 + 183 + /* virq.c */ 184 + void intc_subgroup_init(struct intc_desc *desc, struct intc_desc_int *d); 185 + void intc_irq_xlate_set(unsigned int irq, intc_enum id, struct intc_desc_int *d); 186 + struct intc_map_entry *intc_irq_xlate_get(unsigned int irq);
+83
drivers/sh/intc/userimask.c
··· 1 + /* 2 + * Support for hardware-assisted userspace interrupt masking. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #define pr_fmt(fmt) "intc: " fmt 11 + 12 + #include <linux/errno.h> 13 + #include <linux/sysdev.h> 14 + #include <linux/init.h> 15 + #include <linux/io.h> 16 + #include <asm/sizes.h> 17 + #include "internals.h" 18 + 19 + static void __iomem *uimask; 20 + 21 + static ssize_t 22 + show_intc_userimask(struct sysdev_class *cls, 23 + struct sysdev_class_attribute *attr, char *buf) 24 + { 25 + return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); 26 + } 27 + 28 + static ssize_t 29 + store_intc_userimask(struct sysdev_class *cls, 30 + struct sysdev_class_attribute *attr, 31 + const char *buf, size_t count) 32 + { 33 + unsigned long level; 34 + 35 + level = simple_strtoul(buf, NULL, 10); 36 + 37 + /* 38 + * Minimal acceptable IRQ levels are in the 2 - 16 range, but 39 + * these are chomped so as to not interfere with normal IRQs. 40 + * 41 + * Level 1 is a special case on some CPUs in that it's not 42 + * directly settable, but given that USERIMASK cuts off below a 43 + * certain level, we don't care about this limitation here. 44 + * Level 0 on the other hand equates to user masking disabled. 45 + * 46 + * We use the default priority level as a cut off so that only 47 + * special case opt-in IRQs can be mangled. 48 + */ 49 + if (level >= intc_get_dfl_prio_level()) 50 + return -EINVAL; 51 + 52 + __raw_writel(0xa5 << 24 | level << 4, uimask); 53 + 54 + return count; 55 + } 56 + 57 + static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR, 58 + show_intc_userimask, store_intc_userimask); 59 + 60 + 61 + static int __init userimask_sysdev_init(void) 62 + { 63 + if (unlikely(!uimask)) 64 + return -ENXIO; 65 + 66 + return sysdev_class_create_file(&intc_sysdev_class, &attr_userimask); 67 + } 68 + late_initcall(userimask_sysdev_init); 69 + 70 + int register_intc_userimask(unsigned long addr) 71 + { 72 + if (unlikely(uimask)) 73 + return -EBUSY; 74 + 75 + uimask = ioremap_nocache(addr, SZ_4K); 76 + if (unlikely(!uimask)) 77 + return -ENOMEM; 78 + 79 + pr_info("userimask support registered for levels 0 -> %d\n", 80 + intc_get_dfl_prio_level() - 1); 81 + 82 + return 0; 83 + }
+64
drivers/sh/intc/virq-debugfs.c
··· 1 + /* 2 + * Support for virtual IRQ subgroups debugfs mapping. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * Modelled after arch/powerpc/kernel/irq.c. 7 + * 8 + * This file is subject to the terms and conditions of the GNU General Public 9 + * License. See the file "COPYING" in the main directory of this archive 10 + * for more details. 11 + */ 12 + #include <linux/seq_file.h> 13 + #include <linux/fs.h> 14 + #include <linux/init.h> 15 + #include <linux/irq.h> 16 + #include <linux/debugfs.h> 17 + #include "internals.h" 18 + 19 + static int intc_irq_xlate_debug(struct seq_file *m, void *priv) 20 + { 21 + int i; 22 + 23 + seq_printf(m, "%-5s %-7s %-15s\n", "irq", "enum", "chip name"); 24 + 25 + for (i = 1; i < nr_irqs; i++) { 26 + struct intc_map_entry *entry = intc_irq_xlate_get(i); 27 + struct intc_desc_int *desc = entry->desc; 28 + 29 + if (!desc) 30 + continue; 31 + 32 + seq_printf(m, "%5d ", i); 33 + seq_printf(m, "0x%05x ", entry->enum_id); 34 + seq_printf(m, "%-15s\n", desc->chip.name); 35 + } 36 + 37 + return 0; 38 + } 39 + 40 + static int intc_irq_xlate_open(struct inode *inode, struct file *file) 41 + { 42 + return single_open(file, intc_irq_xlate_debug, inode->i_private); 43 + } 44 + 45 + static const struct file_operations intc_irq_xlate_fops = { 46 + .open = intc_irq_xlate_open, 47 + .read = seq_read, 48 + .llseek = seq_lseek, 49 + .release = single_release, 50 + }; 51 + 52 + static int __init intc_irq_xlate_init(void) 53 + { 54 + /* 55 + * XXX.. use arch_debugfs_dir here when all of the intc users are 56 + * converted. 57 + */ 58 + if (debugfs_create_file("intc_irq_xlate", S_IRUGO, NULL, NULL, 59 + &intc_irq_xlate_fops) == NULL) 60 + return -ENOMEM; 61 + 62 + return 0; 63 + } 64 + fs_initcall(intc_irq_xlate_init);
+255
drivers/sh/intc/virq.c
··· 1 + /* 2 + * Support for virtual IRQ subgroups. 3 + * 4 + * Copyright (C) 2010 Paul Mundt 5 + * 6 + * This file is subject to the terms and conditions of the GNU General Public 7 + * License. See the file "COPYING" in the main directory of this archive 8 + * for more details. 9 + */ 10 + #define pr_fmt(fmt) "intc: " fmt 11 + 12 + #include <linux/slab.h> 13 + #include <linux/irq.h> 14 + #include <linux/list.h> 15 + #include <linux/radix-tree.h> 16 + #include <linux/spinlock.h> 17 + #include "internals.h" 18 + 19 + static struct intc_map_entry intc_irq_xlate[NR_IRQS]; 20 + 21 + struct intc_virq_list { 22 + unsigned int irq; 23 + struct intc_virq_list *next; 24 + }; 25 + 26 + #define for_each_virq(entry, head) \ 27 + for (entry = head; entry; entry = entry->next) 28 + 29 + /* 30 + * Tags for the radix tree 31 + */ 32 + #define INTC_TAG_VIRQ_NEEDS_ALLOC 0 33 + 34 + void intc_irq_xlate_set(unsigned int irq, intc_enum id, struct intc_desc_int *d) 35 + { 36 + unsigned long flags; 37 + 38 + raw_spin_lock_irqsave(&intc_big_lock, flags); 39 + intc_irq_xlate[irq].enum_id = id; 40 + intc_irq_xlate[irq].desc = d; 41 + raw_spin_unlock_irqrestore(&intc_big_lock, flags); 42 + } 43 + 44 + struct intc_map_entry *intc_irq_xlate_get(unsigned int irq) 45 + { 46 + return intc_irq_xlate + irq; 47 + } 48 + 49 + int intc_irq_lookup(const char *chipname, intc_enum enum_id) 50 + { 51 + struct intc_map_entry *ptr; 52 + struct intc_desc_int *d; 53 + int irq = -1; 54 + 55 + list_for_each_entry(d, &intc_list, list) { 56 + int tagged; 57 + 58 + if (strcmp(d->chip.name, chipname) != 0) 59 + continue; 60 + 61 + /* 62 + * Catch early lookups for subgroup VIRQs that have not 63 + * yet been allocated an IRQ. This already includes a 64 + * fast-path out if the tree is untagged, so there is no 65 + * need to explicitly test the root tree. 66 + */ 67 + tagged = radix_tree_tag_get(&d->tree, enum_id, 68 + INTC_TAG_VIRQ_NEEDS_ALLOC); 69 + if (unlikely(tagged)) 70 + break; 71 + 72 + ptr = radix_tree_lookup(&d->tree, enum_id); 73 + if (ptr) { 74 + irq = ptr - intc_irq_xlate; 75 + break; 76 + } 77 + } 78 + 79 + return irq; 80 + } 81 + EXPORT_SYMBOL_GPL(intc_irq_lookup); 82 + 83 + static int add_virq_to_pirq(unsigned int irq, unsigned int virq) 84 + { 85 + struct intc_virq_list **last, *entry; 86 + struct irq_desc *desc = irq_to_desc(irq); 87 + 88 + /* scan for duplicates */ 89 + last = (struct intc_virq_list **)&desc->handler_data; 90 + for_each_virq(entry, desc->handler_data) { 91 + if (entry->irq == virq) 92 + return 0; 93 + last = &entry->next; 94 + } 95 + 96 + entry = kzalloc(sizeof(struct intc_virq_list), GFP_ATOMIC); 97 + if (!entry) { 98 + pr_err("can't allocate VIRQ mapping for %d\n", virq); 99 + return -ENOMEM; 100 + } 101 + 102 + entry->irq = virq; 103 + 104 + *last = entry; 105 + 106 + return 0; 107 + } 108 + 109 + static void intc_virq_handler(unsigned int irq, struct irq_desc *desc) 110 + { 111 + struct intc_virq_list *entry, *vlist = get_irq_data(irq); 112 + struct intc_desc_int *d = get_intc_desc(irq); 113 + 114 + desc->chip->mask_ack(irq); 115 + 116 + for_each_virq(entry, vlist) { 117 + unsigned long addr, handle; 118 + 119 + handle = (unsigned long)get_irq_data(entry->irq); 120 + addr = INTC_REG(d, _INTC_ADDR_E(handle), 0); 121 + 122 + if (intc_reg_fns[_INTC_FN(handle)](addr, handle, 0)) 123 + generic_handle_irq(entry->irq); 124 + } 125 + 126 + desc->chip->unmask(irq); 127 + } 128 + 129 + static unsigned long __init intc_subgroup_data(struct intc_subgroup *subgroup, 130 + struct intc_desc_int *d, 131 + unsigned int index) 132 + { 133 + unsigned int fn = REG_FN_TEST_BASE + (subgroup->reg_width >> 3) - 1; 134 + 135 + return _INTC_MK(fn, MODE_ENABLE_REG, intc_get_reg(d, subgroup->reg), 136 + 0, 1, (subgroup->reg_width - 1) - index); 137 + } 138 + 139 + static void __init intc_subgroup_init_one(struct intc_desc *desc, 140 + struct intc_desc_int *d, 141 + struct intc_subgroup *subgroup) 142 + { 143 + struct intc_map_entry *mapped; 144 + unsigned int pirq; 145 + unsigned long flags; 146 + int i; 147 + 148 + mapped = radix_tree_lookup(&d->tree, subgroup->parent_id); 149 + if (!mapped) { 150 + WARN_ON(1); 151 + return; 152 + } 153 + 154 + pirq = mapped - intc_irq_xlate; 155 + 156 + raw_spin_lock_irqsave(&d->lock, flags); 157 + 158 + for (i = 0; i < ARRAY_SIZE(subgroup->enum_ids); i++) { 159 + struct intc_subgroup_entry *entry; 160 + int err; 161 + 162 + if (!subgroup->enum_ids[i]) 163 + continue; 164 + 165 + entry = kmalloc(sizeof(*entry), GFP_NOWAIT); 166 + if (!entry) 167 + break; 168 + 169 + entry->pirq = pirq; 170 + entry->enum_id = subgroup->enum_ids[i]; 171 + entry->handle = intc_subgroup_data(subgroup, d, i); 172 + 173 + err = radix_tree_insert(&d->tree, entry->enum_id, entry); 174 + if (unlikely(err < 0)) 175 + break; 176 + 177 + radix_tree_tag_set(&d->tree, entry->enum_id, 178 + INTC_TAG_VIRQ_NEEDS_ALLOC); 179 + } 180 + 181 + raw_spin_unlock_irqrestore(&d->lock, flags); 182 + } 183 + 184 + void __init intc_subgroup_init(struct intc_desc *desc, struct intc_desc_int *d) 185 + { 186 + int i; 187 + 188 + if (!desc->hw.subgroups) 189 + return; 190 + 191 + for (i = 0; i < desc->hw.nr_subgroups; i++) 192 + intc_subgroup_init_one(desc, d, desc->hw.subgroups + i); 193 + } 194 + 195 + static void __init intc_subgroup_map(struct intc_desc_int *d) 196 + { 197 + struct intc_subgroup_entry *entries[32]; 198 + unsigned long flags; 199 + unsigned int nr_found; 200 + int i; 201 + 202 + raw_spin_lock_irqsave(&d->lock, flags); 203 + 204 + restart: 205 + nr_found = radix_tree_gang_lookup_tag_slot(&d->tree, 206 + (void ***)entries, 0, ARRAY_SIZE(entries), 207 + INTC_TAG_VIRQ_NEEDS_ALLOC); 208 + 209 + for (i = 0; i < nr_found; i++) { 210 + struct intc_subgroup_entry *entry; 211 + int irq; 212 + 213 + entry = radix_tree_deref_slot((void **)entries[i]); 214 + if (unlikely(!entry)) 215 + continue; 216 + if (unlikely(entry == RADIX_TREE_RETRY)) 217 + goto restart; 218 + 219 + irq = create_irq(); 220 + if (unlikely(irq < 0)) { 221 + pr_err("no more free IRQs, bailing..\n"); 222 + break; 223 + } 224 + 225 + pr_info("Setting up a chained VIRQ from %d -> %d\n", 226 + irq, entry->pirq); 227 + 228 + intc_irq_xlate_set(irq, entry->enum_id, d); 229 + 230 + set_irq_chip_and_handler_name(irq, get_irq_chip(entry->pirq), 231 + handle_simple_irq, "virq"); 232 + set_irq_chip_data(irq, get_irq_chip_data(entry->pirq)); 233 + 234 + set_irq_data(irq, (void *)entry->handle); 235 + 236 + set_irq_chained_handler(entry->pirq, intc_virq_handler); 237 + add_virq_to_pirq(entry->pirq, irq); 238 + 239 + radix_tree_tag_clear(&d->tree, entry->enum_id, 240 + INTC_TAG_VIRQ_NEEDS_ALLOC); 241 + radix_tree_replace_slot((void **)entries[i], 242 + &intc_irq_xlate[irq]); 243 + } 244 + 245 + raw_spin_unlock_irqrestore(&d->lock, flags); 246 + } 247 + 248 + void __init intc_finalize(void) 249 + { 250 + struct intc_desc_int *d; 251 + 252 + list_for_each_entry(d, &intc_list, list) 253 + if (radix_tree_tagged(&d->tree, INTC_TAG_VIRQ_NEEDS_ALLOC)) 254 + intc_subgroup_map(d); 255 + }
+12 -5
drivers/sh/pfc.c
··· 7 7 * License. See the file "COPYING" in the main directory of this archive 8 8 * for more details. 9 9 */ 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 10 12 #include <linux/errno.h> 11 13 #include <linux/kernel.h> 12 14 #include <linux/list.h> ··· 561 559 struct pinmux_data_reg *dr = NULL; 562 560 int bit = 0; 563 561 564 - if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0) { 565 - BUG(); 566 - return 0; 567 - } 562 + if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0) 563 + return -EINVAL; 568 564 569 565 return gpio_read_reg(dr->reg, dr->reg_width, 1, bit); 570 566 } ··· 581 581 { 582 582 struct gpio_chip *chip = &pip->chip; 583 583 584 - pr_info("sh pinmux: %s handling gpio %d -> %d\n", 584 + pr_info("%s handling gpio %d -> %d\n", 585 585 pip->name, pip->first_gpio, pip->last_gpio); 586 586 587 587 setup_data_regs(pip); ··· 601 601 chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1; 602 602 603 603 return gpiochip_add(chip); 604 + } 605 + 606 + int unregister_pinmux(struct pinmux_info *pip) 607 + { 608 + pr_info("%s deregistering\n", pip->name); 609 + 610 + return gpiochip_remove(&pip->chip); 604 611 }
+2 -2
drivers/usb/host/r8a66597-hcd.c
··· 2397 2397 #define R8A66597_DEV_PM_OPS NULL 2398 2398 #endif 2399 2399 2400 - static int __init_or_module r8a66597_remove(struct platform_device *pdev) 2400 + static int __devexit r8a66597_remove(struct platform_device *pdev) 2401 2401 { 2402 2402 struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); 2403 2403 struct usb_hcd *hcd = r8a66597_to_hcd(r8a66597); ··· 2542 2542 2543 2543 static struct platform_driver r8a66597_driver = { 2544 2544 .probe = r8a66597_probe, 2545 - .remove = r8a66597_remove, 2545 + .remove = __devexit_p(r8a66597_remove), 2546 2546 .driver = { 2547 2547 .name = (char *) hcd_name, 2548 2548 .owner = THIS_MODULE,
+4 -2
drivers/video/sh_mobile_lcdcfb.c
··· 1243 1243 if (priv->ch[i].sglist) 1244 1244 vfree(priv->ch[i].sglist); 1245 1245 1246 - dma_free_coherent(&pdev->dev, info->fix.smem_len, 1247 - info->screen_base, priv->ch[i].dma_handle); 1246 + if (info->screen_base) 1247 + dma_free_coherent(&pdev->dev, info->fix.smem_len, 1248 + info->screen_base, 1249 + priv->ch[i].dma_handle); 1248 1250 fb_dealloc_cmap(&info->cmap); 1249 1251 framebuffer_release(info); 1250 1252 }
+7
include/linux/pci_ids.h
··· 2268 2268 2269 2269 #define PCI_VENDOR_ID_SILAN 0x1904 2270 2270 2271 + #define PCI_VENDOR_ID_RENESAS 0x1912 2272 + #define PCI_DEVICE_ID_RENESAS_SH7781 0x0001 2273 + #define PCI_DEVICE_ID_RENESAS_SH7780 0x0002 2274 + #define PCI_DEVICE_ID_RENESAS_SH7763 0x0004 2275 + #define PCI_DEVICE_ID_RENESAS_SH7785 0x0007 2276 + #define PCI_DEVICE_ID_RENESAS_SH7786 0x0010 2277 + 2271 2278 #define PCI_VENDOR_ID_TDI 0x192E 2272 2279 #define PCI_DEVICE_ID_TDI_EHCI 0x0101 2273 2280
+14 -3
include/linux/sh_clk.h
··· 4 4 #include <linux/list.h> 5 5 #include <linux/seq_file.h> 6 6 #include <linux/cpufreq.h> 7 + #include <linux/types.h> 8 + #include <linux/kref.h> 7 9 #include <linux/clk.h> 8 10 #include <linux/err.h> 9 11 10 12 struct clk; 13 + 14 + struct clk_mapping { 15 + phys_addr_t phys; 16 + void __iomem *base; 17 + unsigned long len; 18 + struct kref ref; 19 + }; 11 20 12 21 struct clk_ops { 13 22 void (*init)(struct clk *clk); ··· 30 21 31 22 struct clk { 32 23 struct list_head node; 33 - const char *name; 34 - int id; 35 - 36 24 struct clk *parent; 37 25 struct clk **parent_table; /* list of parents to */ 38 26 unsigned short parent_num; /* choose between */ ··· 51 45 unsigned long arch_flags; 52 46 void *priv; 53 47 struct dentry *dentry; 48 + struct clk_mapping *mapping; 54 49 struct cpufreq_frequency_table *freq_table; 50 + unsigned int nr_freqs; 55 51 }; 56 52 57 53 #define CLK_ENABLE_ON_INIT (1 << 0) ··· 118 110 int clk_rate_table_find(struct clk *clk, 119 111 struct cpufreq_frequency_table *freq_table, 120 112 unsigned long rate); 113 + 114 + long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, 115 + unsigned int div_max, unsigned long rate); 121 116 122 117 #define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ 123 118 { \
+14 -2
include/linux/sh_intc.h
··· 20 20 21 21 #define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } 22 22 23 + struct intc_subgroup { 24 + unsigned long reg, reg_width; 25 + intc_enum parent_id; 26 + intc_enum enum_ids[32]; 27 + }; 28 + 23 29 struct intc_mask_reg { 24 30 unsigned long set_reg, clr_reg, reg_width; 25 31 intc_enum enum_ids[32]; ··· 75 69 unsigned int nr_sense_regs; 76 70 struct intc_mask_reg *ack_regs; 77 71 unsigned int nr_ack_regs; 72 + struct intc_subgroup *subgroups; 73 + unsigned int nr_subgroups; 78 74 }; 79 75 80 - #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) 76 + #define _INTC_ARRAY(a) a, a == NULL ? 0 : sizeof(a)/sizeof(*a) 77 + 81 78 #define INTC_HW_DESC(vectors, groups, mask_regs, \ 82 79 prio_regs, sense_regs, ack_regs) \ 83 80 { \ ··· 114 105 prio_regs, sense_regs, ack_regs), \ 115 106 } 116 107 117 - int __init register_intc_controller(struct intc_desc *desc); 108 + int register_intc_controller(struct intc_desc *desc); 109 + void reserve_intc_vectors(struct intc_vect *vectors, unsigned int nr_vecs); 118 110 int intc_set_priority(unsigned int irq, unsigned int prio); 111 + int intc_irq_lookup(const char *chipname, intc_enum enum_id); 112 + void intc_finalize(void); 119 113 120 114 #ifdef CONFIG_INTC_USERIMASK 121 115 int register_intc_userimask(unsigned long addr);
+1
include/linux/sh_pfc.h
··· 92 92 }; 93 93 94 94 int register_pinmux(struct pinmux_info *pip); 95 + int unregister_pinmux(struct pinmux_info *pip); 95 96 96 97 #endif /* __SH_PFC_H */
+2
sound/soc/sh/siu_pcm.c
··· 127 127 sg_init_table(&sg, 1); 128 128 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)), 129 129 size, offset_in_page(buff)); 130 + sg_dma_len(&sg) = size; 130 131 sg_dma_address(&sg) = buff; 131 132 132 133 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, ··· 177 176 sg_init_table(&sg, 1); 178 177 sg_set_page(&sg, pfn_to_page(PFN_DOWN(buff)), 179 178 size, offset_in_page(buff)); 179 + sg_dma_len(&sg) = size; 180 180 sg_dma_address(&sg) = buff; 181 181 182 182 desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan,