Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: add defconfig for Freescale MPC8349E-mITX board
powerpc: Add base support for the Freescale MPC8349E-mITX eval board
Documentation: correct values in MPC8548E SEC example node
[POWERPC] Actually copy over i8259.c to arch/ppc/syslib this time
[POWERPC] Add new interrupt mapping core and change platforms to use it
[POWERPC] Copy i8259 code back to arch/ppc
[POWERPC] New device-tree interrupt parsing code
[POWERPC] Use the genirq framework
[PATCH] genirq: Allow fasteoi handler to retrigger disabled interrupts
[POWERPC] Update the SWIM3 (powermac) floppy driver
[POWERPC] Fix error handling in detecting legacy serial ports
[POWERPC] Fix booting on Momentum "Apache" board (a Maple derivative)
[POWERPC] Fix various offb and BootX-related issues
[POWERPC] Add a default config for 32-bit CHRP machines
[POWERPC] fix implicit declaration on cell.
[POWERPC] change get_property to return void *

+7198 -2792
+2 -2
Documentation/powerpc/booting-without-of.txt
··· 1436 1436 interrupts = <1d 3>; 1437 1437 interrupt-parent = <40000>; 1438 1438 num-channels = <4>; 1439 - channel-fifo-len = <24>; 1439 + channel-fifo-len = <18>; 1440 1440 exec-units-mask = <000000fe>; 1441 - descriptor-types-mask = <073f1127>; 1441 + descriptor-types-mask = <012b0ebf>; 1442 1442 }; 1443 1443 1444 1444
+1378
arch/powerpc/configs/chrp32_defconfig
··· 1 + # 2 + # Automatically generated make config: don't edit 3 + # Linux kernel version: 2.6.17 4 + # Mon Jul 3 12:08:41 2006 5 + # 6 + # CONFIG_PPC64 is not set 7 + CONFIG_PPC32=y 8 + CONFIG_PPC_MERGE=y 9 + CONFIG_MMU=y 10 + CONFIG_GENERIC_HARDIRQS=y 11 + CONFIG_RWSEM_XCHGADD_ALGORITHM=y 12 + CONFIG_GENERIC_HWEIGHT=y 13 + CONFIG_GENERIC_CALIBRATE_DELAY=y 14 + CONFIG_GENERIC_FIND_NEXT_BIT=y 15 + CONFIG_PPC=y 16 + CONFIG_EARLY_PRINTK=y 17 + CONFIG_GENERIC_NVRAM=y 18 + CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 19 + CONFIG_ARCH_MAY_HAVE_PC_FDC=y 20 + CONFIG_PPC_OF=y 21 + CONFIG_PPC_UDBG_16550=y 22 + CONFIG_GENERIC_TBSYNC=y 23 + # CONFIG_DEFAULT_UIMAGE is not set 24 + 25 + # 26 + # Processor support 27 + # 28 + CONFIG_CLASSIC32=y 29 + # CONFIG_PPC_52xx is not set 30 + # CONFIG_PPC_82xx is not set 31 + # CONFIG_PPC_83xx is not set 32 + # CONFIG_PPC_85xx is not set 33 + # CONFIG_PPC_86xx is not set 34 + # CONFIG_40x is not set 35 + # CONFIG_44x is not set 36 + # CONFIG_8xx is not set 37 + # CONFIG_E200 is not set 38 + CONFIG_6xx=y 39 + CONFIG_PPC_FPU=y 40 + # CONFIG_ALTIVEC is not set 41 + CONFIG_PPC_STD_MMU=y 42 + CONFIG_PPC_STD_MMU_32=y 43 + CONFIG_SMP=y 44 + CONFIG_NR_CPUS=4 45 + 46 + # 47 + # Code maturity level options 48 + # 49 + CONFIG_EXPERIMENTAL=y 50 + CONFIG_LOCK_KERNEL=y 51 + CONFIG_INIT_ENV_ARG_LIMIT=32 52 + 53 + # 54 + # General setup 55 + # 56 + CONFIG_LOCALVERSION="" 57 + # CONFIG_LOCALVERSION_AUTO is not set 58 + CONFIG_SWAP=y 59 + CONFIG_SYSVIPC=y 60 + CONFIG_POSIX_MQUEUE=y 61 + # CONFIG_BSD_PROCESS_ACCT is not set 62 + CONFIG_SYSCTL=y 63 + # CONFIG_AUDIT is not set 64 + CONFIG_IKCONFIG=y 65 + CONFIG_IKCONFIG_PROC=y 66 + # CONFIG_CPUSETS is not set 67 + # CONFIG_RELAY is not set 68 + CONFIG_INITRAMFS_SOURCE="" 69 + # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 70 + # CONFIG_EMBEDDED is not set 71 + CONFIG_KALLSYMS=y 72 + # CONFIG_KALLSYMS_ALL is not set 73 + # CONFIG_KALLSYMS_EXTRA_PASS is not set 74 + CONFIG_HOTPLUG=y 75 + CONFIG_PRINTK=y 76 + CONFIG_BUG=y 77 + CONFIG_ELF_CORE=y 78 + CONFIG_BASE_FULL=y 79 + CONFIG_FUTEX=y 80 + CONFIG_EPOLL=y 81 + CONFIG_SHMEM=y 82 + CONFIG_SLAB=y 83 + # CONFIG_TINY_SHMEM is not set 84 + CONFIG_BASE_SMALL=0 85 + # CONFIG_SLOB is not set 86 + 87 + # 88 + # Loadable module support 89 + # 90 + CONFIG_MODULES=y 91 + CONFIG_MODULE_UNLOAD=y 92 + CONFIG_MODULE_FORCE_UNLOAD=y 93 + # CONFIG_MODVERSIONS is not set 94 + # CONFIG_MODULE_SRCVERSION_ALL is not set 95 + CONFIG_KMOD=y 96 + CONFIG_STOP_MACHINE=y 97 + 98 + # 99 + # Block layer 100 + # 101 + CONFIG_LBD=y 102 + # CONFIG_BLK_DEV_IO_TRACE is not set 103 + # CONFIG_LSF is not set 104 + 105 + # 106 + # IO Schedulers 107 + # 108 + CONFIG_IOSCHED_NOOP=y 109 + CONFIG_IOSCHED_AS=y 110 + CONFIG_IOSCHED_DEADLINE=y 111 + CONFIG_IOSCHED_CFQ=y 112 + CONFIG_DEFAULT_AS=y 113 + # CONFIG_DEFAULT_DEADLINE is not set 114 + # CONFIG_DEFAULT_CFQ is not set 115 + # CONFIG_DEFAULT_NOOP is not set 116 + CONFIG_DEFAULT_IOSCHED="anticipatory" 117 + 118 + # 119 + # Platform support 120 + # 121 + CONFIG_PPC_MULTIPLATFORM=y 122 + # CONFIG_PPC_ISERIES is not set 123 + # CONFIG_EMBEDDED6xx is not set 124 + # CONFIG_APUS is not set 125 + CONFIG_PPC_CHRP=y 126 + # CONFIG_PPC_PMAC is not set 127 + # CONFIG_PPC_CELL is not set 128 + # CONFIG_PPC_CELL_NATIVE is not set 129 + CONFIG_MPIC=y 130 + CONFIG_PPC_RTAS=y 131 + # CONFIG_RTAS_ERROR_LOGGING is not set 132 + CONFIG_RTAS_PROC=y 133 + # CONFIG_MMIO_NVRAM is not set 134 + CONFIG_PPC_MPC106=y 135 + # CONFIG_PPC_970_NAP is not set 136 + # CONFIG_CPU_FREQ is not set 137 + # CONFIG_TAU is not set 138 + # CONFIG_WANT_EARLY_SERIAL is not set 139 + 140 + # 141 + # Kernel options 142 + # 143 + CONFIG_HIGHMEM=y 144 + # CONFIG_HZ_100 is not set 145 + CONFIG_HZ_250=y 146 + # CONFIG_HZ_1000 is not set 147 + CONFIG_HZ=250 148 + CONFIG_PREEMPT_NONE=y 149 + # CONFIG_PREEMPT_VOLUNTARY is not set 150 + # CONFIG_PREEMPT is not set 151 + CONFIG_PREEMPT_BKL=y 152 + CONFIG_BINFMT_ELF=y 153 + CONFIG_BINFMT_MISC=y 154 + # CONFIG_KEXEC is not set 155 + CONFIG_IRQ_ALL_CPUS=y 156 + CONFIG_ARCH_FLATMEM_ENABLE=y 157 + CONFIG_SELECT_MEMORY_MODEL=y 158 + CONFIG_FLATMEM_MANUAL=y 159 + # CONFIG_DISCONTIGMEM_MANUAL is not set 160 + # CONFIG_SPARSEMEM_MANUAL is not set 161 + CONFIG_FLATMEM=y 162 + CONFIG_FLAT_NODE_MEM_MAP=y 163 + # CONFIG_SPARSEMEM_STATIC is not set 164 + CONFIG_SPLIT_PTLOCK_CPUS=4 165 + CONFIG_PROC_DEVICETREE=y 166 + # CONFIG_CMDLINE_BOOL is not set 167 + # CONFIG_PM is not set 168 + CONFIG_SECCOMP=y 169 + CONFIG_ISA_DMA_API=y 170 + 171 + # 172 + # Bus options 173 + # 174 + CONFIG_ISA=y 175 + CONFIG_GENERIC_ISA_DMA=y 176 + CONFIG_PPC_I8259=y 177 + CONFIG_PPC_INDIRECT_PCI=y 178 + CONFIG_PCI=y 179 + CONFIG_PCI_DOMAINS=y 180 + # CONFIG_PCIEPORTBUS is not set 181 + # CONFIG_PCI_DEBUG is not set 182 + 183 + # 184 + # PCCARD (PCMCIA/CardBus) support 185 + # 186 + # CONFIG_PCCARD is not set 187 + 188 + # 189 + # PCI Hotplug Support 190 + # 191 + # CONFIG_HOTPLUG_PCI is not set 192 + 193 + # 194 + # Advanced setup 195 + # 196 + # CONFIG_ADVANCED_OPTIONS is not set 197 + 198 + # 199 + # Default settings for advanced configuration options are used 200 + # 201 + CONFIG_HIGHMEM_START=0xfe000000 202 + CONFIG_LOWMEM_SIZE=0x30000000 203 + CONFIG_KERNEL_START=0xc0000000 204 + CONFIG_TASK_SIZE=0x80000000 205 + CONFIG_BOOT_LOAD=0x00800000 206 + 207 + # 208 + # Networking 209 + # 210 + CONFIG_NET=y 211 + 212 + # 213 + # Networking options 214 + # 215 + # CONFIG_NETDEBUG is not set 216 + CONFIG_PACKET=y 217 + # CONFIG_PACKET_MMAP is not set 218 + CONFIG_UNIX=y 219 + # CONFIG_NET_KEY is not set 220 + CONFIG_INET=y 221 + CONFIG_IP_MULTICAST=y 222 + # CONFIG_IP_ADVANCED_ROUTER is not set 223 + CONFIG_IP_FIB_HASH=y 224 + # CONFIG_IP_PNP is not set 225 + # CONFIG_NET_IPIP is not set 226 + # CONFIG_NET_IPGRE is not set 227 + # CONFIG_IP_MROUTE is not set 228 + # CONFIG_ARPD is not set 229 + CONFIG_SYN_COOKIES=y 230 + # CONFIG_INET_AH is not set 231 + # CONFIG_INET_ESP is not set 232 + # CONFIG_INET_IPCOMP is not set 233 + # CONFIG_INET_XFRM_TUNNEL is not set 234 + # CONFIG_INET_TUNNEL is not set 235 + # CONFIG_INET_XFRM_MODE_TRANSPORT is not set 236 + # CONFIG_INET_XFRM_MODE_TUNNEL is not set 237 + CONFIG_INET_DIAG=y 238 + CONFIG_INET_TCP_DIAG=y 239 + # CONFIG_TCP_CONG_ADVANCED is not set 240 + CONFIG_TCP_CONG_BIC=y 241 + 242 + # 243 + # IP: Virtual Server Configuration 244 + # 245 + # CONFIG_IP_VS is not set 246 + # CONFIG_IPV6 is not set 247 + # CONFIG_INET6_XFRM_TUNNEL is not set 248 + # CONFIG_INET6_TUNNEL is not set 249 + # CONFIG_NETWORK_SECMARK is not set 250 + CONFIG_NETFILTER=y 251 + # CONFIG_NETFILTER_DEBUG is not set 252 + 253 + # 254 + # Core Netfilter Configuration 255 + # 256 + # CONFIG_NETFILTER_NETLINK is not set 257 + # CONFIG_NETFILTER_XTABLES is not set 258 + 259 + # 260 + # IP: Netfilter Configuration 261 + # 262 + CONFIG_IP_NF_CONNTRACK=m 263 + # CONFIG_IP_NF_CT_ACCT is not set 264 + # CONFIG_IP_NF_CONNTRACK_MARK is not set 265 + # CONFIG_IP_NF_CONNTRACK_EVENTS is not set 266 + # CONFIG_IP_NF_CT_PROTO_SCTP is not set 267 + CONFIG_IP_NF_FTP=m 268 + CONFIG_IP_NF_IRC=m 269 + # CONFIG_IP_NF_NETBIOS_NS is not set 270 + CONFIG_IP_NF_TFTP=m 271 + CONFIG_IP_NF_AMANDA=m 272 + # CONFIG_IP_NF_PPTP is not set 273 + # CONFIG_IP_NF_H323 is not set 274 + # CONFIG_IP_NF_SIP is not set 275 + # CONFIG_IP_NF_QUEUE is not set 276 + 277 + # 278 + # DCCP Configuration (EXPERIMENTAL) 279 + # 280 + # CONFIG_IP_DCCP is not set 281 + 282 + # 283 + # SCTP Configuration (EXPERIMENTAL) 284 + # 285 + # CONFIG_IP_SCTP is not set 286 + 287 + # 288 + # TIPC Configuration (EXPERIMENTAL) 289 + # 290 + # CONFIG_TIPC is not set 291 + # CONFIG_ATM is not set 292 + # CONFIG_BRIDGE is not set 293 + # CONFIG_VLAN_8021Q is not set 294 + # CONFIG_DECNET is not set 295 + # CONFIG_LLC2 is not set 296 + # CONFIG_IPX is not set 297 + # CONFIG_ATALK is not set 298 + # CONFIG_X25 is not set 299 + # CONFIG_LAPB is not set 300 + # CONFIG_NET_DIVERT is not set 301 + # CONFIG_ECONET is not set 302 + # CONFIG_WAN_ROUTER is not set 303 + 304 + # 305 + # QoS and/or fair queueing 306 + # 307 + # CONFIG_NET_SCHED is not set 308 + 309 + # 310 + # Network testing 311 + # 312 + # CONFIG_NET_PKTGEN is not set 313 + # CONFIG_HAMRADIO is not set 314 + # CONFIG_IRDA is not set 315 + # CONFIG_BT is not set 316 + # CONFIG_IEEE80211 is not set 317 + 318 + # 319 + # Device Drivers 320 + # 321 + 322 + # 323 + # Generic Driver Options 324 + # 325 + # CONFIG_STANDALONE is not set 326 + CONFIG_PREVENT_FIRMWARE_BUILD=y 327 + # CONFIG_FW_LOADER is not set 328 + # CONFIG_DEBUG_DRIVER is not set 329 + # CONFIG_SYS_HYPERVISOR is not set 330 + 331 + # 332 + # Connector - unified userspace <-> kernelspace linker 333 + # 334 + # CONFIG_CONNECTOR is not set 335 + 336 + # 337 + # Memory Technology Devices (MTD) 338 + # 339 + # CONFIG_MTD is not set 340 + 341 + # 342 + # Parallel port support 343 + # 344 + # CONFIG_PARPORT is not set 345 + 346 + # 347 + # Plug and Play support 348 + # 349 + # CONFIG_PNP is not set 350 + 351 + # 352 + # Block devices 353 + # 354 + CONFIG_BLK_DEV_FD=y 355 + # CONFIG_BLK_DEV_XD is not set 356 + # CONFIG_BLK_CPQ_DA is not set 357 + # CONFIG_BLK_CPQ_CISS_DA is not set 358 + # CONFIG_BLK_DEV_DAC960 is not set 359 + # CONFIG_BLK_DEV_UMEM is not set 360 + # CONFIG_BLK_DEV_COW_COMMON is not set 361 + CONFIG_BLK_DEV_LOOP=y 362 + # CONFIG_BLK_DEV_CRYPTOLOOP is not set 363 + # CONFIG_BLK_DEV_NBD is not set 364 + # CONFIG_BLK_DEV_SX8 is not set 365 + # CONFIG_BLK_DEV_UB is not set 366 + CONFIG_BLK_DEV_RAM=y 367 + CONFIG_BLK_DEV_RAM_COUNT=16 368 + CONFIG_BLK_DEV_RAM_SIZE=4096 369 + CONFIG_BLK_DEV_INITRD=y 370 + # CONFIG_CDROM_PKTCDVD is not set 371 + # CONFIG_ATA_OVER_ETH is not set 372 + 373 + # 374 + # ATA/ATAPI/MFM/RLL support 375 + # 376 + CONFIG_IDE=y 377 + CONFIG_BLK_DEV_IDE=y 378 + 379 + # 380 + # Please see Documentation/ide.txt for help/info on IDE drives 381 + # 382 + # CONFIG_BLK_DEV_IDE_SATA is not set 383 + CONFIG_BLK_DEV_IDEDISK=y 384 + CONFIG_IDEDISK_MULTI_MODE=y 385 + CONFIG_BLK_DEV_IDECD=y 386 + # CONFIG_BLK_DEV_IDETAPE is not set 387 + # CONFIG_BLK_DEV_IDEFLOPPY is not set 388 + # CONFIG_BLK_DEV_IDESCSI is not set 389 + # CONFIG_IDE_TASK_IOCTL is not set 390 + 391 + # 392 + # IDE chipset support/bugfixes 393 + # 394 + CONFIG_IDE_GENERIC=y 395 + CONFIG_BLK_DEV_IDEPCI=y 396 + CONFIG_IDEPCI_SHARE_IRQ=y 397 + # CONFIG_BLK_DEV_OFFBOARD is not set 398 + CONFIG_BLK_DEV_GENERIC=y 399 + # CONFIG_BLK_DEV_OPTI621 is not set 400 + CONFIG_BLK_DEV_SL82C105=y 401 + CONFIG_BLK_DEV_IDEDMA_PCI=y 402 + # CONFIG_BLK_DEV_IDEDMA_FORCED is not set 403 + CONFIG_IDEDMA_PCI_AUTO=y 404 + # CONFIG_IDEDMA_ONLYDISK is not set 405 + # CONFIG_BLK_DEV_AEC62XX is not set 406 + # CONFIG_BLK_DEV_ALI15X3 is not set 407 + # CONFIG_BLK_DEV_AMD74XX is not set 408 + # CONFIG_BLK_DEV_CMD64X is not set 409 + # CONFIG_BLK_DEV_TRIFLEX is not set 410 + # CONFIG_BLK_DEV_CY82C693 is not set 411 + # CONFIG_BLK_DEV_CS5520 is not set 412 + # CONFIG_BLK_DEV_CS5530 is not set 413 + # CONFIG_BLK_DEV_HPT34X is not set 414 + # CONFIG_BLK_DEV_HPT366 is not set 415 + # CONFIG_BLK_DEV_SC1200 is not set 416 + # CONFIG_BLK_DEV_PIIX is not set 417 + # CONFIG_BLK_DEV_IT821X is not set 418 + # CONFIG_BLK_DEV_NS87415 is not set 419 + # CONFIG_BLK_DEV_PDC202XX_OLD is not set 420 + # CONFIG_BLK_DEV_PDC202XX_NEW is not set 421 + # CONFIG_BLK_DEV_SVWKS is not set 422 + # CONFIG_BLK_DEV_SIIMAGE is not set 423 + # CONFIG_BLK_DEV_SLC90E66 is not set 424 + # CONFIG_BLK_DEV_TRM290 is not set 425 + CONFIG_BLK_DEV_VIA82CXXX=y 426 + # CONFIG_IDE_ARM is not set 427 + # CONFIG_IDE_CHIPSETS is not set 428 + CONFIG_BLK_DEV_IDEDMA=y 429 + # CONFIG_IDEDMA_IVB is not set 430 + CONFIG_IDEDMA_AUTO=y 431 + # CONFIG_BLK_DEV_HD is not set 432 + 433 + # 434 + # SCSI device support 435 + # 436 + # CONFIG_RAID_ATTRS is not set 437 + CONFIG_SCSI=y 438 + CONFIG_SCSI_PROC_FS=y 439 + 440 + # 441 + # SCSI support type (disk, tape, CD-ROM) 442 + # 443 + CONFIG_BLK_DEV_SD=y 444 + CONFIG_CHR_DEV_ST=y 445 + # CONFIG_CHR_DEV_OSST is not set 446 + CONFIG_BLK_DEV_SR=y 447 + CONFIG_BLK_DEV_SR_VENDOR=y 448 + CONFIG_CHR_DEV_SG=y 449 + # CONFIG_CHR_DEV_SCH is not set 450 + 451 + # 452 + # Some SCSI devices (e.g. CD jukebox) support multiple LUNs 453 + # 454 + # CONFIG_SCSI_MULTI_LUN is not set 455 + CONFIG_SCSI_CONSTANTS=y 456 + # CONFIG_SCSI_LOGGING is not set 457 + 458 + # 459 + # SCSI Transport Attributes 460 + # 461 + CONFIG_SCSI_SPI_ATTRS=y 462 + # CONFIG_SCSI_FC_ATTRS is not set 463 + # CONFIG_SCSI_ISCSI_ATTRS is not set 464 + # CONFIG_SCSI_SAS_ATTRS is not set 465 + 466 + # 467 + # SCSI low-level drivers 468 + # 469 + # CONFIG_ISCSI_TCP is not set 470 + # CONFIG_BLK_DEV_3W_XXXX_RAID is not set 471 + # CONFIG_SCSI_3W_9XXX is not set 472 + # CONFIG_SCSI_7000FASST is not set 473 + # CONFIG_SCSI_ACARD is not set 474 + # CONFIG_SCSI_AHA152X is not set 475 + # CONFIG_SCSI_AHA1542 is not set 476 + # CONFIG_SCSI_AACRAID is not set 477 + # CONFIG_SCSI_AIC7XXX is not set 478 + # CONFIG_SCSI_AIC7XXX_OLD is not set 479 + # CONFIG_SCSI_AIC79XX is not set 480 + # CONFIG_SCSI_DPT_I2O is not set 481 + # CONFIG_SCSI_IN2000 is not set 482 + # CONFIG_MEGARAID_NEWGEN is not set 483 + # CONFIG_MEGARAID_LEGACY is not set 484 + # CONFIG_MEGARAID_SAS is not set 485 + # CONFIG_SCSI_SATA is not set 486 + # CONFIG_SCSI_HPTIOP is not set 487 + # CONFIG_SCSI_BUSLOGIC is not set 488 + # CONFIG_SCSI_DMX3191D is not set 489 + # CONFIG_SCSI_DTC3280 is not set 490 + # CONFIG_SCSI_EATA is not set 491 + # CONFIG_SCSI_FUTURE_DOMAIN is not set 492 + # CONFIG_SCSI_GDTH is not set 493 + # CONFIG_SCSI_GENERIC_NCR5380 is not set 494 + # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set 495 + # CONFIG_SCSI_IPS is not set 496 + # CONFIG_SCSI_INITIO is not set 497 + # CONFIG_SCSI_INIA100 is not set 498 + # CONFIG_SCSI_NCR53C406A is not set 499 + CONFIG_SCSI_SYM53C8XX_2=y 500 + CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 501 + CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 502 + CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 503 + CONFIG_SCSI_SYM53C8XX_MMIO=y 504 + # CONFIG_SCSI_IPR is not set 505 + # CONFIG_SCSI_PAS16 is not set 506 + # CONFIG_SCSI_PSI240I is not set 507 + # CONFIG_SCSI_QLOGIC_FAS is not set 508 + # CONFIG_SCSI_QLOGIC_1280 is not set 509 + # CONFIG_SCSI_QLA_FC is not set 510 + # CONFIG_SCSI_LPFC is not set 511 + # CONFIG_SCSI_SYM53C416 is not set 512 + # CONFIG_SCSI_DC395x is not set 513 + # CONFIG_SCSI_DC390T is not set 514 + # CONFIG_SCSI_T128 is not set 515 + # CONFIG_SCSI_U14_34F is not set 516 + # CONFIG_SCSI_NSP32 is not set 517 + # CONFIG_SCSI_DEBUG is not set 518 + 519 + # 520 + # Old CD-ROM drivers (not SCSI, not IDE) 521 + # 522 + # CONFIG_CD_NO_IDESCSI is not set 523 + 524 + # 525 + # Multi-device support (RAID and LVM) 526 + # 527 + # CONFIG_MD is not set 528 + 529 + # 530 + # Fusion MPT device support 531 + # 532 + # CONFIG_FUSION is not set 533 + # CONFIG_FUSION_SPI is not set 534 + # CONFIG_FUSION_FC is not set 535 + # CONFIG_FUSION_SAS is not set 536 + 537 + # 538 + # IEEE 1394 (FireWire) support 539 + # 540 + # CONFIG_IEEE1394 is not set 541 + 542 + # 543 + # I2O device support 544 + # 545 + # CONFIG_I2O is not set 546 + 547 + # 548 + # Macintosh device drivers 549 + # 550 + # CONFIG_WINDFARM is not set 551 + 552 + # 553 + # Network device support 554 + # 555 + CONFIG_NETDEVICES=y 556 + # CONFIG_DUMMY is not set 557 + # CONFIG_BONDING is not set 558 + # CONFIG_EQUALIZER is not set 559 + # CONFIG_TUN is not set 560 + 561 + # 562 + # ARCnet devices 563 + # 564 + # CONFIG_ARCNET is not set 565 + 566 + # 567 + # PHY device support 568 + # 569 + # CONFIG_PHYLIB is not set 570 + 571 + # 572 + # Ethernet (10 or 100Mbit) 573 + # 574 + CONFIG_NET_ETHERNET=y 575 + CONFIG_MII=y 576 + # CONFIG_HAPPYMEAL is not set 577 + # CONFIG_SUNGEM is not set 578 + # CONFIG_CASSINI is not set 579 + # CONFIG_NET_VENDOR_3COM is not set 580 + # CONFIG_LANCE is not set 581 + # CONFIG_NET_VENDOR_SMC is not set 582 + # CONFIG_NET_VENDOR_RACAL is not set 583 + 584 + # 585 + # Tulip family network device support 586 + # 587 + CONFIG_NET_TULIP=y 588 + # CONFIG_DE2104X is not set 589 + # CONFIG_TULIP is not set 590 + CONFIG_DE4X5=y 591 + # CONFIG_WINBOND_840 is not set 592 + # CONFIG_DM9102 is not set 593 + # CONFIG_ULI526X is not set 594 + # CONFIG_AT1700 is not set 595 + # CONFIG_DEPCA is not set 596 + # CONFIG_HP100 is not set 597 + # CONFIG_NET_ISA is not set 598 + CONFIG_NET_PCI=y 599 + CONFIG_PCNET32=y 600 + # CONFIG_AMD8111_ETH is not set 601 + # CONFIG_ADAPTEC_STARFIRE is not set 602 + # CONFIG_AC3200 is not set 603 + # CONFIG_APRICOT is not set 604 + # CONFIG_B44 is not set 605 + # CONFIG_FORCEDETH is not set 606 + # CONFIG_CS89x0 is not set 607 + # CONFIG_DGRS is not set 608 + # CONFIG_EEPRO100 is not set 609 + # CONFIG_E100 is not set 610 + # CONFIG_FEALNX is not set 611 + # CONFIG_NATSEMI is not set 612 + # CONFIG_NE2K_PCI is not set 613 + CONFIG_8139CP=y 614 + CONFIG_8139TOO=y 615 + # CONFIG_8139TOO_PIO is not set 616 + # CONFIG_8139TOO_TUNE_TWISTER is not set 617 + # CONFIG_8139TOO_8129 is not set 618 + # CONFIG_8139_OLD_RX_RESET is not set 619 + # CONFIG_SIS900 is not set 620 + # CONFIG_EPIC100 is not set 621 + # CONFIG_SUNDANCE is not set 622 + # CONFIG_TLAN is not set 623 + CONFIG_VIA_RHINE=y 624 + # CONFIG_VIA_RHINE_MMIO is not set 625 + 626 + # 627 + # Ethernet (1000 Mbit) 628 + # 629 + # CONFIG_ACENIC is not set 630 + # CONFIG_DL2K is not set 631 + # CONFIG_E1000 is not set 632 + # CONFIG_NS83820 is not set 633 + # CONFIG_HAMACHI is not set 634 + # CONFIG_YELLOWFIN is not set 635 + # CONFIG_R8169 is not set 636 + # CONFIG_SIS190 is not set 637 + # CONFIG_SKGE is not set 638 + # CONFIG_SKY2 is not set 639 + # CONFIG_SK98LIN is not set 640 + # CONFIG_VIA_VELOCITY is not set 641 + # CONFIG_TIGON3 is not set 642 + # CONFIG_BNX2 is not set 643 + CONFIG_MV643XX_ETH=y 644 + # CONFIG_MV643XX_ETH_0 is not set 645 + # CONFIG_MV643XX_ETH_1 is not set 646 + # CONFIG_MV643XX_ETH_2 is not set 647 + 648 + # 649 + # Ethernet (10000 Mbit) 650 + # 651 + # CONFIG_CHELSIO_T1 is not set 652 + # CONFIG_IXGB is not set 653 + # CONFIG_S2IO is not set 654 + # CONFIG_MYRI10GE is not set 655 + 656 + # 657 + # Token Ring devices 658 + # 659 + # CONFIG_TR is not set 660 + 661 + # 662 + # Wireless LAN (non-hamradio) 663 + # 664 + # CONFIG_NET_RADIO is not set 665 + 666 + # 667 + # Wan interfaces 668 + # 669 + # CONFIG_WAN is not set 670 + # CONFIG_FDDI is not set 671 + # CONFIG_HIPPI is not set 672 + CONFIG_PPP=m 673 + CONFIG_PPP_MULTILINK=y 674 + CONFIG_PPP_FILTER=y 675 + CONFIG_PPP_ASYNC=m 676 + CONFIG_PPP_SYNC_TTY=m 677 + CONFIG_PPP_DEFLATE=m 678 + CONFIG_PPP_BSDCOMP=m 679 + CONFIG_PPP_MPPE=m 680 + CONFIG_PPPOE=m 681 + # CONFIG_SLIP is not set 682 + # CONFIG_NET_FC is not set 683 + # CONFIG_SHAPER is not set 684 + # CONFIG_NETCONSOLE is not set 685 + # CONFIG_NETPOLL is not set 686 + # CONFIG_NET_POLL_CONTROLLER is not set 687 + 688 + # 689 + # ISDN subsystem 690 + # 691 + # CONFIG_ISDN is not set 692 + 693 + # 694 + # Telephony Support 695 + # 696 + # CONFIG_PHONE is not set 697 + 698 + # 699 + # Input device support 700 + # 701 + CONFIG_INPUT=y 702 + 703 + # 704 + # Userland interfaces 705 + # 706 + CONFIG_INPUT_MOUSEDEV=y 707 + CONFIG_INPUT_MOUSEDEV_PSAUX=y 708 + CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 709 + CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 710 + # CONFIG_INPUT_JOYDEV is not set 711 + # CONFIG_INPUT_TSDEV is not set 712 + CONFIG_INPUT_EVDEV=y 713 + # CONFIG_INPUT_EVBUG is not set 714 + 715 + # 716 + # Input Device Drivers 717 + # 718 + CONFIG_INPUT_KEYBOARD=y 719 + CONFIG_KEYBOARD_ATKBD=y 720 + # CONFIG_KEYBOARD_SUNKBD is not set 721 + # CONFIG_KEYBOARD_LKKBD is not set 722 + # CONFIG_KEYBOARD_XTKBD is not set 723 + # CONFIG_KEYBOARD_NEWTON is not set 724 + CONFIG_INPUT_MOUSE=y 725 + CONFIG_MOUSE_PS2=y 726 + # CONFIG_MOUSE_SERIAL is not set 727 + # CONFIG_MOUSE_INPORT is not set 728 + # CONFIG_MOUSE_LOGIBM is not set 729 + # CONFIG_MOUSE_PC110PAD is not set 730 + # CONFIG_MOUSE_VSXXXAA is not set 731 + # CONFIG_INPUT_JOYSTICK is not set 732 + # CONFIG_INPUT_TOUCHSCREEN is not set 733 + CONFIG_INPUT_MISC=y 734 + # CONFIG_INPUT_PCSPKR is not set 735 + CONFIG_INPUT_UINPUT=y 736 + 737 + # 738 + # Hardware I/O ports 739 + # 740 + CONFIG_SERIO=y 741 + CONFIG_SERIO_I8042=y 742 + CONFIG_SERIO_SERPORT=y 743 + # CONFIG_SERIO_PCIPS2 is not set 744 + CONFIG_SERIO_LIBPS2=y 745 + # CONFIG_SERIO_RAW is not set 746 + # CONFIG_GAMEPORT is not set 747 + 748 + # 749 + # Character devices 750 + # 751 + CONFIG_VT=y 752 + CONFIG_VT_CONSOLE=y 753 + CONFIG_HW_CONSOLE=y 754 + # CONFIG_SERIAL_NONSTANDARD is not set 755 + 756 + # 757 + # Serial drivers 758 + # 759 + CONFIG_SERIAL_8250=y 760 + CONFIG_SERIAL_8250_CONSOLE=y 761 + CONFIG_SERIAL_8250_PCI=y 762 + CONFIG_SERIAL_8250_NR_UARTS=4 763 + CONFIG_SERIAL_8250_RUNTIME_UARTS=4 764 + # CONFIG_SERIAL_8250_EXTENDED is not set 765 + 766 + # 767 + # Non-8250 serial port support 768 + # 769 + CONFIG_SERIAL_CORE=y 770 + CONFIG_SERIAL_CORE_CONSOLE=y 771 + # CONFIG_SERIAL_JSM is not set 772 + CONFIG_UNIX98_PTYS=y 773 + CONFIG_LEGACY_PTYS=y 774 + CONFIG_LEGACY_PTY_COUNT=256 775 + # CONFIG_HVC_RTAS is not set 776 + 777 + # 778 + # IPMI 779 + # 780 + # CONFIG_IPMI_HANDLER is not set 781 + 782 + # 783 + # Watchdog Cards 784 + # 785 + # CONFIG_WATCHDOG is not set 786 + CONFIG_NVRAM=y 787 + CONFIG_GEN_RTC=y 788 + # CONFIG_GEN_RTC_X is not set 789 + # CONFIG_DTLK is not set 790 + # CONFIG_R3964 is not set 791 + # CONFIG_APPLICOM is not set 792 + 793 + # 794 + # Ftape, the floppy tape device driver 795 + # 796 + # CONFIG_AGP is not set 797 + # CONFIG_DRM is not set 798 + # CONFIG_RAW_DRIVER is not set 799 + 800 + # 801 + # TPM devices 802 + # 803 + # CONFIG_TCG_TPM is not set 804 + # CONFIG_TELCLOCK is not set 805 + 806 + # 807 + # I2C support 808 + # 809 + CONFIG_I2C=y 810 + # CONFIG_I2C_CHARDEV is not set 811 + 812 + # 813 + # I2C Algorithms 814 + # 815 + CONFIG_I2C_ALGOBIT=y 816 + # CONFIG_I2C_ALGOPCF is not set 817 + # CONFIG_I2C_ALGOPCA is not set 818 + 819 + # 820 + # I2C Hardware Bus support 821 + # 822 + # CONFIG_I2C_ALI1535 is not set 823 + # CONFIG_I2C_ALI1563 is not set 824 + # CONFIG_I2C_ALI15X3 is not set 825 + # CONFIG_I2C_AMD756 is not set 826 + # CONFIG_I2C_AMD8111 is not set 827 + # CONFIG_I2C_HYDRA is not set 828 + # CONFIG_I2C_I801 is not set 829 + # CONFIG_I2C_I810 is not set 830 + # CONFIG_I2C_PIIX4 is not set 831 + # CONFIG_I2C_MPC is not set 832 + # CONFIG_I2C_NFORCE2 is not set 833 + # CONFIG_I2C_OCORES is not set 834 + # CONFIG_I2C_PARPORT_LIGHT is not set 835 + # CONFIG_I2C_PROSAVAGE is not set 836 + # CONFIG_I2C_SAVAGE4 is not set 837 + # CONFIG_I2C_SIS5595 is not set 838 + # CONFIG_I2C_SIS630 is not set 839 + # CONFIG_I2C_SIS96X is not set 840 + # CONFIG_I2C_STUB is not set 841 + # CONFIG_I2C_VIA is not set 842 + # CONFIG_I2C_VIAPRO is not set 843 + # CONFIG_I2C_VOODOO3 is not set 844 + # CONFIG_I2C_PCA_ISA is not set 845 + 846 + # 847 + # Miscellaneous I2C Chip support 848 + # 849 + # CONFIG_SENSORS_DS1337 is not set 850 + # CONFIG_SENSORS_DS1374 is not set 851 + # CONFIG_SENSORS_EEPROM is not set 852 + # CONFIG_SENSORS_PCF8574 is not set 853 + # CONFIG_SENSORS_PCA9539 is not set 854 + # CONFIG_SENSORS_PCF8591 is not set 855 + # CONFIG_SENSORS_M41T00 is not set 856 + # CONFIG_SENSORS_MAX6875 is not set 857 + # CONFIG_I2C_DEBUG_CORE is not set 858 + # CONFIG_I2C_DEBUG_ALGO is not set 859 + # CONFIG_I2C_DEBUG_BUS is not set 860 + # CONFIG_I2C_DEBUG_CHIP is not set 861 + 862 + # 863 + # SPI support 864 + # 865 + # CONFIG_SPI is not set 866 + # CONFIG_SPI_MASTER is not set 867 + 868 + # 869 + # Dallas's 1-wire bus 870 + # 871 + 872 + # 873 + # Hardware Monitoring support 874 + # 875 + # CONFIG_HWMON is not set 876 + # CONFIG_HWMON_VID is not set 877 + 878 + # 879 + # Misc devices 880 + # 881 + 882 + # 883 + # Multimedia devices 884 + # 885 + # CONFIG_VIDEO_DEV is not set 886 + CONFIG_VIDEO_V4L2=y 887 + 888 + # 889 + # Digital Video Broadcasting Devices 890 + # 891 + # CONFIG_DVB is not set 892 + # CONFIG_USB_DABUSB is not set 893 + 894 + # 895 + # Graphics support 896 + # 897 + CONFIG_FB=y 898 + CONFIG_FB_CFB_FILLRECT=y 899 + CONFIG_FB_CFB_COPYAREA=y 900 + CONFIG_FB_CFB_IMAGEBLIT=y 901 + CONFIG_FB_MACMODES=y 902 + CONFIG_FB_FIRMWARE_EDID=y 903 + # CONFIG_FB_BACKLIGHT is not set 904 + CONFIG_FB_MODE_HELPERS=y 905 + CONFIG_FB_TILEBLITTING=y 906 + # CONFIG_FB_CIRRUS is not set 907 + # CONFIG_FB_PM2 is not set 908 + # CONFIG_FB_CYBER2000 is not set 909 + CONFIG_FB_OF=y 910 + # CONFIG_FB_CT65550 is not set 911 + # CONFIG_FB_ASILIANT is not set 912 + # CONFIG_FB_IMSTT is not set 913 + # CONFIG_FB_VGA16 is not set 914 + # CONFIG_FB_S1D13XXX is not set 915 + # CONFIG_FB_NVIDIA is not set 916 + # CONFIG_FB_RIVA is not set 917 + CONFIG_FB_MATROX=y 918 + CONFIG_FB_MATROX_MILLENIUM=y 919 + CONFIG_FB_MATROX_MYSTIQUE=y 920 + CONFIG_FB_MATROX_G=y 921 + # CONFIG_FB_MATROX_I2C is not set 922 + # CONFIG_FB_MATROX_MULTIHEAD is not set 923 + CONFIG_FB_RADEON=y 924 + CONFIG_FB_RADEON_I2C=y 925 + # CONFIG_FB_RADEON_DEBUG is not set 926 + # CONFIG_FB_ATY128 is not set 927 + CONFIG_FB_ATY=y 928 + CONFIG_FB_ATY_CT=y 929 + # CONFIG_FB_ATY_GENERIC_LCD is not set 930 + CONFIG_FB_ATY_GX=y 931 + # CONFIG_FB_SAVAGE is not set 932 + # CONFIG_FB_SIS is not set 933 + # CONFIG_FB_NEOMAGIC is not set 934 + # CONFIG_FB_KYRO is not set 935 + CONFIG_FB_3DFX=y 936 + # CONFIG_FB_3DFX_ACCEL is not set 937 + # CONFIG_FB_VOODOO1 is not set 938 + # CONFIG_FB_TRIDENT is not set 939 + # CONFIG_FB_VIRTUAL is not set 940 + 941 + # 942 + # Console display driver support 943 + # 944 + CONFIG_VGA_CONSOLE=y 945 + # CONFIG_VGACON_SOFT_SCROLLBACK is not set 946 + # CONFIG_MDA_CONSOLE is not set 947 + CONFIG_DUMMY_CONSOLE=y 948 + CONFIG_FRAMEBUFFER_CONSOLE=y 949 + # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set 950 + # CONFIG_FONTS is not set 951 + CONFIG_FONT_8x8=y 952 + CONFIG_FONT_8x16=y 953 + 954 + # 955 + # Logo configuration 956 + # 957 + CONFIG_LOGO=y 958 + CONFIG_LOGO_LINUX_MONO=y 959 + CONFIG_LOGO_LINUX_VGA16=y 960 + CONFIG_LOGO_LINUX_CLUT224=y 961 + # CONFIG_BACKLIGHT_LCD_SUPPORT is not set 962 + 963 + # 964 + # Sound 965 + # 966 + # CONFIG_SOUND is not set 967 + 968 + # 969 + # USB support 970 + # 971 + CONFIG_USB_ARCH_HAS_HCD=y 972 + CONFIG_USB_ARCH_HAS_OHCI=y 973 + CONFIG_USB_ARCH_HAS_EHCI=y 974 + CONFIG_USB=y 975 + # CONFIG_USB_DEBUG is not set 976 + 977 + # 978 + # Miscellaneous USB options 979 + # 980 + CONFIG_USB_DEVICEFS=y 981 + # CONFIG_USB_BANDWIDTH is not set 982 + # CONFIG_USB_DYNAMIC_MINORS is not set 983 + # CONFIG_USB_OTG is not set 984 + 985 + # 986 + # USB Host Controller Drivers 987 + # 988 + CONFIG_USB_EHCI_HCD=m 989 + # CONFIG_USB_EHCI_SPLIT_ISO is not set 990 + # CONFIG_USB_EHCI_ROOT_HUB_TT is not set 991 + # CONFIG_USB_EHCI_TT_NEWSCHED is not set 992 + # CONFIG_USB_ISP116X_HCD is not set 993 + CONFIG_USB_OHCI_HCD=y 994 + # CONFIG_USB_OHCI_BIG_ENDIAN is not set 995 + CONFIG_USB_OHCI_LITTLE_ENDIAN=y 996 + CONFIG_USB_UHCI_HCD=y 997 + # CONFIG_USB_SL811_HCD is not set 998 + 999 + # 1000 + # USB Device Class drivers 1001 + # 1002 + # CONFIG_USB_ACM is not set 1003 + # CONFIG_USB_PRINTER is not set 1004 + 1005 + # 1006 + # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1007 + # 1008 + 1009 + # 1010 + # may also be needed; see USB_STORAGE Help for more information 1011 + # 1012 + CONFIG_USB_STORAGE=m 1013 + # CONFIG_USB_STORAGE_DEBUG is not set 1014 + # CONFIG_USB_STORAGE_DATAFAB is not set 1015 + # CONFIG_USB_STORAGE_FREECOM is not set 1016 + # CONFIG_USB_STORAGE_ISD200 is not set 1017 + # CONFIG_USB_STORAGE_DPCM is not set 1018 + # CONFIG_USB_STORAGE_USBAT is not set 1019 + # CONFIG_USB_STORAGE_SDDR09 is not set 1020 + # CONFIG_USB_STORAGE_SDDR55 is not set 1021 + # CONFIG_USB_STORAGE_JUMPSHOT is not set 1022 + # CONFIG_USB_STORAGE_ALAUDA is not set 1023 + # CONFIG_USB_STORAGE_ONETOUCH is not set 1024 + # CONFIG_USB_LIBUSUAL is not set 1025 + 1026 + # 1027 + # USB Input Devices 1028 + # 1029 + CONFIG_USB_HID=y 1030 + CONFIG_USB_HIDINPUT=y 1031 + # CONFIG_USB_HIDINPUT_POWERBOOK is not set 1032 + # CONFIG_HID_FF is not set 1033 + # CONFIG_USB_HIDDEV is not set 1034 + # CONFIG_USB_AIPTEK is not set 1035 + # CONFIG_USB_WACOM is not set 1036 + # CONFIG_USB_ACECAD is not set 1037 + # CONFIG_USB_KBTAB is not set 1038 + # CONFIG_USB_POWERMATE is not set 1039 + # CONFIG_USB_TOUCHSCREEN is not set 1040 + # CONFIG_USB_YEALINK is not set 1041 + # CONFIG_USB_XPAD is not set 1042 + # CONFIG_USB_ATI_REMOTE is not set 1043 + # CONFIG_USB_ATI_REMOTE2 is not set 1044 + # CONFIG_USB_KEYSPAN_REMOTE is not set 1045 + # CONFIG_USB_APPLETOUCH is not set 1046 + 1047 + # 1048 + # USB Imaging devices 1049 + # 1050 + # CONFIG_USB_MDC800 is not set 1051 + # CONFIG_USB_MICROTEK is not set 1052 + 1053 + # 1054 + # USB Network Adapters 1055 + # 1056 + # CONFIG_USB_CATC is not set 1057 + # CONFIG_USB_KAWETH is not set 1058 + # CONFIG_USB_PEGASUS is not set 1059 + # CONFIG_USB_RTL8150 is not set 1060 + # CONFIG_USB_USBNET is not set 1061 + CONFIG_USB_MON=y 1062 + 1063 + # 1064 + # USB port drivers 1065 + # 1066 + 1067 + # 1068 + # USB Serial Converter support 1069 + # 1070 + # CONFIG_USB_SERIAL is not set 1071 + 1072 + # 1073 + # USB Miscellaneous drivers 1074 + # 1075 + # CONFIG_USB_EMI62 is not set 1076 + # CONFIG_USB_EMI26 is not set 1077 + # CONFIG_USB_AUERSWALD is not set 1078 + # CONFIG_USB_RIO500 is not set 1079 + # CONFIG_USB_LEGOTOWER is not set 1080 + # CONFIG_USB_LCD is not set 1081 + # CONFIG_USB_LED is not set 1082 + # CONFIG_USB_CY7C63 is not set 1083 + # CONFIG_USB_CYTHERM is not set 1084 + # CONFIG_USB_PHIDGETKIT is not set 1085 + # CONFIG_USB_PHIDGETSERVO is not set 1086 + # CONFIG_USB_IDMOUSE is not set 1087 + # CONFIG_USB_APPLEDISPLAY is not set 1088 + # CONFIG_USB_SISUSBVGA is not set 1089 + # CONFIG_USB_LD is not set 1090 + # CONFIG_USB_TEST is not set 1091 + 1092 + # 1093 + # USB DSL modem support 1094 + # 1095 + 1096 + # 1097 + # USB Gadget Support 1098 + # 1099 + # CONFIG_USB_GADGET is not set 1100 + 1101 + # 1102 + # MMC/SD Card support 1103 + # 1104 + # CONFIG_MMC is not set 1105 + 1106 + # 1107 + # LED devices 1108 + # 1109 + # CONFIG_NEW_LEDS is not set 1110 + 1111 + # 1112 + # LED drivers 1113 + # 1114 + 1115 + # 1116 + # LED Triggers 1117 + # 1118 + 1119 + # 1120 + # InfiniBand support 1121 + # 1122 + # CONFIG_INFINIBAND is not set 1123 + 1124 + # 1125 + # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1126 + # 1127 + 1128 + # 1129 + # Real Time Clock 1130 + # 1131 + # CONFIG_RTC_CLASS is not set 1132 + 1133 + # 1134 + # DMA Engine support 1135 + # 1136 + # CONFIG_DMA_ENGINE is not set 1137 + 1138 + # 1139 + # DMA Clients 1140 + # 1141 + 1142 + # 1143 + # DMA Devices 1144 + # 1145 + 1146 + # 1147 + # File systems 1148 + # 1149 + CONFIG_EXT2_FS=y 1150 + # CONFIG_EXT2_FS_XATTR is not set 1151 + # CONFIG_EXT2_FS_XIP is not set 1152 + CONFIG_EXT3_FS=y 1153 + CONFIG_EXT3_FS_XATTR=y 1154 + # CONFIG_EXT3_FS_POSIX_ACL is not set 1155 + # CONFIG_EXT3_FS_SECURITY is not set 1156 + CONFIG_JBD=y 1157 + # CONFIG_JBD_DEBUG is not set 1158 + CONFIG_FS_MBCACHE=y 1159 + # CONFIG_REISERFS_FS is not set 1160 + # CONFIG_JFS_FS is not set 1161 + # CONFIG_FS_POSIX_ACL is not set 1162 + # CONFIG_XFS_FS is not set 1163 + # CONFIG_OCFS2_FS is not set 1164 + # CONFIG_MINIX_FS is not set 1165 + # CONFIG_ROMFS_FS is not set 1166 + CONFIG_INOTIFY=y 1167 + CONFIG_INOTIFY_USER=y 1168 + # CONFIG_QUOTA is not set 1169 + CONFIG_DNOTIFY=y 1170 + # CONFIG_AUTOFS_FS is not set 1171 + # CONFIG_AUTOFS4_FS is not set 1172 + # CONFIG_FUSE_FS is not set 1173 + 1174 + # 1175 + # CD-ROM/DVD Filesystems 1176 + # 1177 + CONFIG_ISO9660_FS=y 1178 + # CONFIG_JOLIET is not set 1179 + # CONFIG_ZISOFS is not set 1180 + # CONFIG_UDF_FS is not set 1181 + 1182 + # 1183 + # DOS/FAT/NT Filesystems 1184 + # 1185 + CONFIG_FAT_FS=m 1186 + CONFIG_MSDOS_FS=m 1187 + CONFIG_VFAT_FS=m 1188 + CONFIG_FAT_DEFAULT_CODEPAGE=437 1189 + CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" 1190 + # CONFIG_NTFS_FS is not set 1191 + 1192 + # 1193 + # Pseudo filesystems 1194 + # 1195 + CONFIG_PROC_FS=y 1196 + CONFIG_PROC_KCORE=y 1197 + CONFIG_SYSFS=y 1198 + CONFIG_TMPFS=y 1199 + # CONFIG_HUGETLB_PAGE is not set 1200 + CONFIG_RAMFS=y 1201 + # CONFIG_CONFIGFS_FS is not set 1202 + 1203 + # 1204 + # Miscellaneous filesystems 1205 + # 1206 + # CONFIG_ADFS_FS is not set 1207 + # CONFIG_AFFS_FS is not set 1208 + # CONFIG_HFS_FS is not set 1209 + # CONFIG_HFSPLUS_FS is not set 1210 + # CONFIG_BEFS_FS is not set 1211 + # CONFIG_BFS_FS is not set 1212 + # CONFIG_EFS_FS is not set 1213 + # CONFIG_CRAMFS is not set 1214 + # CONFIG_VXFS_FS is not set 1215 + # CONFIG_HPFS_FS is not set 1216 + # CONFIG_QNX4FS_FS is not set 1217 + # CONFIG_SYSV_FS is not set 1218 + # CONFIG_UFS_FS is not set 1219 + 1220 + # 1221 + # Network File Systems 1222 + # 1223 + # CONFIG_NFS_FS is not set 1224 + # CONFIG_NFSD is not set 1225 + # CONFIG_SMB_FS is not set 1226 + # CONFIG_CIFS is not set 1227 + # CONFIG_NCP_FS is not set 1228 + # CONFIG_CODA_FS is not set 1229 + # CONFIG_AFS_FS is not set 1230 + # CONFIG_9P_FS is not set 1231 + 1232 + # 1233 + # Partition Types 1234 + # 1235 + CONFIG_PARTITION_ADVANCED=y 1236 + # CONFIG_ACORN_PARTITION is not set 1237 + # CONFIG_OSF_PARTITION is not set 1238 + # CONFIG_AMIGA_PARTITION is not set 1239 + # CONFIG_ATARI_PARTITION is not set 1240 + CONFIG_MAC_PARTITION=y 1241 + CONFIG_MSDOS_PARTITION=y 1242 + # CONFIG_BSD_DISKLABEL is not set 1243 + # CONFIG_MINIX_SUBPARTITION is not set 1244 + # CONFIG_SOLARIS_X86_PARTITION is not set 1245 + # CONFIG_UNIXWARE_DISKLABEL is not set 1246 + # CONFIG_LDM_PARTITION is not set 1247 + # CONFIG_SGI_PARTITION is not set 1248 + # CONFIG_ULTRIX_PARTITION is not set 1249 + # CONFIG_SUN_PARTITION is not set 1250 + # CONFIG_KARMA_PARTITION is not set 1251 + # CONFIG_EFI_PARTITION is not set 1252 + 1253 + # 1254 + # Native Language Support 1255 + # 1256 + CONFIG_NLS=y 1257 + CONFIG_NLS_DEFAULT="iso8859-1" 1258 + # CONFIG_NLS_CODEPAGE_437 is not set 1259 + # CONFIG_NLS_CODEPAGE_737 is not set 1260 + # CONFIG_NLS_CODEPAGE_775 is not set 1261 + # CONFIG_NLS_CODEPAGE_850 is not set 1262 + # CONFIG_NLS_CODEPAGE_852 is not set 1263 + # CONFIG_NLS_CODEPAGE_855 is not set 1264 + # CONFIG_NLS_CODEPAGE_857 is not set 1265 + # CONFIG_NLS_CODEPAGE_860 is not set 1266 + # CONFIG_NLS_CODEPAGE_861 is not set 1267 + # CONFIG_NLS_CODEPAGE_862 is not set 1268 + # CONFIG_NLS_CODEPAGE_863 is not set 1269 + # CONFIG_NLS_CODEPAGE_864 is not set 1270 + # CONFIG_NLS_CODEPAGE_865 is not set 1271 + # CONFIG_NLS_CODEPAGE_866 is not set 1272 + # CONFIG_NLS_CODEPAGE_869 is not set 1273 + # CONFIG_NLS_CODEPAGE_936 is not set 1274 + # CONFIG_NLS_CODEPAGE_950 is not set 1275 + # CONFIG_NLS_CODEPAGE_932 is not set 1276 + # CONFIG_NLS_CODEPAGE_949 is not set 1277 + # CONFIG_NLS_CODEPAGE_874 is not set 1278 + # CONFIG_NLS_ISO8859_8 is not set 1279 + # CONFIG_NLS_CODEPAGE_1250 is not set 1280 + # CONFIG_NLS_CODEPAGE_1251 is not set 1281 + CONFIG_NLS_ASCII=y 1282 + CONFIG_NLS_ISO8859_1=m 1283 + # CONFIG_NLS_ISO8859_2 is not set 1284 + # CONFIG_NLS_ISO8859_3 is not set 1285 + # CONFIG_NLS_ISO8859_4 is not set 1286 + # CONFIG_NLS_ISO8859_5 is not set 1287 + # CONFIG_NLS_ISO8859_6 is not set 1288 + # CONFIG_NLS_ISO8859_7 is not set 1289 + # CONFIG_NLS_ISO8859_9 is not set 1290 + # CONFIG_NLS_ISO8859_13 is not set 1291 + # CONFIG_NLS_ISO8859_14 is not set 1292 + # CONFIG_NLS_ISO8859_15 is not set 1293 + # CONFIG_NLS_KOI8_R is not set 1294 + # CONFIG_NLS_KOI8_U is not set 1295 + # CONFIG_NLS_UTF8 is not set 1296 + 1297 + # 1298 + # Library routines 1299 + # 1300 + CONFIG_CRC_CCITT=m 1301 + # CONFIG_CRC16 is not set 1302 + CONFIG_CRC32=y 1303 + # CONFIG_LIBCRC32C is not set 1304 + CONFIG_ZLIB_INFLATE=m 1305 + CONFIG_ZLIB_DEFLATE=m 1306 + CONFIG_TEXTSEARCH=y 1307 + CONFIG_TEXTSEARCH_KMP=m 1308 + 1309 + # 1310 + # Instrumentation Support 1311 + # 1312 + # CONFIG_PROFILING is not set 1313 + 1314 + # 1315 + # Kernel hacking 1316 + # 1317 + # CONFIG_PRINTK_TIME is not set 1318 + CONFIG_MAGIC_SYSRQ=y 1319 + CONFIG_DEBUG_KERNEL=y 1320 + CONFIG_LOG_BUF_SHIFT=15 1321 + CONFIG_DETECT_SOFTLOCKUP=y 1322 + # CONFIG_SCHEDSTATS is not set 1323 + # CONFIG_DEBUG_SLAB is not set 1324 + CONFIG_DEBUG_MUTEXES=y 1325 + # CONFIG_DEBUG_SPINLOCK is not set 1326 + CONFIG_DEBUG_SPINLOCK_SLEEP=y 1327 + # CONFIG_DEBUG_KOBJECT is not set 1328 + # CONFIG_DEBUG_HIGHMEM is not set 1329 + # CONFIG_DEBUG_INFO is not set 1330 + # CONFIG_DEBUG_FS is not set 1331 + # CONFIG_DEBUG_VM is not set 1332 + CONFIG_FORCED_INLINING=y 1333 + # CONFIG_RCU_TORTURE_TEST is not set 1334 + CONFIG_DEBUGGER=y 1335 + CONFIG_XMON=y 1336 + CONFIG_XMON_DEFAULT=y 1337 + # CONFIG_BDI_SWITCH is not set 1338 + # CONFIG_BOOTX_TEXT is not set 1339 + # CONFIG_PPC_EARLY_DEBUG is not set 1340 + 1341 + # 1342 + # Security options 1343 + # 1344 + # CONFIG_KEYS is not set 1345 + # CONFIG_SECURITY is not set 1346 + 1347 + # 1348 + # Cryptographic options 1349 + # 1350 + CONFIG_CRYPTO=y 1351 + # CONFIG_CRYPTO_HMAC is not set 1352 + # CONFIG_CRYPTO_NULL is not set 1353 + # CONFIG_CRYPTO_MD4 is not set 1354 + # CONFIG_CRYPTO_MD5 is not set 1355 + CONFIG_CRYPTO_SHA1=m 1356 + # CONFIG_CRYPTO_SHA256 is not set 1357 + # CONFIG_CRYPTO_SHA512 is not set 1358 + # CONFIG_CRYPTO_WP512 is not set 1359 + # CONFIG_CRYPTO_TGR192 is not set 1360 + # CONFIG_CRYPTO_DES is not set 1361 + # CONFIG_CRYPTO_BLOWFISH is not set 1362 + # CONFIG_CRYPTO_TWOFISH is not set 1363 + # CONFIG_CRYPTO_SERPENT is not set 1364 + # CONFIG_CRYPTO_AES is not set 1365 + # CONFIG_CRYPTO_CAST5 is not set 1366 + # CONFIG_CRYPTO_CAST6 is not set 1367 + # CONFIG_CRYPTO_TEA is not set 1368 + CONFIG_CRYPTO_ARC4=m 1369 + # CONFIG_CRYPTO_KHAZAD is not set 1370 + # CONFIG_CRYPTO_ANUBIS is not set 1371 + # CONFIG_CRYPTO_DEFLATE is not set 1372 + # CONFIG_CRYPTO_MICHAEL_MIC is not set 1373 + # CONFIG_CRYPTO_CRC32C is not set 1374 + # CONFIG_CRYPTO_TEST is not set 1375 + 1376 + # 1377 + # Hardware crypto devices 1378 + #
+1336
arch/powerpc/configs/mpc834x_itx_defconfig
··· 1 + # 2 + # Automatically generated make config: don't edit 3 + # Linux kernel version: 2.6.17 4 + # Fri Jun 30 17:53:25 2006 5 + # 6 + # CONFIG_PPC64 is not set 7 + CONFIG_PPC32=y 8 + CONFIG_PPC_MERGE=y 9 + CONFIG_MMU=y 10 + CONFIG_GENERIC_HARDIRQS=y 11 + CONFIG_IRQ_PER_CPU=y 12 + CONFIG_RWSEM_XCHGADD_ALGORITHM=y 13 + CONFIG_GENERIC_HWEIGHT=y 14 + CONFIG_GENERIC_CALIBRATE_DELAY=y 15 + CONFIG_GENERIC_FIND_NEXT_BIT=y 16 + CONFIG_PPC=y 17 + CONFIG_EARLY_PRINTK=y 18 + CONFIG_GENERIC_NVRAM=y 19 + CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y 20 + CONFIG_ARCH_MAY_HAVE_PC_FDC=y 21 + CONFIG_PPC_OF=y 22 + CONFIG_PPC_UDBG_16550=y 23 + # CONFIG_GENERIC_TBSYNC is not set 24 + CONFIG_DEFAULT_UIMAGE=y 25 + 26 + # 27 + # Processor support 28 + # 29 + # CONFIG_CLASSIC32 is not set 30 + # CONFIG_PPC_52xx is not set 31 + # CONFIG_PPC_82xx is not set 32 + CONFIG_PPC_83xx=y 33 + # CONFIG_PPC_85xx is not set 34 + # CONFIG_PPC_86xx is not set 35 + # CONFIG_40x is not set 36 + # CONFIG_44x is not set 37 + # CONFIG_8xx is not set 38 + # CONFIG_E200 is not set 39 + CONFIG_6xx=y 40 + CONFIG_83xx=y 41 + CONFIG_PPC_FPU=y 42 + CONFIG_PPC_STD_MMU=y 43 + CONFIG_PPC_STD_MMU_32=y 44 + # CONFIG_SMP is not set 45 + CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 46 + 47 + # 48 + # Code maturity level options 49 + # 50 + CONFIG_EXPERIMENTAL=y 51 + CONFIG_BROKEN_ON_SMP=y 52 + CONFIG_INIT_ENV_ARG_LIMIT=32 53 + 54 + # 55 + # General setup 56 + # 57 + CONFIG_LOCALVERSION="" 58 + CONFIG_LOCALVERSION_AUTO=y 59 + CONFIG_SWAP=y 60 + CONFIG_SYSVIPC=y 61 + # CONFIG_POSIX_MQUEUE is not set 62 + # CONFIG_BSD_PROCESS_ACCT is not set 63 + CONFIG_SYSCTL=y 64 + # CONFIG_AUDIT is not set 65 + # CONFIG_IKCONFIG is not set 66 + # CONFIG_RELAY is not set 67 + CONFIG_INITRAMFS_SOURCE="" 68 + # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 69 + CONFIG_EMBEDDED=y 70 + # CONFIG_KALLSYMS is not set 71 + CONFIG_HOTPLUG=y 72 + CONFIG_PRINTK=y 73 + CONFIG_BUG=y 74 + CONFIG_ELF_CORE=y 75 + CONFIG_BASE_FULL=y 76 + CONFIG_RT_MUTEXES=y 77 + CONFIG_FUTEX=y 78 + # CONFIG_EPOLL is not set 79 + CONFIG_SHMEM=y 80 + CONFIG_SLAB=y 81 + # CONFIG_TINY_SHMEM is not set 82 + CONFIG_BASE_SMALL=0 83 + # CONFIG_SLOB is not set 84 + 85 + # 86 + # Loadable module support 87 + # 88 + CONFIG_MODULES=y 89 + CONFIG_MODULE_UNLOAD=y 90 + # CONFIG_MODULE_FORCE_UNLOAD is not set 91 + # CONFIG_MODVERSIONS is not set 92 + # CONFIG_MODULE_SRCVERSION_ALL is not set 93 + # CONFIG_KMOD is not set 94 + 95 + # 96 + # Block layer 97 + # 98 + # CONFIG_LBD is not set 99 + # CONFIG_BLK_DEV_IO_TRACE is not set 100 + # CONFIG_LSF is not set 101 + 102 + # 103 + # IO Schedulers 104 + # 105 + CONFIG_IOSCHED_NOOP=y 106 + CONFIG_IOSCHED_AS=y 107 + CONFIG_IOSCHED_DEADLINE=y 108 + CONFIG_IOSCHED_CFQ=y 109 + CONFIG_DEFAULT_AS=y 110 + # CONFIG_DEFAULT_DEADLINE is not set 111 + # CONFIG_DEFAULT_CFQ is not set 112 + # CONFIG_DEFAULT_NOOP is not set 113 + CONFIG_DEFAULT_IOSCHED="anticipatory" 114 + CONFIG_PPC_GEN550=y 115 + # CONFIG_WANT_EARLY_SERIAL is not set 116 + 117 + # 118 + # Platform support 119 + # 120 + # CONFIG_MPC834x_SYS is not set 121 + CONFIG_MPC834x_ITX=y 122 + CONFIG_MPC834x=y 123 + 124 + # 125 + # Kernel options 126 + # 127 + # CONFIG_HIGHMEM is not set 128 + # CONFIG_HZ_100 is not set 129 + CONFIG_HZ_250=y 130 + # CONFIG_HZ_1000 is not set 131 + CONFIG_HZ=250 132 + CONFIG_PREEMPT_NONE=y 133 + # CONFIG_PREEMPT_VOLUNTARY is not set 134 + # CONFIG_PREEMPT is not set 135 + CONFIG_BINFMT_ELF=y 136 + # CONFIG_BINFMT_MISC is not set 137 + CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 138 + CONFIG_ARCH_FLATMEM_ENABLE=y 139 + CONFIG_SELECT_MEMORY_MODEL=y 140 + CONFIG_FLATMEM_MANUAL=y 141 + # CONFIG_DISCONTIGMEM_MANUAL is not set 142 + # CONFIG_SPARSEMEM_MANUAL is not set 143 + CONFIG_FLATMEM=y 144 + CONFIG_FLAT_NODE_MEM_MAP=y 145 + # CONFIG_SPARSEMEM_STATIC is not set 146 + CONFIG_SPLIT_PTLOCK_CPUS=4 147 + # CONFIG_RESOURCES_64BIT is not set 148 + CONFIG_PROC_DEVICETREE=y 149 + # CONFIG_CMDLINE_BOOL is not set 150 + # CONFIG_PM is not set 151 + # CONFIG_SOFTWARE_SUSPEND is not set 152 + CONFIG_SECCOMP=y 153 + CONFIG_ISA_DMA_API=y 154 + 155 + # 156 + # Bus options 157 + # 158 + CONFIG_GENERIC_ISA_DMA=y 159 + # CONFIG_PPC_I8259 is not set 160 + CONFIG_PPC_INDIRECT_PCI=y 161 + CONFIG_FSL_SOC=y 162 + CONFIG_PCI=y 163 + CONFIG_PCI_DOMAINS=y 164 + # CONFIG_PCIEPORTBUS is not set 165 + # CONFIG_PCI_DEBUG is not set 166 + 167 + # 168 + # PCCARD (PCMCIA/CardBus) support 169 + # 170 + # CONFIG_PCCARD is not set 171 + 172 + # 173 + # PCI Hotplug Support 174 + # 175 + # CONFIG_HOTPLUG_PCI is not set 176 + 177 + # 178 + # Advanced setup 179 + # 180 + # CONFIG_ADVANCED_OPTIONS is not set 181 + 182 + # 183 + # Default settings for advanced configuration options are used 184 + # 185 + CONFIG_HIGHMEM_START=0xfe000000 186 + CONFIG_LOWMEM_SIZE=0x30000000 187 + CONFIG_KERNEL_START=0xc0000000 188 + CONFIG_TASK_SIZE=0x80000000 189 + CONFIG_BOOT_LOAD=0x00800000 190 + 191 + # 192 + # Networking 193 + # 194 + CONFIG_NET=y 195 + 196 + # 197 + # Networking options 198 + # 199 + # CONFIG_NETDEBUG is not set 200 + CONFIG_PACKET=y 201 + # CONFIG_PACKET_MMAP is not set 202 + CONFIG_UNIX=y 203 + CONFIG_XFRM=y 204 + # CONFIG_XFRM_USER is not set 205 + # CONFIG_NET_KEY is not set 206 + CONFIG_INET=y 207 + CONFIG_IP_MULTICAST=y 208 + # CONFIG_IP_ADVANCED_ROUTER is not set 209 + CONFIG_IP_FIB_HASH=y 210 + CONFIG_IP_PNP=y 211 + CONFIG_IP_PNP_DHCP=y 212 + CONFIG_IP_PNP_BOOTP=y 213 + # CONFIG_IP_PNP_RARP is not set 214 + # CONFIG_NET_IPIP is not set 215 + # CONFIG_NET_IPGRE is not set 216 + # CONFIG_IP_MROUTE is not set 217 + # CONFIG_ARPD is not set 218 + CONFIG_SYN_COOKIES=y 219 + # CONFIG_INET_AH is not set 220 + # CONFIG_INET_ESP is not set 221 + # CONFIG_INET_IPCOMP is not set 222 + # CONFIG_INET_XFRM_TUNNEL is not set 223 + # CONFIG_INET_TUNNEL is not set 224 + CONFIG_INET_XFRM_MODE_TRANSPORT=y 225 + CONFIG_INET_XFRM_MODE_TUNNEL=y 226 + CONFIG_INET_DIAG=y 227 + CONFIG_INET_TCP_DIAG=y 228 + # CONFIG_TCP_CONG_ADVANCED is not set 229 + CONFIG_TCP_CONG_BIC=y 230 + # CONFIG_IPV6 is not set 231 + # CONFIG_INET6_XFRM_TUNNEL is not set 232 + # CONFIG_INET6_TUNNEL is not set 233 + # CONFIG_NETWORK_SECMARK is not set 234 + # CONFIG_NETFILTER is not set 235 + 236 + # 237 + # DCCP Configuration (EXPERIMENTAL) 238 + # 239 + # CONFIG_IP_DCCP is not set 240 + 241 + # 242 + # SCTP Configuration (EXPERIMENTAL) 243 + # 244 + # CONFIG_IP_SCTP is not set 245 + 246 + # 247 + # TIPC Configuration (EXPERIMENTAL) 248 + # 249 + # CONFIG_TIPC is not set 250 + # CONFIG_ATM is not set 251 + # CONFIG_BRIDGE is not set 252 + # CONFIG_VLAN_8021Q is not set 253 + # CONFIG_DECNET is not set 254 + # CONFIG_LLC2 is not set 255 + # CONFIG_IPX is not set 256 + # CONFIG_ATALK is not set 257 + # CONFIG_X25 is not set 258 + # CONFIG_LAPB is not set 259 + # CONFIG_NET_DIVERT is not set 260 + # CONFIG_ECONET is not set 261 + # CONFIG_WAN_ROUTER is not set 262 + 263 + # 264 + # QoS and/or fair queueing 265 + # 266 + # CONFIG_NET_SCHED is not set 267 + 268 + # 269 + # Network testing 270 + # 271 + # CONFIG_NET_PKTGEN is not set 272 + # CONFIG_HAMRADIO is not set 273 + # CONFIG_IRDA is not set 274 + # CONFIG_BT is not set 275 + # CONFIG_IEEE80211 is not set 276 + 277 + # 278 + # Device Drivers 279 + # 280 + 281 + # 282 + # Generic Driver Options 283 + # 284 + CONFIG_STANDALONE=y 285 + CONFIG_PREVENT_FIRMWARE_BUILD=y 286 + # CONFIG_FW_LOADER is not set 287 + # CONFIG_DEBUG_DRIVER is not set 288 + # CONFIG_SYS_HYPERVISOR is not set 289 + 290 + # 291 + # Connector - unified userspace <-> kernelspace linker 292 + # 293 + # CONFIG_CONNECTOR is not set 294 + 295 + # 296 + # Memory Technology Devices (MTD) 297 + # 298 + CONFIG_MTD=y 299 + # CONFIG_MTD_DEBUG is not set 300 + # CONFIG_MTD_CONCAT is not set 301 + # CONFIG_MTD_PARTITIONS is not set 302 + 303 + # 304 + # User Modules And Translation Layers 305 + # 306 + CONFIG_MTD_CHAR=y 307 + # CONFIG_MTD_BLOCK is not set 308 + # CONFIG_MTD_BLOCK_RO is not set 309 + # CONFIG_FTL is not set 310 + # CONFIG_NFTL is not set 311 + # CONFIG_INFTL is not set 312 + # CONFIG_RFD_FTL is not set 313 + 314 + # 315 + # RAM/ROM/Flash chip drivers 316 + # 317 + CONFIG_MTD_CFI=y 318 + # CONFIG_MTD_JEDECPROBE is not set 319 + CONFIG_MTD_GEN_PROBE=y 320 + # CONFIG_MTD_CFI_ADV_OPTIONS is not set 321 + CONFIG_MTD_MAP_BANK_WIDTH_1=y 322 + CONFIG_MTD_MAP_BANK_WIDTH_2=y 323 + CONFIG_MTD_MAP_BANK_WIDTH_4=y 324 + # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set 325 + # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set 326 + # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set 327 + CONFIG_MTD_CFI_I1=y 328 + CONFIG_MTD_CFI_I2=y 329 + # CONFIG_MTD_CFI_I4 is not set 330 + # CONFIG_MTD_CFI_I8 is not set 331 + # CONFIG_MTD_CFI_INTELEXT is not set 332 + CONFIG_MTD_CFI_AMDSTD=y 333 + # CONFIG_MTD_CFI_STAA is not set 334 + CONFIG_MTD_CFI_UTIL=y 335 + # CONFIG_MTD_RAM is not set 336 + # CONFIG_MTD_ROM is not set 337 + # CONFIG_MTD_ABSENT is not set 338 + # CONFIG_MTD_OBSOLETE_CHIPS is not set 339 + 340 + # 341 + # Mapping drivers for chip access 342 + # 343 + # CONFIG_MTD_COMPLEX_MAPPINGS is not set 344 + CONFIG_MTD_PHYSMAP=y 345 + CONFIG_MTD_PHYSMAP_START=0xfe000000 346 + CONFIG_MTD_PHYSMAP_LEN=0x1000000 347 + CONFIG_MTD_PHYSMAP_BANKWIDTH=2 348 + # CONFIG_MTD_PLATRAM is not set 349 + 350 + # 351 + # Self-contained MTD device drivers 352 + # 353 + # CONFIG_MTD_PMC551 is not set 354 + # CONFIG_MTD_DATAFLASH is not set 355 + # CONFIG_MTD_M25P80 is not set 356 + # CONFIG_MTD_SLRAM is not set 357 + # CONFIG_MTD_PHRAM is not set 358 + # CONFIG_MTD_MTDRAM is not set 359 + # CONFIG_MTD_BLOCK2MTD is not set 360 + 361 + # 362 + # Disk-On-Chip Device Drivers 363 + # 364 + # CONFIG_MTD_DOC2000 is not set 365 + # CONFIG_MTD_DOC2001 is not set 366 + # CONFIG_MTD_DOC2001PLUS is not set 367 + 368 + # 369 + # NAND Flash Device Drivers 370 + # 371 + # CONFIG_MTD_NAND is not set 372 + 373 + # 374 + # OneNAND Flash Device Drivers 375 + # 376 + # CONFIG_MTD_ONENAND is not set 377 + 378 + # 379 + # Parallel port support 380 + # 381 + # CONFIG_PARPORT is not set 382 + 383 + # 384 + # Plug and Play support 385 + # 386 + 387 + # 388 + # Block devices 389 + # 390 + # CONFIG_BLK_DEV_FD is not set 391 + # CONFIG_BLK_CPQ_DA is not set 392 + # CONFIG_BLK_CPQ_CISS_DA is not set 393 + # CONFIG_BLK_DEV_DAC960 is not set 394 + # CONFIG_BLK_DEV_UMEM is not set 395 + # CONFIG_BLK_DEV_COW_COMMON is not set 396 + CONFIG_BLK_DEV_LOOP=y 397 + # CONFIG_BLK_DEV_CRYPTOLOOP is not set 398 + # CONFIG_BLK_DEV_NBD is not set 399 + # CONFIG_BLK_DEV_SX8 is not set 400 + # CONFIG_BLK_DEV_UB is not set 401 + CONFIG_BLK_DEV_RAM=y 402 + CONFIG_BLK_DEV_RAM_COUNT=16 403 + CONFIG_BLK_DEV_RAM_SIZE=32768 404 + CONFIG_BLK_DEV_INITRD=y 405 + # CONFIG_CDROM_PKTCDVD is not set 406 + # CONFIG_ATA_OVER_ETH is not set 407 + 408 + # 409 + # ATA/ATAPI/MFM/RLL support 410 + # 411 + CONFIG_IDE=y 412 + # CONFIG_BLK_DEV_IDE is not set 413 + # CONFIG_BLK_DEV_HD_ONLY is not set 414 + # CONFIG_BLK_DEV_HD is not set 415 + 416 + # 417 + # SCSI device support 418 + # 419 + # CONFIG_RAID_ATTRS is not set 420 + CONFIG_SCSI=y 421 + CONFIG_SCSI_PROC_FS=y 422 + 423 + # 424 + # SCSI support type (disk, tape, CD-ROM) 425 + # 426 + CONFIG_BLK_DEV_SD=y 427 + # CONFIG_CHR_DEV_ST is not set 428 + # CONFIG_CHR_DEV_OSST is not set 429 + # CONFIG_BLK_DEV_SR is not set 430 + CONFIG_CHR_DEV_SG=y 431 + # CONFIG_CHR_DEV_SCH is not set 432 + 433 + # 434 + # Some SCSI devices (e.g. CD jukebox) support multiple LUNs 435 + # 436 + # CONFIG_SCSI_MULTI_LUN is not set 437 + # CONFIG_SCSI_CONSTANTS is not set 438 + # CONFIG_SCSI_LOGGING is not set 439 + 440 + # 441 + # SCSI Transport Attributes 442 + # 443 + CONFIG_SCSI_SPI_ATTRS=y 444 + # CONFIG_SCSI_FC_ATTRS is not set 445 + # CONFIG_SCSI_ISCSI_ATTRS is not set 446 + # CONFIG_SCSI_SAS_ATTRS is not set 447 + 448 + # 449 + # SCSI low-level drivers 450 + # 451 + # CONFIG_ISCSI_TCP is not set 452 + # CONFIG_BLK_DEV_3W_XXXX_RAID is not set 453 + # CONFIG_SCSI_3W_9XXX is not set 454 + # CONFIG_SCSI_ACARD is not set 455 + # CONFIG_SCSI_AACRAID is not set 456 + # CONFIG_SCSI_AIC7XXX is not set 457 + # CONFIG_SCSI_AIC7XXX_OLD is not set 458 + # CONFIG_SCSI_AIC79XX is not set 459 + # CONFIG_SCSI_DPT_I2O is not set 460 + # CONFIG_MEGARAID_NEWGEN is not set 461 + # CONFIG_MEGARAID_LEGACY is not set 462 + # CONFIG_MEGARAID_SAS is not set 463 + CONFIG_SCSI_SATA=y 464 + # CONFIG_SCSI_SATA_AHCI is not set 465 + # CONFIG_SCSI_SATA_SVW is not set 466 + # CONFIG_SCSI_ATA_PIIX is not set 467 + # CONFIG_SCSI_SATA_MV is not set 468 + # CONFIG_SCSI_SATA_NV is not set 469 + # CONFIG_SCSI_PDC_ADMA is not set 470 + # CONFIG_SCSI_HPTIOP is not set 471 + # CONFIG_SCSI_SATA_QSTOR is not set 472 + # CONFIG_SCSI_SATA_PROMISE is not set 473 + # CONFIG_SCSI_SATA_SX4 is not set 474 + CONFIG_SCSI_SATA_SIL=y 475 + # CONFIG_SCSI_SATA_SIL24 is not set 476 + # CONFIG_SCSI_SATA_SIS is not set 477 + # CONFIG_SCSI_SATA_ULI is not set 478 + # CONFIG_SCSI_SATA_VIA is not set 479 + # CONFIG_SCSI_SATA_VITESSE is not set 480 + # CONFIG_SCSI_BUSLOGIC is not set 481 + # CONFIG_SCSI_DMX3191D is not set 482 + # CONFIG_SCSI_EATA is not set 483 + # CONFIG_SCSI_FUTURE_DOMAIN is not set 484 + # CONFIG_SCSI_GDTH is not set 485 + # CONFIG_SCSI_IPS is not set 486 + # CONFIG_SCSI_INITIO is not set 487 + # CONFIG_SCSI_INIA100 is not set 488 + # CONFIG_SCSI_SYM53C8XX_2 is not set 489 + # CONFIG_SCSI_IPR is not set 490 + # CONFIG_SCSI_QLOGIC_1280 is not set 491 + # CONFIG_SCSI_QLA_FC is not set 492 + # CONFIG_SCSI_LPFC is not set 493 + # CONFIG_SCSI_DC395x is not set 494 + # CONFIG_SCSI_DC390T is not set 495 + # CONFIG_SCSI_NSP32 is not set 496 + # CONFIG_SCSI_DEBUG is not set 497 + 498 + # 499 + # Multi-device support (RAID and LVM) 500 + # 501 + CONFIG_MD=y 502 + CONFIG_BLK_DEV_MD=y 503 + CONFIG_MD_LINEAR=y 504 + CONFIG_MD_RAID0=y 505 + CONFIG_MD_RAID1=y 506 + # CONFIG_MD_RAID10 is not set 507 + # CONFIG_MD_RAID456 is not set 508 + # CONFIG_MD_MULTIPATH is not set 509 + # CONFIG_MD_FAULTY is not set 510 + # CONFIG_BLK_DEV_DM is not set 511 + 512 + # 513 + # Fusion MPT device support 514 + # 515 + # CONFIG_FUSION is not set 516 + # CONFIG_FUSION_SPI is not set 517 + # CONFIG_FUSION_FC is not set 518 + # CONFIG_FUSION_SAS is not set 519 + 520 + # 521 + # IEEE 1394 (FireWire) support 522 + # 523 + # CONFIG_IEEE1394 is not set 524 + 525 + # 526 + # I2O device support 527 + # 528 + # CONFIG_I2O is not set 529 + 530 + # 531 + # Macintosh device drivers 532 + # 533 + # CONFIG_WINDFARM is not set 534 + 535 + # 536 + # Network device support 537 + # 538 + CONFIG_NETDEVICES=y 539 + # CONFIG_DUMMY is not set 540 + # CONFIG_BONDING is not set 541 + # CONFIG_EQUALIZER is not set 542 + # CONFIG_TUN is not set 543 + 544 + # 545 + # ARCnet devices 546 + # 547 + # CONFIG_ARCNET is not set 548 + 549 + # 550 + # PHY device support 551 + # 552 + CONFIG_PHYLIB=y 553 + 554 + # 555 + # MII PHY device drivers 556 + # 557 + # CONFIG_MARVELL_PHY is not set 558 + # CONFIG_DAVICOM_PHY is not set 559 + # CONFIG_QSEMI_PHY is not set 560 + # CONFIG_LXT_PHY is not set 561 + CONFIG_CICADA_PHY=y 562 + # CONFIG_VITESSE_PHY is not set 563 + # CONFIG_SMSC_PHY is not set 564 + 565 + # 566 + # Ethernet (10 or 100Mbit) 567 + # 568 + CONFIG_NET_ETHERNET=y 569 + CONFIG_MII=y 570 + # CONFIG_HAPPYMEAL is not set 571 + # CONFIG_SUNGEM is not set 572 + # CONFIG_CASSINI is not set 573 + # CONFIG_NET_VENDOR_3COM is not set 574 + 575 + # 576 + # Tulip family network device support 577 + # 578 + # CONFIG_NET_TULIP is not set 579 + # CONFIG_HP100 is not set 580 + CONFIG_NET_PCI=y 581 + # CONFIG_PCNET32 is not set 582 + # CONFIG_AMD8111_ETH is not set 583 + # CONFIG_ADAPTEC_STARFIRE is not set 584 + # CONFIG_B44 is not set 585 + # CONFIG_FORCEDETH is not set 586 + # CONFIG_DGRS is not set 587 + # CONFIG_EEPRO100 is not set 588 + CONFIG_E100=y 589 + # CONFIG_FEALNX is not set 590 + # CONFIG_NATSEMI is not set 591 + # CONFIG_NE2K_PCI is not set 592 + # CONFIG_8139CP is not set 593 + # CONFIG_8139TOO is not set 594 + # CONFIG_SIS900 is not set 595 + # CONFIG_EPIC100 is not set 596 + # CONFIG_SUNDANCE is not set 597 + # CONFIG_TLAN is not set 598 + # CONFIG_VIA_RHINE is not set 599 + 600 + # 601 + # Ethernet (1000 Mbit) 602 + # 603 + # CONFIG_ACENIC is not set 604 + # CONFIG_DL2K is not set 605 + # CONFIG_E1000 is not set 606 + # CONFIG_NS83820 is not set 607 + # CONFIG_HAMACHI is not set 608 + # CONFIG_YELLOWFIN is not set 609 + # CONFIG_R8169 is not set 610 + # CONFIG_SIS190 is not set 611 + # CONFIG_SKGE is not set 612 + # CONFIG_SKY2 is not set 613 + # CONFIG_SK98LIN is not set 614 + # CONFIG_VIA_VELOCITY is not set 615 + # CONFIG_TIGON3 is not set 616 + # CONFIG_BNX2 is not set 617 + CONFIG_GIANFAR=y 618 + CONFIG_GFAR_NAPI=y 619 + 620 + # 621 + # Ethernet (10000 Mbit) 622 + # 623 + # CONFIG_CHELSIO_T1 is not set 624 + # CONFIG_IXGB is not set 625 + # CONFIG_S2IO is not set 626 + # CONFIG_MYRI10GE is not set 627 + 628 + # 629 + # Token Ring devices 630 + # 631 + # CONFIG_TR is not set 632 + 633 + # 634 + # Wireless LAN (non-hamradio) 635 + # 636 + # CONFIG_NET_RADIO is not set 637 + 638 + # 639 + # Wan interfaces 640 + # 641 + # CONFIG_WAN is not set 642 + # CONFIG_FDDI is not set 643 + # CONFIG_HIPPI is not set 644 + # CONFIG_PPP is not set 645 + # CONFIG_SLIP is not set 646 + # CONFIG_NET_FC is not set 647 + # CONFIG_SHAPER is not set 648 + # CONFIG_NETCONSOLE is not set 649 + # CONFIG_NETPOLL is not set 650 + # CONFIG_NET_POLL_CONTROLLER is not set 651 + 652 + # 653 + # ISDN subsystem 654 + # 655 + # CONFIG_ISDN is not set 656 + 657 + # 658 + # Telephony Support 659 + # 660 + # CONFIG_PHONE is not set 661 + 662 + # 663 + # Input device support 664 + # 665 + CONFIG_INPUT=y 666 + 667 + # 668 + # Userland interfaces 669 + # 670 + # CONFIG_INPUT_MOUSEDEV is not set 671 + # CONFIG_INPUT_JOYDEV is not set 672 + # CONFIG_INPUT_TSDEV is not set 673 + # CONFIG_INPUT_EVDEV is not set 674 + # CONFIG_INPUT_EVBUG is not set 675 + 676 + # 677 + # Input Device Drivers 678 + # 679 + # CONFIG_INPUT_KEYBOARD is not set 680 + # CONFIG_INPUT_MOUSE is not set 681 + # CONFIG_INPUT_JOYSTICK is not set 682 + # CONFIG_INPUT_TOUCHSCREEN is not set 683 + # CONFIG_INPUT_MISC is not set 684 + 685 + # 686 + # Hardware I/O ports 687 + # 688 + # CONFIG_SERIO is not set 689 + # CONFIG_GAMEPORT is not set 690 + 691 + # 692 + # Character devices 693 + # 694 + # CONFIG_VT is not set 695 + # CONFIG_SERIAL_NONSTANDARD is not set 696 + 697 + # 698 + # Serial drivers 699 + # 700 + CONFIG_SERIAL_8250=y 701 + CONFIG_SERIAL_8250_CONSOLE=y 702 + CONFIG_SERIAL_8250_PCI=y 703 + CONFIG_SERIAL_8250_NR_UARTS=4 704 + CONFIG_SERIAL_8250_RUNTIME_UARTS=4 705 + # CONFIG_SERIAL_8250_EXTENDED is not set 706 + 707 + # 708 + # Non-8250 serial port support 709 + # 710 + CONFIG_SERIAL_CORE=y 711 + CONFIG_SERIAL_CORE_CONSOLE=y 712 + # CONFIG_SERIAL_JSM is not set 713 + CONFIG_UNIX98_PTYS=y 714 + CONFIG_LEGACY_PTYS=y 715 + CONFIG_LEGACY_PTY_COUNT=256 716 + 717 + # 718 + # IPMI 719 + # 720 + # CONFIG_IPMI_HANDLER is not set 721 + 722 + # 723 + # Watchdog Cards 724 + # 725 + CONFIG_WATCHDOG=y 726 + # CONFIG_WATCHDOG_NOWAYOUT is not set 727 + 728 + # 729 + # Watchdog Device Drivers 730 + # 731 + # CONFIG_SOFT_WATCHDOG is not set 732 + CONFIG_83xx_WDT=y 733 + 734 + # 735 + # PCI-based Watchdog Cards 736 + # 737 + # CONFIG_PCIPCWATCHDOG is not set 738 + # CONFIG_WDTPCI is not set 739 + 740 + # 741 + # USB-based Watchdog Cards 742 + # 743 + # CONFIG_USBPCWATCHDOG is not set 744 + CONFIG_HW_RANDOM=y 745 + # CONFIG_NVRAM is not set 746 + # CONFIG_GEN_RTC is not set 747 + # CONFIG_DTLK is not set 748 + # CONFIG_R3964 is not set 749 + # CONFIG_APPLICOM is not set 750 + 751 + # 752 + # Ftape, the floppy tape device driver 753 + # 754 + # CONFIG_AGP is not set 755 + # CONFIG_DRM is not set 756 + # CONFIG_RAW_DRIVER is not set 757 + 758 + # 759 + # TPM devices 760 + # 761 + # CONFIG_TCG_TPM is not set 762 + # CONFIG_TELCLOCK is not set 763 + 764 + # 765 + # I2C support 766 + # 767 + CONFIG_I2C=y 768 + CONFIG_I2C_CHARDEV=y 769 + 770 + # 771 + # I2C Algorithms 772 + # 773 + # CONFIG_I2C_ALGOBIT is not set 774 + # CONFIG_I2C_ALGOPCF is not set 775 + # CONFIG_I2C_ALGOPCA is not set 776 + 777 + # 778 + # I2C Hardware Bus support 779 + # 780 + # CONFIG_I2C_ALI1535 is not set 781 + # CONFIG_I2C_ALI1563 is not set 782 + # CONFIG_I2C_ALI15X3 is not set 783 + # CONFIG_I2C_AMD756 is not set 784 + # CONFIG_I2C_AMD8111 is not set 785 + # CONFIG_I2C_I801 is not set 786 + # CONFIG_I2C_I810 is not set 787 + # CONFIG_I2C_PIIX4 is not set 788 + CONFIG_I2C_MPC=y 789 + # CONFIG_I2C_NFORCE2 is not set 790 + # CONFIG_I2C_OCORES is not set 791 + # CONFIG_I2C_PARPORT_LIGHT is not set 792 + # CONFIG_I2C_PROSAVAGE is not set 793 + # CONFIG_I2C_SAVAGE4 is not set 794 + # CONFIG_I2C_SIS5595 is not set 795 + # CONFIG_I2C_SIS630 is not set 796 + # CONFIG_I2C_SIS96X is not set 797 + # CONFIG_I2C_STUB is not set 798 + # CONFIG_I2C_VIA is not set 799 + # CONFIG_I2C_VIAPRO is not set 800 + # CONFIG_I2C_VOODOO3 is not set 801 + # CONFIG_I2C_PCA_ISA is not set 802 + 803 + # 804 + # Miscellaneous I2C Chip support 805 + # 806 + # CONFIG_SENSORS_DS1337 is not set 807 + # CONFIG_SENSORS_DS1374 is not set 808 + # CONFIG_SENSORS_EEPROM is not set 809 + # CONFIG_SENSORS_PCF8574 is not set 810 + # CONFIG_SENSORS_PCA9539 is not set 811 + # CONFIG_SENSORS_PCF8591 is not set 812 + # CONFIG_SENSORS_M41T00 is not set 813 + # CONFIG_SENSORS_MAX6875 is not set 814 + # CONFIG_I2C_DEBUG_CORE is not set 815 + # CONFIG_I2C_DEBUG_ALGO is not set 816 + # CONFIG_I2C_DEBUG_BUS is not set 817 + # CONFIG_I2C_DEBUG_CHIP is not set 818 + 819 + # 820 + # SPI support 821 + # 822 + CONFIG_SPI=y 823 + # CONFIG_SPI_DEBUG is not set 824 + CONFIG_SPI_MASTER=y 825 + 826 + # 827 + # SPI Master Controller Drivers 828 + # 829 + CONFIG_SPI_BITBANG=y 830 + CONFIG_SPI_MPC83xx=y 831 + 832 + # 833 + # SPI Protocol Masters 834 + # 835 + 836 + # 837 + # Dallas's 1-wire bus 838 + # 839 + 840 + # 841 + # Hardware Monitoring support 842 + # 843 + CONFIG_HWMON=y 844 + # CONFIG_HWMON_VID is not set 845 + # CONFIG_SENSORS_ABITUGURU is not set 846 + # CONFIG_SENSORS_ADM1021 is not set 847 + # CONFIG_SENSORS_ADM1025 is not set 848 + # CONFIG_SENSORS_ADM1026 is not set 849 + # CONFIG_SENSORS_ADM1031 is not set 850 + # CONFIG_SENSORS_ADM9240 is not set 851 + # CONFIG_SENSORS_ASB100 is not set 852 + # CONFIG_SENSORS_ATXP1 is not set 853 + # CONFIG_SENSORS_DS1621 is not set 854 + # CONFIG_SENSORS_F71805F is not set 855 + # CONFIG_SENSORS_FSCHER is not set 856 + # CONFIG_SENSORS_FSCPOS is not set 857 + # CONFIG_SENSORS_GL518SM is not set 858 + # CONFIG_SENSORS_GL520SM is not set 859 + # CONFIG_SENSORS_IT87 is not set 860 + # CONFIG_SENSORS_LM63 is not set 861 + # CONFIG_SENSORS_LM70 is not set 862 + # CONFIG_SENSORS_LM75 is not set 863 + # CONFIG_SENSORS_LM77 is not set 864 + # CONFIG_SENSORS_LM78 is not set 865 + # CONFIG_SENSORS_LM80 is not set 866 + # CONFIG_SENSORS_LM83 is not set 867 + # CONFIG_SENSORS_LM85 is not set 868 + # CONFIG_SENSORS_LM87 is not set 869 + # CONFIG_SENSORS_LM90 is not set 870 + # CONFIG_SENSORS_LM92 is not set 871 + # CONFIG_SENSORS_MAX1619 is not set 872 + # CONFIG_SENSORS_PC87360 is not set 873 + # CONFIG_SENSORS_SIS5595 is not set 874 + # CONFIG_SENSORS_SMSC47M1 is not set 875 + # CONFIG_SENSORS_SMSC47M192 is not set 876 + # CONFIG_SENSORS_SMSC47B397 is not set 877 + # CONFIG_SENSORS_VIA686A is not set 878 + # CONFIG_SENSORS_VT8231 is not set 879 + # CONFIG_SENSORS_W83781D is not set 880 + # CONFIG_SENSORS_W83791D is not set 881 + # CONFIG_SENSORS_W83792D is not set 882 + # CONFIG_SENSORS_W83L785TS is not set 883 + # CONFIG_SENSORS_W83627HF is not set 884 + # CONFIG_SENSORS_W83627EHF is not set 885 + # CONFIG_HWMON_DEBUG_CHIP is not set 886 + 887 + # 888 + # Misc devices 889 + # 890 + 891 + # 892 + # Multimedia devices 893 + # 894 + # CONFIG_VIDEO_DEV is not set 895 + CONFIG_VIDEO_V4L2=y 896 + 897 + # 898 + # Digital Video Broadcasting Devices 899 + # 900 + # CONFIG_DVB is not set 901 + # CONFIG_USB_DABUSB is not set 902 + 903 + # 904 + # Graphics support 905 + # 906 + CONFIG_FIRMWARE_EDID=y 907 + # CONFIG_FB is not set 908 + 909 + # 910 + # Sound 911 + # 912 + # CONFIG_SOUND is not set 913 + 914 + # 915 + # USB support 916 + # 917 + CONFIG_USB_ARCH_HAS_HCD=y 918 + CONFIG_USB_ARCH_HAS_OHCI=y 919 + CONFIG_USB_ARCH_HAS_EHCI=y 920 + CONFIG_USB=y 921 + # CONFIG_USB_DEBUG is not set 922 + 923 + # 924 + # Miscellaneous USB options 925 + # 926 + CONFIG_USB_DEVICEFS=y 927 + # CONFIG_USB_BANDWIDTH is not set 928 + # CONFIG_USB_DYNAMIC_MINORS is not set 929 + # CONFIG_USB_OTG is not set 930 + 931 + # 932 + # USB Host Controller Drivers 933 + # 934 + CONFIG_USB_EHCI_HCD=y 935 + # CONFIG_USB_EHCI_SPLIT_ISO is not set 936 + # CONFIG_USB_EHCI_ROOT_HUB_TT is not set 937 + # CONFIG_USB_EHCI_TT_NEWSCHED is not set 938 + # CONFIG_USB_ISP116X_HCD is not set 939 + CONFIG_USB_OHCI_HCD=y 940 + # CONFIG_USB_OHCI_BIG_ENDIAN is not set 941 + CONFIG_USB_OHCI_LITTLE_ENDIAN=y 942 + CONFIG_USB_UHCI_HCD=y 943 + # CONFIG_USB_SL811_HCD is not set 944 + 945 + # 946 + # USB Device Class drivers 947 + # 948 + # CONFIG_USB_ACM is not set 949 + # CONFIG_USB_PRINTER is not set 950 + 951 + # 952 + # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 953 + # 954 + 955 + # 956 + # may also be needed; see USB_STORAGE Help for more information 957 + # 958 + CONFIG_USB_STORAGE=y 959 + # CONFIG_USB_STORAGE_DEBUG is not set 960 + # CONFIG_USB_STORAGE_DATAFAB is not set 961 + # CONFIG_USB_STORAGE_FREECOM is not set 962 + # CONFIG_USB_STORAGE_DPCM is not set 963 + # CONFIG_USB_STORAGE_USBAT is not set 964 + # CONFIG_USB_STORAGE_SDDR09 is not set 965 + # CONFIG_USB_STORAGE_SDDR55 is not set 966 + # CONFIG_USB_STORAGE_JUMPSHOT is not set 967 + # CONFIG_USB_STORAGE_ALAUDA is not set 968 + # CONFIG_USB_LIBUSUAL is not set 969 + 970 + # 971 + # USB Input Devices 972 + # 973 + # CONFIG_USB_HID is not set 974 + 975 + # 976 + # USB HID Boot Protocol drivers 977 + # 978 + # CONFIG_USB_KBD is not set 979 + # CONFIG_USB_MOUSE is not set 980 + # CONFIG_USB_AIPTEK is not set 981 + # CONFIG_USB_WACOM is not set 982 + # CONFIG_USB_ACECAD is not set 983 + # CONFIG_USB_KBTAB is not set 984 + # CONFIG_USB_POWERMATE is not set 985 + # CONFIG_USB_TOUCHSCREEN is not set 986 + # CONFIG_USB_YEALINK is not set 987 + # CONFIG_USB_XPAD is not set 988 + # CONFIG_USB_ATI_REMOTE is not set 989 + # CONFIG_USB_ATI_REMOTE2 is not set 990 + # CONFIG_USB_KEYSPAN_REMOTE is not set 991 + # CONFIG_USB_APPLETOUCH is not set 992 + 993 + # 994 + # USB Imaging devices 995 + # 996 + # CONFIG_USB_MDC800 is not set 997 + # CONFIG_USB_MICROTEK is not set 998 + 999 + # 1000 + # USB Network Adapters 1001 + # 1002 + # CONFIG_USB_CATC is not set 1003 + # CONFIG_USB_KAWETH is not set 1004 + # CONFIG_USB_PEGASUS is not set 1005 + # CONFIG_USB_RTL8150 is not set 1006 + # CONFIG_USB_USBNET is not set 1007 + CONFIG_USB_MON=y 1008 + 1009 + # 1010 + # USB port drivers 1011 + # 1012 + 1013 + # 1014 + # USB Serial Converter support 1015 + # 1016 + # CONFIG_USB_SERIAL is not set 1017 + 1018 + # 1019 + # USB Miscellaneous drivers 1020 + # 1021 + # CONFIG_USB_EMI62 is not set 1022 + # CONFIG_USB_EMI26 is not set 1023 + # CONFIG_USB_AUERSWALD is not set 1024 + # CONFIG_USB_RIO500 is not set 1025 + # CONFIG_USB_LEGOTOWER is not set 1026 + # CONFIG_USB_LCD is not set 1027 + # CONFIG_USB_LED is not set 1028 + # CONFIG_USB_CY7C63 is not set 1029 + # CONFIG_USB_CYTHERM is not set 1030 + # CONFIG_USB_PHIDGETKIT is not set 1031 + # CONFIG_USB_PHIDGETSERVO is not set 1032 + # CONFIG_USB_IDMOUSE is not set 1033 + # CONFIG_USB_APPLEDISPLAY is not set 1034 + # CONFIG_USB_SISUSBVGA is not set 1035 + # CONFIG_USB_LD is not set 1036 + # CONFIG_USB_TEST is not set 1037 + 1038 + # 1039 + # USB DSL modem support 1040 + # 1041 + 1042 + # 1043 + # USB Gadget Support 1044 + # 1045 + CONFIG_USB_GADGET=y 1046 + # CONFIG_USB_GADGET_DEBUG_FILES is not set 1047 + CONFIG_USB_GADGET_SELECTED=y 1048 + CONFIG_USB_GADGET_NET2280=y 1049 + CONFIG_USB_NET2280=y 1050 + # CONFIG_USB_GADGET_PXA2XX is not set 1051 + # CONFIG_USB_GADGET_GOKU is not set 1052 + # CONFIG_USB_GADGET_LH7A40X is not set 1053 + # CONFIG_USB_GADGET_OMAP is not set 1054 + # CONFIG_USB_GADGET_AT91 is not set 1055 + # CONFIG_USB_GADGET_DUMMY_HCD is not set 1056 + CONFIG_USB_GADGET_DUALSPEED=y 1057 + # CONFIG_USB_ZERO is not set 1058 + CONFIG_USB_ETH=y 1059 + CONFIG_USB_ETH_RNDIS=y 1060 + # CONFIG_USB_GADGETFS is not set 1061 + # CONFIG_USB_FILE_STORAGE is not set 1062 + # CONFIG_USB_G_SERIAL is not set 1063 + 1064 + # 1065 + # MMC/SD Card support 1066 + # 1067 + # CONFIG_MMC is not set 1068 + 1069 + # 1070 + # LED devices 1071 + # 1072 + # CONFIG_NEW_LEDS is not set 1073 + 1074 + # 1075 + # LED drivers 1076 + # 1077 + 1078 + # 1079 + # LED Triggers 1080 + # 1081 + 1082 + # 1083 + # InfiniBand support 1084 + # 1085 + # CONFIG_INFINIBAND is not set 1086 + 1087 + # 1088 + # EDAC - error detection and reporting (RAS) (EXPERIMENTAL) 1089 + # 1090 + 1091 + # 1092 + # Real Time Clock 1093 + # 1094 + CONFIG_RTC_LIB=y 1095 + CONFIG_RTC_CLASS=y 1096 + CONFIG_RTC_HCTOSYS=y 1097 + CONFIG_RTC_HCTOSYS_DEVICE="rtc0" 1098 + 1099 + # 1100 + # RTC interfaces 1101 + # 1102 + CONFIG_RTC_INTF_SYSFS=y 1103 + CONFIG_RTC_INTF_PROC=y 1104 + CONFIG_RTC_INTF_DEV=y 1105 + CONFIG_RTC_INTF_DEV_UIE_EMUL=y 1106 + 1107 + # 1108 + # RTC drivers 1109 + # 1110 + # CONFIG_RTC_DRV_X1205 is not set 1111 + CONFIG_RTC_DRV_DS1307=y 1112 + # CONFIG_RTC_DRV_DS1553 is not set 1113 + # CONFIG_RTC_DRV_DS1672 is not set 1114 + # CONFIG_RTC_DRV_DS1742 is not set 1115 + # CONFIG_RTC_DRV_PCF8563 is not set 1116 + # CONFIG_RTC_DRV_PCF8583 is not set 1117 + # CONFIG_RTC_DRV_RS5C348 is not set 1118 + # CONFIG_RTC_DRV_RS5C372 is not set 1119 + # CONFIG_RTC_DRV_M48T86 is not set 1120 + # CONFIG_RTC_DRV_TEST is not set 1121 + # CONFIG_RTC_DRV_MAX6902 is not set 1122 + # CONFIG_RTC_DRV_V3020 is not set 1123 + 1124 + # 1125 + # DMA Engine support 1126 + # 1127 + CONFIG_DMA_ENGINE=y 1128 + 1129 + # 1130 + # DMA Clients 1131 + # 1132 + CONFIG_NET_DMA=y 1133 + 1134 + # 1135 + # DMA Devices 1136 + # 1137 + CONFIG_INTEL_IOATDMA=y 1138 + 1139 + # 1140 + # File systems 1141 + # 1142 + CONFIG_EXT2_FS=y 1143 + # CONFIG_EXT2_FS_XATTR is not set 1144 + # CONFIG_EXT2_FS_XIP is not set 1145 + CONFIG_EXT3_FS=y 1146 + CONFIG_EXT3_FS_XATTR=y 1147 + # CONFIG_EXT3_FS_POSIX_ACL is not set 1148 + # CONFIG_EXT3_FS_SECURITY is not set 1149 + CONFIG_JBD=y 1150 + # CONFIG_JBD_DEBUG is not set 1151 + CONFIG_FS_MBCACHE=y 1152 + # CONFIG_REISERFS_FS is not set 1153 + # CONFIG_JFS_FS is not set 1154 + # CONFIG_FS_POSIX_ACL is not set 1155 + # CONFIG_XFS_FS is not set 1156 + # CONFIG_OCFS2_FS is not set 1157 + # CONFIG_MINIX_FS is not set 1158 + # CONFIG_ROMFS_FS is not set 1159 + CONFIG_INOTIFY=y 1160 + CONFIG_INOTIFY_USER=y 1161 + # CONFIG_QUOTA is not set 1162 + CONFIG_DNOTIFY=y 1163 + # CONFIG_AUTOFS_FS is not set 1164 + # CONFIG_AUTOFS4_FS is not set 1165 + # CONFIG_FUSE_FS is not set 1166 + 1167 + # 1168 + # CD-ROM/DVD Filesystems 1169 + # 1170 + # CONFIG_ISO9660_FS is not set 1171 + # CONFIG_UDF_FS is not set 1172 + 1173 + # 1174 + # DOS/FAT/NT Filesystems 1175 + # 1176 + # CONFIG_MSDOS_FS is not set 1177 + # CONFIG_VFAT_FS is not set 1178 + # CONFIG_NTFS_FS is not set 1179 + 1180 + # 1181 + # Pseudo filesystems 1182 + # 1183 + CONFIG_PROC_FS=y 1184 + CONFIG_PROC_KCORE=y 1185 + CONFIG_SYSFS=y 1186 + CONFIG_TMPFS=y 1187 + # CONFIG_HUGETLB_PAGE is not set 1188 + CONFIG_RAMFS=y 1189 + # CONFIG_CONFIGFS_FS is not set 1190 + 1191 + # 1192 + # Miscellaneous filesystems 1193 + # 1194 + # CONFIG_ADFS_FS is not set 1195 + # CONFIG_AFFS_FS is not set 1196 + # CONFIG_HFS_FS is not set 1197 + # CONFIG_HFSPLUS_FS is not set 1198 + # CONFIG_BEFS_FS is not set 1199 + # CONFIG_BFS_FS is not set 1200 + # CONFIG_EFS_FS is not set 1201 + # CONFIG_JFFS_FS is not set 1202 + # CONFIG_JFFS2_FS is not set 1203 + # CONFIG_CRAMFS is not set 1204 + # CONFIG_VXFS_FS is not set 1205 + # CONFIG_HPFS_FS is not set 1206 + # CONFIG_QNX4FS_FS is not set 1207 + # CONFIG_SYSV_FS is not set 1208 + # CONFIG_UFS_FS is not set 1209 + 1210 + # 1211 + # Network File Systems 1212 + # 1213 + CONFIG_NFS_FS=y 1214 + CONFIG_NFS_V3=y 1215 + # CONFIG_NFS_V3_ACL is not set 1216 + CONFIG_NFS_V4=y 1217 + # CONFIG_NFS_DIRECTIO is not set 1218 + # CONFIG_NFSD is not set 1219 + CONFIG_ROOT_NFS=y 1220 + CONFIG_LOCKD=y 1221 + CONFIG_LOCKD_V4=y 1222 + CONFIG_NFS_COMMON=y 1223 + CONFIG_SUNRPC=y 1224 + CONFIG_SUNRPC_GSS=y 1225 + CONFIG_RPCSEC_GSS_KRB5=y 1226 + # CONFIG_RPCSEC_GSS_SPKM3 is not set 1227 + # CONFIG_SMB_FS is not set 1228 + # CONFIG_CIFS is not set 1229 + # CONFIG_CIFS_DEBUG2 is not set 1230 + # CONFIG_NCP_FS is not set 1231 + # CONFIG_CODA_FS is not set 1232 + # CONFIG_AFS_FS is not set 1233 + # CONFIG_9P_FS is not set 1234 + 1235 + # 1236 + # Partition Types 1237 + # 1238 + CONFIG_PARTITION_ADVANCED=y 1239 + # CONFIG_ACORN_PARTITION is not set 1240 + # CONFIG_OSF_PARTITION is not set 1241 + # CONFIG_AMIGA_PARTITION is not set 1242 + # CONFIG_ATARI_PARTITION is not set 1243 + # CONFIG_MAC_PARTITION is not set 1244 + # CONFIG_MSDOS_PARTITION is not set 1245 + # CONFIG_LDM_PARTITION is not set 1246 + # CONFIG_SGI_PARTITION is not set 1247 + # CONFIG_ULTRIX_PARTITION is not set 1248 + # CONFIG_SUN_PARTITION is not set 1249 + # CONFIG_KARMA_PARTITION is not set 1250 + # CONFIG_EFI_PARTITION is not set 1251 + 1252 + # 1253 + # Native Language Support 1254 + # 1255 + # CONFIG_NLS is not set 1256 + 1257 + # 1258 + # Library routines 1259 + # 1260 + # CONFIG_CRC_CCITT is not set 1261 + # CONFIG_CRC16 is not set 1262 + CONFIG_CRC32=y 1263 + # CONFIG_LIBCRC32C is not set 1264 + CONFIG_PLIST=y 1265 + 1266 + # 1267 + # Instrumentation Support 1268 + # 1269 + # CONFIG_PROFILING is not set 1270 + 1271 + # 1272 + # Kernel hacking 1273 + # 1274 + CONFIG_PRINTK_TIME=y 1275 + # CONFIG_MAGIC_SYSRQ is not set 1276 + # CONFIG_UNUSED_SYMBOLS is not set 1277 + CONFIG_DEBUG_KERNEL=y 1278 + CONFIG_LOG_BUF_SHIFT=17 1279 + CONFIG_DETECT_SOFTLOCKUP=y 1280 + # CONFIG_SCHEDSTATS is not set 1281 + # CONFIG_DEBUG_SLAB is not set 1282 + # CONFIG_DEBUG_MUTEXES is not set 1283 + # CONFIG_DEBUG_RT_MUTEXES is not set 1284 + # CONFIG_RT_MUTEX_TESTER is not set 1285 + # CONFIG_DEBUG_SPINLOCK is not set 1286 + # CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1287 + # CONFIG_DEBUG_KOBJECT is not set 1288 + CONFIG_DEBUG_INFO=y 1289 + # CONFIG_DEBUG_FS is not set 1290 + # CONFIG_DEBUG_VM is not set 1291 + CONFIG_FORCED_INLINING=y 1292 + # CONFIG_RCU_TORTURE_TEST is not set 1293 + # CONFIG_DEBUGGER is not set 1294 + # CONFIG_BDI_SWITCH is not set 1295 + CONFIG_BOOTX_TEXT=y 1296 + CONFIG_SERIAL_TEXT_DEBUG=y 1297 + # CONFIG_PPC_EARLY_DEBUG is not set 1298 + 1299 + # 1300 + # Security options 1301 + # 1302 + # CONFIG_KEYS is not set 1303 + # CONFIG_SECURITY is not set 1304 + 1305 + # 1306 + # Cryptographic options 1307 + # 1308 + CONFIG_CRYPTO=y 1309 + # CONFIG_CRYPTO_HMAC is not set 1310 + # CONFIG_CRYPTO_NULL is not set 1311 + # CONFIG_CRYPTO_MD4 is not set 1312 + CONFIG_CRYPTO_MD5=y 1313 + # CONFIG_CRYPTO_SHA1 is not set 1314 + # CONFIG_CRYPTO_SHA256 is not set 1315 + # CONFIG_CRYPTO_SHA512 is not set 1316 + # CONFIG_CRYPTO_WP512 is not set 1317 + # CONFIG_CRYPTO_TGR192 is not set 1318 + CONFIG_CRYPTO_DES=y 1319 + # CONFIG_CRYPTO_BLOWFISH is not set 1320 + # CONFIG_CRYPTO_TWOFISH is not set 1321 + # CONFIG_CRYPTO_SERPENT is not set 1322 + # CONFIG_CRYPTO_AES is not set 1323 + # CONFIG_CRYPTO_CAST5 is not set 1324 + # CONFIG_CRYPTO_CAST6 is not set 1325 + # CONFIG_CRYPTO_TEA is not set 1326 + # CONFIG_CRYPTO_ARC4 is not set 1327 + # CONFIG_CRYPTO_KHAZAD is not set 1328 + # CONFIG_CRYPTO_ANUBIS is not set 1329 + # CONFIG_CRYPTO_DEFLATE is not set 1330 + # CONFIG_CRYPTO_MICHAEL_MIC is not set 1331 + # CONFIG_CRYPTO_CRC32C is not set 1332 + # CONFIG_CRYPTO_TEST is not set 1333 + 1334 + # 1335 + # Hardware crypto devices 1336 + #
+14 -6
arch/powerpc/kernel/btext.c
··· 111 111 logicalDisplayBase = (unsigned char *)address; 112 112 dispDeviceBase = (unsigned char *)address; 113 113 dispDeviceRowBytes = pitch; 114 - dispDeviceDepth = depth; 114 + dispDeviceDepth = depth == 15 ? 16 : depth; 115 115 dispDeviceRect[0] = dispDeviceRect[1] = 0; 116 116 dispDeviceRect[2] = width; 117 117 dispDeviceRect[3] = height; ··· 160 160 unsigned long address = 0; 161 161 u32 *prop; 162 162 163 - prop = (u32 *)get_property(np, "width", NULL); 163 + prop = (u32 *)get_property(np, "linux,bootx-width", NULL); 164 + if (prop == NULL) 165 + prop = (u32 *)get_property(np, "width", NULL); 164 166 if (prop == NULL) 165 167 return -EINVAL; 166 168 width = *prop; 167 - prop = (u32 *)get_property(np, "height", NULL); 169 + prop = (u32 *)get_property(np, "linux,bootx-height", NULL); 170 + if (prop == NULL) 171 + prop = (u32 *)get_property(np, "height", NULL); 168 172 if (prop == NULL) 169 173 return -EINVAL; 170 174 height = *prop; 171 - prop = (u32 *)get_property(np, "depth", NULL); 175 + prop = (u32 *)get_property(np, "linux,bootx-depth", NULL); 176 + if (prop == NULL) 177 + prop = (u32 *)get_property(np, "depth", NULL); 172 178 if (prop == NULL) 173 179 return -EINVAL; 174 180 depth = *prop; 175 181 pitch = width * ((depth + 7) / 8); 176 - prop = (u32 *)get_property(np, "linebytes", NULL); 182 + prop = (u32 *)get_property(np, "linux,bootx-linebytes", NULL); 183 + if (prop == NULL) 184 + prop = (u32 *)get_property(np, "linebytes", NULL); 177 185 if (prop) 178 186 pitch = *prop; 179 187 if (pitch == 1) ··· 202 194 g_max_loc_Y = height / 16; 203 195 dispDeviceBase = (unsigned char *)address; 204 196 dispDeviceRowBytes = pitch; 205 - dispDeviceDepth = depth; 197 + dispDeviceDepth = depth == 15 ? 16 : depth; 206 198 dispDeviceRect[0] = dispDeviceRect[1] = 0; 207 199 dispDeviceRect[2] = width; 208 200 dispDeviceRect[3] = height;
+2 -7
arch/powerpc/kernel/ibmebus.c
··· 323 323 unsigned long irq_flags, const char * devname, 324 324 void *dev_id) 325 325 { 326 - unsigned int irq = virt_irq_create_mapping(ist); 326 + unsigned int irq = irq_create_mapping(NULL, ist, 0); 327 327 328 328 if (irq == NO_IRQ) 329 329 return -EINVAL; 330 - 331 - irq = irq_offset_up(irq); 332 330 333 331 return request_irq(irq, handler, 334 332 irq_flags, devname, dev_id); ··· 335 337 336 338 void ibmebus_free_irq(struct ibmebus_dev *dev, u32 ist, void *dev_id) 337 339 { 338 - unsigned int irq = virt_irq_create_mapping(ist); 340 + unsigned int irq = irq_find_mapping(NULL, ist); 339 341 340 - irq = irq_offset_up(irq); 341 342 free_irq(irq, dev_id); 342 - 343 - return; 344 343 } 345 344 EXPORT_SYMBOL(ibmebus_free_irq); 346 345
+520 -141
arch/powerpc/kernel/irq.c
··· 29 29 * to reduce code space and undefined function references. 30 30 */ 31 31 32 + #undef DEBUG 33 + 32 34 #include <linux/module.h> 33 35 #include <linux/threads.h> 34 36 #include <linux/kernel_stat.h> ··· 48 46 #include <linux/cpumask.h> 49 47 #include <linux/profile.h> 50 48 #include <linux/bitops.h> 51 - #include <linux/pci.h> 49 + #include <linux/list.h> 50 + #include <linux/radix-tree.h> 51 + #include <linux/mutex.h> 52 + #include <linux/bootmem.h> 52 53 53 54 #include <asm/uaccess.h> 54 55 #include <asm/system.h> ··· 62 57 #include <asm/prom.h> 63 58 #include <asm/ptrace.h> 64 59 #include <asm/machdep.h> 60 + #include <asm/udbg.h> 65 61 #ifdef CONFIG_PPC_ISERIES 66 62 #include <asm/paca.h> 67 63 #endif 68 64 69 65 int __irq_offset_value; 70 - #ifdef CONFIG_PPC32 71 - EXPORT_SYMBOL(__irq_offset_value); 72 - #endif 73 - 74 66 static int ppc_spurious_interrupts; 75 67 76 68 #ifdef CONFIG_PPC32 77 - #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 78 - 79 - unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 69 + EXPORT_SYMBOL(__irq_offset_value); 80 70 atomic_t ppc_n_lost_interrupts; 71 + 72 + #ifndef CONFIG_PPC_MERGE 73 + #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 74 + unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 75 + #endif 81 76 82 77 #ifdef CONFIG_TAU_INT 83 78 extern int tau_initialized; 84 79 extern int tau_interrupts(int); 85 80 #endif 81 + #endif /* CONFIG_PPC32 */ 86 82 87 83 #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) 88 84 extern atomic_t ipi_recv; 89 85 extern atomic_t ipi_sent; 90 86 #endif 91 - #endif /* CONFIG_PPC32 */ 92 87 93 88 #ifdef CONFIG_PPC64 94 89 EXPORT_SYMBOL(irq_desc); 95 90 96 91 int distribute_irqs = 1; 97 - u64 ppc64_interrupt_controller; 98 92 #endif /* CONFIG_PPC64 */ 99 93 100 94 int show_interrupts(struct seq_file *p, void *v) ··· 186 182 187 183 void do_IRQ(struct pt_regs *regs) 188 184 { 189 - int irq; 185 + unsigned int irq; 190 186 #ifdef CONFIG_IRQSTACKS 191 187 struct thread_info *curtp, *irqtp; 192 188 #endif ··· 217 213 */ 218 214 irq = ppc_md.get_irq(regs); 219 215 220 - if (irq >= 0) { 216 + if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) { 221 217 #ifdef CONFIG_IRQSTACKS 222 218 /* Switch to the irq stack to handle this */ 223 219 curtp = current_thread_info(); 224 220 irqtp = hardirq_ctx[smp_processor_id()]; 225 221 if (curtp != irqtp) { 222 + struct irq_desc *desc = irq_desc + irq; 223 + void *handler = desc->handle_irq; 224 + if (handler == NULL) 225 + handler = &__do_IRQ; 226 226 irqtp->task = curtp->task; 227 227 irqtp->flags = 0; 228 - call___do_IRQ(irq, regs, irqtp); 228 + call_handle_irq(irq, desc, regs, irqtp, handler); 229 229 irqtp->task = NULL; 230 230 if (irqtp->flags) 231 231 set_bits(irqtp->flags, &curtp->flags); 232 232 } else 233 233 #endif 234 - __do_IRQ(irq, regs); 235 - } else if (irq != -2) 234 + generic_handle_irq(irq, regs); 235 + } else if (irq != NO_IRQ_IGNORE) 236 236 /* That's not SMP safe ... but who cares ? */ 237 237 ppc_spurious_interrupts++; 238 238 ··· 253 245 254 246 void __init init_IRQ(void) 255 247 { 256 - #ifdef CONFIG_PPC64 257 - static int once = 0; 258 - 259 - if (once) 260 - return; 261 - 262 - once++; 263 - 264 - #endif 265 248 ppc_md.init_IRQ(); 266 249 #ifdef CONFIG_PPC64 267 250 irq_ctx_init(); 268 251 #endif 269 252 } 270 253 271 - #ifdef CONFIG_PPC64 272 - /* 273 - * Virtual IRQ mapping code, used on systems with XICS interrupt controllers. 274 - */ 275 - 276 - #define UNDEFINED_IRQ 0xffffffff 277 - unsigned int virt_irq_to_real_map[NR_IRQS]; 278 - 279 - /* 280 - * Don't use virtual irqs 0, 1, 2 for devices. 281 - * The pcnet32 driver considers interrupt numbers < 2 to be invalid, 282 - * and 2 is the XICS IPI interrupt. 283 - * We limit virtual irqs to __irq_offet_value less than virt_irq_max so 284 - * that when we offset them we don't end up with an interrupt 285 - * number >= virt_irq_max. 286 - */ 287 - #define MIN_VIRT_IRQ 3 288 - 289 - unsigned int virt_irq_max; 290 - static unsigned int max_virt_irq; 291 - static unsigned int nr_virt_irqs; 292 - 293 - void 294 - virt_irq_init(void) 295 - { 296 - int i; 297 - 298 - if ((virt_irq_max == 0) || (virt_irq_max > (NR_IRQS - 1))) 299 - virt_irq_max = NR_IRQS - 1; 300 - max_virt_irq = virt_irq_max - __irq_offset_value; 301 - nr_virt_irqs = max_virt_irq - MIN_VIRT_IRQ + 1; 302 - 303 - for (i = 0; i < NR_IRQS; i++) 304 - virt_irq_to_real_map[i] = UNDEFINED_IRQ; 305 - } 306 - 307 - /* Create a mapping for a real_irq if it doesn't already exist. 308 - * Return the virtual irq as a convenience. 309 - */ 310 - int virt_irq_create_mapping(unsigned int real_irq) 311 - { 312 - unsigned int virq, first_virq; 313 - static int warned; 314 - 315 - if (ppc64_interrupt_controller == IC_OPEN_PIC) 316 - return real_irq; /* no mapping for openpic (for now) */ 317 - 318 - if (ppc64_interrupt_controller == IC_CELL_PIC) 319 - return real_irq; /* no mapping for iic either */ 320 - 321 - /* don't map interrupts < MIN_VIRT_IRQ */ 322 - if (real_irq < MIN_VIRT_IRQ) { 323 - virt_irq_to_real_map[real_irq] = real_irq; 324 - return real_irq; 325 - } 326 - 327 - /* map to a number between MIN_VIRT_IRQ and max_virt_irq */ 328 - virq = real_irq; 329 - if (virq > max_virt_irq) 330 - virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ; 331 - 332 - /* search for this number or a free slot */ 333 - first_virq = virq; 334 - while (virt_irq_to_real_map[virq] != UNDEFINED_IRQ) { 335 - if (virt_irq_to_real_map[virq] == real_irq) 336 - return virq; 337 - if (++virq > max_virt_irq) 338 - virq = MIN_VIRT_IRQ; 339 - if (virq == first_virq) 340 - goto nospace; /* oops, no free slots */ 341 - } 342 - 343 - virt_irq_to_real_map[virq] = real_irq; 344 - return virq; 345 - 346 - nospace: 347 - if (!warned) { 348 - printk(KERN_CRIT "Interrupt table is full\n"); 349 - printk(KERN_CRIT "Increase virt_irq_max (currently %d) " 350 - "in your kernel sources and rebuild.\n", virt_irq_max); 351 - warned = 1; 352 - } 353 - return NO_IRQ; 354 - } 355 - 356 - /* 357 - * In most cases will get a hit on the very first slot checked in the 358 - * virt_irq_to_real_map. Only when there are a large number of 359 - * IRQs will this be expensive. 360 - */ 361 - unsigned int real_irq_to_virt_slowpath(unsigned int real_irq) 362 - { 363 - unsigned int virq; 364 - unsigned int first_virq; 365 - 366 - virq = real_irq; 367 - 368 - if (virq > max_virt_irq) 369 - virq = (virq % nr_virt_irqs) + MIN_VIRT_IRQ; 370 - 371 - first_virq = virq; 372 - 373 - do { 374 - if (virt_irq_to_real_map[virq] == real_irq) 375 - return virq; 376 - 377 - virq++; 378 - 379 - if (virq >= max_virt_irq) 380 - virq = 0; 381 - 382 - } while (first_virq != virq); 383 - 384 - return NO_IRQ; 385 - 386 - } 387 - #endif /* CONFIG_PPC64 */ 388 254 389 255 #ifdef CONFIG_IRQSTACKS 390 256 struct thread_info *softirq_ctx[NR_CPUS] __read_mostly; ··· 312 430 local_irq_restore(flags); 313 431 } 314 432 EXPORT_SYMBOL(do_softirq); 433 + 434 + 435 + /* 436 + * IRQ controller and virtual interrupts 437 + */ 438 + 439 + #ifdef CONFIG_PPC_MERGE 440 + 441 + static LIST_HEAD(irq_hosts); 442 + static spinlock_t irq_big_lock = SPIN_LOCK_UNLOCKED; 443 + 444 + struct irq_map_entry irq_map[NR_IRQS]; 445 + static unsigned int irq_virq_count = NR_IRQS; 446 + static struct irq_host *irq_default_host; 447 + 448 + struct irq_host *irq_alloc_host(unsigned int revmap_type, 449 + unsigned int revmap_arg, 450 + struct irq_host_ops *ops, 451 + irq_hw_number_t inval_irq) 452 + { 453 + struct irq_host *host; 454 + unsigned int size = sizeof(struct irq_host); 455 + unsigned int i; 456 + unsigned int *rmap; 457 + unsigned long flags; 458 + 459 + /* Allocate structure and revmap table if using linear mapping */ 460 + if (revmap_type == IRQ_HOST_MAP_LINEAR) 461 + size += revmap_arg * sizeof(unsigned int); 462 + if (mem_init_done) 463 + host = kzalloc(size, GFP_KERNEL); 464 + else { 465 + host = alloc_bootmem(size); 466 + if (host) 467 + memset(host, 0, size); 468 + } 469 + if (host == NULL) 470 + return NULL; 471 + 472 + /* Fill structure */ 473 + host->revmap_type = revmap_type; 474 + host->inval_irq = inval_irq; 475 + host->ops = ops; 476 + 477 + spin_lock_irqsave(&irq_big_lock, flags); 478 + 479 + /* If it's a legacy controller, check for duplicates and 480 + * mark it as allocated (we use irq 0 host pointer for that 481 + */ 482 + if (revmap_type == IRQ_HOST_MAP_LEGACY) { 483 + if (irq_map[0].host != NULL) { 484 + spin_unlock_irqrestore(&irq_big_lock, flags); 485 + /* If we are early boot, we can't free the structure, 486 + * too bad... 487 + * this will be fixed once slab is made available early 488 + * instead of the current cruft 489 + */ 490 + if (mem_init_done) 491 + kfree(host); 492 + return NULL; 493 + } 494 + irq_map[0].host = host; 495 + } 496 + 497 + list_add(&host->link, &irq_hosts); 498 + spin_unlock_irqrestore(&irq_big_lock, flags); 499 + 500 + /* Additional setups per revmap type */ 501 + switch(revmap_type) { 502 + case IRQ_HOST_MAP_LEGACY: 503 + /* 0 is always the invalid number for legacy */ 504 + host->inval_irq = 0; 505 + /* setup us as the host for all legacy interrupts */ 506 + for (i = 1; i < NUM_ISA_INTERRUPTS; i++) { 507 + irq_map[i].hwirq = 0; 508 + smp_wmb(); 509 + irq_map[i].host = host; 510 + smp_wmb(); 511 + 512 + /* Clear some flags */ 513 + get_irq_desc(i)->status 514 + &= ~(IRQ_NOREQUEST | IRQ_LEVEL); 515 + 516 + /* Legacy flags are left to default at this point, 517 + * one can then use irq_create_mapping() to 518 + * explicitely change them 519 + */ 520 + ops->map(host, i, i, 0); 521 + } 522 + break; 523 + case IRQ_HOST_MAP_LINEAR: 524 + rmap = (unsigned int *)(host + 1); 525 + for (i = 0; i < revmap_arg; i++) 526 + rmap[i] = IRQ_NONE; 527 + host->revmap_data.linear.size = revmap_arg; 528 + smp_wmb(); 529 + host->revmap_data.linear.revmap = rmap; 530 + break; 531 + default: 532 + break; 533 + } 534 + 535 + pr_debug("irq: Allocated host of type %d @0x%p\n", revmap_type, host); 536 + 537 + return host; 538 + } 539 + 540 + struct irq_host *irq_find_host(struct device_node *node) 541 + { 542 + struct irq_host *h, *found = NULL; 543 + unsigned long flags; 544 + 545 + /* We might want to match the legacy controller last since 546 + * it might potentially be set to match all interrupts in 547 + * the absence of a device node. This isn't a problem so far 548 + * yet though... 549 + */ 550 + spin_lock_irqsave(&irq_big_lock, flags); 551 + list_for_each_entry(h, &irq_hosts, link) 552 + if (h->ops->match == NULL || h->ops->match(h, node)) { 553 + found = h; 554 + break; 555 + } 556 + spin_unlock_irqrestore(&irq_big_lock, flags); 557 + return found; 558 + } 559 + EXPORT_SYMBOL_GPL(irq_find_host); 560 + 561 + void irq_set_default_host(struct irq_host *host) 562 + { 563 + pr_debug("irq: Default host set to @0x%p\n", host); 564 + 565 + irq_default_host = host; 566 + } 567 + 568 + void irq_set_virq_count(unsigned int count) 569 + { 570 + pr_debug("irq: Trying to set virq count to %d\n", count); 571 + 572 + BUG_ON(count < NUM_ISA_INTERRUPTS); 573 + if (count < NR_IRQS) 574 + irq_virq_count = count; 575 + } 576 + 577 + unsigned int irq_create_mapping(struct irq_host *host, 578 + irq_hw_number_t hwirq, 579 + unsigned int flags) 580 + { 581 + unsigned int virq, hint; 582 + 583 + pr_debug("irq: irq_create_mapping(0x%p, 0x%lx, 0x%x)\n", 584 + host, hwirq, flags); 585 + 586 + /* Look for default host if nececssary */ 587 + if (host == NULL) 588 + host = irq_default_host; 589 + if (host == NULL) { 590 + printk(KERN_WARNING "irq_create_mapping called for" 591 + " NULL host, hwirq=%lx\n", hwirq); 592 + WARN_ON(1); 593 + return NO_IRQ; 594 + } 595 + pr_debug("irq: -> using host @%p\n", host); 596 + 597 + /* Check if mapping already exist, if it does, call 598 + * host->ops->map() to update the flags 599 + */ 600 + virq = irq_find_mapping(host, hwirq); 601 + if (virq != IRQ_NONE) { 602 + pr_debug("irq: -> existing mapping on virq %d\n", virq); 603 + host->ops->map(host, virq, hwirq, flags); 604 + return virq; 605 + } 606 + 607 + /* Get a virtual interrupt number */ 608 + if (host->revmap_type == IRQ_HOST_MAP_LEGACY) { 609 + /* Handle legacy */ 610 + virq = (unsigned int)hwirq; 611 + if (virq == 0 || virq >= NUM_ISA_INTERRUPTS) 612 + return NO_IRQ; 613 + return virq; 614 + } else { 615 + /* Allocate a virtual interrupt number */ 616 + hint = hwirq % irq_virq_count; 617 + virq = irq_alloc_virt(host, 1, hint); 618 + if (virq == NO_IRQ) { 619 + pr_debug("irq: -> virq allocation failed\n"); 620 + return NO_IRQ; 621 + } 622 + } 623 + pr_debug("irq: -> obtained virq %d\n", virq); 624 + 625 + /* Clear some flags */ 626 + get_irq_desc(virq)->status &= ~(IRQ_NOREQUEST | IRQ_LEVEL); 627 + 628 + /* map it */ 629 + if (host->ops->map(host, virq, hwirq, flags)) { 630 + pr_debug("irq: -> mapping failed, freeing\n"); 631 + irq_free_virt(virq, 1); 632 + return NO_IRQ; 633 + } 634 + smp_wmb(); 635 + irq_map[virq].hwirq = hwirq; 636 + smp_mb(); 637 + return virq; 638 + } 639 + EXPORT_SYMBOL_GPL(irq_create_mapping); 640 + 641 + extern unsigned int irq_create_of_mapping(struct device_node *controller, 642 + u32 *intspec, unsigned int intsize) 643 + { 644 + struct irq_host *host; 645 + irq_hw_number_t hwirq; 646 + unsigned int flags = IRQ_TYPE_NONE; 647 + 648 + if (controller == NULL) 649 + host = irq_default_host; 650 + else 651 + host = irq_find_host(controller); 652 + if (host == NULL) 653 + return NO_IRQ; 654 + 655 + /* If host has no translation, then we assume interrupt line */ 656 + if (host->ops->xlate == NULL) 657 + hwirq = intspec[0]; 658 + else { 659 + if (host->ops->xlate(host, controller, intspec, intsize, 660 + &hwirq, &flags)) 661 + return NO_IRQ; 662 + } 663 + 664 + return irq_create_mapping(host, hwirq, flags); 665 + } 666 + EXPORT_SYMBOL_GPL(irq_create_of_mapping); 667 + 668 + unsigned int irq_of_parse_and_map(struct device_node *dev, int index) 669 + { 670 + struct of_irq oirq; 671 + 672 + if (of_irq_map_one(dev, index, &oirq)) 673 + return NO_IRQ; 674 + 675 + return irq_create_of_mapping(oirq.controller, oirq.specifier, 676 + oirq.size); 677 + } 678 + EXPORT_SYMBOL_GPL(irq_of_parse_and_map); 679 + 680 + void irq_dispose_mapping(unsigned int virq) 681 + { 682 + struct irq_host *host = irq_map[virq].host; 683 + irq_hw_number_t hwirq; 684 + unsigned long flags; 685 + 686 + WARN_ON (host == NULL); 687 + if (host == NULL) 688 + return; 689 + 690 + /* Never unmap legacy interrupts */ 691 + if (host->revmap_type == IRQ_HOST_MAP_LEGACY) 692 + return; 693 + 694 + /* remove chip and handler */ 695 + set_irq_chip_and_handler(virq, NULL, NULL); 696 + 697 + /* Make sure it's completed */ 698 + synchronize_irq(virq); 699 + 700 + /* Tell the PIC about it */ 701 + if (host->ops->unmap) 702 + host->ops->unmap(host, virq); 703 + smp_mb(); 704 + 705 + /* Clear reverse map */ 706 + hwirq = irq_map[virq].hwirq; 707 + switch(host->revmap_type) { 708 + case IRQ_HOST_MAP_LINEAR: 709 + if (hwirq < host->revmap_data.linear.size) 710 + host->revmap_data.linear.revmap[hwirq] = IRQ_NONE; 711 + break; 712 + case IRQ_HOST_MAP_TREE: 713 + /* Check if radix tree allocated yet */ 714 + if (host->revmap_data.tree.gfp_mask == 0) 715 + break; 716 + /* XXX radix tree not safe ! remove lock whem it becomes safe 717 + * and use some RCU sync to make sure everything is ok before we 718 + * can re-use that map entry 719 + */ 720 + spin_lock_irqsave(&irq_big_lock, flags); 721 + radix_tree_delete(&host->revmap_data.tree, hwirq); 722 + spin_unlock_irqrestore(&irq_big_lock, flags); 723 + break; 724 + } 725 + 726 + /* Destroy map */ 727 + smp_mb(); 728 + irq_map[virq].hwirq = host->inval_irq; 729 + 730 + /* Set some flags */ 731 + get_irq_desc(virq)->status |= IRQ_NOREQUEST; 732 + 733 + /* Free it */ 734 + irq_free_virt(virq, 1); 735 + } 736 + EXPORT_SYMBOL_GPL(irq_dispose_mapping); 737 + 738 + unsigned int irq_find_mapping(struct irq_host *host, 739 + irq_hw_number_t hwirq) 740 + { 741 + unsigned int i; 742 + unsigned int hint = hwirq % irq_virq_count; 743 + 744 + /* Look for default host if nececssary */ 745 + if (host == NULL) 746 + host = irq_default_host; 747 + if (host == NULL) 748 + return NO_IRQ; 749 + 750 + /* legacy -> bail early */ 751 + if (host->revmap_type == IRQ_HOST_MAP_LEGACY) 752 + return hwirq; 753 + 754 + /* Slow path does a linear search of the map */ 755 + if (hint < NUM_ISA_INTERRUPTS) 756 + hint = NUM_ISA_INTERRUPTS; 757 + i = hint; 758 + do { 759 + if (irq_map[i].host == host && 760 + irq_map[i].hwirq == hwirq) 761 + return i; 762 + i++; 763 + if (i >= irq_virq_count) 764 + i = NUM_ISA_INTERRUPTS; 765 + } while(i != hint); 766 + return NO_IRQ; 767 + } 768 + EXPORT_SYMBOL_GPL(irq_find_mapping); 769 + 770 + 771 + unsigned int irq_radix_revmap(struct irq_host *host, 772 + irq_hw_number_t hwirq) 773 + { 774 + struct radix_tree_root *tree; 775 + struct irq_map_entry *ptr; 776 + unsigned int virq; 777 + unsigned long flags; 778 + 779 + WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE); 780 + 781 + /* Check if the radix tree exist yet. We test the value of 782 + * the gfp_mask for that. Sneaky but saves another int in the 783 + * structure. If not, we fallback to slow mode 784 + */ 785 + tree = &host->revmap_data.tree; 786 + if (tree->gfp_mask == 0) 787 + return irq_find_mapping(host, hwirq); 788 + 789 + /* XXX Current radix trees are NOT SMP safe !!! Remove that lock 790 + * when that is fixed (when Nick's patch gets in 791 + */ 792 + spin_lock_irqsave(&irq_big_lock, flags); 793 + 794 + /* Now try to resolve */ 795 + ptr = radix_tree_lookup(tree, hwirq); 796 + /* Found it, return */ 797 + if (ptr) { 798 + virq = ptr - irq_map; 799 + goto bail; 800 + } 801 + 802 + /* If not there, try to insert it */ 803 + virq = irq_find_mapping(host, hwirq); 804 + if (virq != NO_IRQ) 805 + radix_tree_insert(tree, virq, &irq_map[virq]); 806 + bail: 807 + spin_unlock_irqrestore(&irq_big_lock, flags); 808 + return virq; 809 + } 810 + 811 + unsigned int irq_linear_revmap(struct irq_host *host, 812 + irq_hw_number_t hwirq) 813 + { 814 + unsigned int *revmap; 815 + 816 + WARN_ON(host->revmap_type != IRQ_HOST_MAP_LINEAR); 817 + 818 + /* Check revmap bounds */ 819 + if (unlikely(hwirq >= host->revmap_data.linear.size)) 820 + return irq_find_mapping(host, hwirq); 821 + 822 + /* Check if revmap was allocated */ 823 + revmap = host->revmap_data.linear.revmap; 824 + if (unlikely(revmap == NULL)) 825 + return irq_find_mapping(host, hwirq); 826 + 827 + /* Fill up revmap with slow path if no mapping found */ 828 + if (unlikely(revmap[hwirq] == NO_IRQ)) 829 + revmap[hwirq] = irq_find_mapping(host, hwirq); 830 + 831 + return revmap[hwirq]; 832 + } 833 + 834 + unsigned int irq_alloc_virt(struct irq_host *host, 835 + unsigned int count, 836 + unsigned int hint) 837 + { 838 + unsigned long flags; 839 + unsigned int i, j, found = NO_IRQ; 840 + unsigned int limit = irq_virq_count - count; 841 + 842 + if (count == 0 || count > (irq_virq_count - NUM_ISA_INTERRUPTS)) 843 + return NO_IRQ; 844 + 845 + spin_lock_irqsave(&irq_big_lock, flags); 846 + 847 + /* Use hint for 1 interrupt if any */ 848 + if (count == 1 && hint >= NUM_ISA_INTERRUPTS && 849 + hint < irq_virq_count && irq_map[hint].host == NULL) { 850 + found = hint; 851 + goto hint_found; 852 + } 853 + 854 + /* Look for count consecutive numbers in the allocatable 855 + * (non-legacy) space 856 + */ 857 + for (i = NUM_ISA_INTERRUPTS; i <= limit; ) { 858 + for (j = i; j < (i + count); j++) 859 + if (irq_map[j].host != NULL) { 860 + i = j + 1; 861 + continue; 862 + } 863 + found = i; 864 + break; 865 + } 866 + if (found == NO_IRQ) { 867 + spin_unlock_irqrestore(&irq_big_lock, flags); 868 + return NO_IRQ; 869 + } 870 + hint_found: 871 + for (i = found; i < (found + count); i++) { 872 + irq_map[i].hwirq = host->inval_irq; 873 + smp_wmb(); 874 + irq_map[i].host = host; 875 + } 876 + spin_unlock_irqrestore(&irq_big_lock, flags); 877 + return found; 878 + } 879 + 880 + void irq_free_virt(unsigned int virq, unsigned int count) 881 + { 882 + unsigned long flags; 883 + unsigned int i; 884 + 885 + WARN_ON (virq < NUM_ISA_INTERRUPTS); 886 + WARN_ON (count == 0 || (virq + count) > irq_virq_count); 887 + 888 + spin_lock_irqsave(&irq_big_lock, flags); 889 + for (i = virq; i < (virq + count); i++) { 890 + struct irq_host *host; 891 + 892 + if (i < NUM_ISA_INTERRUPTS || 893 + (virq + count) > irq_virq_count) 894 + continue; 895 + 896 + host = irq_map[i].host; 897 + irq_map[i].hwirq = host->inval_irq; 898 + smp_wmb(); 899 + irq_map[i].host = NULL; 900 + } 901 + spin_unlock_irqrestore(&irq_big_lock, flags); 902 + } 903 + 904 + void irq_early_init(void) 905 + { 906 + unsigned int i; 907 + 908 + for (i = 0; i < NR_IRQS; i++) 909 + get_irq_desc(i)->status |= IRQ_NOREQUEST; 910 + } 911 + 912 + /* We need to create the radix trees late */ 913 + static int irq_late_init(void) 914 + { 915 + struct irq_host *h; 916 + unsigned long flags; 917 + 918 + spin_lock_irqsave(&irq_big_lock, flags); 919 + list_for_each_entry(h, &irq_hosts, link) { 920 + if (h->revmap_type == IRQ_HOST_MAP_TREE) 921 + INIT_RADIX_TREE(&h->revmap_data.tree, GFP_ATOMIC); 922 + } 923 + spin_unlock_irqrestore(&irq_big_lock, flags); 924 + 925 + return 0; 926 + } 927 + arch_initcall(irq_late_init); 928 + 929 + #endif /* CONFIG_PPC_MERGE */ 315 930 316 931 #ifdef CONFIG_PCI_MSI 317 932 int pci_enable_msi(struct pci_dev * pdev)
+33 -24
arch/powerpc/kernel/legacy_serial.c
··· 28 28 struct device_node *np; 29 29 unsigned int speed; 30 30 unsigned int clock; 31 + int irq_check_parent; 31 32 phys_addr_t taddr; 32 33 } legacy_serial_infos[MAX_LEGACY_SERIAL_PORTS]; 33 34 static unsigned int legacy_serial_count; ··· 37 36 static int __init add_legacy_port(struct device_node *np, int want_index, 38 37 int iotype, phys_addr_t base, 39 38 phys_addr_t taddr, unsigned long irq, 40 - upf_t flags) 39 + upf_t flags, int irq_check_parent) 41 40 { 42 41 u32 *clk, *spd, clock = BASE_BAUD * 16; 43 42 int index; ··· 69 68 if (legacy_serial_infos[index].np != 0) { 70 69 /* if we still have some room, move it, else override */ 71 70 if (legacy_serial_count < MAX_LEGACY_SERIAL_PORTS) { 72 - printk(KERN_INFO "Moved legacy port %d -> %d\n", 71 + printk(KERN_DEBUG "Moved legacy port %d -> %d\n", 73 72 index, legacy_serial_count); 74 73 legacy_serial_ports[legacy_serial_count] = 75 74 legacy_serial_ports[index]; ··· 77 76 legacy_serial_infos[index]; 78 77 legacy_serial_count++; 79 78 } else { 80 - printk(KERN_INFO "Replacing legacy port %d\n", index); 79 + printk(KERN_DEBUG "Replacing legacy port %d\n", index); 81 80 } 82 81 } 83 82 ··· 96 95 legacy_serial_infos[index].np = of_node_get(np); 97 96 legacy_serial_infos[index].clock = clock; 98 97 legacy_serial_infos[index].speed = spd ? *spd : 0; 98 + legacy_serial_infos[index].irq_check_parent = irq_check_parent; 99 99 100 - printk(KERN_INFO "Found legacy serial port %d for %s\n", 100 + printk(KERN_DEBUG "Found legacy serial port %d for %s\n", 101 101 index, np->full_name); 102 - printk(KERN_INFO " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", 102 + printk(KERN_DEBUG " %s=%llx, taddr=%llx, irq=%lx, clk=%d, speed=%d\n", 103 103 (iotype == UPIO_PORT) ? "port" : "mem", 104 104 (unsigned long long)base, (unsigned long long)taddr, irq, 105 105 legacy_serial_ports[index].uartclk, ··· 128 126 return -1; 129 127 130 128 addr = of_translate_address(soc_dev, addrp); 129 + if (addr == OF_BAD_ADDR) 130 + return -1; 131 131 132 132 /* Add port, irq will be dealt with later. We passed a translated 133 133 * IO port value. It will be fixed up later along with the irq 134 134 */ 135 - return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags); 135 + return add_legacy_port(np, -1, UPIO_MEM, addr, addr, NO_IRQ, flags, 0); 136 136 } 137 137 138 138 static int __init add_legacy_isa_port(struct device_node *np, ··· 144 140 char *typep; 145 141 int index = -1; 146 142 phys_addr_t taddr; 143 + 144 + DBG(" -> add_legacy_isa_port(%s)\n", np->full_name); 147 145 148 146 /* Get the ISA port number */ 149 147 reg = (u32 *)get_property(np, "reg", NULL); ··· 167 161 168 162 /* Translate ISA address */ 169 163 taddr = of_translate_address(np, reg); 164 + if (taddr == OF_BAD_ADDR) 165 + return -1; 170 166 171 167 /* Add port, irq will be dealt with later */ 172 - return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, NO_IRQ, UPF_BOOT_AUTOCONF); 168 + return add_legacy_port(np, index, UPIO_PORT, reg[1], taddr, 169 + NO_IRQ, UPF_BOOT_AUTOCONF, 0); 173 170 174 171 } 175 172 ··· 184 175 u32 *addrp; 185 176 unsigned int flags; 186 177 int iotype, index = -1, lindex = 0; 178 + 179 + DBG(" -> add_legacy_pci_port(%s)\n", np->full_name); 187 180 188 181 /* We only support ports that have a clock frequency properly 189 182 * encoded in the device-tree (that is have an fcode). Anything ··· 205 194 /* We only support BAR 0 for now */ 206 195 iotype = (flags & IORESOURCE_MEM) ? UPIO_MEM : UPIO_PORT; 207 196 addr = of_translate_address(pci_dev, addrp); 197 + if (addr == OF_BAD_ADDR) 198 + return -1; 208 199 209 200 /* Set the IO base to the same as the translated address for MMIO, 210 201 * or to the domain local IO base for PIO (it will be fixed up later) ··· 244 231 /* Add port, irq will be dealt with later. We passed a translated 245 232 * IO port value. It will be fixed up later along with the irq 246 233 */ 247 - return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, UPF_BOOT_AUTOCONF); 234 + return add_legacy_port(np, index, iotype, base, addr, NO_IRQ, 235 + UPF_BOOT_AUTOCONF, np != pci_dev); 248 236 } 249 237 #endif 250 238 ··· 376 362 struct device_node *np, 377 363 struct plat_serial8250_port *port) 378 364 { 365 + unsigned int virq; 366 + 379 367 DBG("fixup_port_irq(%d)\n", index); 380 368 381 - /* Check for interrupts in that node */ 382 - if (np->n_intrs > 0) { 383 - port->irq = np->intrs[0].line; 384 - DBG(" port %d (%s), irq=%d\n", 385 - index, np->full_name, port->irq); 386 - return; 369 + virq = irq_of_parse_and_map(np, 0); 370 + if (virq == NO_IRQ && legacy_serial_infos[index].irq_check_parent) { 371 + np = of_get_parent(np); 372 + if (np == NULL) 373 + return; 374 + virq = irq_of_parse_and_map(np, 0); 375 + of_node_put(np); 387 376 } 388 - 389 - /* Check for interrupts in the parent */ 390 - np = of_get_parent(np); 391 - if (np == NULL) 377 + if (virq == NO_IRQ) 392 378 return; 393 379 394 - if (np->n_intrs > 0) { 395 - port->irq = np->intrs[0].line; 396 - DBG(" port %d (%s), irq=%d\n", 397 - index, np->full_name, port->irq); 398 - } 399 - of_node_put(np); 380 + port->irq = virq; 400 381 } 401 382 402 383 static void __init fixup_port_pio(int index,
+6 -4
arch/powerpc/kernel/misc_64.S
··· 51 51 mtlr r0 52 52 blr 53 53 54 - _GLOBAL(call___do_IRQ) 54 + _GLOBAL(call_handle_irq) 55 + ld r8,0(r7) 55 56 mflr r0 56 57 std r0,16(r1) 57 - stdu r1,THREAD_SIZE-112(r5) 58 - mr r1,r5 59 - bl .__do_IRQ 58 + mtctr r8 59 + stdu r1,THREAD_SIZE-112(r6) 60 + mr r1,r6 61 + bctrl 60 62 ld r1,0(r1) 61 63 ld r0,16(r1) 62 64 mtlr r0
+37
arch/powerpc/kernel/pci_32.c
··· 1404 1404 /* XXX FIXME - update OF device tree node interrupt property */ 1405 1405 } 1406 1406 1407 + #ifdef CONFIG_PPC_MERGE 1408 + /* XXX This is a copy of the ppc64 version. This is temporary until we start 1409 + * merging the 2 PCI layers 1410 + */ 1411 + /* 1412 + * Reads the interrupt pin to determine if interrupt is use by card. 1413 + * If the interrupt is used, then gets the interrupt line from the 1414 + * openfirmware and sets it in the pci_dev and pci_config line. 1415 + */ 1416 + int pci_read_irq_line(struct pci_dev *pci_dev) 1417 + { 1418 + struct of_irq oirq; 1419 + unsigned int virq; 1420 + 1421 + DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 1422 + 1423 + if (of_irq_map_pci(pci_dev, &oirq)) { 1424 + DBG(" -> failed !\n"); 1425 + return -1; 1426 + } 1427 + 1428 + DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", 1429 + oirq.size, oirq.specifier[0], oirq.controller->full_name); 1430 + 1431 + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); 1432 + if(virq == NO_IRQ) { 1433 + DBG(" -> failed to map !\n"); 1434 + return -1; 1435 + } 1436 + pci_dev->irq = virq; 1437 + pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq); 1438 + 1439 + return 0; 1440 + } 1441 + EXPORT_SYMBOL(pci_read_irq_line); 1442 + #endif /* CONFIG_PPC_MERGE */ 1443 + 1407 1444 int pcibios_enable_device(struct pci_dev *dev, int mask) 1408 1445 { 1409 1446 u16 cmd, old_cmd;
+16 -17
arch/powerpc/kernel/pci_64.c
··· 398 398 } else { 399 399 dev->hdr_type = PCI_HEADER_TYPE_NORMAL; 400 400 dev->rom_base_reg = PCI_ROM_ADDRESS; 401 + /* Maybe do a default OF mapping here */ 401 402 dev->irq = NO_IRQ; 402 - if (node->n_intrs > 0) { 403 - dev->irq = node->intrs[0].line; 404 - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 405 - dev->irq); 406 - } 407 403 } 408 404 409 405 pci_parse_of_addrs(node, dev); ··· 1284 1288 */ 1285 1289 int pci_read_irq_line(struct pci_dev *pci_dev) 1286 1290 { 1287 - u8 intpin; 1288 - struct device_node *node; 1291 + struct of_irq oirq; 1292 + unsigned int virq; 1289 1293 1290 - pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin); 1291 - if (intpin == 0) 1292 - return 0; 1294 + DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 1293 1295 1294 - node = pci_device_to_OF_node(pci_dev); 1295 - if (node == NULL) 1296 + if (of_irq_map_pci(pci_dev, &oirq)) { 1297 + DBG(" -> failed !\n"); 1296 1298 return -1; 1299 + } 1297 1300 1298 - if (node->n_intrs == 0) 1301 + DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", 1302 + oirq.size, oirq.specifier[0], oirq.controller->full_name); 1303 + 1304 + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); 1305 + if(virq == NO_IRQ) { 1306 + DBG(" -> failed to map !\n"); 1299 1307 return -1; 1300 - 1301 - pci_dev->irq = node->intrs[0].line; 1302 - 1303 - pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq); 1308 + } 1309 + pci_dev->irq = virq; 1310 + pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq); 1304 1311 1305 1312 return 0; 1306 1313 }
+3 -451
arch/powerpc/kernel/prom.c
··· 30 30 #include <linux/module.h> 31 31 #include <linux/kexec.h> 32 32 #include <linux/debugfs.h> 33 + #include <linux/irq.h> 33 34 34 35 #include <asm/prom.h> 35 36 #include <asm/rtas.h> ··· 86 85 87 86 /* export that to outside world */ 88 87 struct device_node *of_chosen; 89 - 90 - struct device_node *dflt_interrupt_controller; 91 - int num_interrupt_controllers; 92 - 93 - /* 94 - * Wrapper for allocating memory for various data that needs to be 95 - * attached to device nodes as they are processed at boot or when 96 - * added to the device tree later (e.g. DLPAR). At boot there is 97 - * already a region reserved so we just increment *mem_start by size; 98 - * otherwise we call kmalloc. 99 - */ 100 - static void * prom_alloc(unsigned long size, unsigned long *mem_start) 101 - { 102 - unsigned long tmp; 103 - 104 - if (!mem_start) 105 - return kmalloc(size, GFP_KERNEL); 106 - 107 - tmp = *mem_start; 108 - *mem_start += size; 109 - return (void *)tmp; 110 - } 111 - 112 - /* 113 - * Find the device_node with a given phandle. 114 - */ 115 - static struct device_node * find_phandle(phandle ph) 116 - { 117 - struct device_node *np; 118 - 119 - for (np = allnodes; np != 0; np = np->allnext) 120 - if (np->linux_phandle == ph) 121 - return np; 122 - return NULL; 123 - } 124 - 125 - /* 126 - * Find the interrupt parent of a node. 127 - */ 128 - static struct device_node * __devinit intr_parent(struct device_node *p) 129 - { 130 - phandle *parp; 131 - 132 - parp = (phandle *) get_property(p, "interrupt-parent", NULL); 133 - if (parp == NULL) 134 - return p->parent; 135 - p = find_phandle(*parp); 136 - if (p != NULL) 137 - return p; 138 - /* 139 - * On a powermac booted with BootX, we don't get to know the 140 - * phandles for any nodes, so find_phandle will return NULL. 141 - * Fortunately these machines only have one interrupt controller 142 - * so there isn't in fact any ambiguity. -- paulus 143 - */ 144 - if (num_interrupt_controllers == 1) 145 - p = dflt_interrupt_controller; 146 - return p; 147 - } 148 - 149 - /* 150 - * Find out the size of each entry of the interrupts property 151 - * for a node. 152 - */ 153 - int __devinit prom_n_intr_cells(struct device_node *np) 154 - { 155 - struct device_node *p; 156 - unsigned int *icp; 157 - 158 - for (p = np; (p = intr_parent(p)) != NULL; ) { 159 - icp = (unsigned int *) 160 - get_property(p, "#interrupt-cells", NULL); 161 - if (icp != NULL) 162 - return *icp; 163 - if (get_property(p, "interrupt-controller", NULL) != NULL 164 - || get_property(p, "interrupt-map", NULL) != NULL) { 165 - printk("oops, node %s doesn't have #interrupt-cells\n", 166 - p->full_name); 167 - return 1; 168 - } 169 - } 170 - #ifdef DEBUG_IRQ 171 - printk("prom_n_intr_cells failed for %s\n", np->full_name); 172 - #endif 173 - return 1; 174 - } 175 - 176 - /* 177 - * Map an interrupt from a device up to the platform interrupt 178 - * descriptor. 179 - */ 180 - static int __devinit map_interrupt(unsigned int **irq, struct device_node **ictrler, 181 - struct device_node *np, unsigned int *ints, 182 - int nintrc) 183 - { 184 - struct device_node *p, *ipar; 185 - unsigned int *imap, *imask, *ip; 186 - int i, imaplen, match; 187 - int newintrc = 0, newaddrc = 0; 188 - unsigned int *reg; 189 - int naddrc; 190 - 191 - reg = (unsigned int *) get_property(np, "reg", NULL); 192 - naddrc = prom_n_addr_cells(np); 193 - p = intr_parent(np); 194 - while (p != NULL) { 195 - if (get_property(p, "interrupt-controller", NULL) != NULL) 196 - /* this node is an interrupt controller, stop here */ 197 - break; 198 - imap = (unsigned int *) 199 - get_property(p, "interrupt-map", &imaplen); 200 - if (imap == NULL) { 201 - p = intr_parent(p); 202 - continue; 203 - } 204 - imask = (unsigned int *) 205 - get_property(p, "interrupt-map-mask", NULL); 206 - if (imask == NULL) { 207 - printk("oops, %s has interrupt-map but no mask\n", 208 - p->full_name); 209 - return 0; 210 - } 211 - imaplen /= sizeof(unsigned int); 212 - match = 0; 213 - ipar = NULL; 214 - while (imaplen > 0 && !match) { 215 - /* check the child-interrupt field */ 216 - match = 1; 217 - for (i = 0; i < naddrc && match; ++i) 218 - match = ((reg[i] ^ imap[i]) & imask[i]) == 0; 219 - for (; i < naddrc + nintrc && match; ++i) 220 - match = ((ints[i-naddrc] ^ imap[i]) & imask[i]) == 0; 221 - imap += naddrc + nintrc; 222 - imaplen -= naddrc + nintrc; 223 - /* grab the interrupt parent */ 224 - ipar = find_phandle((phandle) *imap++); 225 - --imaplen; 226 - if (ipar == NULL && num_interrupt_controllers == 1) 227 - /* cope with BootX not giving us phandles */ 228 - ipar = dflt_interrupt_controller; 229 - if (ipar == NULL) { 230 - printk("oops, no int parent %x in map of %s\n", 231 - imap[-1], p->full_name); 232 - return 0; 233 - } 234 - /* find the parent's # addr and intr cells */ 235 - ip = (unsigned int *) 236 - get_property(ipar, "#interrupt-cells", NULL); 237 - if (ip == NULL) { 238 - printk("oops, no #interrupt-cells on %s\n", 239 - ipar->full_name); 240 - return 0; 241 - } 242 - newintrc = *ip; 243 - ip = (unsigned int *) 244 - get_property(ipar, "#address-cells", NULL); 245 - newaddrc = (ip == NULL)? 0: *ip; 246 - imap += newaddrc + newintrc; 247 - imaplen -= newaddrc + newintrc; 248 - } 249 - if (imaplen < 0) { 250 - printk("oops, error decoding int-map on %s, len=%d\n", 251 - p->full_name, imaplen); 252 - return 0; 253 - } 254 - if (!match) { 255 - #ifdef DEBUG_IRQ 256 - printk("oops, no match in %s int-map for %s\n", 257 - p->full_name, np->full_name); 258 - #endif 259 - return 0; 260 - } 261 - p = ipar; 262 - naddrc = newaddrc; 263 - nintrc = newintrc; 264 - ints = imap - nintrc; 265 - reg = ints - naddrc; 266 - } 267 - if (p == NULL) { 268 - #ifdef DEBUG_IRQ 269 - printk("hmmm, int tree for %s doesn't have ctrler\n", 270 - np->full_name); 271 - #endif 272 - return 0; 273 - } 274 - *irq = ints; 275 - *ictrler = p; 276 - return nintrc; 277 - } 278 - 279 - static unsigned char map_isa_senses[4] = { 280 - IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, 281 - IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE, 282 - IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE, 283 - IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE 284 - }; 285 - 286 - static unsigned char map_mpic_senses[4] = { 287 - IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE, 288 - IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, 289 - /* 2 seems to be used for the 8259 cascade... */ 290 - IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE, 291 - IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE, 292 - }; 293 - 294 - static int __devinit finish_node_interrupts(struct device_node *np, 295 - unsigned long *mem_start, 296 - int measure_only) 297 - { 298 - unsigned int *ints; 299 - int intlen, intrcells, intrcount; 300 - int i, j, n, sense; 301 - unsigned int *irq, virq; 302 - struct device_node *ic; 303 - int trace = 0; 304 - 305 - //#define TRACE(fmt...) do { if (trace) { printk(fmt); mdelay(1000); } } while(0) 306 - #define TRACE(fmt...) 307 - 308 - if (!strcmp(np->name, "smu-doorbell")) 309 - trace = 1; 310 - 311 - TRACE("Finishing SMU doorbell ! num_interrupt_controllers = %d\n", 312 - num_interrupt_controllers); 313 - 314 - if (num_interrupt_controllers == 0) { 315 - /* 316 - * Old machines just have a list of interrupt numbers 317 - * and no interrupt-controller nodes. 318 - */ 319 - ints = (unsigned int *) get_property(np, "AAPL,interrupts", 320 - &intlen); 321 - /* XXX old interpret_pci_props looked in parent too */ 322 - /* XXX old interpret_macio_props looked for interrupts 323 - before AAPL,interrupts */ 324 - if (ints == NULL) 325 - ints = (unsigned int *) get_property(np, "interrupts", 326 - &intlen); 327 - if (ints == NULL) 328 - return 0; 329 - 330 - np->n_intrs = intlen / sizeof(unsigned int); 331 - np->intrs = prom_alloc(np->n_intrs * sizeof(np->intrs[0]), 332 - mem_start); 333 - if (!np->intrs) 334 - return -ENOMEM; 335 - if (measure_only) 336 - return 0; 337 - 338 - for (i = 0; i < np->n_intrs; ++i) { 339 - np->intrs[i].line = *ints++; 340 - np->intrs[i].sense = IRQ_SENSE_LEVEL 341 - | IRQ_POLARITY_NEGATIVE; 342 - } 343 - return 0; 344 - } 345 - 346 - ints = (unsigned int *) get_property(np, "interrupts", &intlen); 347 - TRACE("ints=%p, intlen=%d\n", ints, intlen); 348 - if (ints == NULL) 349 - return 0; 350 - intrcells = prom_n_intr_cells(np); 351 - intlen /= intrcells * sizeof(unsigned int); 352 - TRACE("intrcells=%d, new intlen=%d\n", intrcells, intlen); 353 - np->intrs = prom_alloc(intlen * sizeof(*(np->intrs)), mem_start); 354 - if (!np->intrs) 355 - return -ENOMEM; 356 - 357 - if (measure_only) 358 - return 0; 359 - 360 - intrcount = 0; 361 - for (i = 0; i < intlen; ++i, ints += intrcells) { 362 - n = map_interrupt(&irq, &ic, np, ints, intrcells); 363 - TRACE("map, irq=%d, ic=%p, n=%d\n", irq, ic, n); 364 - if (n <= 0) 365 - continue; 366 - 367 - /* don't map IRQ numbers under a cascaded 8259 controller */ 368 - if (ic && device_is_compatible(ic, "chrp,iic")) { 369 - np->intrs[intrcount].line = irq[0]; 370 - sense = (n > 1)? (irq[1] & 3): 3; 371 - np->intrs[intrcount].sense = map_isa_senses[sense]; 372 - } else { 373 - virq = virt_irq_create_mapping(irq[0]); 374 - TRACE("virq=%d\n", virq); 375 - #ifdef CONFIG_PPC64 376 - if (virq == NO_IRQ) { 377 - printk(KERN_CRIT "Could not allocate interrupt" 378 - " number for %s\n", np->full_name); 379 - continue; 380 - } 381 - #endif 382 - np->intrs[intrcount].line = irq_offset_up(virq); 383 - sense = (n > 1)? (irq[1] & 3): 1; 384 - 385 - /* Apple uses bits in there in a different way, let's 386 - * only keep the real sense bit on macs 387 - */ 388 - if (machine_is(powermac)) 389 - sense &= 0x1; 390 - np->intrs[intrcount].sense = map_mpic_senses[sense]; 391 - } 392 - 393 - #ifdef CONFIG_PPC64 394 - /* We offset irq numbers for the u3 MPIC by 128 in PowerMac */ 395 - if (machine_is(powermac) && ic && ic->parent) { 396 - char *name = get_property(ic->parent, "name", NULL); 397 - if (name && !strcmp(name, "u3")) 398 - np->intrs[intrcount].line += 128; 399 - else if (!(name && (!strcmp(name, "mac-io") || 400 - !strcmp(name, "u4")))) 401 - /* ignore other cascaded controllers, such as 402 - the k2-sata-root */ 403 - break; 404 - } 405 - #endif /* CONFIG_PPC64 */ 406 - if (n > 2) { 407 - printk("hmmm, got %d intr cells for %s:", n, 408 - np->full_name); 409 - for (j = 0; j < n; ++j) 410 - printk(" %d", irq[j]); 411 - printk("\n"); 412 - } 413 - ++intrcount; 414 - } 415 - np->n_intrs = intrcount; 416 - 417 - return 0; 418 - } 419 - 420 - static int __devinit finish_node(struct device_node *np, 421 - unsigned long *mem_start, 422 - int measure_only) 423 - { 424 - struct device_node *child; 425 - int rc = 0; 426 - 427 - rc = finish_node_interrupts(np, mem_start, measure_only); 428 - if (rc) 429 - goto out; 430 - 431 - for (child = np->child; child != NULL; child = child->sibling) { 432 - rc = finish_node(child, mem_start, measure_only); 433 - if (rc) 434 - goto out; 435 - } 436 - out: 437 - return rc; 438 - } 439 - 440 - static void __init scan_interrupt_controllers(void) 441 - { 442 - struct device_node *np; 443 - int n = 0; 444 - char *name, *ic; 445 - int iclen; 446 - 447 - for (np = allnodes; np != NULL; np = np->allnext) { 448 - ic = get_property(np, "interrupt-controller", &iclen); 449 - name = get_property(np, "name", NULL); 450 - /* checking iclen makes sure we don't get a false 451 - match on /chosen.interrupt_controller */ 452 - if ((name != NULL 453 - && strcmp(name, "interrupt-controller") == 0) 454 - || (ic != NULL && iclen == 0 455 - && strcmp(name, "AppleKiwi"))) { 456 - if (n == 0) 457 - dflt_interrupt_controller = np; 458 - ++n; 459 - } 460 - } 461 - num_interrupt_controllers = n; 462 - } 463 - 464 - /** 465 - * finish_device_tree is called once things are running normally 466 - * (i.e. with text and data mapped to the address they were linked at). 467 - * It traverses the device tree and fills in some of the additional, 468 - * fields in each node like {n_}addrs and {n_}intrs, the virt interrupt 469 - * mapping is also initialized at this point. 470 - */ 471 - void __init finish_device_tree(void) 472 - { 473 - unsigned long start, end, size = 0; 474 - 475 - DBG(" -> finish_device_tree\n"); 476 - 477 - #ifdef CONFIG_PPC64 478 - /* Initialize virtual IRQ map */ 479 - virt_irq_init(); 480 - #endif 481 - scan_interrupt_controllers(); 482 - 483 - /* 484 - * Finish device-tree (pre-parsing some properties etc...) 485 - * We do this in 2 passes. One with "measure_only" set, which 486 - * will only measure the amount of memory needed, then we can 487 - * allocate that memory, and call finish_node again. However, 488 - * we must be careful as most routines will fail nowadays when 489 - * prom_alloc() returns 0, so we must make sure our first pass 490 - * doesn't start at 0. We pre-initialize size to 16 for that 491 - * reason and then remove those additional 16 bytes 492 - */ 493 - size = 16; 494 - finish_node(allnodes, &size, 1); 495 - size -= 16; 496 - 497 - if (0 == size) 498 - end = start = 0; 499 - else 500 - end = start = (unsigned long)__va(lmb_alloc(size, 128)); 501 - 502 - finish_node(allnodes, &end, 0); 503 - BUG_ON(end != start + size); 504 - 505 - DBG(" <- finish_device_tree\n"); 506 - } 507 88 508 89 static inline char *find_flat_dt_string(u32 offset) 509 90 { ··· 972 1389 EXPORT_SYMBOL(prom_n_size_cells); 973 1390 974 1391 /** 975 - * Work out the sense (active-low level / active-high edge) 976 - * of each interrupt from the device tree. 977 - */ 978 - void __init prom_get_irq_senses(unsigned char *senses, int off, int max) 979 - { 980 - struct device_node *np; 981 - int i, j; 982 - 983 - /* default to level-triggered */ 984 - memset(senses, IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE, max - off); 985 - 986 - for (np = allnodes; np != 0; np = np->allnext) { 987 - for (j = 0; j < np->n_intrs; j++) { 988 - i = np->intrs[j].line; 989 - if (i >= off && i < max) 990 - senses[i-off] = np->intrs[j].sense; 991 - } 992 - } 993 - } 994 - 995 - /** 996 1392 * Construct and return a list of the device_nodes with a given name. 997 1393 */ 998 1394 struct device_node *find_devices(const char *name) ··· 1370 1808 node->deadprops = NULL; 1371 1809 } 1372 1810 } 1373 - kfree(node->intrs); 1374 1811 kfree(node->full_name); 1375 1812 kfree(node->data); 1376 1813 kfree(node); ··· 1442 1881 #ifdef CONFIG_PPC_PSERIES 1443 1882 /* 1444 1883 * Fix up the uninitialized fields in a new device node: 1445 - * name, type, n_addrs, addrs, n_intrs, intrs, and pci-specific fields 1446 - * 1447 - * A lot of boot-time code is duplicated here, because functions such 1448 - * as finish_node_interrupts, interpret_pci_props, etc. cannot use the 1449 - * slab allocator. 1450 - * 1451 - * This should probably be split up into smaller chunks. 1884 + * name, type and pci-specific fields 1452 1885 */ 1453 1886 1454 1887 static int of_finish_dynamic_node(struct device_node *node) ··· 1483 1928 switch (action) { 1484 1929 case PSERIES_RECONFIG_ADD: 1485 1930 err = of_finish_dynamic_node(node); 1486 - if (!err) 1487 - finish_node(node, NULL, 0); 1488 1931 if (err < 0) { 1489 1932 printk(KERN_ERR "finish_node returned %d\n", err); 1490 1933 err = NOTIFY_BAD; ··· 1528 1975 * Find a property with a given name for a given node 1529 1976 * and return the value. 1530 1977 */ 1531 - unsigned char *get_property(struct device_node *np, const char *name, 1532 - int *lenp) 1978 + void *get_property(struct device_node *np, const char *name, int *lenp) 1533 1979 { 1534 1980 struct property *pp = of_find_property(np,name,lenp); 1535 1981 return pp ? pp->value : NULL;
+14 -4
arch/powerpc/kernel/prom_init.c
··· 1990 1990 static void __init fixup_device_tree_maple(void) 1991 1991 { 1992 1992 phandle isa; 1993 + u32 rloc = 0x01002000; /* IO space; PCI device = 4 */ 1993 1994 u32 isa_ranges[6]; 1995 + char *name; 1994 1996 1995 - isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4")); 1997 + name = "/ht@0/isa@4"; 1998 + isa = call_prom("finddevice", 1, 1, ADDR(name)); 1999 + if (!PHANDLE_VALID(isa)) { 2000 + name = "/ht@0/isa@6"; 2001 + isa = call_prom("finddevice", 1, 1, ADDR(name)); 2002 + rloc = 0x01003000; /* IO space; PCI device = 6 */ 2003 + } 1996 2004 if (!PHANDLE_VALID(isa)) 1997 2005 return; 1998 2006 2007 + if (prom_getproplen(isa, "ranges") != 12) 2008 + return; 1999 2009 if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges)) 2000 2010 == PROM_ERROR) 2001 2011 return; ··· 2015 2005 isa_ranges[2] != 0x00010000) 2016 2006 return; 2017 2007 2018 - prom_printf("fixing up bogus ISA range on Maple...\n"); 2008 + prom_printf("Fixing up bogus ISA range on Maple/Apache...\n"); 2019 2009 2020 2010 isa_ranges[0] = 0x1; 2021 2011 isa_ranges[1] = 0x0; 2022 - isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */ 2012 + isa_ranges[2] = rloc; 2023 2013 isa_ranges[3] = 0x0; 2024 2014 isa_ranges[4] = 0x0; 2025 2015 isa_ranges[5] = 0x00010000; 2026 - prom_setprop(isa, "/ht@0/isa@4", "ranges", 2016 + prom_setprop(isa, name, "ranges", 2027 2017 isa_ranges, sizeof(isa_ranges)); 2028 2018 } 2029 2019 #else
+419 -24
arch/powerpc/kernel/prom_parse.c
··· 38 38 static void of_dump_addr(const char *s, u32 *addr, int na) { } 39 39 #endif 40 40 41 - /* Read a big address */ 42 - static inline u64 of_read_addr(u32 *cell, int size) 43 - { 44 - u64 r = 0; 45 - while (size--) 46 - r = (r << 32) | *(cell++); 47 - return r; 48 - } 49 41 50 42 /* Callbacks for bus specific translators */ 51 43 struct of_bus { ··· 69 77 { 70 78 u64 cp, s, da; 71 79 72 - cp = of_read_addr(range, na); 73 - s = of_read_addr(range + na + pna, ns); 74 - da = of_read_addr(addr, na); 80 + cp = of_read_number(range, na); 81 + s = of_read_number(range + na + pna, ns); 82 + da = of_read_number(addr, na); 75 83 76 84 DBG("OF: default map, cp="PRu64", s="PRu64", da="PRu64"\n", 77 85 cp, s, da); ··· 83 91 84 92 static int of_bus_default_translate(u32 *addr, u64 offset, int na) 85 93 { 86 - u64 a = of_read_addr(addr, na); 94 + u64 a = of_read_number(addr, na); 87 95 memset(addr, 0, na * 4); 88 96 a += offset; 89 97 if (na > 1) ··· 127 135 return OF_BAD_ADDR; 128 136 129 137 /* Read address values, skipping high cell */ 130 - cp = of_read_addr(range + 1, na - 1); 131 - s = of_read_addr(range + na + pna, ns); 132 - da = of_read_addr(addr + 1, na - 1); 138 + cp = of_read_number(range + 1, na - 1); 139 + s = of_read_number(range + na + pna, ns); 140 + da = of_read_number(addr + 1, na - 1); 133 141 134 142 DBG("OF: PCI map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da); 135 143 ··· 187 195 return OF_BAD_ADDR; 188 196 189 197 /* Read address values, skipping high cell */ 190 - cp = of_read_addr(range + 1, na - 1); 191 - s = of_read_addr(range + na + pna, ns); 192 - da = of_read_addr(addr + 1, na - 1); 198 + cp = of_read_number(range + 1, na - 1); 199 + s = of_read_number(range + na + pna, ns); 200 + da = of_read_number(addr + 1, na - 1); 193 201 194 202 DBG("OF: ISA map, cp="PRu64", s="PRu64", da="PRu64"\n", cp, s, da); 195 203 ··· 287 295 */ 288 296 ranges = (u32 *)get_property(parent, "ranges", &rlen); 289 297 if (ranges == NULL || rlen == 0) { 290 - offset = of_read_addr(addr, na); 298 + offset = of_read_number(addr, na); 291 299 memset(addr, 0, pna * 4); 292 300 DBG("OF: no ranges, 1:1 translation\n"); 293 301 goto finish; ··· 370 378 /* If root, we have finished */ 371 379 if (parent == NULL) { 372 380 DBG("OF: reached root node\n"); 373 - result = of_read_addr(addr, na); 381 + result = of_read_number(addr, na); 374 382 break; 375 383 } 376 384 ··· 434 442 for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++) 435 443 if (i == index) { 436 444 if (size) 437 - *size = of_read_addr(prop + na, ns); 445 + *size = of_read_number(prop + na, ns); 438 446 if (flags) 439 447 *flags = bus->get_flags(prop); 440 448 return prop; ··· 476 484 for (i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++) 477 485 if ((prop[0] & 0xff) == ((bar_no * 4) + PCI_BASE_ADDRESS_0)) { 478 486 if (size) 479 - *size = of_read_addr(prop + na, ns); 487 + *size = of_read_number(prop + na, ns); 480 488 if (flags) 481 489 *flags = bus->get_flags(prop); 482 490 return prop; ··· 557 565 prop = get_property(dn, "#address-cells", NULL); 558 566 559 567 cells = prop ? *(u32 *)prop : prom_n_addr_cells(dn); 560 - *phys = of_read_addr(dma_window, cells); 568 + *phys = of_read_number(dma_window, cells); 561 569 562 570 dma_window += cells; 563 571 564 572 prop = get_property(dn, "ibm,#dma-size-cells", NULL); 565 573 cells = prop ? *(u32 *)prop : prom_n_size_cells(dn); 566 - *size = of_read_addr(dma_window, cells); 574 + *size = of_read_number(dma_window, cells); 567 575 } 576 + 577 + /* 578 + * Interrupt remapper 579 + */ 580 + 581 + static unsigned int of_irq_workarounds; 582 + static struct device_node *of_irq_dflt_pic; 583 + 584 + static struct device_node *of_irq_find_parent(struct device_node *child) 585 + { 586 + struct device_node *p; 587 + phandle *parp; 588 + 589 + if (!of_node_get(child)) 590 + return NULL; 591 + 592 + do { 593 + parp = (phandle *)get_property(child, "interrupt-parent", NULL); 594 + if (parp == NULL) 595 + p = of_get_parent(child); 596 + else { 597 + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) 598 + p = of_node_get(of_irq_dflt_pic); 599 + else 600 + p = of_find_node_by_phandle(*parp); 601 + } 602 + of_node_put(child); 603 + child = p; 604 + } while (p && get_property(p, "#interrupt-cells", NULL) == NULL); 605 + 606 + return p; 607 + } 608 + 609 + static u8 of_irq_pci_swizzle(u8 slot, u8 pin) 610 + { 611 + return (((pin - 1) + slot) % 4) + 1; 612 + } 613 + 614 + /* This doesn't need to be called if you don't have any special workaround 615 + * flags to pass 616 + */ 617 + void of_irq_map_init(unsigned int flags) 618 + { 619 + of_irq_workarounds = flags; 620 + 621 + /* OldWorld, don't bother looking at other things */ 622 + if (flags & OF_IMAP_OLDWORLD_MAC) 623 + return; 624 + 625 + /* If we don't have phandles, let's try to locate a default interrupt 626 + * controller (happens when booting with BootX). We do a first match 627 + * here, hopefully, that only ever happens on machines with one 628 + * controller. 629 + */ 630 + if (flags & OF_IMAP_NO_PHANDLE) { 631 + struct device_node *np; 632 + 633 + for(np = NULL; (np = of_find_all_nodes(np)) != NULL;) { 634 + if (get_property(np, "interrupt-controller", NULL) 635 + == NULL) 636 + continue; 637 + /* Skip /chosen/interrupt-controller */ 638 + if (strcmp(np->name, "chosen") == 0) 639 + continue; 640 + /* It seems like at least one person on this planet wants 641 + * to use BootX on a machine with an AppleKiwi controller 642 + * which happens to pretend to be an interrupt 643 + * controller too. 644 + */ 645 + if (strcmp(np->name, "AppleKiwi") == 0) 646 + continue; 647 + /* I think we found one ! */ 648 + of_irq_dflt_pic = np; 649 + break; 650 + } 651 + } 652 + 653 + } 654 + 655 + int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr, 656 + struct of_irq *out_irq) 657 + { 658 + struct device_node *ipar, *tnode, *old = NULL, *newpar = NULL; 659 + u32 *tmp, *imap, *imask; 660 + u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0; 661 + int imaplen, match, i; 662 + 663 + ipar = of_node_get(parent); 664 + 665 + /* First get the #interrupt-cells property of the current cursor 666 + * that tells us how to interpret the passed-in intspec. If there 667 + * is none, we are nice and just walk up the tree 668 + */ 669 + do { 670 + tmp = (u32 *)get_property(ipar, "#interrupt-cells", NULL); 671 + if (tmp != NULL) { 672 + intsize = *tmp; 673 + break; 674 + } 675 + tnode = ipar; 676 + ipar = of_irq_find_parent(ipar); 677 + of_node_put(tnode); 678 + } while (ipar); 679 + if (ipar == NULL) { 680 + DBG(" -> no parent found !\n"); 681 + goto fail; 682 + } 683 + 684 + DBG("of_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize); 685 + 686 + /* Look for this #address-cells. We have to implement the old linux 687 + * trick of looking for the parent here as some device-trees rely on it 688 + */ 689 + old = of_node_get(ipar); 690 + do { 691 + tmp = (u32 *)get_property(old, "#address-cells", NULL); 692 + tnode = of_get_parent(old); 693 + of_node_put(old); 694 + old = tnode; 695 + } while(old && tmp == NULL); 696 + of_node_put(old); 697 + old = NULL; 698 + addrsize = (tmp == NULL) ? 2 : *tmp; 699 + 700 + DBG(" -> addrsize=%d\n", addrsize); 701 + 702 + /* Now start the actual "proper" walk of the interrupt tree */ 703 + while (ipar != NULL) { 704 + /* Now check if cursor is an interrupt-controller and if it is 705 + * then we are done 706 + */ 707 + if (get_property(ipar, "interrupt-controller", NULL) != NULL) { 708 + DBG(" -> got it !\n"); 709 + memcpy(out_irq->specifier, intspec, 710 + intsize * sizeof(u32)); 711 + out_irq->size = intsize; 712 + out_irq->controller = ipar; 713 + of_node_put(old); 714 + return 0; 715 + } 716 + 717 + /* Now look for an interrupt-map */ 718 + imap = (u32 *)get_property(ipar, "interrupt-map", &imaplen); 719 + /* No interrupt map, check for an interrupt parent */ 720 + if (imap == NULL) { 721 + DBG(" -> no map, getting parent\n"); 722 + newpar = of_irq_find_parent(ipar); 723 + goto skiplevel; 724 + } 725 + imaplen /= sizeof(u32); 726 + 727 + /* Look for a mask */ 728 + imask = (u32 *)get_property(ipar, "interrupt-map-mask", NULL); 729 + 730 + /* If we were passed no "reg" property and we attempt to parse 731 + * an interrupt-map, then #address-cells must be 0. 732 + * Fail if it's not. 733 + */ 734 + if (addr == NULL && addrsize != 0) { 735 + DBG(" -> no reg passed in when needed !\n"); 736 + goto fail; 737 + } 738 + 739 + /* Parse interrupt-map */ 740 + match = 0; 741 + while (imaplen > (addrsize + intsize + 1) && !match) { 742 + /* Compare specifiers */ 743 + match = 1; 744 + for (i = 0; i < addrsize && match; ++i) { 745 + u32 mask = imask ? imask[i] : 0xffffffffu; 746 + match = ((addr[i] ^ imap[i]) & mask) == 0; 747 + } 748 + for (; i < (addrsize + intsize) && match; ++i) { 749 + u32 mask = imask ? imask[i] : 0xffffffffu; 750 + match = 751 + ((intspec[i-addrsize] ^ imap[i]) & mask) == 0; 752 + } 753 + imap += addrsize + intsize; 754 + imaplen -= addrsize + intsize; 755 + 756 + DBG(" -> match=%d (imaplen=%d)\n", match, imaplen); 757 + 758 + /* Get the interrupt parent */ 759 + if (of_irq_workarounds & OF_IMAP_NO_PHANDLE) 760 + newpar = of_node_get(of_irq_dflt_pic); 761 + else 762 + newpar = of_find_node_by_phandle((phandle)*imap); 763 + imap++; 764 + --imaplen; 765 + 766 + /* Check if not found */ 767 + if (newpar == NULL) { 768 + DBG(" -> imap parent not found !\n"); 769 + goto fail; 770 + } 771 + 772 + /* Get #interrupt-cells and #address-cells of new 773 + * parent 774 + */ 775 + tmp = (u32 *)get_property(newpar, "#interrupt-cells", 776 + NULL); 777 + if (tmp == NULL) { 778 + DBG(" -> parent lacks #interrupt-cells !\n"); 779 + goto fail; 780 + } 781 + newintsize = *tmp; 782 + tmp = (u32 *)get_property(newpar, "#address-cells", 783 + NULL); 784 + newaddrsize = (tmp == NULL) ? 0 : *tmp; 785 + 786 + DBG(" -> newintsize=%d, newaddrsize=%d\n", 787 + newintsize, newaddrsize); 788 + 789 + /* Check for malformed properties */ 790 + if (imaplen < (newaddrsize + newintsize)) 791 + goto fail; 792 + 793 + imap += newaddrsize + newintsize; 794 + imaplen -= newaddrsize + newintsize; 795 + 796 + DBG(" -> imaplen=%d\n", imaplen); 797 + } 798 + if (!match) 799 + goto fail; 800 + 801 + of_node_put(old); 802 + old = of_node_get(newpar); 803 + addrsize = newaddrsize; 804 + intsize = newintsize; 805 + intspec = imap - intsize; 806 + addr = intspec - addrsize; 807 + 808 + skiplevel: 809 + /* Iterate again with new parent */ 810 + DBG(" -> new parent: %s\n", newpar ? newpar->full_name : "<>"); 811 + of_node_put(ipar); 812 + ipar = newpar; 813 + newpar = NULL; 814 + } 815 + fail: 816 + of_node_put(ipar); 817 + of_node_put(old); 818 + of_node_put(newpar); 819 + 820 + return -EINVAL; 821 + } 822 + EXPORT_SYMBOL_GPL(of_irq_map_raw); 823 + 824 + #if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) 825 + static int of_irq_map_oldworld(struct device_node *device, int index, 826 + struct of_irq *out_irq) 827 + { 828 + u32 *ints; 829 + int intlen; 830 + 831 + /* 832 + * Old machines just have a list of interrupt numbers 833 + * and no interrupt-controller nodes. 834 + */ 835 + ints = (u32 *) get_property(device, "AAPL,interrupts", &intlen); 836 + if (ints == NULL) 837 + return -EINVAL; 838 + intlen /= sizeof(u32); 839 + 840 + if (index >= intlen) 841 + return -EINVAL; 842 + 843 + out_irq->controller = NULL; 844 + out_irq->specifier[0] = ints[index]; 845 + out_irq->size = 1; 846 + 847 + return 0; 848 + } 849 + #else /* defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) */ 850 + static int of_irq_map_oldworld(struct device_node *device, int index, 851 + struct of_irq *out_irq) 852 + { 853 + return -EINVAL; 854 + } 855 + #endif /* !(defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)) */ 856 + 857 + int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq) 858 + { 859 + struct device_node *p; 860 + u32 *intspec, *tmp, intsize, intlen, *addr; 861 + int res; 862 + 863 + DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index); 864 + 865 + /* OldWorld mac stuff is "special", handle out of line */ 866 + if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC) 867 + return of_irq_map_oldworld(device, index, out_irq); 868 + 869 + /* Get the interrupts property */ 870 + intspec = (u32 *)get_property(device, "interrupts", &intlen); 871 + if (intspec == NULL) 872 + return -EINVAL; 873 + intlen /= sizeof(u32); 874 + 875 + /* Get the reg property (if any) */ 876 + addr = (u32 *)get_property(device, "reg", NULL); 877 + 878 + /* Look for the interrupt parent. */ 879 + p = of_irq_find_parent(device); 880 + if (p == NULL) 881 + return -EINVAL; 882 + 883 + /* Get size of interrupt specifier */ 884 + tmp = (u32 *)get_property(p, "#interrupt-cells", NULL); 885 + if (tmp == NULL) { 886 + of_node_put(p); 887 + return -EINVAL; 888 + } 889 + intsize = *tmp; 890 + 891 + /* Check index */ 892 + if (index * intsize >= intlen) 893 + return -EINVAL; 894 + 895 + /* Get new specifier and map it */ 896 + res = of_irq_map_raw(p, intspec + index * intsize, addr, out_irq); 897 + of_node_put(p); 898 + return res; 899 + } 900 + EXPORT_SYMBOL_GPL(of_irq_map_one); 901 + 902 + int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) 903 + { 904 + struct device_node *dn, *ppnode; 905 + struct pci_dev *ppdev; 906 + u32 lspec; 907 + u32 laddr[3]; 908 + u8 pin; 909 + int rc; 910 + 911 + /* Check if we have a device node, if yes, fallback to standard OF 912 + * parsing 913 + */ 914 + dn = pci_device_to_OF_node(pdev); 915 + if (dn) 916 + return of_irq_map_one(dn, 0, out_irq); 917 + 918 + /* Ok, we don't, time to have fun. Let's start by building up an 919 + * interrupt spec. we assume #interrupt-cells is 1, which is standard 920 + * for PCI. If you do different, then don't use that routine. 921 + */ 922 + rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin); 923 + if (rc != 0) 924 + return rc; 925 + /* No pin, exit */ 926 + if (pin == 0) 927 + return -ENODEV; 928 + 929 + /* Now we walk up the PCI tree */ 930 + lspec = pin; 931 + for (;;) { 932 + /* Get the pci_dev of our parent */ 933 + ppdev = pdev->bus->self; 934 + 935 + /* Ouch, it's a host bridge... */ 936 + if (ppdev == NULL) { 937 + #ifdef CONFIG_PPC64 938 + ppnode = pci_bus_to_OF_node(pdev->bus); 939 + #else 940 + struct pci_controller *host; 941 + host = pci_bus_to_host(pdev->bus); 942 + ppnode = host ? host->arch_data : NULL; 943 + #endif 944 + /* No node for host bridge ? give up */ 945 + if (ppnode == NULL) 946 + return -EINVAL; 947 + } else 948 + /* We found a P2P bridge, check if it has a node */ 949 + ppnode = pci_device_to_OF_node(ppdev); 950 + 951 + /* Ok, we have found a parent with a device-node, hand over to 952 + * the OF parsing code. 953 + * We build a unit address from the linux device to be used for 954 + * resolution. Note that we use the linux bus number which may 955 + * not match your firmware bus numbering. 956 + * Fortunately, in most cases, interrupt-map-mask doesn't include 957 + * the bus number as part of the matching. 958 + * You should still be careful about that though if you intend 959 + * to rely on this function (you ship a firmware that doesn't 960 + * create device nodes for all PCI devices). 961 + */ 962 + if (ppnode) 963 + break; 964 + 965 + /* We can only get here if we hit a P2P bridge with no node, 966 + * let's do standard swizzling and try again 967 + */ 968 + lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec); 969 + pdev = ppdev; 970 + } 971 + 972 + laddr[0] = (pdev->bus->number << 16) 973 + | (pdev->devfn << 8); 974 + laddr[1] = laddr[2] = 0; 975 + return of_irq_map_raw(ppnode, &lspec, laddr, out_irq); 976 + } 977 + EXPORT_SYMBOL_GPL(of_irq_map_pci); 978 +
-17
arch/powerpc/kernel/rtas_pci.c
··· 297 297 struct device_node *node; 298 298 struct pci_controller *phb; 299 299 unsigned int index; 300 - unsigned int root_size_cells = 0; 301 - unsigned int *opprop = NULL; 302 300 struct device_node *root = of_find_node_by_path("/"); 303 301 304 - if (ppc64_interrupt_controller == IC_OPEN_PIC) { 305 - opprop = (unsigned int *)get_property(root, 306 - "platform-open-pic", NULL); 307 - } 308 - 309 - root_size_cells = prom_n_size_cells(root); 310 - 311 302 index = 0; 312 - 313 303 for (node = of_get_next_child(root, NULL); 314 304 node != NULL; 315 305 node = of_get_next_child(root, node)) { ··· 314 324 setup_phb(node, phb); 315 325 pci_process_bridge_OF_ranges(phb, node, 0); 316 326 pci_setup_phb_io(phb, index == 0); 317 - #ifdef CONFIG_PPC_PSERIES 318 - /* XXX This code need serious fixing ... --BenH */ 319 - if (ppc64_interrupt_controller == IC_OPEN_PIC && pSeries_mpic) { 320 - int addr = root_size_cells * (index + 2) - 1; 321 - mpic_assign_isu(pSeries_mpic, index, opprop[addr]); 322 - } 323 - #endif 324 327 index++; 325 328 } 326 329
-2
arch/powerpc/kernel/setup_32.c
··· 51 51 52 52 extern void bootx_init(unsigned long r4, unsigned long phys); 53 53 54 - boot_infos_t *boot_infos; 55 54 struct ide_machdep_calls ppc_ide_md; 56 55 57 56 int boot_cpuid; ··· 239 240 ppc_md.init_early(); 240 241 241 242 find_legacy_serial_ports(); 242 - finish_device_tree(); 243 243 244 244 smp_setup_cpu_maps(); 245 245
+6 -11
arch/powerpc/kernel/setup_64.c
··· 361 361 362 362 /* 363 363 * Fill the ppc64_caches & systemcfg structures with informations 364 - * retrieved from the device-tree. Need to be called before 365 - * finish_device_tree() since the later requires some of the 366 - * informations filled up here to properly parse the interrupt tree. 364 + * retrieved from the device-tree. 367 365 */ 368 366 initialize_cache_info(); 367 + 368 + /* 369 + * Initialize irq remapping subsystem 370 + */ 371 + irq_early_init(); 369 372 370 373 #ifdef CONFIG_PPC_RTAS 371 374 /* ··· 395 392 * so that further code can be debugged 396 393 */ 397 394 find_legacy_serial_ports(); 398 - 399 - /* 400 - * "Finish" the device-tree, that is do the actual parsing of 401 - * some of the properties like the interrupt map 402 - */ 403 - finish_device_tree(); 404 395 405 396 /* 406 397 * Initialize xmon ··· 424 427 425 428 printk("-----------------------------------------------------\n"); 426 429 printk("ppc64_pft_size = 0x%lx\n", ppc64_pft_size); 427 - printk("ppc64_interrupt_controller = 0x%ld\n", 428 - ppc64_interrupt_controller); 429 430 printk("physicalMemorySize = 0x%lx\n", lmb_phys_mem_size()); 430 431 printk("ppc64_caches.dcache_line_size = 0x%x\n", 431 432 ppc64_caches.dline_size);
+1 -11
arch/powerpc/kernel/vio.c
··· 218 218 { 219 219 struct vio_dev *viodev; 220 220 unsigned int *unit_address; 221 - unsigned int *irq_p; 222 221 223 222 /* we need the 'device_type' property, in order to match with drivers */ 224 223 if (of_node->type == NULL) { ··· 242 243 243 244 viodev->dev.platform_data = of_node_get(of_node); 244 245 245 - viodev->irq = NO_IRQ; 246 - irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL); 247 - if (irq_p) { 248 - int virq = virt_irq_create_mapping(*irq_p); 249 - if (virq == NO_IRQ) { 250 - printk(KERN_ERR "Unable to allocate interrupt " 251 - "number for %s\n", of_node->full_name); 252 - } else 253 - viodev->irq = irq_offset_up(virq); 254 - } 246 + viodev->irq = irq_of_parse_and_map(of_node, 0); 255 247 256 248 snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address); 257 249 viodev->name = of_node->name;
+10 -1
arch/powerpc/platforms/83xx/Kconfig
··· 16 16 3 PCI slots. The PIBs PCI initialization is the bootloader's 17 17 responsiblilty. 18 18 19 + config MPC834x_ITX 20 + bool "Freescale MPC834x ITX" 21 + select DEFAULT_UIMAGE 22 + help 23 + This option enables support for the MPC 834x ITX evaluation board. 24 + 25 + Be aware that PCI initialization is the bootloader's 26 + responsiblilty. 27 + 19 28 endchoice 20 29 21 30 config MPC834x 22 31 bool 23 32 select PPC_UDBG_16550 24 33 select PPC_INDIRECT_PCI 25 - default y if MPC834x_SYS 34 + default y if MPC834x_SYS || MPC834x_ITX 26 35 27 36 endmenu
+1
arch/powerpc/platforms/83xx/Makefile
··· 4 4 obj-y := misc.o 5 5 obj-$(CONFIG_PCI) += pci.o 6 6 obj-$(CONFIG_MPC834x_SYS) += mpc834x_sys.o 7 + obj-$(CONFIG_MPC834x_ITX) += mpc834x_itx.o
+156
arch/powerpc/platforms/83xx/mpc834x_itx.c
··· 1 + /* 2 + * arch/powerpc/platforms/83xx/mpc834x_itx.c 3 + * 4 + * MPC834x ITX board specific routines 5 + * 6 + * Maintainer: Kumar Gala <galak@kernel.crashing.org> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + */ 13 + 14 + #include <linux/config.h> 15 + #include <linux/stddef.h> 16 + #include <linux/kernel.h> 17 + #include <linux/init.h> 18 + #include <linux/errno.h> 19 + #include <linux/reboot.h> 20 + #include <linux/pci.h> 21 + #include <linux/kdev_t.h> 22 + #include <linux/major.h> 23 + #include <linux/console.h> 24 + #include <linux/delay.h> 25 + #include <linux/seq_file.h> 26 + #include <linux/root_dev.h> 27 + 28 + #include <asm/system.h> 29 + #include <asm/atomic.h> 30 + #include <asm/time.h> 31 + #include <asm/io.h> 32 + #include <asm/machdep.h> 33 + #include <asm/ipic.h> 34 + #include <asm/bootinfo.h> 35 + #include <asm/irq.h> 36 + #include <asm/prom.h> 37 + #include <asm/udbg.h> 38 + #include <sysdev/fsl_soc.h> 39 + 40 + #include "mpc83xx.h" 41 + 42 + #include <platforms/83xx/mpc834x_sys.h> 43 + 44 + #ifndef CONFIG_PCI 45 + unsigned long isa_io_base = 0; 46 + unsigned long isa_mem_base = 0; 47 + #endif 48 + 49 + #ifdef CONFIG_PCI 50 + static int 51 + mpc83xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) 52 + { 53 + static char pci_irq_table[][4] = 54 + /* 55 + * PCI IDSEL/INTPIN->INTLINE 56 + * A B C D 57 + */ 58 + { 59 + {PIRQB, PIRQC, PIRQD, PIRQA}, /* idsel 0x0e */ 60 + {PIRQA, PIRQB, PIRQC, PIRQD}, /* idsel 0x0f */ 61 + {PIRQC, PIRQD, PIRQA, PIRQB}, /* idsel 0x10 */ 62 + }; 63 + 64 + const long min_idsel = 0x0e, max_idsel = 0x10, irqs_per_slot = 4; 65 + return PCI_IRQ_TABLE_LOOKUP; 66 + } 67 + #endif /* CONFIG_PCI */ 68 + 69 + /* ************************************************************************ 70 + * 71 + * Setup the architecture 72 + * 73 + */ 74 + static void __init mpc834x_itx_setup_arch(void) 75 + { 76 + struct device_node *np; 77 + 78 + if (ppc_md.progress) 79 + ppc_md.progress("mpc834x_itx_setup_arch()", 0); 80 + 81 + np = of_find_node_by_type(NULL, "cpu"); 82 + if (np != 0) { 83 + unsigned int *fp = 84 + (int *)get_property(np, "clock-frequency", NULL); 85 + if (fp != 0) 86 + loops_per_jiffy = *fp / HZ; 87 + else 88 + loops_per_jiffy = 50000000 / HZ; 89 + of_node_put(np); 90 + } 91 + #ifdef CONFIG_PCI 92 + for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;) 93 + add_bridge(np); 94 + 95 + ppc_md.pci_swizzle = common_swizzle; 96 + ppc_md.pci_map_irq = mpc83xx_map_irq; 97 + ppc_md.pci_exclude_device = mpc83xx_exclude_device; 98 + #endif 99 + 100 + #ifdef CONFIG_ROOT_NFS 101 + ROOT_DEV = Root_NFS; 102 + #else 103 + ROOT_DEV = Root_HDA1; 104 + #endif 105 + } 106 + 107 + void __init mpc834x_itx_init_IRQ(void) 108 + { 109 + u8 senses[8] = { 110 + 0, /* EXT 0 */ 111 + IRQ_SENSE_LEVEL, /* EXT 1 */ 112 + IRQ_SENSE_LEVEL, /* EXT 2 */ 113 + 0, /* EXT 3 */ 114 + #ifdef CONFIG_PCI 115 + IRQ_SENSE_LEVEL, /* EXT 4 */ 116 + IRQ_SENSE_LEVEL, /* EXT 5 */ 117 + IRQ_SENSE_LEVEL, /* EXT 6 */ 118 + IRQ_SENSE_LEVEL, /* EXT 7 */ 119 + #else 120 + 0, /* EXT 4 */ 121 + 0, /* EXT 5 */ 122 + 0, /* EXT 6 */ 123 + 0, /* EXT 7 */ 124 + #endif 125 + }; 126 + 127 + ipic_init(get_immrbase() + 0x00700, 0, 0, senses, 8); 128 + 129 + /* Initialize the default interrupt mapping priorities, 130 + * in case the boot rom changed something on us. 131 + */ 132 + ipic_set_default_priority(); 133 + } 134 + 135 + /* 136 + * Called very early, MMU is off, device-tree isn't unflattened 137 + */ 138 + static int __init mpc834x_itx_probe(void) 139 + { 140 + /* We always match for now, eventually we should look at the flat 141 + dev tree to ensure this is the board we are suppose to run on 142 + */ 143 + return 1; 144 + } 145 + 146 + define_machine(mpc834x_itx) { 147 + .name = "MPC834x ITX", 148 + .probe = mpc834x_itx_probe, 149 + .setup_arch = mpc834x_itx_setup_arch, 150 + .init_IRQ = mpc834x_itx_init_IRQ, 151 + .get_irq = ipic_get_irq, 152 + .restart = mpc83xx_restart, 153 + .time_init = mpc83xx_time_init, 154 + .calibrate_decr = generic_calibrate_decr, 155 + .progress = udbg_progress, 156 + };
+23
arch/powerpc/platforms/83xx/mpc834x_itx.h
··· 1 + /* 2 + * arch/powerpc/platforms/83xx/mpc834x_itx.h 3 + * 4 + * MPC834X ITX common board definitions 5 + * 6 + * Maintainer: Kumar Gala <galak@kernel.crashing.org> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + * 13 + */ 14 + 15 + #ifndef __MACH_MPC83XX_ITX_H__ 16 + #define __MACH_MPC83XX_ITX_H__ 17 + 18 + #define PIRQA MPC83xx_IRQ_EXT4 19 + #define PIRQB MPC83xx_IRQ_EXT5 20 + #define PIRQC MPC83xx_IRQ_EXT6 21 + #define PIRQD MPC83xx_IRQ_EXT7 22 + 23 + #endif /* __MACH_MPC83XX_ITX_H__ */
+195 -242
arch/powerpc/platforms/cell/interrupt.c
··· 1 1 /* 2 2 * Cell Internal Interrupt Controller 3 3 * 4 + * Copyright (C) 2006 Benjamin Herrenschmidt (benh@kernel.crashing.org) 5 + * IBM, Corp. 6 + * 4 7 * (C) Copyright IBM Deutschland Entwicklung GmbH 2005 5 8 * 6 9 * Author: Arnd Bergmann <arndb@de.ibm.com> ··· 28 25 #include <linux/module.h> 29 26 #include <linux/percpu.h> 30 27 #include <linux/types.h> 28 + #include <linux/ioport.h> 31 29 32 30 #include <asm/io.h> 33 31 #include <asm/pgtable.h> 34 32 #include <asm/prom.h> 35 33 #include <asm/ptrace.h> 34 + #include <asm/machdep.h> 36 35 37 36 #include "interrupt.h" 38 37 #include "cbe_regs.h" ··· 42 37 struct iic { 43 38 struct cbe_iic_thread_regs __iomem *regs; 44 39 u8 target_id; 40 + u8 eoi_stack[16]; 41 + int eoi_ptr; 42 + struct irq_host *host; 45 43 }; 46 44 47 45 static DEFINE_PER_CPU(struct iic, iic); 46 + #define IIC_NODE_COUNT 2 47 + static struct irq_host *iic_hosts[IIC_NODE_COUNT]; 48 48 49 - void iic_local_enable(void) 49 + /* Convert between "pending" bits and hw irq number */ 50 + static irq_hw_number_t iic_pending_to_hwnum(struct cbe_iic_pending_bits bits) 51 + { 52 + unsigned char unit = bits.source & 0xf; 53 + 54 + if (bits.flags & CBE_IIC_IRQ_IPI) 55 + return IIC_IRQ_IPI0 | (bits.prio >> 4); 56 + else if (bits.class <= 3) 57 + return (bits.class << 4) | unit; 58 + else 59 + return IIC_IRQ_INVALID; 60 + } 61 + 62 + static void iic_mask(unsigned int irq) 63 + { 64 + } 65 + 66 + static void iic_unmask(unsigned int irq) 67 + { 68 + } 69 + 70 + static void iic_eoi(unsigned int irq) 50 71 { 51 72 struct iic *iic = &__get_cpu_var(iic); 52 - u64 tmp; 53 - 54 - /* 55 - * There seems to be a bug that is present in DD2.x CPUs 56 - * and still only partially fixed in DD3.1. 57 - * This bug causes a value written to the priority register 58 - * not to make it there, resulting in a system hang unless we 59 - * write it again. 60 - * Masking with 0xf0 is done because the Cell BE does not 61 - * implement the lower four bits of the interrupt priority, 62 - * they always read back as zeroes, although future CPUs 63 - * might implement different bits. 64 - */ 65 - do { 66 - out_be64(&iic->regs->prio, 0xff); 67 - tmp = in_be64(&iic->regs->prio); 68 - } while ((tmp & 0xf0) != 0xf0); 73 + out_be64(&iic->regs->prio, iic->eoi_stack[--iic->eoi_ptr]); 74 + BUG_ON(iic->eoi_ptr < 0); 69 75 } 70 76 71 - void iic_local_disable(void) 72 - { 73 - out_be64(&__get_cpu_var(iic).regs->prio, 0x0); 74 - } 75 - 76 - static unsigned int iic_startup(unsigned int irq) 77 - { 78 - return 0; 79 - } 80 - 81 - static void iic_enable(unsigned int irq) 82 - { 83 - iic_local_enable(); 84 - } 85 - 86 - static void iic_disable(unsigned int irq) 87 - { 88 - } 89 - 90 - static void iic_end(unsigned int irq) 91 - { 92 - iic_local_enable(); 93 - } 94 - 95 - static struct hw_interrupt_type iic_pic = { 77 + static struct irq_chip iic_chip = { 96 78 .typename = " CELL-IIC ", 97 - .startup = iic_startup, 98 - .enable = iic_enable, 99 - .disable = iic_disable, 100 - .end = iic_end, 79 + .mask = iic_mask, 80 + .unmask = iic_unmask, 81 + .eoi = iic_eoi, 101 82 }; 102 83 103 - static int iic_external_get_irq(struct cbe_iic_pending_bits pending) 104 - { 105 - int irq; 106 - unsigned char node, unit; 107 - 108 - node = pending.source >> 4; 109 - unit = pending.source & 0xf; 110 - irq = -1; 111 - 112 - /* 113 - * This mapping is specific to the Cell Broadband 114 - * Engine. We might need to get the numbers 115 - * from the device tree to support future CPUs. 116 - */ 117 - switch (unit) { 118 - case 0x00: 119 - case 0x0b: 120 - /* 121 - * One of these units can be connected 122 - * to an external interrupt controller. 123 - */ 124 - if (pending.class != 2) 125 - break; 126 - irq = IIC_EXT_OFFSET 127 - + spider_get_irq(node) 128 - + node * IIC_NODE_STRIDE; 129 - break; 130 - case 0x01 ... 0x04: 131 - case 0x07 ... 0x0a: 132 - /* 133 - * These units are connected to the SPEs 134 - */ 135 - if (pending.class > 2) 136 - break; 137 - irq = IIC_SPE_OFFSET 138 - + pending.class * IIC_CLASS_STRIDE 139 - + node * IIC_NODE_STRIDE 140 - + unit; 141 - break; 142 - } 143 - if (irq == -1) 144 - printk(KERN_WARNING "Unexpected interrupt class %02x, " 145 - "source %02x, prio %02x, cpu %02x\n", pending.class, 146 - pending.source, pending.prio, smp_processor_id()); 147 - return irq; 148 - } 149 - 150 84 /* Get an IRQ number from the pending state register of the IIC */ 151 - int iic_get_irq(struct pt_regs *regs) 85 + static unsigned int iic_get_irq(struct pt_regs *regs) 152 86 { 153 - struct iic *iic; 154 - int irq; 155 - struct cbe_iic_pending_bits pending; 87 + struct cbe_iic_pending_bits pending; 88 + struct iic *iic; 156 89 157 - iic = &__get_cpu_var(iic); 158 - *(unsigned long *) &pending = 159 - in_be64((unsigned long __iomem *) &iic->regs->pending_destr); 160 - 161 - irq = -1; 162 - if (pending.flags & CBE_IIC_IRQ_VALID) { 163 - if (pending.flags & CBE_IIC_IRQ_IPI) { 164 - irq = IIC_IPI_OFFSET + (pending.prio >> 4); 165 - /* 166 - if (irq > 0x80) 167 - printk(KERN_WARNING "Unexpected IPI prio %02x" 168 - "on CPU %02x\n", pending.prio, 169 - smp_processor_id()); 170 - */ 171 - } else { 172 - irq = iic_external_get_irq(pending); 173 - } 174 - } 175 - return irq; 176 - } 177 - 178 - /* hardcoded part to be compatible with older firmware */ 179 - 180 - static int setup_iic_hardcoded(void) 181 - { 182 - struct device_node *np; 183 - int nodeid, cpu; 184 - unsigned long regs; 185 - struct iic *iic; 186 - 187 - for_each_possible_cpu(cpu) { 188 - iic = &per_cpu(iic, cpu); 189 - nodeid = cpu/2; 190 - 191 - for (np = of_find_node_by_type(NULL, "cpu"); 192 - np; 193 - np = of_find_node_by_type(np, "cpu")) { 194 - if (nodeid == *(int *)get_property(np, "node-id", NULL)) 195 - break; 196 - } 197 - 198 - if (!np) { 199 - printk(KERN_WARNING "IIC: CPU %d not found\n", cpu); 200 - iic->regs = NULL; 201 - iic->target_id = 0xff; 202 - return -ENODEV; 203 - } 204 - 205 - regs = *(long *)get_property(np, "iic", NULL); 206 - 207 - /* hack until we have decided on the devtree info */ 208 - regs += 0x400; 209 - if (cpu & 1) 210 - regs += 0x20; 211 - 212 - printk(KERN_INFO "IIC for CPU %d at %lx\n", cpu, regs); 213 - iic->regs = ioremap(regs, sizeof(struct cbe_iic_thread_regs)); 214 - iic->target_id = (nodeid << 4) + ((cpu & 1) ? 0xf : 0xe); 215 - } 216 - 217 - return 0; 218 - } 219 - 220 - static int setup_iic(void) 221 - { 222 - struct device_node *dn; 223 - unsigned long *regs; 224 - char *compatible; 225 - unsigned *np, found = 0; 226 - struct iic *iic = NULL; 227 - 228 - for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 229 - compatible = (char *)get_property(dn, "compatible", NULL); 230 - 231 - if (!compatible) { 232 - printk(KERN_WARNING "no compatible property found !\n"); 233 - continue; 234 - } 235 - 236 - if (strstr(compatible, "IBM,CBEA-Internal-Interrupt-Controller")) 237 - regs = (unsigned long *)get_property(dn,"reg", NULL); 238 - else 239 - continue; 240 - 241 - if (!regs) 242 - printk(KERN_WARNING "IIC: no reg property\n"); 243 - 244 - np = (unsigned int *)get_property(dn, "ibm,interrupt-server-ranges", NULL); 245 - 246 - if (!np) { 247 - printk(KERN_WARNING "IIC: CPU association not found\n"); 248 - iic->regs = NULL; 249 - iic->target_id = 0xff; 250 - return -ENODEV; 251 - } 252 - 253 - iic = &per_cpu(iic, np[0]); 254 - iic->regs = ioremap(regs[0], sizeof(struct cbe_iic_thread_regs)); 255 - iic->target_id = ((np[0] & 2) << 3) + ((np[0] & 1) ? 0xf : 0xe); 256 - printk("IIC for CPU %d at %lx mapped to %p\n", np[0], regs[0], iic->regs); 257 - 258 - iic = &per_cpu(iic, np[1]); 259 - iic->regs = ioremap(regs[2], sizeof(struct cbe_iic_thread_regs)); 260 - iic->target_id = ((np[1] & 2) << 3) + ((np[1] & 1) ? 0xf : 0xe); 261 - printk("IIC for CPU %d at %lx mapped to %p\n", np[1], regs[2], iic->regs); 262 - 263 - found++; 264 - } 265 - 266 - if (found) 267 - return 0; 268 - else 269 - return -ENODEV; 90 + iic = &__get_cpu_var(iic); 91 + *(unsigned long *) &pending = 92 + in_be64((unsigned long __iomem *) &iic->regs->pending_destr); 93 + iic->eoi_stack[++iic->eoi_ptr] = pending.prio; 94 + BUG_ON(iic->eoi_ptr > 15); 95 + if (pending.flags & CBE_IIC_IRQ_VALID) 96 + return irq_linear_revmap(iic->host, 97 + iic_pending_to_hwnum(pending)); 98 + return NO_IRQ; 270 99 } 271 100 272 101 #ifdef CONFIG_SMP ··· 108 269 /* Use the highest interrupt priorities for IPI */ 109 270 static inline int iic_ipi_to_irq(int ipi) 110 271 { 111 - return IIC_IPI_OFFSET + IIC_NUM_IPIS - 1 - ipi; 272 + return IIC_IRQ_IPI0 + IIC_NUM_IPIS - 1 - ipi; 112 273 } 113 274 114 275 static inline int iic_irq_to_ipi(int irq) 115 276 { 116 - return IIC_NUM_IPIS - 1 - (irq - IIC_IPI_OFFSET); 277 + return IIC_NUM_IPIS - 1 - (irq - IIC_IRQ_IPI0); 117 278 } 118 279 119 280 void iic_setup_cpu(void) ··· 132 293 } 133 294 EXPORT_SYMBOL_GPL(iic_get_target_id); 134 295 296 + struct irq_host *iic_get_irq_host(int node) 297 + { 298 + if (node < 0 || node >= IIC_NODE_COUNT) 299 + return NULL; 300 + return iic_hosts[node]; 301 + } 302 + EXPORT_SYMBOL_GPL(iic_get_irq_host); 303 + 304 + 135 305 static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) 136 306 { 137 - smp_message_recv(iic_irq_to_ipi(irq), regs); 307 + int ipi = (int)(long)dev_id; 308 + 309 + smp_message_recv(ipi, regs); 310 + 138 311 return IRQ_HANDLED; 139 312 } 140 313 141 314 static void iic_request_ipi(int ipi, const char *name) 142 315 { 143 - int irq; 316 + int node, virq; 144 317 145 - irq = iic_ipi_to_irq(ipi); 146 - /* IPIs are marked IRQF_DISABLED as they must run with irqs 147 - * disabled */ 148 - get_irq_desc(irq)->chip = &iic_pic; 149 - get_irq_desc(irq)->status |= IRQ_PER_CPU; 150 - request_irq(irq, iic_ipi_action, IRQF_DISABLED, name, NULL); 318 + for (node = 0; node < IIC_NODE_COUNT; node++) { 319 + char *rname; 320 + if (iic_hosts[node] == NULL) 321 + continue; 322 + virq = irq_create_mapping(iic_hosts[node], 323 + iic_ipi_to_irq(ipi), 0); 324 + if (virq == NO_IRQ) { 325 + printk(KERN_ERR 326 + "iic: failed to map IPI %s on node %d\n", 327 + name, node); 328 + continue; 329 + } 330 + rname = kzalloc(strlen(name) + 16, GFP_KERNEL); 331 + if (rname) 332 + sprintf(rname, "%s node %d", name, node); 333 + else 334 + rname = (char *)name; 335 + if (request_irq(virq, iic_ipi_action, IRQF_DISABLED, 336 + rname, (void *)(long)ipi)) 337 + printk(KERN_ERR 338 + "iic: failed to request IPI %s on node %d\n", 339 + name, node); 340 + } 151 341 } 152 342 153 343 void iic_request_IPIs(void) ··· 187 319 iic_request_ipi(PPC_MSG_DEBUGGER_BREAK, "IPI-debug"); 188 320 #endif /* CONFIG_DEBUGGER */ 189 321 } 322 + 190 323 #endif /* CONFIG_SMP */ 191 324 192 - static void iic_setup_spe_handlers(void) 193 - { 194 - int be, isrc; 195 325 196 - /* Assume two threads per BE are present */ 197 - for (be=0; be < num_present_cpus() / 2; be++) { 198 - for (isrc = 0; isrc < IIC_CLASS_STRIDE * 3; isrc++) { 199 - int irq = IIC_NODE_STRIDE * be + IIC_SPE_OFFSET + isrc; 200 - get_irq_desc(irq)->chip = &iic_pic; 201 - } 202 - } 326 + static int iic_host_match(struct irq_host *h, struct device_node *node) 327 + { 328 + return h->host_data != NULL && node == h->host_data; 203 329 } 204 330 205 - void iic_init_IRQ(void) 331 + static int iic_host_map(struct irq_host *h, unsigned int virq, 332 + irq_hw_number_t hw, unsigned int flags) 206 333 { 207 - int cpu, irq_offset; 208 - struct iic *iic; 334 + if (hw < IIC_IRQ_IPI0) 335 + set_irq_chip_and_handler(virq, &iic_chip, handle_fasteoi_irq); 336 + else 337 + set_irq_chip_and_handler(virq, &iic_chip, handle_percpu_irq); 338 + return 0; 339 + } 209 340 210 - if (setup_iic() < 0) 211 - setup_iic_hardcoded(); 341 + static int iic_host_xlate(struct irq_host *h, struct device_node *ct, 342 + u32 *intspec, unsigned int intsize, 343 + irq_hw_number_t *out_hwirq, unsigned int *out_flags) 212 344 213 - irq_offset = 0; 214 - for_each_possible_cpu(cpu) { 215 - iic = &per_cpu(iic, cpu); 216 - if (iic->regs) 217 - out_be64(&iic->regs->prio, 0xff); 345 + { 346 + /* Currently, we don't translate anything. That needs to be fixed as 347 + * we get better defined device-trees. iic interrupts have to be 348 + * explicitely mapped by whoever needs them 349 + */ 350 + return -ENODEV; 351 + } 352 + 353 + static struct irq_host_ops iic_host_ops = { 354 + .match = iic_host_match, 355 + .map = iic_host_map, 356 + .xlate = iic_host_xlate, 357 + }; 358 + 359 + static void __init init_one_iic(unsigned int hw_cpu, unsigned long addr, 360 + struct irq_host *host) 361 + { 362 + /* XXX FIXME: should locate the linux CPU number from the HW cpu 363 + * number properly. We are lucky for now 364 + */ 365 + struct iic *iic = &per_cpu(iic, hw_cpu); 366 + 367 + iic->regs = ioremap(addr, sizeof(struct cbe_iic_thread_regs)); 368 + BUG_ON(iic->regs == NULL); 369 + 370 + iic->target_id = ((hw_cpu & 2) << 3) | ((hw_cpu & 1) ? 0xf : 0xe); 371 + iic->eoi_stack[0] = 0xff; 372 + iic->host = host; 373 + out_be64(&iic->regs->prio, 0); 374 + 375 + printk(KERN_INFO "IIC for CPU %d at %lx mapped to %p, target id 0x%x\n", 376 + hw_cpu, addr, iic->regs, iic->target_id); 377 + } 378 + 379 + static int __init setup_iic(void) 380 + { 381 + struct device_node *dn; 382 + struct resource r0, r1; 383 + struct irq_host *host; 384 + int found = 0; 385 + u32 *np; 386 + 387 + for (dn = NULL; 388 + (dn = of_find_node_by_name(dn,"interrupt-controller")) != NULL;) { 389 + if (!device_is_compatible(dn, 390 + "IBM,CBEA-Internal-Interrupt-Controller")) 391 + continue; 392 + np = (u32 *)get_property(dn, "ibm,interrupt-server-ranges", 393 + NULL); 394 + if (np == NULL) { 395 + printk(KERN_WARNING "IIC: CPU association not found\n"); 396 + of_node_put(dn); 397 + return -ENODEV; 398 + } 399 + if (of_address_to_resource(dn, 0, &r0) || 400 + of_address_to_resource(dn, 1, &r1)) { 401 + printk(KERN_WARNING "IIC: Can't resolve addresses\n"); 402 + of_node_put(dn); 403 + return -ENODEV; 404 + } 405 + host = NULL; 406 + if (found < IIC_NODE_COUNT) { 407 + host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 408 + IIC_SOURCE_COUNT, 409 + &iic_host_ops, 410 + IIC_IRQ_INVALID); 411 + iic_hosts[found] = host; 412 + BUG_ON(iic_hosts[found] == NULL); 413 + iic_hosts[found]->host_data = of_node_get(dn); 414 + found++; 415 + } 416 + init_one_iic(np[0], r0.start, host); 417 + init_one_iic(np[1], r1.start, host); 218 418 } 219 - iic_setup_spe_handlers(); 419 + 420 + if (found) 421 + return 0; 422 + else 423 + return -ENODEV; 424 + } 425 + 426 + void __init iic_init_IRQ(void) 427 + { 428 + /* Discover and initialize iics */ 429 + if (setup_iic() < 0) 430 + panic("IIC: Failed to initialize !\n"); 431 + 432 + /* Set master interrupt handling function */ 433 + ppc_md.get_irq = iic_get_irq; 434 + 435 + /* Enable on current CPU */ 436 + iic_setup_cpu(); 220 437 }
+8 -11
arch/powerpc/platforms/cell/interrupt.h
··· 37 37 */ 38 38 39 39 enum { 40 - IIC_EXT_OFFSET = 0x00, /* Start of south bridge IRQs */ 41 - IIC_NUM_EXT = 0x40, /* Number of south bridge IRQs */ 42 - IIC_SPE_OFFSET = 0x40, /* Start of SPE interrupts */ 43 - IIC_CLASS_STRIDE = 0x10, /* SPE IRQs per class */ 44 - IIC_IPI_OFFSET = 0x70, /* Start of IPI IRQs */ 45 - IIC_NUM_IPIS = 0x10, /* IRQs reserved for IPI */ 46 - IIC_NODE_STRIDE = 0x80, /* Total IRQs per node */ 40 + IIC_IRQ_INVALID = 0xff, 41 + IIC_IRQ_MAX = 0x3f, 42 + IIC_IRQ_EXT_IOIF0 = 0x20, 43 + IIC_IRQ_EXT_IOIF1 = 0x2b, 44 + IIC_IRQ_IPI0 = 0x40, 45 + IIC_NUM_IPIS = 0x10, /* IRQs reserved for IPI */ 46 + IIC_SOURCE_COUNT = 0x50, 47 47 }; 48 48 49 49 extern void iic_init_IRQ(void); 50 - extern int iic_get_irq(struct pt_regs *regs); 51 50 extern void iic_cause_IPI(int cpu, int mesg); 52 51 extern void iic_request_IPIs(void); 53 52 extern void iic_setup_cpu(void); 54 - extern void iic_local_enable(void); 55 - extern void iic_local_disable(void); 56 53 57 54 extern u8 iic_get_target_id(int cpu); 55 + extern struct irq_host *iic_get_irq_host(int node); 58 56 59 57 extern void spider_init_IRQ(void); 60 - extern int spider_get_irq(int node); 61 58 62 59 #endif 63 60 #endif /* ASM_CELL_PIC_H */
+17 -5
arch/powerpc/platforms/cell/setup.c
··· 49 49 #include <asm/irq.h> 50 50 #include <asm/spu.h> 51 51 #include <asm/spu_priv1.h> 52 + #include <asm/udbg.h> 52 53 53 54 #include "interrupt.h" 54 55 #include "iommu.h" ··· 80 79 printk("*** %04x : %s\n", hex, s ? s : ""); 81 80 } 82 81 82 + static void __init cell_pcibios_fixup(void) 83 + { 84 + struct pci_dev *dev = NULL; 85 + 86 + for_each_pci_dev(dev) 87 + pci_read_irq_line(dev); 88 + } 89 + 90 + static void __init cell_init_irq(void) 91 + { 92 + iic_init_IRQ(); 93 + spider_init_IRQ(); 94 + } 95 + 83 96 static void __init cell_setup_arch(void) 84 97 { 85 - ppc_md.init_IRQ = iic_init_IRQ; 86 - ppc_md.get_irq = iic_get_irq; 87 98 #ifdef CONFIG_SPU_BASE 88 99 spu_priv1_ops = &spu_priv1_mmio_ops; 89 100 #endif ··· 121 108 /* Find and initialize PCI host bridges */ 122 109 init_pci_config_tokens(); 123 110 find_and_init_phbs(); 124 - spider_init_IRQ(); 125 111 cbe_pervasive_init(); 126 112 #ifdef CONFIG_DUMMY_CONSOLE 127 113 conswitchp = &dummy_con; ··· 137 125 DBG(" -> cell_init_early()\n"); 138 126 139 127 cell_init_iommu(); 140 - 141 - ppc64_interrupt_controller = IC_CELL_PIC; 142 128 143 129 DBG(" <- cell_init_early()\n"); 144 130 } ··· 183 173 .calibrate_decr = generic_calibrate_decr, 184 174 .check_legacy_ioport = cell_check_legacy_ioport, 185 175 .progress = cell_progress, 176 + .init_IRQ = cell_init_irq, 177 + .pcibios_fixup = cell_pcibios_fixup, 186 178 #ifdef CONFIG_KEXEC 187 179 .machine_kexec = default_machine_kexec, 188 180 .machine_kexec_prepare = default_machine_kexec_prepare,
+270 -140
arch/powerpc/platforms/cell/spider-pic.c
··· 22 22 23 23 #include <linux/interrupt.h> 24 24 #include <linux/irq.h> 25 + #include <linux/ioport.h> 25 26 26 27 #include <asm/pgtable.h> 27 28 #include <asm/prom.h> ··· 57 56 REISWAITEN = 0x508, /* Reissue Wait Control*/ 58 57 }; 59 58 60 - static void __iomem *spider_pics[4]; 59 + #define SPIDER_CHIP_COUNT 4 60 + #define SPIDER_SRC_COUNT 64 61 + #define SPIDER_IRQ_INVALID 63 61 62 62 - static void __iomem *spider_get_pic(int irq) 63 + struct spider_pic { 64 + struct irq_host *host; 65 + struct device_node *of_node; 66 + void __iomem *regs; 67 + unsigned int node_id; 68 + }; 69 + static struct spider_pic spider_pics[SPIDER_CHIP_COUNT]; 70 + 71 + static struct spider_pic *spider_virq_to_pic(unsigned int virq) 63 72 { 64 - int node = irq / IIC_NODE_STRIDE; 65 - irq %= IIC_NODE_STRIDE; 66 - 67 - if (irq >= IIC_EXT_OFFSET && 68 - irq < IIC_EXT_OFFSET + IIC_NUM_EXT && 69 - spider_pics) 70 - return spider_pics[node]; 71 - return NULL; 73 + return irq_map[virq].host->host_data; 72 74 } 73 75 74 - static int spider_get_nr(unsigned int irq) 76 + static void __iomem *spider_get_irq_config(struct spider_pic *pic, 77 + unsigned int src) 75 78 { 76 - return (irq % IIC_NODE_STRIDE) - IIC_EXT_OFFSET; 79 + return pic->regs + TIR_CFGA + 8 * src; 77 80 } 78 81 79 - static void __iomem *spider_get_irq_config(int irq) 82 + static void spider_unmask_irq(unsigned int virq) 80 83 { 81 - void __iomem *pic; 82 - pic = spider_get_pic(irq); 83 - return pic + TIR_CFGA + 8 * spider_get_nr(irq); 84 + struct spider_pic *pic = spider_virq_to_pic(virq); 85 + void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); 86 + 87 + /* We use no locking as we should be covered by the descriptor lock 88 + * for access to invidual source configuration registers 89 + */ 90 + out_be32(cfg, in_be32(cfg) | 0x30000000u); 84 91 } 85 92 86 - static void spider_enable_irq(unsigned int irq) 93 + static void spider_mask_irq(unsigned int virq) 87 94 { 88 - int nodeid = (irq / IIC_NODE_STRIDE) * 0x10; 89 - void __iomem *cfg = spider_get_irq_config(irq); 90 - irq = spider_get_nr(irq); 95 + struct spider_pic *pic = spider_virq_to_pic(virq); 96 + void __iomem *cfg = spider_get_irq_config(pic, irq_map[virq].hwirq); 91 97 92 - out_be32(cfg, (in_be32(cfg) & ~0xf0)| 0x3107000eu | nodeid); 93 - out_be32(cfg + 4, in_be32(cfg + 4) | 0x00020000u | irq); 94 - } 95 - 96 - static void spider_disable_irq(unsigned int irq) 97 - { 98 - void __iomem *cfg = spider_get_irq_config(irq); 99 - irq = spider_get_nr(irq); 100 - 98 + /* We use no locking as we should be covered by the descriptor lock 99 + * for access to invidual source configuration registers 100 + */ 101 101 out_be32(cfg, in_be32(cfg) & ~0x30000000u); 102 102 } 103 103 104 - static unsigned int spider_startup_irq(unsigned int irq) 104 + static void spider_ack_irq(unsigned int virq) 105 105 { 106 - spider_enable_irq(irq); 106 + struct spider_pic *pic = spider_virq_to_pic(virq); 107 + unsigned int src = irq_map[virq].hwirq; 108 + 109 + /* Reset edge detection logic if necessary 110 + */ 111 + if (get_irq_desc(virq)->status & IRQ_LEVEL) 112 + return; 113 + 114 + /* Only interrupts 47 to 50 can be set to edge */ 115 + if (src < 47 || src > 50) 116 + return; 117 + 118 + /* Perform the clear of the edge logic */ 119 + out_be32(pic->regs + TIR_EDC, 0x100 | (src & 0xf)); 120 + } 121 + 122 + static struct irq_chip spider_pic = { 123 + .typename = " SPIDER ", 124 + .unmask = spider_unmask_irq, 125 + .mask = spider_mask_irq, 126 + .ack = spider_ack_irq, 127 + }; 128 + 129 + static int spider_host_match(struct irq_host *h, struct device_node *node) 130 + { 131 + struct spider_pic *pic = h->host_data; 132 + return node == pic->of_node; 133 + } 134 + 135 + static int spider_host_map(struct irq_host *h, unsigned int virq, 136 + irq_hw_number_t hw, unsigned int flags) 137 + { 138 + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 139 + struct spider_pic *pic = h->host_data; 140 + void __iomem *cfg = spider_get_irq_config(pic, hw); 141 + int level = 0; 142 + u32 ic; 143 + 144 + /* Note that only level high is supported for most interrupts */ 145 + if (sense != IRQ_TYPE_NONE && sense != IRQ_TYPE_LEVEL_HIGH && 146 + (hw < 47 || hw > 50)) 147 + return -EINVAL; 148 + 149 + /* Decode sense type */ 150 + switch(sense) { 151 + case IRQ_TYPE_EDGE_RISING: 152 + ic = 0x3; 153 + break; 154 + case IRQ_TYPE_EDGE_FALLING: 155 + ic = 0x2; 156 + break; 157 + case IRQ_TYPE_LEVEL_LOW: 158 + ic = 0x0; 159 + level = 1; 160 + break; 161 + case IRQ_TYPE_LEVEL_HIGH: 162 + case IRQ_TYPE_NONE: 163 + ic = 0x1; 164 + level = 1; 165 + break; 166 + default: 167 + return -EINVAL; 168 + } 169 + 170 + /* Configure the source. One gross hack that was there before and 171 + * that I've kept around is the priority to the BE which I set to 172 + * be the same as the interrupt source number. I don't know wether 173 + * that's supposed to make any kind of sense however, we'll have to 174 + * decide that, but for now, I'm not changing the behaviour. 175 + */ 176 + out_be32(cfg, (ic << 24) | (0x7 << 16) | (pic->node_id << 4) | 0xe); 177 + out_be32(cfg + 4, (0x2 << 16) | (hw & 0xff)); 178 + 179 + if (level) 180 + get_irq_desc(virq)->status |= IRQ_LEVEL; 181 + set_irq_chip_and_handler(virq, &spider_pic, handle_level_irq); 107 182 return 0; 108 183 } 109 184 110 - static void spider_shutdown_irq(unsigned int irq) 185 + static int spider_host_xlate(struct irq_host *h, struct device_node *ct, 186 + u32 *intspec, unsigned int intsize, 187 + irq_hw_number_t *out_hwirq, unsigned int *out_flags) 188 + 111 189 { 112 - spider_disable_irq(irq); 190 + /* Spider interrupts have 2 cells, first is the interrupt source, 191 + * second, well, I don't know for sure yet ... We mask the top bits 192 + * because old device-trees encode a node number in there 193 + */ 194 + *out_hwirq = intspec[0] & 0x3f; 195 + *out_flags = IRQ_TYPE_LEVEL_HIGH; 196 + return 0; 113 197 } 114 198 115 - static void spider_end_irq(unsigned int irq) 116 - { 117 - spider_enable_irq(irq); 118 - } 119 - 120 - static void spider_ack_irq(unsigned int irq) 121 - { 122 - spider_disable_irq(irq); 123 - iic_local_enable(); 124 - } 125 - 126 - static struct hw_interrupt_type spider_pic = { 127 - .typename = " SPIDER ", 128 - .startup = spider_startup_irq, 129 - .shutdown = spider_shutdown_irq, 130 - .enable = spider_enable_irq, 131 - .disable = spider_disable_irq, 132 - .ack = spider_ack_irq, 133 - .end = spider_end_irq, 199 + static struct irq_host_ops spider_host_ops = { 200 + .match = spider_host_match, 201 + .map = spider_host_map, 202 + .xlate = spider_host_xlate, 134 203 }; 135 204 136 - int spider_get_irq(int node) 205 + static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc, 206 + struct pt_regs *regs) 137 207 { 138 - unsigned long cs; 139 - void __iomem *regs = spider_pics[node]; 208 + struct spider_pic *pic = desc->handler_data; 209 + unsigned int cs, virq; 140 210 141 - cs = in_be32(regs + TIR_CS) >> 24; 142 - 143 - if (cs == 63) 144 - return -1; 211 + cs = in_be32(pic->regs + TIR_CS) >> 24; 212 + if (cs == SPIDER_IRQ_INVALID) 213 + virq = NO_IRQ; 145 214 else 146 - return cs; 215 + virq = irq_linear_revmap(pic->host, cs); 216 + if (virq != NO_IRQ) 217 + generic_handle_irq(virq, regs); 218 + desc->chip->eoi(irq); 147 219 } 148 220 149 - /* hardcoded part to be compatible with older firmware */ 150 - 151 - void spider_init_IRQ_hardcoded(void) 221 + /* For hooking up the cascace we have a problem. Our device-tree is 222 + * crap and we don't know on which BE iic interrupt we are hooked on at 223 + * least not the "standard" way. We can reconstitute it based on two 224 + * informations though: which BE node we are connected to and wether 225 + * we are connected to IOIF0 or IOIF1. Right now, we really only care 226 + * about the IBM cell blade and we know that its firmware gives us an 227 + * interrupt-map property which is pretty strange. 228 + */ 229 + static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) 152 230 { 153 - int node; 154 - long spiderpic; 155 - long pics[] = { 0x24000008000, 0x34000008000 }; 156 - int n; 231 + unsigned int virq; 232 + u32 *imap, *tmp; 233 + int imaplen, intsize, unit; 234 + struct device_node *iic; 235 + struct irq_host *iic_host; 157 236 158 - pr_debug("%s(%d): Using hardcoded defaults\n", __FUNCTION__, __LINE__); 159 - 160 - for (node = 0; node < num_present_cpus()/2; node++) { 161 - spiderpic = pics[node]; 162 - printk(KERN_DEBUG "SPIDER addr: %lx\n", spiderpic); 163 - spider_pics[node] = ioremap(spiderpic, 0x800); 164 - for (n = 0; n < IIC_NUM_EXT; n++) { 165 - int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; 166 - get_irq_desc(irq)->chip = &spider_pic; 167 - } 168 - 169 - /* do not mask any interrupts because of level */ 170 - out_be32(spider_pics[node] + TIR_MSK, 0x0); 171 - 172 - /* disable edge detection clear */ 173 - /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ 174 - 175 - /* enable interrupt packets to be output */ 176 - out_be32(spider_pics[node] + TIR_PIEN, 177 - in_be32(spider_pics[node] + TIR_PIEN) | 0x1); 178 - 179 - /* Enable the interrupt detection enable bit. Do this last! */ 180 - out_be32(spider_pics[node] + TIR_DEN, 181 - in_be32(spider_pics[node] + TIR_DEN) | 0x1); 237 + #if 0 /* Enable that when we have a way to retreive the node as well */ 238 + /* First, we check wether we have a real "interrupts" in the device 239 + * tree in case the device-tree is ever fixed 240 + */ 241 + struct of_irq oirq; 242 + if (of_irq_map_one(pic->of_node, 0, &oirq) == 0) { 243 + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, 244 + oirq.size); 245 + goto bail; 182 246 } 247 + #endif 248 + 249 + /* Now do the horrible hacks */ 250 + tmp = (u32 *)get_property(pic->of_node, "#interrupt-cells", NULL); 251 + if (tmp == NULL) 252 + return NO_IRQ; 253 + intsize = *tmp; 254 + imap = (u32 *)get_property(pic->of_node, "interrupt-map", &imaplen); 255 + if (imap == NULL || imaplen < (intsize + 1)) 256 + return NO_IRQ; 257 + iic = of_find_node_by_phandle(imap[intsize]); 258 + if (iic == NULL) 259 + return NO_IRQ; 260 + imap += intsize + 1; 261 + tmp = (u32 *)get_property(iic, "#interrupt-cells", NULL); 262 + if (tmp == NULL) 263 + return NO_IRQ; 264 + intsize = *tmp; 265 + /* Assume unit is last entry of interrupt specifier */ 266 + unit = imap[intsize - 1]; 267 + /* Ok, we have a unit, now let's try to get the node */ 268 + tmp = (u32 *)get_property(iic, "ibm,interrupt-server-ranges", NULL); 269 + if (tmp == NULL) { 270 + of_node_put(iic); 271 + return NO_IRQ; 272 + } 273 + /* ugly as hell but works for now */ 274 + pic->node_id = (*tmp) >> 1; 275 + of_node_put(iic); 276 + 277 + /* Ok, now let's get cracking. You may ask me why I just didn't match 278 + * the iic host from the iic OF node, but that way I'm still compatible 279 + * with really really old old firmwares for which we don't have a node 280 + */ 281 + iic_host = iic_get_irq_host(pic->node_id); 282 + if (iic_host == NULL) 283 + return NO_IRQ; 284 + /* Manufacture an IIC interrupt number of class 2 */ 285 + virq = irq_create_mapping(iic_host, 0x20 | unit, 0); 286 + if (virq == NO_IRQ) 287 + printk(KERN_ERR "spider_pic: failed to map cascade !"); 288 + return virq; 183 289 } 184 290 185 - void spider_init_IRQ(void) 291 + 292 + static void __init spider_init_one(struct device_node *of_node, int chip, 293 + unsigned long addr) 186 294 { 187 - long spider_reg; 295 + struct spider_pic *pic = &spider_pics[chip]; 296 + int i, virq; 297 + 298 + /* Map registers */ 299 + pic->regs = ioremap(addr, 0x1000); 300 + if (pic->regs == NULL) 301 + panic("spider_pic: can't map registers !"); 302 + 303 + /* Allocate a host */ 304 + pic->host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, SPIDER_SRC_COUNT, 305 + &spider_host_ops, SPIDER_IRQ_INVALID); 306 + if (pic->host == NULL) 307 + panic("spider_pic: can't allocate irq host !"); 308 + pic->host->host_data = pic; 309 + 310 + /* Fill out other bits */ 311 + pic->of_node = of_node_get(of_node); 312 + 313 + /* Go through all sources and disable them */ 314 + for (i = 0; i < SPIDER_SRC_COUNT; i++) { 315 + void __iomem *cfg = pic->regs + TIR_CFGA + 8 * i; 316 + out_be32(cfg, in_be32(cfg) & ~0x30000000u); 317 + } 318 + 319 + /* do not mask any interrupts because of level */ 320 + out_be32(pic->regs + TIR_MSK, 0x0); 321 + 322 + /* enable interrupt packets to be output */ 323 + out_be32(pic->regs + TIR_PIEN, in_be32(pic->regs + TIR_PIEN) | 0x1); 324 + 325 + /* Hook up the cascade interrupt to the iic and nodeid */ 326 + virq = spider_find_cascade_and_node(pic); 327 + if (virq == NO_IRQ) 328 + return; 329 + set_irq_data(virq, pic); 330 + set_irq_chained_handler(virq, spider_irq_cascade); 331 + 332 + printk(KERN_INFO "spider_pic: node %d, addr: 0x%lx %s\n", 333 + pic->node_id, addr, of_node->full_name); 334 + 335 + /* Enable the interrupt detection enable bit. Do this last! */ 336 + out_be32(pic->regs + TIR_DEN, in_be32(pic->regs + TIR_DEN) | 0x1); 337 + } 338 + 339 + void __init spider_init_IRQ(void) 340 + { 341 + struct resource r; 188 342 struct device_node *dn; 189 - char *compatible; 190 - int n, node = 0; 343 + int chip = 0; 191 344 192 - for (dn = NULL; (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 193 - compatible = (char *)get_property(dn, "compatible", NULL); 194 - 195 - if (!compatible) 196 - continue; 197 - 198 - if (strstr(compatible, "CBEA,platform-spider-pic")) 199 - spider_reg = *(long *)get_property(dn,"reg", NULL); 200 - else if (strstr(compatible, "sti,platform-spider-pic")) { 201 - spider_init_IRQ_hardcoded(); 202 - return; 345 + /* XXX node numbers are totally bogus. We _hope_ we get the device 346 + * nodes in the right order here but that's definitely not guaranteed, 347 + * we need to get the node from the device tree instead. 348 + * There is currently no proper property for it (but our whole 349 + * device-tree is bogus anyway) so all we can do is pray or maybe test 350 + * the address and deduce the node-id 351 + */ 352 + for (dn = NULL; 353 + (dn = of_find_node_by_name(dn, "interrupt-controller"));) { 354 + if (device_is_compatible(dn, "CBEA,platform-spider-pic")) { 355 + if (of_address_to_resource(dn, 0, &r)) { 356 + printk(KERN_WARNING "spider-pic: Failed\n"); 357 + continue; 358 + } 359 + } else if (device_is_compatible(dn, "sti,platform-spider-pic") 360 + && (chip < 2)) { 361 + static long hard_coded_pics[] = 362 + { 0x24000008000, 0x34000008000 }; 363 + r.start = hard_coded_pics[chip]; 203 364 } else 204 365 continue; 205 - 206 - if (!spider_reg) 207 - printk("interrupt controller does not have reg property !\n"); 208 - 209 - n = prom_n_addr_cells(dn); 210 - 211 - if ( n != 2) 212 - printk("reg property with invalid number of elements \n"); 213 - 214 - spider_pics[node] = ioremap(spider_reg, 0x800); 215 - 216 - printk("SPIDER addr: %lx with %i addr_cells mapped to %p\n", 217 - spider_reg, n, spider_pics[node]); 218 - 219 - for (n = 0; n < IIC_NUM_EXT; n++) { 220 - int irq = n + IIC_EXT_OFFSET + node * IIC_NODE_STRIDE; 221 - get_irq_desc(irq)->chip = &spider_pic; 222 - } 223 - 224 - /* do not mask any interrupts because of level */ 225 - out_be32(spider_pics[node] + TIR_MSK, 0x0); 226 - 227 - /* disable edge detection clear */ 228 - /* out_be32(spider_pics[node] + TIR_EDC, 0x0); */ 229 - 230 - /* enable interrupt packets to be output */ 231 - out_be32(spider_pics[node] + TIR_PIEN, 232 - in_be32(spider_pics[node] + TIR_PIEN) | 0x1); 233 - 234 - /* Enable the interrupt detection enable bit. Do this last! */ 235 - out_be32(spider_pics[node] + TIR_DEN, 236 - in_be32(spider_pics[node] + TIR_DEN) | 0x1); 237 - 238 - node++; 366 + spider_init_one(dn, chip++, r.start); 239 367 } 240 368 }
+75 -44
arch/powerpc/platforms/cell/spu_base.c
··· 264 264 return stat ? IRQ_HANDLED : IRQ_NONE; 265 265 } 266 266 267 - static int 268 - spu_request_irqs(struct spu *spu) 267 + static int spu_request_irqs(struct spu *spu) 269 268 { 270 - int ret; 271 - int irq_base; 269 + int ret = 0; 272 270 273 - irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; 271 + if (spu->irqs[0] != NO_IRQ) { 272 + snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", 273 + spu->number); 274 + ret = request_irq(spu->irqs[0], spu_irq_class_0, 275 + IRQF_DISABLED, 276 + spu->irq_c0, spu); 277 + if (ret) 278 + goto bail0; 279 + } 280 + if (spu->irqs[1] != NO_IRQ) { 281 + snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", 282 + spu->number); 283 + ret = request_irq(spu->irqs[1], spu_irq_class_1, 284 + IRQF_DISABLED, 285 + spu->irq_c1, spu); 286 + if (ret) 287 + goto bail1; 288 + } 289 + if (spu->irqs[2] != NO_IRQ) { 290 + snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", 291 + spu->number); 292 + ret = request_irq(spu->irqs[2], spu_irq_class_2, 293 + IRQF_DISABLED, 294 + spu->irq_c2, spu); 295 + if (ret) 296 + goto bail2; 297 + } 298 + return 0; 274 299 275 - snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number); 276 - ret = request_irq(irq_base + spu->isrc, 277 - spu_irq_class_0, IRQF_DISABLED, spu->irq_c0, spu); 278 - if (ret) 279 - goto out; 280 - 281 - snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number); 282 - ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, 283 - spu_irq_class_1, IRQF_DISABLED, spu->irq_c1, spu); 284 - if (ret) 285 - goto out1; 286 - 287 - snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number); 288 - ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, 289 - spu_irq_class_2, IRQF_DISABLED, spu->irq_c2, spu); 290 - if (ret) 291 - goto out2; 292 - goto out; 293 - 294 - out2: 295 - free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); 296 - out1: 297 - free_irq(irq_base + spu->isrc, spu); 298 - out: 300 + bail2: 301 + if (spu->irqs[1] != NO_IRQ) 302 + free_irq(spu->irqs[1], spu); 303 + bail1: 304 + if (spu->irqs[0] != NO_IRQ) 305 + free_irq(spu->irqs[0], spu); 306 + bail0: 299 307 return ret; 300 308 } 301 309 302 - static void 303 - spu_free_irqs(struct spu *spu) 310 + static void spu_free_irqs(struct spu *spu) 304 311 { 305 - int irq_base; 306 - 307 - irq_base = IIC_NODE_STRIDE * spu->node + IIC_SPE_OFFSET; 308 - 309 - free_irq(irq_base + spu->isrc, spu); 310 - free_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc, spu); 311 - free_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc, spu); 312 + if (spu->irqs[0] != NO_IRQ) 313 + free_irq(spu->irqs[0], spu); 314 + if (spu->irqs[1] != NO_IRQ) 315 + free_irq(spu->irqs[1], spu); 316 + if (spu->irqs[2] != NO_IRQ) 317 + free_irq(spu->irqs[2], spu); 312 318 } 313 319 314 320 static LIST_HEAD(spu_list); ··· 565 559 iounmap((u8 __iomem *)spu->local_store); 566 560 } 567 561 562 + /* This function shall be abstracted for HV platforms */ 563 + static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) 564 + { 565 + struct irq_host *host; 566 + unsigned int isrc; 567 + u32 *tmp; 568 + 569 + host = iic_get_irq_host(spu->node); 570 + if (host == NULL) 571 + return -ENODEV; 572 + 573 + /* Get the interrupt source from the device-tree */ 574 + tmp = (u32 *)get_property(np, "isrc", NULL); 575 + if (!tmp) 576 + return -ENODEV; 577 + spu->isrc = isrc = tmp[0]; 578 + 579 + /* Now map interrupts of all 3 classes */ 580 + spu->irqs[0] = irq_create_mapping(host, 0x00 | isrc, 0); 581 + spu->irqs[1] = irq_create_mapping(host, 0x10 | isrc, 0); 582 + spu->irqs[2] = irq_create_mapping(host, 0x20 | isrc, 0); 583 + 584 + /* Right now, we only fail if class 2 failed */ 585 + return spu->irqs[2] == NO_IRQ ? -EINVAL : 0; 586 + } 587 + 568 588 static int __init spu_map_device(struct spu *spu, struct device_node *node) 569 589 { 570 590 char *prop; 571 591 int ret; 572 592 573 593 ret = -ENODEV; 574 - prop = get_property(node, "isrc", NULL); 575 - if (!prop) 576 - goto out; 577 - spu->isrc = *(unsigned int *)prop; 578 - 579 594 spu->name = get_property(node, "name", NULL); 580 595 if (!spu->name) 581 596 goto out; ··· 663 636 return ret; 664 637 } 665 638 666 - sysdev_create_file(&spu->sysdev, &attr_isrc); 639 + if (spu->isrc != 0) 640 + sysdev_create_file(&spu->sysdev, &attr_isrc); 667 641 sysfs_add_device_to_node(&spu->sysdev, spu->nid); 668 642 669 643 return 0; ··· 696 668 spu->nid = of_node_to_nid(spe); 697 669 if (spu->nid == -1) 698 670 spu->nid = 0; 671 + ret = spu_map_interrupts(spu, spe); 672 + if (ret) 673 + goto out_unmap; 699 674 spin_lock_init(&spu->register_lock); 700 675 spu_mfc_sdr_set(spu, mfspr(SPRN_SDR1)); 701 676 spu_mfc_sr1_set(spu, 0x33);
+2 -9
arch/powerpc/platforms/chrp/pci.c
··· 18 18 #include <asm/machdep.h> 19 19 #include <asm/sections.h> 20 20 #include <asm/pci-bridge.h> 21 - #include <asm/open_pic.h> 22 21 #include <asm/grackle.h> 23 22 #include <asm/rtas.h> 24 23 ··· 160 161 chrp_pcibios_fixup(void) 161 162 { 162 163 struct pci_dev *dev = NULL; 163 - struct device_node *np; 164 164 165 - /* PCI interrupts are controlled by the OpenPIC */ 166 - for_each_pci_dev(dev) { 167 - np = pci_device_to_OF_node(dev); 168 - if ((np != 0) && (np->n_intrs > 0) && (np->intrs[0].line != 0)) 169 - dev->irq = np->intrs[0].line; 170 - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); 171 - } 165 + for_each_pci_dev(dev) 166 + pci_read_irq_line(dev); 172 167 } 173 168 174 169 #define PRG_CL_RESET_VALID 0x00010000
+69 -32
arch/powerpc/platforms/chrp/setup.c
··· 59 59 int _chrp_type; 60 60 EXPORT_SYMBOL(_chrp_type); 61 61 62 - struct mpic *chrp_mpic; 62 + static struct mpic *chrp_mpic; 63 63 64 64 /* Used for doing CHRP event-scans */ 65 65 DEFINE_PER_CPU(struct timer_list, heartbeat_timer); ··· 315 315 jiffies + event_scan_interval); 316 316 } 317 317 318 + static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc, 319 + struct pt_regs *regs) 320 + { 321 + unsigned int cascade_irq = i8259_irq(regs); 322 + if (cascade_irq != NO_IRQ) 323 + generic_handle_irq(cascade_irq, regs); 324 + desc->chip->eoi(irq); 325 + } 326 + 318 327 /* 319 328 * Finds the open-pic node and sets up the mpic driver. 320 329 */ 321 330 static void __init chrp_find_openpic(void) 322 331 { 323 332 struct device_node *np, *root; 324 - int len, i, j, irq_count; 333 + int len, i, j; 325 334 int isu_size, idu_size; 326 335 unsigned int *iranges, *opprop = NULL; 327 336 int oplen = 0; 328 337 unsigned long opaddr; 329 338 int na = 1; 330 - unsigned char init_senses[NR_IRQS - NUM_8259_INTERRUPTS]; 331 339 332 - np = find_type_devices("open-pic"); 340 + np = of_find_node_by_type(NULL, "open-pic"); 333 341 if (np == NULL) 334 342 return; 335 - root = find_path_device("/"); 343 + root = of_find_node_by_path("/"); 336 344 if (root) { 337 345 opprop = (unsigned int *) get_property 338 346 (root, "platform-open-pic", &oplen); ··· 351 343 oplen /= na * sizeof(unsigned int); 352 344 } else { 353 345 struct resource r; 354 - if (of_address_to_resource(np, 0, &r)) 355 - return; 346 + if (of_address_to_resource(np, 0, &r)) { 347 + goto bail; 348 + } 356 349 opaddr = r.start; 357 350 oplen = 0; 358 351 } 359 352 360 353 printk(KERN_INFO "OpenPIC at %lx\n", opaddr); 361 - 362 - irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */ 363 - prom_get_irq_senses(init_senses, NUM_ISA_INTERRUPTS, NR_IRQS - 4); 364 - /* i8259 cascade is always positive level */ 365 - init_senses[0] = IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE; 366 354 367 355 iranges = (unsigned int *) get_property(np, "interrupt-ranges", &len); 368 356 if (iranges == NULL) ··· 386 382 if (len > 1) 387 383 isu_size = iranges[3]; 388 384 389 - chrp_mpic = mpic_alloc(opaddr, MPIC_PRIMARY, 390 - isu_size, NUM_ISA_INTERRUPTS, irq_count, 391 - NR_IRQS - 4, init_senses, irq_count, 392 - " MPIC "); 385 + chrp_mpic = mpic_alloc(np, opaddr, MPIC_PRIMARY, 386 + isu_size, 0, " MPIC "); 393 387 if (chrp_mpic == NULL) { 394 388 printk(KERN_ERR "Failed to allocate MPIC structure\n"); 395 - return; 389 + goto bail; 396 390 } 397 - 398 391 j = na - 1; 399 392 for (i = 1; i < len; ++i) { 400 393 iranges += 2; ··· 403 402 } 404 403 405 404 mpic_init(chrp_mpic); 406 - mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL); 405 + ppc_md.get_irq = mpic_get_irq; 406 + bail: 407 + of_node_put(root); 408 + of_node_put(np); 407 409 } 408 410 409 411 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) ··· 417 413 }; 418 414 #endif 419 415 420 - void __init chrp_init_IRQ(void) 416 + static void __init chrp_find_8259(void) 421 417 { 422 - struct device_node *np; 418 + struct device_node *np, *pic = NULL; 423 419 unsigned long chrp_int_ack = 0; 424 - #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) 425 - struct device_node *kbd; 426 - #endif 420 + unsigned int cascade_irq; 427 421 422 + /* Look for cascade */ 423 + for_each_node_by_type(np, "interrupt-controller") 424 + if (device_is_compatible(np, "chrp,iic")) { 425 + pic = np; 426 + break; 427 + } 428 + /* Ok, 8259 wasn't found. We need to handle the case where 429 + * we have a pegasos that claims to be chrp but doesn't have 430 + * a proper interrupt tree 431 + */ 432 + if (pic == NULL && chrp_mpic != NULL) { 433 + printk(KERN_ERR "i8259: Not found in device-tree" 434 + " assuming no legacy interrupts\n"); 435 + return; 436 + } 437 + 438 + /* Look for intack. In a perfect world, we would look for it on 439 + * the ISA bus that holds the 8259 but heh... Works that way. If 440 + * we ever see a problem, we can try to re-use the pSeries code here. 441 + * Also, Pegasos-type platforms don't have a proper node to start 442 + * from anyway 443 + */ 428 444 for (np = find_devices("pci"); np != NULL; np = np->next) { 429 445 unsigned int *addrp = (unsigned int *) 430 446 get_property(np, "8259-interrupt-acknowledge", NULL); ··· 455 431 break; 456 432 } 457 433 if (np == NULL) 458 - printk(KERN_ERR "Cannot find PCI interrupt acknowledge address\n"); 434 + printk(KERN_WARNING "Cannot find PCI interrupt acknowledge" 435 + " address, polling\n"); 459 436 437 + i8259_init(pic, chrp_int_ack); 438 + if (ppc_md.get_irq == NULL) 439 + ppc_md.get_irq = i8259_irq; 440 + if (chrp_mpic != NULL) { 441 + cascade_irq = irq_of_parse_and_map(pic, 0); 442 + if (cascade_irq == NO_IRQ) 443 + printk(KERN_ERR "i8259: failed to map cascade irq\n"); 444 + else 445 + set_irq_chained_handler(cascade_irq, 446 + chrp_8259_cascade); 447 + } 448 + } 449 + 450 + void __init chrp_init_IRQ(void) 451 + { 452 + #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(XMON) 453 + struct device_node *kbd; 454 + #endif 460 455 chrp_find_openpic(); 461 - 462 - i8259_init(chrp_int_ack, 0); 456 + chrp_find_8259(); 463 457 464 458 if (_chrp_type == _CHRP_Pegasos) 465 459 ppc_md.get_irq = i8259_irq; ··· 562 520 DMA_MODE_READ = 0x44; 563 521 DMA_MODE_WRITE = 0x48; 564 522 isa_io_base = CHRP_ISA_IO_BASE; /* default value */ 565 - ppc_do_canonicalize_irqs = 1; 566 - 567 - /* Assume we have an 8259... */ 568 - __irq_offset_value = NUM_ISA_INTERRUPTS; 569 523 570 524 return 1; 571 525 } ··· 573 535 .init = chrp_init2, 574 536 .show_cpuinfo = chrp_show_cpuinfo, 575 537 .init_IRQ = chrp_init_IRQ, 576 - .get_irq = mpic_get_irq, 577 538 .pcibios_fixup = chrp_pcibios_fixup, 578 539 .restart = rtas_restart, 579 540 .power_off = rtas_power_off,
-1
arch/powerpc/platforms/chrp/smp.c
··· 29 29 #include <asm/smp.h> 30 30 #include <asm/residual.h> 31 31 #include <asm/time.h> 32 - #include <asm/open_pic.h> 33 32 #include <asm/machdep.h> 34 33 #include <asm/smp.h> 35 34 #include <asm/mpic.h>
+64 -41
arch/powerpc/platforms/iseries/irq.c
··· 162 162 printk(KERN_ERR "pci_event_handler: NULL event received\n"); 163 163 } 164 164 165 - /* 166 - * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c 167 - * It must be called before the bus walk. 168 - */ 169 - void __init iSeries_init_IRQ(void) 170 - { 171 - /* Register PCI event handler and open an event path */ 172 - int ret; 173 - 174 - ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo, 175 - &pci_event_handler); 176 - if (ret == 0) { 177 - ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0); 178 - if (ret != 0) 179 - printk(KERN_ERR "iseries_init_IRQ: open event path " 180 - "failed with rc 0x%x\n", ret); 181 - } else 182 - printk(KERN_ERR "iseries_init_IRQ: register handler " 183 - "failed with rc 0x%x\n", ret); 184 - } 185 - 186 165 #define REAL_IRQ_TO_SUBBUS(irq) (((irq) >> 14) & 0xff) 187 166 #define REAL_IRQ_TO_BUS(irq) ((((irq) >> 6) & 0xff) + 1) 188 167 #define REAL_IRQ_TO_IDSEL(irq) ((((irq) >> 3) & 7) + 1) ··· 175 196 { 176 197 u32 bus, dev_id, function, mask; 177 198 const u32 sub_bus = 0; 178 - unsigned int rirq = virt_irq_to_real_map[irq]; 199 + unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 179 200 180 201 /* The IRQ has already been locked by the caller */ 181 202 bus = REAL_IRQ_TO_BUS(rirq); ··· 192 213 { 193 214 u32 bus, dev_id, function, mask; 194 215 const u32 sub_bus = 0; 195 - unsigned int rirq = virt_irq_to_real_map[irq]; 216 + unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 196 217 197 218 bus = REAL_IRQ_TO_BUS(rirq); 198 219 function = REAL_IRQ_TO_FUNC(rirq); ··· 233 254 { 234 255 u32 bus, dev_id, function, mask; 235 256 const u32 sub_bus = 0; 236 - unsigned int rirq = virt_irq_to_real_map[irq]; 257 + unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 237 258 238 259 /* irq should be locked by the caller */ 239 260 bus = REAL_IRQ_TO_BUS(rirq); ··· 256 277 { 257 278 u32 bus, dev_id, function, mask; 258 279 const u32 sub_bus = 0; 259 - unsigned int rirq = virt_irq_to_real_map[irq]; 280 + unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 260 281 261 282 /* The IRQ has already been locked by the caller */ 262 283 bus = REAL_IRQ_TO_BUS(rirq); ··· 270 291 271 292 static void iseries_end_IRQ(unsigned int irq) 272 293 { 273 - unsigned int rirq = virt_irq_to_real_map[irq]; 294 + unsigned int rirq = (unsigned int)irq_map[irq].hwirq; 274 295 275 296 HvCallPci_eoi(REAL_IRQ_TO_BUS(rirq), REAL_IRQ_TO_SUBBUS(rirq), 276 297 (REAL_IRQ_TO_IDSEL(rirq) << 4) + REAL_IRQ_TO_FUNC(rirq)); 277 298 } 278 299 279 - static hw_irq_controller iSeries_IRQ_handler = { 280 - .typename = "iSeries irq controller", 281 - .startup = iseries_startup_IRQ, 282 - .shutdown = iseries_shutdown_IRQ, 283 - .enable = iseries_enable_IRQ, 284 - .disable = iseries_disable_IRQ, 285 - .end = iseries_end_IRQ 300 + static struct irq_chip iseries_pic = { 301 + .typename = "iSeries irq controller", 302 + .startup = iseries_startup_IRQ, 303 + .shutdown = iseries_shutdown_IRQ, 304 + .unmask = iseries_enable_IRQ, 305 + .mask = iseries_disable_IRQ, 306 + .eoi = iseries_end_IRQ 286 307 }; 287 308 288 309 /* ··· 293 314 int __init iSeries_allocate_IRQ(HvBusNumber bus, 294 315 HvSubBusNumber sub_bus, u32 bsubbus) 295 316 { 296 - int virtirq; 297 317 unsigned int realirq; 298 318 u8 idsel = ISERIES_GET_DEVICE_FROM_SUBBUS(bsubbus); 299 319 u8 function = ISERIES_GET_FUNCTION_FROM_SUBBUS(bsubbus); 300 320 301 321 realirq = (((((sub_bus << 8) + (bus - 1)) << 3) + (idsel - 1)) << 3) 302 322 + function; 303 - virtirq = virt_irq_create_mapping(realirq); 304 323 305 - irq_desc[virtirq].chip = &iSeries_IRQ_handler; 306 - return virtirq; 324 + return irq_create_mapping(NULL, realirq, IRQ_TYPE_NONE); 307 325 } 308 326 309 327 #endif /* CONFIG_PCI */ ··· 308 332 /* 309 333 * Get the next pending IRQ. 310 334 */ 311 - int iSeries_get_irq(struct pt_regs *regs) 335 + unsigned int iSeries_get_irq(struct pt_regs *regs) 312 336 { 313 - /* -2 means ignore this interrupt */ 314 - int irq = -2; 337 + int irq = NO_IRQ_IGNORE; 315 338 316 339 #ifdef CONFIG_SMP 317 340 if (get_lppaca()->int_dword.fields.ipi_cnt) { ··· 333 358 } 334 359 spin_unlock(&pending_irqs_lock); 335 360 if (irq >= NR_IRQS) 336 - irq = -2; 361 + irq = NO_IRQ_IGNORE; 337 362 } 338 363 #endif 339 364 340 365 return irq; 341 366 } 367 + 368 + static int iseries_irq_host_map(struct irq_host *h, unsigned int virq, 369 + irq_hw_number_t hw, unsigned int flags) 370 + { 371 + set_irq_chip_and_handler(virq, &iseries_pic, handle_fasteoi_irq); 372 + 373 + return 0; 374 + } 375 + 376 + static struct irq_host_ops iseries_irq_host_ops = { 377 + .map = iseries_irq_host_map, 378 + }; 379 + 380 + /* 381 + * This is called by init_IRQ. set in ppc_md.init_IRQ by iSeries_setup.c 382 + * It must be called before the bus walk. 383 + */ 384 + void __init iSeries_init_IRQ(void) 385 + { 386 + /* Register PCI event handler and open an event path */ 387 + struct irq_host *host; 388 + int ret; 389 + 390 + /* 391 + * The Hypervisor only allows us up to 256 interrupt 392 + * sources (the irq number is passed in a u8). 393 + */ 394 + irq_set_virq_count(256); 395 + 396 + /* Create irq host. No need for a revmap since HV will give us 397 + * back our virtual irq number 398 + */ 399 + host = irq_alloc_host(IRQ_HOST_MAP_NOMAP, 0, &iseries_irq_host_ops, 0); 400 + BUG_ON(host == NULL); 401 + irq_set_default_host(host); 402 + 403 + ret = HvLpEvent_registerHandler(HvLpEvent_Type_PciIo, 404 + &pci_event_handler); 405 + if (ret == 0) { 406 + ret = HvLpEvent_openPath(HvLpEvent_Type_PciIo, 0); 407 + if (ret != 0) 408 + printk(KERN_ERR "iseries_init_IRQ: open event path " 409 + "failed with rc 0x%x\n", ret); 410 + } else 411 + printk(KERN_ERR "iseries_init_IRQ: register handler " 412 + "failed with rc 0x%x\n", ret); 413 + } 414 +
+1 -1
arch/powerpc/platforms/iseries/irq.h
··· 4 4 extern void iSeries_init_IRQ(void); 5 5 extern int iSeries_allocate_IRQ(HvBusNumber, HvSubBusNumber, u32); 6 6 extern void iSeries_activate_IRQs(void); 7 - extern int iSeries_get_irq(struct pt_regs *); 7 + extern unsigned int iSeries_get_irq(struct pt_regs *); 8 8 9 9 #endif /* _ISERIES_IRQ_H */
-8
arch/powerpc/platforms/iseries/setup.c
··· 294 294 { 295 295 DBG(" -> iSeries_init_early()\n"); 296 296 297 - ppc64_interrupt_controller = IC_ISERIES; 298 - 299 297 #if defined(CONFIG_BLK_DEV_INITRD) 300 298 /* 301 299 * If the init RAM disk has been configured and there is ··· 656 658 657 659 powerpc_firmware_features |= FW_FEATURE_ISERIES; 658 660 powerpc_firmware_features |= FW_FEATURE_LPAR; 659 - 660 - /* 661 - * The Hypervisor only allows us up to 256 interrupt 662 - * sources (the irq number is passed in a u8). 663 - */ 664 - virt_irq_max = 255; 665 661 666 662 hpte_init_iSeries(); 667 663
+11 -6
arch/powerpc/platforms/maple/pci.c
··· 443 443 int maple_pci_get_legacy_ide_irq(struct pci_dev *pdev, int channel) 444 444 { 445 445 struct device_node *np; 446 - int irq = channel ? 15 : 14; 446 + unsigned int defirq = channel ? 15 : 14; 447 + unsigned int irq; 447 448 448 449 if (pdev->vendor != PCI_VENDOR_ID_AMD || 449 450 pdev->device != PCI_DEVICE_ID_AMD_8111_IDE) 450 - return irq; 451 + return defirq; 451 452 452 453 np = pci_device_to_OF_node(pdev); 453 454 if (np == NULL) 454 - return irq; 455 - if (np->n_intrs < 2) 456 - return irq; 457 - return np->intrs[channel & 0x1].line; 455 + return defirq; 456 + irq = irq_of_parse_and_map(np, channel & 0x1); 457 + if (irq == NO_IRQ) { 458 + printk("Failed to map onboard IDE interrupt for channel %d\n", 459 + channel); 460 + return defirq; 461 + } 462 + return irq; 458 463 } 459 464 460 465 /* XXX: To remove once all firmwares are ok */
+63 -31
arch/powerpc/platforms/maple/setup.c
··· 11 11 * 12 12 */ 13 13 14 - #define DEBUG 14 + #undef DEBUG 15 15 16 16 #include <linux/init.h> 17 17 #include <linux/errno.h> ··· 198 198 { 199 199 DBG(" -> maple_init_early\n"); 200 200 201 - /* Setup interrupt mapping options */ 202 - ppc64_interrupt_controller = IC_OPEN_PIC; 203 - 204 201 iommu_init_early_dart(); 205 202 206 203 DBG(" <- maple_init_early\n"); 207 204 } 208 205 209 - 210 - static __init void maple_init_IRQ(void) 206 + /* 207 + * This is almost identical to pSeries and CHRP. We need to make that 208 + * code generic at one point, with appropriate bits in the device-tree to 209 + * identify the presence of an HT APIC 210 + */ 211 + static void __init maple_init_IRQ(void) 211 212 { 212 - struct device_node *root; 213 + struct device_node *root, *np, *mpic_node = NULL; 213 214 unsigned int *opprop; 214 - unsigned long opic_addr; 215 + unsigned long openpic_addr = 0; 216 + int naddr, n, i, opplen, has_isus = 0; 215 217 struct mpic *mpic; 216 - unsigned char senses[128]; 217 - int n; 218 + unsigned int flags = MPIC_PRIMARY; 218 219 219 - DBG(" -> maple_init_IRQ\n"); 220 + /* Locate MPIC in the device-tree. Note that there is a bug 221 + * in Maple device-tree where the type of the controller is 222 + * open-pic and not interrupt-controller 223 + */ 224 + for_each_node_by_type(np, "open-pic") { 225 + mpic_node = np; 226 + break; 227 + } 228 + if (mpic_node == NULL) { 229 + printk(KERN_ERR 230 + "Failed to locate the MPIC interrupt controller\n"); 231 + return; 232 + } 220 233 221 - /* XXX: Non standard, replace that with a proper openpic/mpic node 222 - * in the device-tree. Find the Open PIC if present */ 234 + /* Find address list in /platform-open-pic */ 223 235 root = of_find_node_by_path("/"); 224 - opprop = (unsigned int *) get_property(root, 225 - "platform-open-pic", NULL); 226 - if (opprop == 0) 227 - panic("OpenPIC not found !\n"); 228 - 229 - n = prom_n_addr_cells(root); 230 - for (opic_addr = 0; n > 0; --n) 231 - opic_addr = (opic_addr << 32) + *opprop++; 236 + naddr = prom_n_addr_cells(root); 237 + opprop = (unsigned int *) get_property(root, "platform-open-pic", 238 + &opplen); 239 + if (opprop != 0) { 240 + openpic_addr = of_read_number(opprop, naddr); 241 + has_isus = (opplen > naddr); 242 + printk(KERN_DEBUG "OpenPIC addr: %lx, has ISUs: %d\n", 243 + openpic_addr, has_isus); 244 + } 232 245 of_node_put(root); 233 246 234 - /* Obtain sense values from device-tree */ 235 - prom_get_irq_senses(senses, 0, 128); 247 + BUG_ON(openpic_addr == 0); 236 248 237 - mpic = mpic_alloc(opic_addr, 238 - MPIC_PRIMARY | MPIC_BIG_ENDIAN | 239 - MPIC_BROKEN_U3 | MPIC_WANTS_RESET, 240 - 0, 0, 128, 128, senses, 128, "U3-MPIC"); 249 + /* Check for a big endian MPIC */ 250 + if (get_property(np, "big-endian", NULL) != NULL) 251 + flags |= MPIC_BIG_ENDIAN; 252 + 253 + /* XXX Maple specific bits */ 254 + flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; 255 + 256 + /* Setup the openpic driver. More device-tree junks, we hard code no 257 + * ISUs for now. I'll have to revisit some stuffs with the folks doing 258 + * the firmware for those 259 + */ 260 + mpic = mpic_alloc(mpic_node, openpic_addr, flags, 261 + /*has_isus ? 16 :*/ 0, 0, " MPIC "); 241 262 BUG_ON(mpic == NULL); 242 - mpic_init(mpic); 243 263 244 - DBG(" <- maple_init_IRQ\n"); 264 + /* Add ISUs */ 265 + opplen /= sizeof(u32); 266 + for (n = 0, i = naddr; i < opplen; i += naddr, n++) { 267 + unsigned long isuaddr = of_read_number(opprop + i, naddr); 268 + mpic_assign_isu(mpic, n, isuaddr); 269 + } 270 + 271 + /* All ISUs are setup, complete initialization */ 272 + mpic_init(mpic); 273 + ppc_md.get_irq = mpic_get_irq; 274 + of_node_put(mpic_node); 275 + of_node_put(root); 245 276 } 246 277 247 278 static void __init maple_progress(char *s, unsigned short hex) ··· 287 256 static int __init maple_probe(void) 288 257 { 289 258 unsigned long root = of_get_flat_dt_root(); 290 - if (!of_flat_dt_is_compatible(root, "Momentum,Maple")) 259 + 260 + if (!of_flat_dt_is_compatible(root, "Momentum,Maple") && 261 + !of_flat_dt_is_compatible(root, "Momentum,Apache")) 291 262 return 0; 292 263 /* 293 264 * On U3, the DART (iommu) must be allocated now since it ··· 310 277 .setup_arch = maple_setup_arch, 311 278 .init_early = maple_init_early, 312 279 .init_IRQ = maple_init_IRQ, 313 - .get_irq = mpic_get_irq, 314 280 .pcibios_fixup = maple_pcibios_fixup, 315 281 .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, 316 282 .restart = maple_restart,
+32 -1
arch/powerpc/platforms/powermac/bootx_init.c
··· 162 162 { 163 163 u32 val; 164 164 165 + bootx_dt_add_prop("linux,bootx", NULL, 0, mem_end); 166 + 165 167 if (bootx_info->kernelParamsOffset) { 166 168 char *args = (char *)((unsigned long)bootx_info) + 167 169 bootx_info->kernelParamsOffset; ··· 183 181 static void __init bootx_add_display_props(unsigned long base, 184 182 unsigned long *mem_end) 185 183 { 184 + boot_infos_t *bi = bootx_info; 185 + u32 tmp; 186 + 186 187 bootx_dt_add_prop("linux,boot-display", NULL, 0, mem_end); 187 188 bootx_dt_add_prop("linux,opened", NULL, 0, mem_end); 189 + tmp = bi->dispDeviceDepth; 190 + bootx_dt_add_prop("linux,bootx-depth", &tmp, 4, mem_end); 191 + tmp = bi->dispDeviceRect[2] - bi->dispDeviceRect[0]; 192 + bootx_dt_add_prop("linux,bootx-width", &tmp, 4, mem_end); 193 + tmp = bi->dispDeviceRect[3] - bi->dispDeviceRect[1]; 194 + bootx_dt_add_prop("linux,bootx-height", &tmp, 4, mem_end); 195 + tmp = bi->dispDeviceRowBytes; 196 + bootx_dt_add_prop("linux,bootx-linebytes", &tmp, 4, mem_end); 197 + tmp = (u32)bi->dispDeviceBase; 198 + if (tmp == 0) 199 + tmp = (u32)bi->logicalDisplayBase; 200 + tmp += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; 201 + tmp += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); 202 + bootx_dt_add_prop("linux,bootx-addr", &tmp, 4, mem_end); 188 203 } 189 204 190 205 static void __init bootx_dt_add_string(char *s, unsigned long *mem_end) ··· 230 211 231 212 if (!strcmp(namep, "/chosen")) { 232 213 DBG(" detected /chosen ! adding properties names !\n"); 233 - bootx_dt_add_string("linux,platform", mem_end); 214 + bootx_dt_add_string("linux,bootx", mem_end); 234 215 bootx_dt_add_string("linux,stdout-path", mem_end); 235 216 bootx_dt_add_string("linux,initrd-start", mem_end); 236 217 bootx_dt_add_string("linux,initrd-end", mem_end); ··· 241 222 DBG(" detected display ! adding properties names !\n"); 242 223 bootx_dt_add_string("linux,boot-display", mem_end); 243 224 bootx_dt_add_string("linux,opened", mem_end); 225 + bootx_dt_add_string("linux,bootx-depth", mem_end); 226 + bootx_dt_add_string("linux,bootx-width", mem_end); 227 + bootx_dt_add_string("linux,bootx-height", mem_end); 228 + bootx_dt_add_string("linux,bootx-linebytes", mem_end); 229 + bootx_dt_add_string("linux,bootx-addr", mem_end); 244 230 strncpy(bootx_disp_path, namep, 255); 245 231 } 246 232 ··· 467 443 if (!BOOT_INFO_IS_V2_COMPATIBLE(bi)) 468 444 bi->logicalDisplayBase = bi->dispDeviceBase; 469 445 446 + /* Fixup depth 16 -> 15 as that's what MacOS calls 16bpp */ 447 + if (bi->dispDeviceDepth == 16) 448 + bi->dispDeviceDepth = 15; 449 + 470 450 #ifdef CONFIG_BOOTX_TEXT 451 + ptr = (unsigned long)bi->logicalDisplayBase; 452 + ptr += bi->dispDeviceRect[1] * bi->dispDeviceRowBytes; 453 + ptr += bi->dispDeviceRect[0] * ((bi->dispDeviceDepth + 7) / 8); 471 454 btext_setup_display(bi->dispDeviceRect[2] - bi->dispDeviceRect[0], 472 455 bi->dispDeviceRect[3] - bi->dispDeviceRect[1], 473 456 bi->dispDeviceDepth, bi->dispDeviceRowBytes,
+5 -4
arch/powerpc/platforms/powermac/low_i2c.c
··· 522 522 host->speed = KW_I2C_MODE_25KHZ; 523 523 break; 524 524 } 525 - if (np->n_intrs > 0) 526 - host->irq = np->intrs[0].line; 527 - else 528 - host->irq = NO_IRQ; 525 + host->irq = irq_of_parse_and_map(np, 0); 526 + if (host->irq == NO_IRQ) 527 + printk(KERN_WARNING 528 + "low_i2c: Failed to map interrupt for %s\n", 529 + np->full_name); 529 530 530 531 host->base = ioremap((*addrp), 0x1000); 531 532 if (host->base == NULL) {
+2 -3
arch/powerpc/platforms/powermac/nvram.c
··· 29 29 #include <asm/machdep.h> 30 30 #include <asm/nvram.h> 31 31 32 + #include "pmac.h" 33 + 32 34 #define DEBUG 33 35 34 36 #ifdef DEBUG ··· 81 79 static int nvram_partitions[3]; 82 80 // XXX Turn that into a sem 83 81 static DEFINE_SPINLOCK(nv_lock); 84 - 85 - extern int pmac_newworld; 86 - extern int system_running; 87 82 88 83 static int (*core99_write_bank)(int bank, u8* datas); 89 84 static int (*core99_erase_bank)(int bank);
+46 -22
arch/powerpc/platforms/powermac/pci.c
··· 46 46 static struct pci_controller *u3_agp; 47 47 static struct pci_controller *u4_pcie; 48 48 static struct pci_controller *u3_ht; 49 + #define has_second_ohare 0 50 + #else 51 + static int has_second_ohare; 49 52 #endif /* CONFIG_PPC64 */ 50 53 51 54 extern u8 pci_cache_line_size; ··· 650 647 early_write_config_word(hose, bus, devfn, PCI_BRIDGE_CONTROL, val); 651 648 } 652 649 650 + static void __init init_second_ohare(void) 651 + { 652 + struct device_node *np = of_find_node_by_name(NULL, "pci106b,7"); 653 + unsigned char bus, devfn; 654 + unsigned short cmd; 655 + 656 + if (np == NULL) 657 + return; 658 + 659 + /* This must run before we initialize the PICs since the second 660 + * ohare hosts a PIC that will be accessed there. 661 + */ 662 + if (pci_device_from_OF_node(np, &bus, &devfn) == 0) { 663 + struct pci_controller* hose = 664 + pci_find_hose_for_OF_device(np); 665 + if (!hose) { 666 + printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); 667 + return; 668 + } 669 + early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); 670 + cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; 671 + cmd &= ~PCI_COMMAND_IO; 672 + early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); 673 + } 674 + has_second_ohare = 1; 675 + } 676 + 653 677 /* 654 678 * Some Apple desktop machines have a NEC PD720100A USB2 controller 655 679 * on the motherboard. Open Firmware, on these, will disable the ··· 718 688 " EHCI, fixing up...\n"); 719 689 data &= ~1UL; 720 690 early_write_config_dword(hose, bus, devfn, 0xe4, data); 721 - early_write_config_byte(hose, bus, 722 - devfn | 2, PCI_INTERRUPT_LINE, 723 - nec->intrs[0].line); 724 691 } 725 692 } 726 693 } ··· 985 958 return 0; 986 959 } 987 960 988 - static void __init pcibios_fixup_OF_interrupts(void) 961 + void __init pmac_pcibios_fixup(void) 989 962 { 990 963 struct pci_dev* dev = NULL; 991 964 992 - /* 993 - * Open Firmware often doesn't initialize the 994 - * PCI_INTERRUPT_LINE config register properly, so we 995 - * should find the device node and apply the interrupt 996 - * obtained from the OF device-tree 997 - */ 998 965 for_each_pci_dev(dev) { 999 - struct device_node *node; 1000 - node = pci_device_to_OF_node(dev); 1001 - /* this is the node, see if it has interrupts */ 1002 - if (node && node->n_intrs > 0) 1003 - dev->irq = node->intrs[0].line; 1004 - pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); 1005 - } 1006 - } 966 + /* Read interrupt from the device-tree */ 967 + pci_read_irq_line(dev); 1007 968 1008 - void __init pmac_pcibios_fixup(void) 1009 - { 1010 - /* Fixup interrupts according to OF tree */ 1011 - pcibios_fixup_OF_interrupts(); 969 + /* Fixup interrupt for the modem/ethernet combo controller. 970 + * on machines with a second ohare chip. 971 + * The number in the device tree (27) is bogus (correct for 972 + * the ethernet-only board but not the combo ethernet/modem 973 + * board). The real interrupt is 28 on the second controller 974 + * -> 28+32 = 60. 975 + */ 976 + if (has_second_ohare && 977 + dev->vendor == PCI_VENDOR_ID_DEC && 978 + dev->device == PCI_DEVICE_ID_DEC_TULIP_PLUS) 979 + dev->irq = irq_create_mapping(NULL, 60, 0); 980 + } 1012 981 } 1013 982 1014 983 #ifdef CONFIG_PPC64 ··· 1094 1071 1095 1072 #else /* CONFIG_PPC64 */ 1096 1073 init_p2pbridge(); 1074 + init_second_ohare(); 1097 1075 fixup_nec_usb2(); 1098 1076 1099 1077 /* We are still having some issues with the Xserve G4, enabling
+6 -7
arch/powerpc/platforms/powermac/pfunc_base.c
··· 24 24 25 25 static int macio_do_gpio_irq_enable(struct pmf_function *func) 26 26 { 27 - if (func->node->n_intrs < 1) 27 + unsigned int irq = irq_of_parse_and_map(func->node, 0); 28 + if (irq == NO_IRQ) 28 29 return -EINVAL; 29 - 30 - return request_irq(func->node->intrs[0].line, macio_gpio_irq, 0, 31 - func->node->name, func); 30 + return request_irq(irq, macio_gpio_irq, 0, func->node->name, func); 32 31 } 33 32 34 33 static int macio_do_gpio_irq_disable(struct pmf_function *func) 35 34 { 36 - if (func->node->n_intrs < 1) 35 + unsigned int irq = irq_of_parse_and_map(func->node, 0); 36 + if (irq == NO_IRQ) 37 37 return -EINVAL; 38 - 39 - free_irq(func->node->intrs[0].line, func); 38 + free_irq(irq, func); 40 39 return 0; 41 40 } 42 41
+192 -230
arch/powerpc/platforms/powermac/pic.c
··· 65 65 66 66 static DEFINE_SPINLOCK(pmac_pic_lock); 67 67 68 - #define GATWICK_IRQ_POOL_SIZE 10 69 - static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE]; 70 - 71 68 #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 72 69 static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 70 + static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 71 + static int pmac_irq_cascade = -1; 72 + static struct irq_host *pmac_pic_host; 73 73 74 - /* 75 - * Mark an irq as "lost". This is only used on the pmac 76 - * since it can lose interrupts (see pmac_set_irq_mask). 77 - * -- Cort 78 - */ 79 - void __set_lost(unsigned long irq_nr, int nokick) 74 + static void __pmac_retrigger(unsigned int irq_nr) 80 75 { 81 - if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) { 76 + if (irq_nr >= max_real_irqs && pmac_irq_cascade > 0) { 77 + __set_bit(irq_nr, ppc_lost_interrupts); 78 + irq_nr = pmac_irq_cascade; 79 + mb(); 80 + } 81 + if (!__test_and_set_bit(irq_nr, ppc_lost_interrupts)) { 82 82 atomic_inc(&ppc_n_lost_interrupts); 83 - if (!nokick) 84 - set_dec(1); 83 + set_dec(1); 85 84 } 86 85 } 87 86 88 - static void pmac_mask_and_ack_irq(unsigned int irq_nr) 87 + static void pmac_mask_and_ack_irq(unsigned int virq) 89 88 { 90 - unsigned long bit = 1UL << (irq_nr & 0x1f); 91 - int i = irq_nr >> 5; 89 + unsigned int src = irq_map[virq].hwirq; 90 + unsigned long bit = 1UL << (virq & 0x1f); 91 + int i = virq >> 5; 92 92 unsigned long flags; 93 93 94 - if ((unsigned)irq_nr >= max_irqs) 95 - return; 96 - 97 - clear_bit(irq_nr, ppc_cached_irq_mask); 98 - if (test_and_clear_bit(irq_nr, ppc_lost_interrupts)) 99 - atomic_dec(&ppc_n_lost_interrupts); 100 94 spin_lock_irqsave(&pmac_pic_lock, flags); 95 + __clear_bit(src, ppc_cached_irq_mask); 96 + if (__test_and_clear_bit(src, ppc_lost_interrupts)) 97 + atomic_dec(&ppc_n_lost_interrupts); 101 98 out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]); 102 99 out_le32(&pmac_irq_hw[i]->ack, bit); 103 100 do { ··· 106 109 spin_unlock_irqrestore(&pmac_pic_lock, flags); 107 110 } 108 111 109 - static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) 112 + static void pmac_ack_irq(unsigned int virq) 113 + { 114 + unsigned int src = irq_map[virq].hwirq; 115 + unsigned long bit = 1UL << (src & 0x1f); 116 + int i = src >> 5; 117 + unsigned long flags; 118 + 119 + spin_lock_irqsave(&pmac_pic_lock, flags); 120 + if (__test_and_clear_bit(src, ppc_lost_interrupts)) 121 + atomic_dec(&ppc_n_lost_interrupts); 122 + out_le32(&pmac_irq_hw[i]->ack, bit); 123 + (void)in_le32(&pmac_irq_hw[i]->ack); 124 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 125 + } 126 + 127 + static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost) 110 128 { 111 129 unsigned long bit = 1UL << (irq_nr & 0x1f); 112 130 int i = irq_nr >> 5; 113 - unsigned long flags; 114 131 115 132 if ((unsigned)irq_nr >= max_irqs) 116 133 return; 117 134 118 - spin_lock_irqsave(&pmac_pic_lock, flags); 119 135 /* enable unmasked interrupts */ 120 136 out_le32(&pmac_irq_hw[i]->enable, ppc_cached_irq_mask[i]); 121 137 ··· 145 135 * the bit in the flag register or request another interrupt. 146 136 */ 147 137 if (bit & ppc_cached_irq_mask[i] & in_le32(&pmac_irq_hw[i]->level)) 148 - __set_lost((ulong)irq_nr, nokicklost); 149 - spin_unlock_irqrestore(&pmac_pic_lock, flags); 138 + __pmac_retrigger(irq_nr); 150 139 } 151 140 152 141 /* When an irq gets requested for the first client, if it's an 153 142 * edge interrupt, we clear any previous one on the controller 154 143 */ 155 - static unsigned int pmac_startup_irq(unsigned int irq_nr) 144 + static unsigned int pmac_startup_irq(unsigned int virq) 156 145 { 157 - unsigned long bit = 1UL << (irq_nr & 0x1f); 158 - int i = irq_nr >> 5; 146 + unsigned long flags; 147 + unsigned int src = irq_map[virq].hwirq; 148 + unsigned long bit = 1UL << (src & 0x1f); 149 + int i = src >> 5; 159 150 160 - if ((irq_desc[irq_nr].status & IRQ_LEVEL) == 0) 151 + spin_lock_irqsave(&pmac_pic_lock, flags); 152 + if ((irq_desc[virq].status & IRQ_LEVEL) == 0) 161 153 out_le32(&pmac_irq_hw[i]->ack, bit); 162 - set_bit(irq_nr, ppc_cached_irq_mask); 163 - pmac_set_irq_mask(irq_nr, 0); 154 + __set_bit(src, ppc_cached_irq_mask); 155 + __pmac_set_irq_mask(src, 0); 156 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 164 157 165 158 return 0; 166 159 } 167 160 168 - static void pmac_mask_irq(unsigned int irq_nr) 161 + static void pmac_mask_irq(unsigned int virq) 169 162 { 170 - clear_bit(irq_nr, ppc_cached_irq_mask); 171 - pmac_set_irq_mask(irq_nr, 0); 172 - mb(); 163 + unsigned long flags; 164 + unsigned int src = irq_map[virq].hwirq; 165 + 166 + spin_lock_irqsave(&pmac_pic_lock, flags); 167 + __clear_bit(src, ppc_cached_irq_mask); 168 + __pmac_set_irq_mask(src, 0); 169 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 173 170 } 174 171 175 - static void pmac_unmask_irq(unsigned int irq_nr) 172 + static void pmac_unmask_irq(unsigned int virq) 176 173 { 177 - set_bit(irq_nr, ppc_cached_irq_mask); 178 - pmac_set_irq_mask(irq_nr, 0); 174 + unsigned long flags; 175 + unsigned int src = irq_map[virq].hwirq; 176 + 177 + spin_lock_irqsave(&pmac_pic_lock, flags); 178 + __set_bit(src, ppc_cached_irq_mask); 179 + __pmac_set_irq_mask(src, 0); 180 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 179 181 } 180 182 181 - static void pmac_end_irq(unsigned int irq_nr) 183 + static int pmac_retrigger(unsigned int virq) 182 184 { 183 - if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)) 184 - && irq_desc[irq_nr].action) { 185 - set_bit(irq_nr, ppc_cached_irq_mask); 186 - pmac_set_irq_mask(irq_nr, 1); 187 - } 185 + unsigned long flags; 186 + 187 + spin_lock_irqsave(&pmac_pic_lock, flags); 188 + __pmac_retrigger(irq_map[virq].hwirq); 189 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 190 + return 1; 188 191 } 189 192 190 - 191 - struct hw_interrupt_type pmac_pic = { 193 + static struct irq_chip pmac_pic = { 192 194 .typename = " PMAC-PIC ", 193 195 .startup = pmac_startup_irq, 194 - .enable = pmac_unmask_irq, 195 - .disable = pmac_mask_irq, 196 - .ack = pmac_mask_and_ack_irq, 197 - .end = pmac_end_irq, 198 - }; 199 - 200 - struct hw_interrupt_type gatwick_pic = { 201 - .typename = " GATWICK ", 202 - .startup = pmac_startup_irq, 203 - .enable = pmac_unmask_irq, 204 - .disable = pmac_mask_irq, 205 - .ack = pmac_mask_and_ack_irq, 206 - .end = pmac_end_irq, 196 + .mask = pmac_mask_irq, 197 + .ack = pmac_ack_irq, 198 + .mask_ack = pmac_mask_and_ack_irq, 199 + .unmask = pmac_unmask_irq, 200 + .retrigger = pmac_retrigger, 207 201 }; 208 202 209 203 static irqreturn_t gatwick_action(int cpl, void *dev_id, struct pt_regs *regs) 210 204 { 205 + unsigned long flags; 211 206 int irq, bits; 207 + int rc = IRQ_NONE; 212 208 209 + spin_lock_irqsave(&pmac_pic_lock, flags); 213 210 for (irq = max_irqs; (irq -= 32) >= max_real_irqs; ) { 214 211 int i = irq >> 5; 215 212 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; ··· 226 209 if (bits == 0) 227 210 continue; 228 211 irq += __ilog2(bits); 212 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 229 213 __do_IRQ(irq, regs); 230 - return IRQ_HANDLED; 214 + spin_lock_irqsave(&pmac_pic_lock, flags); 215 + rc = IRQ_HANDLED; 231 216 } 232 - printk("gatwick irq not from gatwick pic\n"); 233 - return IRQ_NONE; 217 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 218 + return rc; 234 219 } 235 220 236 - static int pmac_get_irq(struct pt_regs *regs) 221 + static unsigned int pmac_pic_get_irq(struct pt_regs *regs) 237 222 { 238 223 int irq; 239 224 unsigned long bits = 0; 225 + unsigned long flags; 240 226 241 227 #ifdef CONFIG_SMP 242 228 void psurge_smp_message_recv(struct pt_regs *); ··· 247 227 /* IPI's are a hack on the powersurge -- Cort */ 248 228 if ( smp_processor_id() != 0 ) { 249 229 psurge_smp_message_recv(regs); 250 - return -2; /* ignore, already handled */ 230 + return NO_IRQ_IGNORE; /* ignore, already handled */ 251 231 } 252 232 #endif /* CONFIG_SMP */ 233 + spin_lock_irqsave(&pmac_pic_lock, flags); 253 234 for (irq = max_real_irqs; (irq -= 32) >= 0; ) { 254 235 int i = irq >> 5; 255 236 bits = in_le32(&pmac_irq_hw[i]->event) | ppc_lost_interrupts[i]; ··· 262 241 irq += __ilog2(bits); 263 242 break; 264 243 } 265 - 266 - return irq; 267 - } 268 - 269 - /* This routine will fix some missing interrupt values in the device tree 270 - * on the gatwick mac-io controller used by some PowerBooks 271 - * 272 - * Walking of OF nodes could use a bit more fixing up here, but it's not 273 - * very important as this is all boot time code on static portions of the 274 - * device-tree. 275 - * 276 - * However, the modifications done to "intrs" will have to be removed and 277 - * replaced with proper updates of the "interrupts" properties or 278 - * AAPL,interrupts, yet to be decided, once the dynamic parsing is there. 279 - */ 280 - static void __init pmac_fix_gatwick_interrupts(struct device_node *gw, 281 - int irq_base) 282 - { 283 - struct device_node *node; 284 - int count; 285 - 286 - memset(gatwick_int_pool, 0, sizeof(gatwick_int_pool)); 287 - count = 0; 288 - for (node = NULL; (node = of_get_next_child(gw, node)) != NULL;) { 289 - /* Fix SCC */ 290 - if ((strcasecmp(node->name, "escc") == 0) && node->child) { 291 - if (node->child->n_intrs < 3) { 292 - node->child->intrs = &gatwick_int_pool[count]; 293 - count += 3; 294 - } 295 - node->child->n_intrs = 3; 296 - node->child->intrs[0].line = 15+irq_base; 297 - node->child->intrs[1].line = 4+irq_base; 298 - node->child->intrs[2].line = 5+irq_base; 299 - printk(KERN_INFO "irq: fixed SCC on gatwick" 300 - " (%d,%d,%d)\n", 301 - node->child->intrs[0].line, 302 - node->child->intrs[1].line, 303 - node->child->intrs[2].line); 304 - } 305 - /* Fix media-bay & left SWIM */ 306 - if (strcasecmp(node->name, "media-bay") == 0) { 307 - struct device_node* ya_node; 308 - 309 - if (node->n_intrs == 0) 310 - node->intrs = &gatwick_int_pool[count++]; 311 - node->n_intrs = 1; 312 - node->intrs[0].line = 29+irq_base; 313 - printk(KERN_INFO "irq: fixed media-bay on gatwick" 314 - " (%d)\n", node->intrs[0].line); 315 - 316 - ya_node = node->child; 317 - while(ya_node) { 318 - if (strcasecmp(ya_node->name, "floppy") == 0) { 319 - if (ya_node->n_intrs < 2) { 320 - ya_node->intrs = &gatwick_int_pool[count]; 321 - count += 2; 322 - } 323 - ya_node->n_intrs = 2; 324 - ya_node->intrs[0].line = 19+irq_base; 325 - ya_node->intrs[1].line = 1+irq_base; 326 - printk(KERN_INFO "irq: fixed floppy on second controller (%d,%d)\n", 327 - ya_node->intrs[0].line, ya_node->intrs[1].line); 328 - } 329 - if (strcasecmp(ya_node->name, "ata4") == 0) { 330 - if (ya_node->n_intrs < 2) { 331 - ya_node->intrs = &gatwick_int_pool[count]; 332 - count += 2; 333 - } 334 - ya_node->n_intrs = 2; 335 - ya_node->intrs[0].line = 14+irq_base; 336 - ya_node->intrs[1].line = 3+irq_base; 337 - printk(KERN_INFO "irq: fixed ide on second controller (%d,%d)\n", 338 - ya_node->intrs[0].line, ya_node->intrs[1].line); 339 - } 340 - ya_node = ya_node->sibling; 341 - } 342 - } 343 - } 344 - if (count > 10) { 345 - printk("WARNING !! Gatwick interrupt pool overflow\n"); 346 - printk(" GATWICK_IRQ_POOL_SIZE = %d\n", GATWICK_IRQ_POOL_SIZE); 347 - printk(" requested = %d\n", count); 348 - } 349 - } 350 - 351 - /* 352 - * The PowerBook 3400/2400/3500 can have a combo ethernet/modem 353 - * card which includes an ohare chip that acts as a second interrupt 354 - * controller. If we find this second ohare, set it up and fix the 355 - * interrupt value in the device tree for the ethernet chip. 356 - */ 357 - static void __init enable_second_ohare(struct device_node *np) 358 - { 359 - unsigned char bus, devfn; 360 - unsigned short cmd; 361 - struct device_node *ether; 362 - 363 - /* This code doesn't strictly belong here, it could be part of 364 - * either the PCI initialisation or the feature code. It's kept 365 - * here for historical reasons. 366 - */ 367 - if (pci_device_from_OF_node(np, &bus, &devfn) == 0) { 368 - struct pci_controller* hose = 369 - pci_find_hose_for_OF_device(np); 370 - if (!hose) { 371 - printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); 372 - return; 373 - } 374 - early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); 375 - cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; 376 - cmd &= ~PCI_COMMAND_IO; 377 - early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); 378 - } 379 - 380 - /* Fix interrupt for the modem/ethernet combo controller. The number 381 - * in the device tree (27) is bogus (correct for the ethernet-only 382 - * board but not the combo ethernet/modem board). 383 - * The real interrupt is 28 on the second controller -> 28+32 = 60. 384 - */ 385 - ether = of_find_node_by_name(NULL, "pci1011,14"); 386 - if (ether && ether->n_intrs > 0) { 387 - ether->intrs[0].line = 60; 388 - printk(KERN_INFO "irq: Fixed ethernet IRQ to %d\n", 389 - ether->intrs[0].line); 390 - } 391 - of_node_put(ether); 244 + spin_unlock_irqrestore(&pmac_pic_lock, flags); 245 + if (unlikely(irq < 0)) 246 + return NO_IRQ; 247 + return irq_linear_revmap(pmac_pic_host, irq); 392 248 } 393 249 394 250 #ifdef CONFIG_XMON ··· 284 386 .name = "cascade", 285 387 }; 286 388 389 + static int pmac_pic_host_match(struct irq_host *h, struct device_node *node) 390 + { 391 + /* We match all, we don't always have a node anyway */ 392 + return 1; 393 + } 394 + 395 + static int pmac_pic_host_map(struct irq_host *h, unsigned int virq, 396 + irq_hw_number_t hw, unsigned int flags) 397 + { 398 + struct irq_desc *desc = get_irq_desc(virq); 399 + int level; 400 + 401 + if (hw >= max_irqs) 402 + return -EINVAL; 403 + 404 + /* Mark level interrupts, set delayed disable for edge ones and set 405 + * handlers 406 + */ 407 + level = !!(level_mask[hw >> 5] & (1UL << (hw & 0x1f))); 408 + if (level) 409 + desc->status |= IRQ_LEVEL; 410 + else 411 + desc->status |= IRQ_DELAYED_DISABLE; 412 + set_irq_chip_and_handler(virq, &pmac_pic, level ? 413 + handle_level_irq : handle_edge_irq); 414 + return 0; 415 + } 416 + 417 + static int pmac_pic_host_xlate(struct irq_host *h, struct device_node *ct, 418 + u32 *intspec, unsigned int intsize, 419 + irq_hw_number_t *out_hwirq, 420 + unsigned int *out_flags) 421 + 422 + { 423 + *out_hwirq = *intspec; 424 + return 0; 425 + } 426 + 427 + static struct irq_host_ops pmac_pic_host_ops = { 428 + .match = pmac_pic_host_match, 429 + .map = pmac_pic_host_map, 430 + .xlate = pmac_pic_host_xlate, 431 + }; 432 + 287 433 static void __init pmac_pic_probe_oldstyle(void) 288 434 { 289 435 int i; 290 - int irq_cascade = -1; 291 436 struct device_node *master = NULL; 292 437 struct device_node *slave = NULL; 293 438 u8 __iomem *addr; 294 439 struct resource r; 295 440 296 441 /* Set our get_irq function */ 297 - ppc_md.get_irq = pmac_get_irq; 442 + ppc_md.get_irq = pmac_pic_get_irq; 298 443 299 444 /* 300 445 * Find the interrupt controller type & node ··· 355 414 if (slave) { 356 415 max_irqs = 64; 357 416 level_mask[1] = OHARE_LEVEL_MASK; 358 - enable_second_ohare(slave); 359 417 } 360 418 } else if ((master = of_find_node_by_name(NULL, "mac-io")) != NULL) { 361 419 max_irqs = max_real_irqs = 64; ··· 378 438 max_irqs = 128; 379 439 level_mask[2] = HEATHROW_LEVEL_MASK; 380 440 level_mask[3] = 0; 381 - pmac_fix_gatwick_interrupts(slave, max_real_irqs); 382 441 } 383 442 } 384 443 BUG_ON(master == NULL); 385 444 386 - /* Set the handler for the main PIC */ 387 - for ( i = 0; i < max_real_irqs ; i++ ) 388 - irq_desc[i].chip = &pmac_pic; 445 + /* 446 + * Allocate an irq host 447 + */ 448 + pmac_pic_host = irq_alloc_host(IRQ_HOST_MAP_LINEAR, max_irqs, 449 + &pmac_pic_host_ops, 450 + max_irqs); 451 + BUG_ON(pmac_pic_host == NULL); 452 + irq_set_default_host(pmac_pic_host); 389 453 390 454 /* Get addresses of first controller if we have a node for it */ 391 455 BUG_ON(of_address_to_resource(master, 0, &r)); ··· 416 472 pmac_irq_hw[i++] = 417 473 (volatile struct pmac_irq_hw __iomem *) 418 474 (addr + 0x10); 419 - irq_cascade = slave->intrs[0].line; 475 + pmac_irq_cascade = irq_of_parse_and_map(slave, 0); 420 476 421 477 printk(KERN_INFO "irq: Found slave Apple PIC %s for %d irqs" 422 478 " cascade: %d\n", slave->full_name, 423 - max_irqs - max_real_irqs, irq_cascade); 479 + max_irqs - max_real_irqs, pmac_irq_cascade); 424 480 } 425 481 of_node_put(slave); 426 482 427 - /* disable all interrupts in all controllers */ 483 + /* Disable all interrupts in all controllers */ 428 484 for (i = 0; i * 32 < max_irqs; ++i) 429 485 out_le32(&pmac_irq_hw[i]->enable, 0); 430 486 431 - /* mark level interrupts */ 432 - for (i = 0; i < max_irqs; i++) 433 - if (level_mask[i >> 5] & (1UL << (i & 0x1f))) 434 - irq_desc[i].status = IRQ_LEVEL; 487 + /* Hookup cascade irq */ 488 + if (slave && pmac_irq_cascade != NO_IRQ) 489 + setup_irq(pmac_irq_cascade, &gatwick_cascade_action); 435 490 436 - /* Setup handlers for secondary controller and hook cascade irq*/ 437 - if (slave) { 438 - for ( i = max_real_irqs ; i < max_irqs ; i++ ) 439 - irq_desc[i].chip = &gatwick_pic; 440 - setup_irq(irq_cascade, &gatwick_cascade_action); 441 - } 442 491 printk(KERN_INFO "irq: System has %d possible interrupts\n", max_irqs); 443 492 #ifdef CONFIG_XMON 444 - setup_irq(20, &xmon_action); 493 + setup_irq(irq_create_mapping(NULL, 20, 0), &xmon_action); 445 494 #endif 446 495 } 447 496 #endif /* CONFIG_PPC32 */ 448 497 449 - static int pmac_u3_cascade(struct pt_regs *regs, void *data) 498 + static void pmac_u3_cascade(unsigned int irq, struct irq_desc *desc, 499 + struct pt_regs *regs) 450 500 { 451 - return mpic_get_one_irq((struct mpic *)data, regs); 501 + struct mpic *mpic = desc->handler_data; 502 + 503 + unsigned int cascade_irq = mpic_get_one_irq(mpic, regs); 504 + if (cascade_irq != NO_IRQ) 505 + generic_handle_irq(cascade_irq, regs); 506 + desc->chip->eoi(irq); 452 507 } 453 508 454 509 static void __init pmac_pic_setup_mpic_nmi(struct mpic *mpic) ··· 457 514 int nmi_irq; 458 515 459 516 pswitch = of_find_node_by_name(NULL, "programmer-switch"); 460 - if (pswitch && pswitch->n_intrs) { 461 - nmi_irq = pswitch->intrs[0].line; 462 - mpic_irq_set_priority(nmi_irq, 9); 463 - setup_irq(nmi_irq, &xmon_action); 517 + if (pswitch) { 518 + nmi_irq = irq_of_parse_and_map(pswitch, 0); 519 + if (nmi_irq != NO_IRQ) { 520 + mpic_irq_set_priority(nmi_irq, 9); 521 + setup_irq(nmi_irq, &xmon_action); 522 + } 523 + of_node_put(pswitch); 464 524 } 465 - of_node_put(pswitch); 466 525 #endif /* defined(CONFIG_XMON) && defined(CONFIG_PPC32) */ 467 526 } 468 527 469 528 static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, 470 529 int master) 471 530 { 472 - unsigned char senses[128]; 473 - int offset = master ? 0 : 128; 474 - int count = master ? 128 : 124; 475 531 const char *name = master ? " MPIC 1 " : " MPIC 2 "; 476 532 struct resource r; 477 533 struct mpic *mpic; ··· 483 541 484 542 pmac_call_feature(PMAC_FTR_ENABLE_MPIC, np, 0, 0); 485 543 486 - prom_get_irq_senses(senses, offset, offset + count); 487 - 488 544 flags |= MPIC_WANTS_RESET; 489 545 if (get_property(np, "big-endian", NULL)) 490 546 flags |= MPIC_BIG_ENDIAN; ··· 493 553 if (master && (flags & MPIC_BIG_ENDIAN)) 494 554 flags |= MPIC_BROKEN_U3; 495 555 496 - mpic = mpic_alloc(r.start, flags, 0, offset, count, master ? 252 : 0, 497 - senses, count, name); 556 + mpic = mpic_alloc(np, r.start, flags, 0, 0, name); 498 557 if (mpic == NULL) 499 558 return NULL; 500 559 ··· 506 567 { 507 568 struct mpic *mpic1, *mpic2; 508 569 struct device_node *np, *master = NULL, *slave = NULL; 570 + unsigned int cascade; 509 571 510 572 /* We can have up to 2 MPICs cascaded */ 511 573 for (np = NULL; (np = of_find_node_by_type(np, "open-pic")) ··· 543 603 of_node_put(master); 544 604 545 605 /* No slave, let's go out */ 546 - if (slave == NULL || slave->n_intrs < 1) 606 + if (slave == NULL) 547 607 return 0; 608 + 609 + /* Get/Map slave interrupt */ 610 + cascade = irq_of_parse_and_map(slave, 0); 611 + if (cascade == NO_IRQ) { 612 + printk(KERN_ERR "Failed to map cascade IRQ\n"); 613 + return 0; 614 + } 548 615 549 616 mpic2 = pmac_setup_one_mpic(slave, 0); 550 617 if (mpic2 == NULL) { ··· 559 612 of_node_put(slave); 560 613 return 0; 561 614 } 562 - mpic_setup_cascade(slave->intrs[0].line, pmac_u3_cascade, mpic2); 615 + set_irq_data(cascade, mpic2); 616 + set_irq_chained_handler(cascade, pmac_u3_cascade); 563 617 564 618 of_node_put(slave); 565 619 return 0; ··· 569 621 570 622 void __init pmac_pic_init(void) 571 623 { 624 + unsigned int flags = 0; 625 + 626 + /* We configure the OF parsing based on our oldworld vs. newworld 627 + * platform type and wether we were booted by BootX. 628 + */ 629 + #ifdef CONFIG_PPC32 630 + if (!pmac_newworld) 631 + flags |= OF_IMAP_OLDWORLD_MAC; 632 + if (get_property(of_chosen, "linux,bootx", NULL) != NULL) 633 + flags |= OF_IMAP_NO_PHANDLE; 634 + of_irq_map_init(flags); 635 + #endif /* CONFIG_PPC_32 */ 636 + 572 637 /* We first try to detect Apple's new Core99 chipset, since mac-io 573 638 * is quite different on those machines and contains an IBM MPIC2. 574 639 */ ··· 604 643 605 644 /* This used to be passed by the PMU driver but that link got 606 645 * broken with the new driver model. We use this tweak for now... 646 + * We really want to do things differently though... 607 647 */ 608 648 static int pmacpic_find_viaint(void) 609 649 { ··· 618 656 np = of_find_node_by_name(NULL, "via-pmu"); 619 657 if (np == NULL) 620 658 goto not_found; 621 - viaint = np->intrs[0].line; 659 + viaint = irq_of_parse_and_map(np, 0);; 622 660 #endif /* CONFIG_ADB_PMU */ 623 661 624 662 not_found:
+2
arch/powerpc/platforms/powermac/pmac.h
··· 12 12 13 13 struct rtc_time; 14 14 15 + extern int pmac_newworld; 16 + 15 17 extern long pmac_time_init(void); 16 18 extern unsigned long pmac_get_boot_time(void); 17 19 extern void pmac_get_rtc_time(struct rtc_time *);
-3
arch/powerpc/platforms/powermac/setup.c
··· 613 613 udbg_adb_init(!!strstr(cmd_line, "btextdbg")); 614 614 615 615 #ifdef CONFIG_PPC64 616 - /* Setup interrupt mapping options */ 617 - ppc64_interrupt_controller = IC_OPEN_PIC; 618 - 619 616 iommu_init_early_dart(); 620 617 #endif 621 618 }
+51 -27
arch/powerpc/platforms/pseries/ras.c
··· 72 72 73 73 /* #define DEBUG */ 74 74 75 - static void request_ras_irqs(struct device_node *np, char *propname, 75 + 76 + static void request_ras_irqs(struct device_node *np, 76 77 irqreturn_t (*handler)(int, void *, struct pt_regs *), 77 78 const char *name) 78 79 { 79 - unsigned int *ireg, len, i; 80 - int virq, n_intr; 80 + int i, index, count = 0; 81 + struct of_irq oirq; 82 + u32 *opicprop; 83 + unsigned int opicplen; 84 + unsigned int virqs[16]; 81 85 82 - ireg = (unsigned int *)get_property(np, propname, &len); 83 - if (ireg == NULL) 84 - return; 85 - n_intr = prom_n_intr_cells(np); 86 - len /= n_intr * sizeof(*ireg); 86 + /* Check for obsolete "open-pic-interrupt" property. If present, then 87 + * map those interrupts using the default interrupt host and default 88 + * trigger 89 + */ 90 + opicprop = (u32 *)get_property(np, "open-pic-interrupt", &opicplen); 91 + if (opicprop) { 92 + opicplen /= sizeof(u32); 93 + for (i = 0; i < opicplen; i++) { 94 + if (count > 15) 95 + break; 96 + virqs[count] = irq_create_mapping(NULL, *(opicprop++), 97 + IRQ_TYPE_NONE); 98 + if (virqs[count] == NO_IRQ) 99 + printk(KERN_ERR "Unable to allocate interrupt " 100 + "number for %s\n", np->full_name); 101 + else 102 + count++; 87 103 88 - for (i = 0; i < len; i++) { 89 - virq = virt_irq_create_mapping(*ireg); 90 - if (virq == NO_IRQ) { 91 - printk(KERN_ERR "Unable to allocate interrupt " 92 - "number for %s\n", np->full_name); 93 - return; 94 104 } 95 - if (request_irq(irq_offset_up(virq), handler, 0, name, NULL)) { 105 + } 106 + /* Else use normal interrupt tree parsing */ 107 + else { 108 + /* First try to do a proper OF tree parsing */ 109 + for (index = 0; of_irq_map_one(np, index, &oirq) == 0; 110 + index++) { 111 + if (count > 15) 112 + break; 113 + virqs[count] = irq_create_of_mapping(oirq.controller, 114 + oirq.specifier, 115 + oirq.size); 116 + if (virqs[count] == NO_IRQ) 117 + printk(KERN_ERR "Unable to allocate interrupt " 118 + "number for %s\n", np->full_name); 119 + else 120 + count++; 121 + } 122 + } 123 + 124 + /* Now request them */ 125 + for (i = 0; i < count; i++) { 126 + if (request_irq(virqs[i], handler, 0, name, NULL)) { 96 127 printk(KERN_ERR "Unable to request interrupt %d for " 97 - "%s\n", irq_offset_up(virq), np->full_name); 128 + "%s\n", virqs[i], np->full_name); 98 129 return; 99 130 } 100 - ireg += n_intr; 101 131 } 102 132 } 103 133 ··· 145 115 /* Internal Errors */ 146 116 np = of_find_node_by_path("/event-sources/internal-errors"); 147 117 if (np != NULL) { 148 - request_ras_irqs(np, "open-pic-interrupt", ras_error_interrupt, 149 - "RAS_ERROR"); 150 - request_ras_irqs(np, "interrupts", ras_error_interrupt, 151 - "RAS_ERROR"); 118 + request_ras_irqs(np, ras_error_interrupt, "RAS_ERROR"); 152 119 of_node_put(np); 153 120 } 154 121 155 122 /* EPOW Events */ 156 123 np = of_find_node_by_path("/event-sources/epow-events"); 157 124 if (np != NULL) { 158 - request_ras_irqs(np, "open-pic-interrupt", ras_epow_interrupt, 159 - "RAS_EPOW"); 160 - request_ras_irqs(np, "interrupts", ras_epow_interrupt, 161 - "RAS_EPOW"); 125 + request_ras_irqs(np, ras_epow_interrupt, "RAS_EPOW"); 162 126 of_node_put(np); 163 127 } 164 128 ··· 186 162 187 163 status = rtas_call(ras_check_exception_token, 6, 1, NULL, 188 164 RAS_VECTOR_OFFSET, 189 - virt_irq_to_real(irq_offset_down(irq)), 165 + irq_map[irq].hwirq, 190 166 RTAS_EPOW_WARNING | RTAS_POWERMGM_EVENTS, 191 167 critical, __pa(&ras_log_buf), 192 168 rtas_get_error_log_max()); ··· 222 198 223 199 status = rtas_call(ras_check_exception_token, 6, 1, NULL, 224 200 RAS_VECTOR_OFFSET, 225 - virt_irq_to_real(irq_offset_down(irq)), 201 + irq_map[irq].hwirq, 226 202 RTAS_INTERNAL_ERROR, 1 /*Time Critical */, 227 203 __pa(&ras_log_buf), 228 204 rtas_get_error_log_max());
+135 -113
arch/powerpc/platforms/pseries/setup.c
··· 76 76 #define DBG(fmt...) 77 77 #endif 78 78 79 + /* move those away to a .h */ 80 + extern void smp_init_pseries_mpic(void); 81 + extern void smp_init_pseries_xics(void); 79 82 extern void find_udbg_vterm(void); 80 83 81 84 int fwnmi_active; /* TRUE if an FWNMI handler is present */ ··· 86 83 static void pseries_shared_idle_sleep(void); 87 84 static void pseries_dedicated_idle_sleep(void); 88 85 89 - struct mpic *pSeries_mpic; 86 + static struct device_node *pSeries_mpic_node; 90 87 91 88 static void pSeries_show_cpuinfo(struct seq_file *m) 92 89 { ··· 121 118 fwnmi_active = 1; 122 119 } 123 120 124 - static void __init pSeries_init_mpic(void) 121 + void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc, 122 + struct pt_regs *regs) 125 123 { 126 - unsigned int *addrp; 127 - struct device_node *np; 128 - unsigned long intack = 0; 129 - 130 - /* All ISUs are setup, complete initialization */ 131 - mpic_init(pSeries_mpic); 132 - 133 - /* Check what kind of cascade ACK we have */ 134 - if (!(np = of_find_node_by_name(NULL, "pci")) 135 - || !(addrp = (unsigned int *) 136 - get_property(np, "8259-interrupt-acknowledge", NULL))) 137 - printk(KERN_ERR "Cannot find pci to get ack address\n"); 138 - else 139 - intack = addrp[prom_n_addr_cells(np)-1]; 140 - of_node_put(np); 141 - 142 - /* Setup the legacy interrupts & controller */ 143 - i8259_init(intack, 0); 144 - 145 - /* Hook cascade to mpic */ 146 - mpic_setup_cascade(NUM_ISA_INTERRUPTS, i8259_irq_cascade, NULL); 124 + unsigned int cascade_irq = i8259_irq(regs); 125 + if (cascade_irq != NO_IRQ) 126 + generic_handle_irq(cascade_irq, regs); 127 + desc->chip->eoi(irq); 147 128 } 148 129 149 - static void __init pSeries_setup_mpic(void) 130 + static void __init pseries_mpic_init_IRQ(void) 150 131 { 132 + struct device_node *np, *old, *cascade = NULL; 133 + unsigned int *addrp; 134 + unsigned long intack = 0; 151 135 unsigned int *opprop; 152 136 unsigned long openpic_addr = 0; 153 - unsigned char senses[NR_IRQS - NUM_ISA_INTERRUPTS]; 154 - struct device_node *root; 155 - int irq_count; 137 + unsigned int cascade_irq; 138 + int naddr, n, i, opplen; 139 + struct mpic *mpic; 156 140 157 - /* Find the Open PIC if present */ 158 - root = of_find_node_by_path("/"); 159 - opprop = (unsigned int *) get_property(root, "platform-open-pic", NULL); 141 + np = of_find_node_by_path("/"); 142 + naddr = prom_n_addr_cells(np); 143 + opprop = (unsigned int *) get_property(np, "platform-open-pic", &opplen); 160 144 if (opprop != 0) { 161 - int n = prom_n_addr_cells(root); 162 - 163 - for (openpic_addr = 0; n > 0; --n) 164 - openpic_addr = (openpic_addr << 32) + *opprop++; 145 + openpic_addr = of_read_number(opprop, naddr); 165 146 printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); 166 147 } 167 - of_node_put(root); 148 + of_node_put(np); 168 149 169 150 BUG_ON(openpic_addr == 0); 170 151 171 - /* Get the sense values from OF */ 172 - prom_get_irq_senses(senses, NUM_ISA_INTERRUPTS, NR_IRQS); 173 - 174 152 /* Setup the openpic driver */ 175 - irq_count = NR_IRQS - NUM_ISA_INTERRUPTS - 4; /* leave room for IPIs */ 176 - pSeries_mpic = mpic_alloc(openpic_addr, MPIC_PRIMARY, 177 - 16, 16, irq_count, /* isu size, irq offset, irq count */ 178 - NR_IRQS - 4, /* ipi offset */ 179 - senses, irq_count, /* sense & sense size */ 180 - " MPIC "); 153 + mpic = mpic_alloc(pSeries_mpic_node, openpic_addr, 154 + MPIC_PRIMARY, 155 + 16, 250, /* isu size, irq count */ 156 + " MPIC "); 157 + BUG_ON(mpic == NULL); 158 + 159 + /* Add ISUs */ 160 + opplen /= sizeof(u32); 161 + for (n = 0, i = naddr; i < opplen; i += naddr, n++) { 162 + unsigned long isuaddr = of_read_number(opprop + i, naddr); 163 + mpic_assign_isu(mpic, n, isuaddr); 164 + } 165 + 166 + /* All ISUs are setup, complete initialization */ 167 + mpic_init(mpic); 168 + 169 + /* Look for cascade */ 170 + for_each_node_by_type(np, "interrupt-controller") 171 + if (device_is_compatible(np, "chrp,iic")) { 172 + cascade = np; 173 + break; 174 + } 175 + if (cascade == NULL) 176 + return; 177 + 178 + cascade_irq = irq_of_parse_and_map(cascade, 0); 179 + if (cascade == NO_IRQ) { 180 + printk(KERN_ERR "xics: failed to map cascade interrupt"); 181 + return; 182 + } 183 + 184 + /* Check ACK type */ 185 + for (old = of_node_get(cascade); old != NULL ; old = np) { 186 + np = of_get_parent(old); 187 + of_node_put(old); 188 + if (np == NULL) 189 + break; 190 + if (strcmp(np->name, "pci") != 0) 191 + continue; 192 + addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", 193 + NULL); 194 + if (addrp == NULL) 195 + continue; 196 + naddr = prom_n_addr_cells(np); 197 + intack = addrp[naddr-1]; 198 + if (naddr > 1) 199 + intack |= ((unsigned long)addrp[naddr-2]) << 32; 200 + } 201 + if (intack) 202 + printk(KERN_DEBUG "mpic: PCI 8259 intack at 0x%016lx\n", 203 + intack); 204 + i8259_init(cascade, intack); 205 + of_node_put(cascade); 206 + set_irq_chained_handler(cascade_irq, pseries_8259_cascade); 181 207 } 182 208 183 209 static void pseries_lpar_enable_pmcs(void) ··· 224 192 get_lppaca()->pmcregs_in_use = 1; 225 193 } 226 194 195 + #ifdef CONFIG_KEXEC 196 + static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary) 197 + { 198 + mpic_teardown_this_cpu(secondary); 199 + } 200 + 201 + static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) 202 + { 203 + /* Don't risk a hypervisor call if we're crashing */ 204 + if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { 205 + unsigned long vpa = __pa(get_lppaca()); 206 + 207 + if (unregister_vpa(hard_smp_processor_id(), vpa)) { 208 + printk("VPA deregistration of cpu %u (hw_cpu_id %d) " 209 + "failed\n", smp_processor_id(), 210 + hard_smp_processor_id()); 211 + } 212 + } 213 + xics_teardown_cpu(secondary); 214 + } 215 + #endif /* CONFIG_KEXEC */ 216 + 217 + static void __init pseries_discover_pic(void) 218 + { 219 + struct device_node *np; 220 + char *typep; 221 + 222 + for (np = NULL; (np = of_find_node_by_name(np, 223 + "interrupt-controller"));) { 224 + typep = (char *)get_property(np, "compatible", NULL); 225 + if (strstr(typep, "open-pic")) { 226 + pSeries_mpic_node = of_node_get(np); 227 + ppc_md.init_IRQ = pseries_mpic_init_IRQ; 228 + ppc_md.get_irq = mpic_get_irq; 229 + #ifdef CONFIG_KEXEC 230 + ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic; 231 + #endif 232 + #ifdef CONFIG_SMP 233 + smp_init_pseries_mpic(); 234 + #endif 235 + return; 236 + } else if (strstr(typep, "ppc-xicp")) { 237 + ppc_md.init_IRQ = xics_init_IRQ; 238 + #ifdef CONFIG_KEXEC 239 + ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics; 240 + #endif 241 + #ifdef CONFIG_SMP 242 + smp_init_pseries_xics(); 243 + #endif 244 + return; 245 + } 246 + } 247 + printk(KERN_ERR "pSeries_discover_pic: failed to recognize" 248 + " interrupt-controller\n"); 249 + } 250 + 227 251 static void __init pSeries_setup_arch(void) 228 252 { 229 - /* Fixup ppc_md depending on the type of interrupt controller */ 230 - if (ppc64_interrupt_controller == IC_OPEN_PIC) { 231 - ppc_md.init_IRQ = pSeries_init_mpic; 232 - ppc_md.get_irq = mpic_get_irq; 233 - /* Allocate the mpic now, so that find_and_init_phbs() can 234 - * fill the ISUs */ 235 - pSeries_setup_mpic(); 236 - } else { 237 - ppc_md.init_IRQ = xics_init_IRQ; 238 - ppc_md.get_irq = xics_get_irq; 239 - } 253 + /* Discover PIC type and setup ppc_md accordingly */ 254 + pseries_discover_pic(); 240 255 241 - #ifdef CONFIG_SMP 242 - smp_init_pSeries(); 243 - #endif 244 256 /* openpic global configuration register (64-bit format). */ 245 257 /* openpic Interrupt Source Unit pointer (64-bit format). */ 246 258 /* python0 facility area (mmio) (64-bit format) REAL address. */ ··· 336 260 } 337 261 arch_initcall(pSeries_init_panel); 338 262 339 - static void __init pSeries_discover_pic(void) 340 - { 341 - struct device_node *np; 342 - char *typep; 343 - 344 - /* 345 - * Setup interrupt mapping options that are needed for finish_device_tree 346 - * to properly parse the OF interrupt tree & do the virtual irq mapping 347 - */ 348 - __irq_offset_value = NUM_ISA_INTERRUPTS; 349 - ppc64_interrupt_controller = IC_INVALID; 350 - for (np = NULL; (np = of_find_node_by_name(np, "interrupt-controller"));) { 351 - typep = (char *)get_property(np, "compatible", NULL); 352 - if (strstr(typep, "open-pic")) { 353 - ppc64_interrupt_controller = IC_OPEN_PIC; 354 - break; 355 - } else if (strstr(typep, "ppc-xicp")) { 356 - ppc64_interrupt_controller = IC_PPC_XIC; 357 - break; 358 - } 359 - } 360 - if (ppc64_interrupt_controller == IC_INVALID) 361 - printk("pSeries_discover_pic: failed to recognize" 362 - " interrupt-controller\n"); 363 - 364 - } 365 - 366 263 static void pSeries_mach_cpu_die(void) 367 264 { 368 265 local_irq_disable(); 369 266 idle_task_exit(); 370 - /* Some hardware requires clearing the CPPR, while other hardware does not 371 - * it is safe either way 372 - */ 373 - pSeriesLP_cppr_info(0, 0); 267 + xics_teardown_cpu(0); 374 268 rtas_stop_self(); 375 269 /* Should never get here... */ 376 270 BUG(); ··· 377 331 ppc_md.set_dabr = pseries_set_xdabr; 378 332 379 333 iommu_init_early_pSeries(); 380 - 381 - pSeries_discover_pic(); 382 334 383 335 DBG(" <- pSeries_init_early()\n"); 384 336 } ··· 549 505 return PCI_PROBE_NORMAL; 550 506 } 551 507 552 - #ifdef CONFIG_KEXEC 553 - static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) 554 - { 555 - /* Don't risk a hypervisor call if we're crashing */ 556 - if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { 557 - unsigned long vpa = __pa(get_lppaca()); 558 - 559 - if (unregister_vpa(hard_smp_processor_id(), vpa)) { 560 - printk("VPA deregistration of cpu %u (hw_cpu_id %d) " 561 - "failed\n", smp_processor_id(), 562 - hard_smp_processor_id()); 563 - } 564 - } 565 - 566 - if (ppc64_interrupt_controller == IC_OPEN_PIC) 567 - mpic_teardown_this_cpu(secondary); 568 - else 569 - xics_teardown_cpu(secondary); 570 - } 571 - #endif 572 - 573 508 define_machine(pseries) { 574 509 .name = "pSeries", 575 510 .probe = pSeries_probe, ··· 573 550 .system_reset_exception = pSeries_system_reset_exception, 574 551 .machine_check_exception = pSeries_machine_check_exception, 575 552 #ifdef CONFIG_KEXEC 576 - .kexec_cpu_down = pseries_kexec_cpu_down, 577 553 .machine_kexec = default_machine_kexec, 578 554 .machine_kexec_prepare = default_machine_kexec_prepare, 579 555 .machine_crash_shutdown = default_machine_crash_shutdown,
+16 -16
arch/powerpc/platforms/pseries/smp.c
··· 416 416 #endif 417 417 418 418 /* This is called very early */ 419 - void __init smp_init_pSeries(void) 419 + static void __init smp_init_pseries(void) 420 420 { 421 421 int i; 422 422 423 423 DBG(" -> smp_init_pSeries()\n"); 424 - 425 - switch (ppc64_interrupt_controller) { 426 - #ifdef CONFIG_MPIC 427 - case IC_OPEN_PIC: 428 - smp_ops = &pSeries_mpic_smp_ops; 429 - break; 430 - #endif 431 - #ifdef CONFIG_XICS 432 - case IC_PPC_XIC: 433 - smp_ops = &pSeries_xics_smp_ops; 434 - break; 435 - #endif 436 - default: 437 - panic("Invalid interrupt controller"); 438 - } 439 424 440 425 #ifdef CONFIG_HOTPLUG_CPU 441 426 smp_ops->cpu_disable = pSeries_cpu_disable; ··· 456 471 DBG(" <- smp_init_pSeries()\n"); 457 472 } 458 473 474 + #ifdef CONFIG_MPIC 475 + void __init smp_init_pseries_mpic(void) 476 + { 477 + smp_ops = &pSeries_mpic_smp_ops; 478 + 479 + smp_init_pseries(); 480 + } 481 + #endif 482 + 483 + void __init smp_init_pseries_xics(void) 484 + { 485 + smp_ops = &pSeries_xics_smp_ops; 486 + 487 + smp_init_pseries(); 488 + }
+449 -309
arch/powerpc/platforms/pseries/xics.c
··· 8 8 * as published by the Free Software Foundation; either version 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 + 12 + #undef DEBUG 13 + 11 14 #include <linux/types.h> 12 15 #include <linux/threads.h> 13 16 #include <linux/kernel.h> ··· 22 19 #include <linux/gfp.h> 23 20 #include <linux/radix-tree.h> 24 21 #include <linux/cpu.h> 22 + 25 23 #include <asm/firmware.h> 26 24 #include <asm/prom.h> 27 25 #include <asm/io.h> ··· 34 30 #include <asm/i8259.h> 35 31 36 32 #include "xics.h" 37 - 38 - static unsigned int xics_startup(unsigned int irq); 39 - static void xics_enable_irq(unsigned int irq); 40 - static void xics_disable_irq(unsigned int irq); 41 - static void xics_mask_and_ack_irq(unsigned int irq); 42 - static void xics_end_irq(unsigned int irq); 43 - static void xics_set_affinity(unsigned int irq_nr, cpumask_t cpumask); 44 - 45 - static struct hw_interrupt_type xics_pic = { 46 - .typename = " XICS ", 47 - .startup = xics_startup, 48 - .enable = xics_enable_irq, 49 - .disable = xics_disable_irq, 50 - .ack = xics_mask_and_ack_irq, 51 - .end = xics_end_irq, 52 - .set_affinity = xics_set_affinity 53 - }; 54 - 55 - /* This is used to map real irq numbers to virtual */ 56 - static struct radix_tree_root irq_map = RADIX_TREE_INIT(GFP_ATOMIC); 57 33 58 34 #define XICS_IPI 2 59 35 #define XICS_IRQ_SPURIOUS 0 ··· 65 81 66 82 static struct xics_ipl __iomem *xics_per_cpu[NR_CPUS]; 67 83 68 - static int xics_irq_8259_cascade = 0; 69 - static int xics_irq_8259_cascade_real = 0; 70 84 static unsigned int default_server = 0xFF; 71 85 static unsigned int default_distrib_server = 0; 72 86 static unsigned int interrupt_server_size = 8; 87 + 88 + static struct irq_host *xics_host; 73 89 74 90 /* 75 91 * XICS only has a single IPI, so encode the messages per CPU ··· 82 98 static int ibm_int_on; 83 99 static int ibm_int_off; 84 100 85 - typedef struct { 86 - int (*xirr_info_get)(int cpu); 87 - void (*xirr_info_set)(int cpu, int val); 88 - void (*cppr_info)(int cpu, u8 val); 89 - void (*qirr_info)(int cpu, u8 val); 90 - } xics_ops; 101 + 102 + /* Direct HW low level accessors */ 91 103 92 104 93 - /* SMP */ 94 - 95 - static int pSeries_xirr_info_get(int n_cpu) 105 + static inline unsigned int direct_xirr_info_get(int n_cpu) 96 106 { 97 107 return in_be32(&xics_per_cpu[n_cpu]->xirr.word); 98 108 } 99 109 100 - static void pSeries_xirr_info_set(int n_cpu, int value) 110 + static inline void direct_xirr_info_set(int n_cpu, int value) 101 111 { 102 112 out_be32(&xics_per_cpu[n_cpu]->xirr.word, value); 103 113 } 104 114 105 - static void pSeries_cppr_info(int n_cpu, u8 value) 115 + static inline void direct_cppr_info(int n_cpu, u8 value) 106 116 { 107 117 out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value); 108 118 } 109 119 110 - static void pSeries_qirr_info(int n_cpu, u8 value) 120 + static inline void direct_qirr_info(int n_cpu, u8 value) 111 121 { 112 122 out_8(&xics_per_cpu[n_cpu]->qirr.bytes[0], value); 113 123 } 114 124 115 - static xics_ops pSeries_ops = { 116 - pSeries_xirr_info_get, 117 - pSeries_xirr_info_set, 118 - pSeries_cppr_info, 119 - pSeries_qirr_info 120 - }; 121 125 122 - static xics_ops *ops = &pSeries_ops; 126 + /* LPAR low level accessors */ 123 127 124 - 125 - /* LPAR */ 126 128 127 129 static inline long plpar_eoi(unsigned long xirr) 128 130 { ··· 131 161 return plpar_hcall(H_XIRR, 0, 0, 0, 0, xirr_ret, &dummy, &dummy); 132 162 } 133 163 134 - static int pSeriesLP_xirr_info_get(int n_cpu) 164 + static inline unsigned int lpar_xirr_info_get(int n_cpu) 135 165 { 136 166 unsigned long lpar_rc; 137 167 unsigned long return_value; ··· 139 169 lpar_rc = plpar_xirr(&return_value); 140 170 if (lpar_rc != H_SUCCESS) 141 171 panic(" bad return code xirr - rc = %lx \n", lpar_rc); 142 - return (int)return_value; 172 + return (unsigned int)return_value; 143 173 } 144 174 145 - static void pSeriesLP_xirr_info_set(int n_cpu, int value) 175 + static inline void lpar_xirr_info_set(int n_cpu, int value) 146 176 { 147 177 unsigned long lpar_rc; 148 178 unsigned long val64 = value & 0xffffffff; ··· 153 183 val64); 154 184 } 155 185 156 - void pSeriesLP_cppr_info(int n_cpu, u8 value) 186 + static inline void lpar_cppr_info(int n_cpu, u8 value) 157 187 { 158 188 unsigned long lpar_rc; 159 189 ··· 162 192 panic("bad return code cppr - rc = %lx\n", lpar_rc); 163 193 } 164 194 165 - static void pSeriesLP_qirr_info(int n_cpu , u8 value) 195 + static inline void lpar_qirr_info(int n_cpu , u8 value) 166 196 { 167 197 unsigned long lpar_rc; 168 198 ··· 171 201 panic("bad return code qirr - rc = %lx\n", lpar_rc); 172 202 } 173 203 174 - xics_ops pSeriesLP_ops = { 175 - pSeriesLP_xirr_info_get, 176 - pSeriesLP_xirr_info_set, 177 - pSeriesLP_cppr_info, 178 - pSeriesLP_qirr_info 179 - }; 180 204 181 - static unsigned int xics_startup(unsigned int virq) 182 - { 183 - unsigned int irq; 205 + /* High level handlers and init code */ 184 206 185 - irq = irq_offset_down(virq); 186 - if (radix_tree_insert(&irq_map, virt_irq_to_real(irq), 187 - &virt_irq_to_real_map[irq]) == -ENOMEM) 188 - printk(KERN_CRIT "Out of memory creating real -> virtual" 189 - " IRQ mapping for irq %u (real 0x%x)\n", 190 - virq, virt_irq_to_real(irq)); 191 - xics_enable_irq(virq); 192 - return 0; /* return value is ignored */ 193 - } 194 - 195 - static unsigned int real_irq_to_virt(unsigned int real_irq) 196 - { 197 - unsigned int *ptr; 198 - 199 - ptr = radix_tree_lookup(&irq_map, real_irq); 200 - if (ptr == NULL) 201 - return NO_IRQ; 202 - return ptr - virt_irq_to_real_map; 203 - } 204 207 205 208 #ifdef CONFIG_SMP 206 - static int get_irq_server(unsigned int irq) 209 + static int get_irq_server(unsigned int virq) 207 210 { 208 211 unsigned int server; 209 212 /* For the moment only implement delivery to all cpus or one cpu */ 210 - cpumask_t cpumask = irq_desc[irq].affinity; 213 + cpumask_t cpumask = irq_desc[virq].affinity; 211 214 cpumask_t tmp = CPU_MASK_NONE; 212 215 213 216 if (!distribute_irqs) ··· 201 258 202 259 } 203 260 #else 204 - static int get_irq_server(unsigned int irq) 261 + static int get_irq_server(unsigned int virq) 205 262 { 206 263 return default_server; 207 264 } 208 265 #endif 209 266 210 - static void xics_enable_irq(unsigned int virq) 267 + 268 + static void xics_unmask_irq(unsigned int virq) 211 269 { 212 270 unsigned int irq; 213 271 int call_status; 214 272 unsigned int server; 215 273 216 - irq = virt_irq_to_real(irq_offset_down(virq)); 217 - if (irq == XICS_IPI) 274 + pr_debug("xics: unmask virq %d\n", virq); 275 + 276 + irq = (unsigned int)irq_map[virq].hwirq; 277 + pr_debug(" -> map to hwirq 0x%x\n", irq); 278 + if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 218 279 return; 219 280 220 281 server = get_irq_server(virq); 282 + 221 283 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 222 284 DEFAULT_PRIORITY); 223 285 if (call_status != 0) { ··· 241 293 } 242 294 } 243 295 244 - static void xics_disable_real_irq(unsigned int irq) 296 + static void xics_mask_real_irq(unsigned int irq) 245 297 { 246 298 int call_status; 247 299 unsigned int server; ··· 266 318 } 267 319 } 268 320 269 - static void xics_disable_irq(unsigned int virq) 321 + static void xics_mask_irq(unsigned int virq) 270 322 { 271 323 unsigned int irq; 272 324 273 - irq = virt_irq_to_real(irq_offset_down(virq)); 274 - xics_disable_real_irq(irq); 325 + pr_debug("xics: mask virq %d\n", virq); 326 + 327 + irq = (unsigned int)irq_map[virq].hwirq; 328 + if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 329 + return; 330 + xics_mask_real_irq(irq); 275 331 } 276 332 277 - static void xics_end_irq(unsigned int irq) 333 + static unsigned int xics_startup(unsigned int virq) 334 + { 335 + unsigned int irq; 336 + 337 + /* force a reverse mapping of the interrupt so it gets in the cache */ 338 + irq = (unsigned int)irq_map[virq].hwirq; 339 + irq_radix_revmap(xics_host, irq); 340 + 341 + /* unmask it */ 342 + xics_unmask_irq(virq); 343 + return 0; 344 + } 345 + 346 + static void xics_eoi_direct(unsigned int virq) 278 347 { 279 348 int cpu = smp_processor_id(); 349 + unsigned int irq = (unsigned int)irq_map[virq].hwirq; 280 350 281 351 iosync(); 282 - ops->xirr_info_set(cpu, ((0xff << 24) | 283 - (virt_irq_to_real(irq_offset_down(irq))))); 284 - 352 + direct_xirr_info_set(cpu, (0xff << 24) | irq); 285 353 } 286 354 287 - static void xics_mask_and_ack_irq(unsigned int irq) 355 + 356 + static void xics_eoi_lpar(unsigned int virq) 288 357 { 289 358 int cpu = smp_processor_id(); 359 + unsigned int irq = (unsigned int)irq_map[virq].hwirq; 290 360 291 - if (irq < irq_offset_value()) { 292 - i8259_pic.ack(irq); 293 - iosync(); 294 - ops->xirr_info_set(cpu, ((0xff<<24) | 295 - xics_irq_8259_cascade_real)); 296 - iosync(); 297 - } 361 + iosync(); 362 + lpar_xirr_info_set(cpu, (0xff << 24) | irq); 298 363 } 299 364 300 - int xics_get_irq(struct pt_regs *regs) 365 + static inline unsigned int xics_remap_irq(unsigned int vec) 301 366 { 302 - unsigned int cpu = smp_processor_id(); 303 - unsigned int vec; 304 - int irq; 367 + unsigned int irq; 305 368 306 - vec = ops->xirr_info_get(cpu); 307 - /* (vec >> 24) == old priority */ 308 369 vec &= 0x00ffffff; 309 370 310 - /* for sanity, this had better be < NR_IRQS - 16 */ 311 - if (vec == xics_irq_8259_cascade_real) { 312 - irq = i8259_irq(regs); 313 - xics_end_irq(irq_offset_up(xics_irq_8259_cascade)); 314 - } else if (vec == XICS_IRQ_SPURIOUS) { 315 - irq = -1; 316 - } else { 317 - irq = real_irq_to_virt(vec); 318 - if (irq == NO_IRQ) 319 - irq = real_irq_to_virt_slowpath(vec); 320 - if (irq == NO_IRQ) { 321 - printk(KERN_ERR "Interrupt %u (real) is invalid," 322 - " disabling it.\n", vec); 323 - xics_disable_real_irq(vec); 324 - } else 325 - irq = irq_offset_up(irq); 326 - } 327 - return irq; 371 + if (vec == XICS_IRQ_SPURIOUS) 372 + return NO_IRQ; 373 + irq = irq_radix_revmap(xics_host, vec); 374 + if (likely(irq != NO_IRQ)) 375 + return irq; 376 + 377 + printk(KERN_ERR "Interrupt %u (real) is invalid," 378 + " disabling it.\n", vec); 379 + xics_mask_real_irq(vec); 380 + return NO_IRQ; 381 + } 382 + 383 + static unsigned int xics_get_irq_direct(struct pt_regs *regs) 384 + { 385 + unsigned int cpu = smp_processor_id(); 386 + 387 + return xics_remap_irq(direct_xirr_info_get(cpu)); 388 + } 389 + 390 + static unsigned int xics_get_irq_lpar(struct pt_regs *regs) 391 + { 392 + unsigned int cpu = smp_processor_id(); 393 + 394 + return xics_remap_irq(lpar_xirr_info_get(cpu)); 328 395 } 329 396 330 397 #ifdef CONFIG_SMP 331 398 332 - static irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs) 399 + static irqreturn_t xics_ipi_dispatch(int cpu, struct pt_regs *regs) 333 400 { 334 - int cpu = smp_processor_id(); 335 - 336 - ops->qirr_info(cpu, 0xff); 337 - 338 401 WARN_ON(cpu_is_offline(cpu)); 339 402 340 403 while (xics_ipi_message[cpu].value) { ··· 377 418 return IRQ_HANDLED; 378 419 } 379 420 380 - void xics_cause_IPI(int cpu) 381 - { 382 - ops->qirr_info(cpu, IPI_PRIORITY); 383 - } 384 - #endif /* CONFIG_SMP */ 385 - 386 - void xics_setup_cpu(void) 421 + static irqreturn_t xics_ipi_action_direct(int irq, void *dev_id, struct pt_regs *regs) 387 422 { 388 423 int cpu = smp_processor_id(); 389 424 390 - ops->cppr_info(cpu, 0xff); 391 - iosync(); 425 + direct_qirr_info(cpu, 0xff); 392 426 393 - /* 394 - * Put the calling processor into the GIQ. This is really only 395 - * necessary from a secondary thread as the OF start-cpu interface 396 - * performs this function for us on primary threads. 397 - * 398 - * XXX: undo of teardown on kexec needs this too, as may hotplug 399 - */ 400 - rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, 401 - (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); 427 + return xics_ipi_dispatch(cpu, regs); 402 428 } 403 429 404 - void xics_init_IRQ(void) 430 + static irqreturn_t xics_ipi_action_lpar(int irq, void *dev_id, struct pt_regs *regs) 405 431 { 406 - int i; 407 - unsigned long intr_size = 0; 408 - struct device_node *np; 409 - uint *ireg, ilen, indx = 0; 410 - unsigned long intr_base = 0; 411 - struct xics_interrupt_node { 412 - unsigned long addr; 413 - unsigned long size; 414 - } intnodes[NR_CPUS]; 432 + int cpu = smp_processor_id(); 415 433 416 - ppc64_boot_msg(0x20, "XICS Init"); 434 + lpar_qirr_info(cpu, 0xff); 417 435 418 - ibm_get_xive = rtas_token("ibm,get-xive"); 419 - ibm_set_xive = rtas_token("ibm,set-xive"); 420 - ibm_int_on = rtas_token("ibm,int-on"); 421 - ibm_int_off = rtas_token("ibm,int-off"); 436 + return xics_ipi_dispatch(cpu, regs); 437 + } 422 438 423 - np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation"); 424 - if (!np) 425 - panic("xics_init_IRQ: can't find interrupt presentation"); 426 - 427 - nextnode: 428 - ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL); 429 - if (ireg) { 430 - /* 431 - * set node starting index for this node 432 - */ 433 - indx = *ireg; 434 - } 435 - 436 - ireg = (uint *)get_property(np, "reg", &ilen); 437 - if (!ireg) 438 - panic("xics_init_IRQ: can't find interrupt reg property"); 439 - 440 - while (ilen) { 441 - intnodes[indx].addr = (unsigned long)*ireg++ << 32; 442 - ilen -= sizeof(uint); 443 - intnodes[indx].addr |= *ireg++; 444 - ilen -= sizeof(uint); 445 - intnodes[indx].size = (unsigned long)*ireg++ << 32; 446 - ilen -= sizeof(uint); 447 - intnodes[indx].size |= *ireg++; 448 - ilen -= sizeof(uint); 449 - indx++; 450 - if (indx >= NR_CPUS) break; 451 - } 452 - 453 - np = of_find_node_by_type(np, "PowerPC-External-Interrupt-Presentation"); 454 - if ((indx < NR_CPUS) && np) goto nextnode; 455 - 456 - /* Find the server numbers for the boot cpu. */ 457 - for (np = of_find_node_by_type(NULL, "cpu"); 458 - np; 459 - np = of_find_node_by_type(np, "cpu")) { 460 - ireg = (uint *)get_property(np, "reg", &ilen); 461 - if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) { 462 - ireg = (uint *)get_property(np, "ibm,ppc-interrupt-gserver#s", 463 - &ilen); 464 - i = ilen / sizeof(int); 465 - if (ireg && i > 0) { 466 - default_server = ireg[0]; 467 - default_distrib_server = ireg[i-1]; /* take last element */ 468 - } 469 - ireg = (uint *)get_property(np, 470 - "ibm,interrupt-server#-size", NULL); 471 - if (ireg) 472 - interrupt_server_size = *ireg; 473 - break; 474 - } 475 - } 476 - of_node_put(np); 477 - 478 - intr_base = intnodes[0].addr; 479 - intr_size = intnodes[0].size; 480 - 481 - np = of_find_node_by_type(NULL, "interrupt-controller"); 482 - if (!np) { 483 - printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); 484 - xics_irq_8259_cascade_real = -1; 485 - xics_irq_8259_cascade = -1; 486 - } else { 487 - ireg = (uint *) get_property(np, "interrupts", NULL); 488 - if (!ireg) 489 - panic("xics_init_IRQ: can't find ISA interrupts property"); 490 - 491 - xics_irq_8259_cascade_real = *ireg; 492 - xics_irq_8259_cascade 493 - = virt_irq_create_mapping(xics_irq_8259_cascade_real); 494 - i8259_init(0, 0); 495 - of_node_put(np); 496 - } 497 - 439 + void xics_cause_IPI(int cpu) 440 + { 498 441 if (firmware_has_feature(FW_FEATURE_LPAR)) 499 - ops = &pSeriesLP_ops; 500 - else { 501 - #ifdef CONFIG_SMP 502 - for_each_possible_cpu(i) { 503 - int hard_id; 442 + lpar_qirr_info(cpu, IPI_PRIORITY); 443 + else 444 + direct_qirr_info(cpu, IPI_PRIORITY); 445 + } 504 446 505 - /* FIXME: Do this dynamically! --RR */ 506 - if (!cpu_present(i)) 507 - continue; 508 - 509 - hard_id = get_hard_smp_processor_id(i); 510 - xics_per_cpu[i] = ioremap(intnodes[hard_id].addr, 511 - intnodes[hard_id].size); 512 - } 513 - #else 514 - xics_per_cpu[0] = ioremap(intr_base, intr_size); 515 447 #endif /* CONFIG_SMP */ 516 - } 517 448 518 - for (i = irq_offset_value(); i < NR_IRQS; ++i) 519 - get_irq_desc(i)->chip = &xics_pic; 520 - 521 - xics_setup_cpu(); 522 - 523 - ppc64_boot_msg(0x21, "XICS Done"); 524 - } 525 - 526 - /* 527 - * We cant do this in init_IRQ because we need the memory subsystem up for 528 - * request_irq() 529 - */ 530 - static int __init xics_setup_i8259(void) 449 + static void xics_set_cpu_priority(int cpu, unsigned char cppr) 531 450 { 532 - if (ppc64_interrupt_controller == IC_PPC_XIC && 533 - xics_irq_8259_cascade != -1) { 534 - if (request_irq(irq_offset_up(xics_irq_8259_cascade), 535 - no_action, 0, "8259 cascade", NULL)) 536 - printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " 537 - "cascade\n"); 538 - } 539 - return 0; 451 + if (firmware_has_feature(FW_FEATURE_LPAR)) 452 + lpar_cppr_info(cpu, cppr); 453 + else 454 + direct_cppr_info(cpu, cppr); 455 + iosync(); 540 456 } 541 - arch_initcall(xics_setup_i8259); 542 - 543 - #ifdef CONFIG_SMP 544 - void xics_request_IPIs(void) 545 - { 546 - virt_irq_to_real_map[XICS_IPI] = XICS_IPI; 547 - 548 - /* 549 - * IPIs are marked IRQF_DISABLED as they must run with irqs 550 - * disabled 551 - */ 552 - request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, 553 - IRQF_DISABLED, "IPI", NULL); 554 - get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU; 555 - } 556 - #endif 557 457 558 458 static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) 559 459 { ··· 422 604 unsigned long newmask; 423 605 cpumask_t tmp = CPU_MASK_NONE; 424 606 425 - irq = virt_irq_to_real(irq_offset_down(virq)); 426 - if (irq == XICS_IPI || irq == NO_IRQ) 607 + irq = (unsigned int)irq_map[virq].hwirq; 608 + if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 427 609 return; 428 610 429 611 status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); ··· 454 636 } 455 637 } 456 638 457 - void xics_teardown_cpu(int secondary) 639 + void xics_setup_cpu(void) 458 640 { 459 641 int cpu = smp_processor_id(); 460 642 461 - ops->cppr_info(cpu, 0x00); 462 - iosync(); 643 + xics_set_cpu_priority(cpu, 0xff); 463 644 464 - /* Clear IPI */ 465 - ops->qirr_info(cpu, 0xff); 645 + /* 646 + * Put the calling processor into the GIQ. This is really only 647 + * necessary from a secondary thread as the OF start-cpu interface 648 + * performs this function for us on primary threads. 649 + * 650 + * XXX: undo of teardown on kexec needs this too, as may hotplug 651 + */ 652 + rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, 653 + (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); 654 + } 655 + 656 + 657 + static struct irq_chip xics_pic_direct = { 658 + .typename = " XICS ", 659 + .startup = xics_startup, 660 + .mask = xics_mask_irq, 661 + .unmask = xics_unmask_irq, 662 + .eoi = xics_eoi_direct, 663 + .set_affinity = xics_set_affinity 664 + }; 665 + 666 + 667 + static struct irq_chip xics_pic_lpar = { 668 + .typename = " XICS ", 669 + .startup = xics_startup, 670 + .mask = xics_mask_irq, 671 + .unmask = xics_unmask_irq, 672 + .eoi = xics_eoi_lpar, 673 + .set_affinity = xics_set_affinity 674 + }; 675 + 676 + 677 + static int xics_host_match(struct irq_host *h, struct device_node *node) 678 + { 679 + /* IBM machines have interrupt parents of various funky types for things 680 + * like vdevices, events, etc... The trick we use here is to match 681 + * everything here except the legacy 8259 which is compatible "chrp,iic" 682 + */ 683 + return !device_is_compatible(node, "chrp,iic"); 684 + } 685 + 686 + static int xics_host_map_direct(struct irq_host *h, unsigned int virq, 687 + irq_hw_number_t hw, unsigned int flags) 688 + { 689 + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 690 + 691 + pr_debug("xics: map_direct virq %d, hwirq 0x%lx, flags: 0x%x\n", 692 + virq, hw, flags); 693 + 694 + if (sense && sense != IRQ_TYPE_LEVEL_LOW) 695 + printk(KERN_WARNING "xics: using unsupported sense 0x%x" 696 + " for irq %d (h: 0x%lx)\n", flags, virq, hw); 697 + 698 + get_irq_desc(virq)->status |= IRQ_LEVEL; 699 + set_irq_chip_and_handler(virq, &xics_pic_direct, handle_fasteoi_irq); 700 + return 0; 701 + } 702 + 703 + static int xics_host_map_lpar(struct irq_host *h, unsigned int virq, 704 + irq_hw_number_t hw, unsigned int flags) 705 + { 706 + unsigned int sense = flags & IRQ_TYPE_SENSE_MASK; 707 + 708 + pr_debug("xics: map_lpar virq %d, hwirq 0x%lx, flags: 0x%x\n", 709 + virq, hw, flags); 710 + 711 + if (sense && sense != IRQ_TYPE_LEVEL_LOW) 712 + printk(KERN_WARNING "xics: using unsupported sense 0x%x" 713 + " for irq %d (h: 0x%lx)\n", flags, virq, hw); 714 + 715 + get_irq_desc(virq)->status |= IRQ_LEVEL; 716 + set_irq_chip_and_handler(virq, &xics_pic_lpar, handle_fasteoi_irq); 717 + return 0; 718 + } 719 + 720 + static int xics_host_xlate(struct irq_host *h, struct device_node *ct, 721 + u32 *intspec, unsigned int intsize, 722 + irq_hw_number_t *out_hwirq, unsigned int *out_flags) 723 + 724 + { 725 + /* Current xics implementation translates everything 726 + * to level. It is not technically right for MSIs but this 727 + * is irrelevant at this point. We might get smarter in the future 728 + */ 729 + *out_hwirq = intspec[0]; 730 + *out_flags = IRQ_TYPE_LEVEL_LOW; 731 + 732 + return 0; 733 + } 734 + 735 + static struct irq_host_ops xics_host_direct_ops = { 736 + .match = xics_host_match, 737 + .map = xics_host_map_direct, 738 + .xlate = xics_host_xlate, 739 + }; 740 + 741 + static struct irq_host_ops xics_host_lpar_ops = { 742 + .match = xics_host_match, 743 + .map = xics_host_map_lpar, 744 + .xlate = xics_host_xlate, 745 + }; 746 + 747 + static void __init xics_init_host(void) 748 + { 749 + struct irq_host_ops *ops; 750 + 751 + if (firmware_has_feature(FW_FEATURE_LPAR)) 752 + ops = &xics_host_lpar_ops; 753 + else 754 + ops = &xics_host_direct_ops; 755 + xics_host = irq_alloc_host(IRQ_HOST_MAP_TREE, 0, ops, 756 + XICS_IRQ_SPURIOUS); 757 + BUG_ON(xics_host == NULL); 758 + irq_set_default_host(xics_host); 759 + } 760 + 761 + static void __init xics_map_one_cpu(int hw_id, unsigned long addr, 762 + unsigned long size) 763 + { 764 + #ifdef CONFIG_SMP 765 + int i; 766 + 767 + /* This may look gross but it's good enough for now, we don't quite 768 + * have a hard -> linux processor id matching. 769 + */ 770 + for_each_possible_cpu(i) { 771 + if (!cpu_present(i)) 772 + continue; 773 + if (hw_id == get_hard_smp_processor_id(i)) { 774 + xics_per_cpu[i] = ioremap(addr, size); 775 + return; 776 + } 777 + } 778 + #else 779 + if (hw_id != 0) 780 + return; 781 + xics_per_cpu[0] = ioremap(addr, size); 782 + #endif /* CONFIG_SMP */ 783 + } 784 + 785 + static void __init xics_init_one_node(struct device_node *np, 786 + unsigned int *indx) 787 + { 788 + unsigned int ilen; 789 + u32 *ireg; 790 + 791 + /* This code does the theorically broken assumption that the interrupt 792 + * server numbers are the same as the hard CPU numbers. 793 + * This happens to be the case so far but we are playing with fire... 794 + * should be fixed one of these days. -BenH. 795 + */ 796 + ireg = (u32 *)get_property(np, "ibm,interrupt-server-ranges", NULL); 797 + 798 + /* Do that ever happen ? we'll know soon enough... but even good'old 799 + * f80 does have that property .. 800 + */ 801 + WARN_ON(ireg == NULL); 802 + if (ireg) { 803 + /* 804 + * set node starting index for this node 805 + */ 806 + *indx = *ireg; 807 + } 808 + ireg = (u32 *)get_property(np, "reg", &ilen); 809 + if (!ireg) 810 + panic("xics_init_IRQ: can't find interrupt reg property"); 811 + 812 + while (ilen >= (4 * sizeof(u32))) { 813 + unsigned long addr, size; 814 + 815 + /* XXX Use proper OF parsing code here !!! */ 816 + addr = (unsigned long)*ireg++ << 32; 817 + ilen -= sizeof(u32); 818 + addr |= *ireg++; 819 + ilen -= sizeof(u32); 820 + size = (unsigned long)*ireg++ << 32; 821 + ilen -= sizeof(u32); 822 + size |= *ireg++; 823 + ilen -= sizeof(u32); 824 + xics_map_one_cpu(*indx, addr, size); 825 + (*indx)++; 826 + } 827 + } 828 + 829 + 830 + static void __init xics_setup_8259_cascade(void) 831 + { 832 + struct device_node *np, *old, *found = NULL; 833 + int cascade, naddr; 834 + u32 *addrp; 835 + unsigned long intack = 0; 836 + 837 + for_each_node_by_type(np, "interrupt-controller") 838 + if (device_is_compatible(np, "chrp,iic")) { 839 + found = np; 840 + break; 841 + } 842 + if (found == NULL) { 843 + printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); 844 + return; 845 + } 846 + cascade = irq_of_parse_and_map(found, 0); 847 + if (cascade == NO_IRQ) { 848 + printk(KERN_ERR "xics: failed to map cascade interrupt"); 849 + return; 850 + } 851 + pr_debug("xics: cascade mapped to irq %d\n", cascade); 852 + 853 + for (old = of_node_get(found); old != NULL ; old = np) { 854 + np = of_get_parent(old); 855 + of_node_put(old); 856 + if (np == NULL) 857 + break; 858 + if (strcmp(np->name, "pci") != 0) 859 + continue; 860 + addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", NULL); 861 + if (addrp == NULL) 862 + continue; 863 + naddr = prom_n_addr_cells(np); 864 + intack = addrp[naddr-1]; 865 + if (naddr > 1) 866 + intack |= ((unsigned long)addrp[naddr-2]) << 32; 867 + } 868 + if (intack) 869 + printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack); 870 + i8259_init(found, intack); 871 + of_node_put(found); 872 + set_irq_chained_handler(cascade, pseries_8259_cascade); 873 + } 874 + 875 + void __init xics_init_IRQ(void) 876 + { 877 + int i; 878 + struct device_node *np; 879 + u32 *ireg, ilen, indx = 0; 880 + int found = 0; 881 + 882 + ppc64_boot_msg(0x20, "XICS Init"); 883 + 884 + ibm_get_xive = rtas_token("ibm,get-xive"); 885 + ibm_set_xive = rtas_token("ibm,set-xive"); 886 + ibm_int_on = rtas_token("ibm,int-on"); 887 + ibm_int_off = rtas_token("ibm,int-off"); 888 + 889 + for_each_node_by_type(np, "PowerPC-External-Interrupt-Presentation") { 890 + found = 1; 891 + if (firmware_has_feature(FW_FEATURE_LPAR)) 892 + break; 893 + xics_init_one_node(np, &indx); 894 + } 895 + if (found == 0) 896 + return; 897 + 898 + xics_init_host(); 899 + 900 + /* Find the server numbers for the boot cpu. */ 901 + for (np = of_find_node_by_type(NULL, "cpu"); 902 + np; 903 + np = of_find_node_by_type(np, "cpu")) { 904 + ireg = (u32 *)get_property(np, "reg", &ilen); 905 + if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) { 906 + ireg = (u32 *)get_property(np, 907 + "ibm,ppc-interrupt-gserver#s", 908 + &ilen); 909 + i = ilen / sizeof(int); 910 + if (ireg && i > 0) { 911 + default_server = ireg[0]; 912 + /* take last element */ 913 + default_distrib_server = ireg[i-1]; 914 + } 915 + ireg = (u32 *)get_property(np, 916 + "ibm,interrupt-server#-size", NULL); 917 + if (ireg) 918 + interrupt_server_size = *ireg; 919 + break; 920 + } 921 + } 922 + of_node_put(np); 923 + 924 + if (firmware_has_feature(FW_FEATURE_LPAR)) 925 + ppc_md.get_irq = xics_get_irq_lpar; 926 + else 927 + ppc_md.get_irq = xics_get_irq_direct; 928 + 929 + xics_setup_cpu(); 930 + 931 + xics_setup_8259_cascade(); 932 + 933 + ppc64_boot_msg(0x21, "XICS Done"); 934 + } 935 + 936 + 937 + #ifdef CONFIG_SMP 938 + void xics_request_IPIs(void) 939 + { 940 + unsigned int ipi; 941 + 942 + ipi = irq_create_mapping(xics_host, XICS_IPI, 0); 943 + BUG_ON(ipi == NO_IRQ); 944 + 945 + /* 946 + * IPIs are marked IRQF_DISABLED as they must run with irqs 947 + * disabled 948 + */ 949 + set_irq_handler(ipi, handle_percpu_irq); 950 + if (firmware_has_feature(FW_FEATURE_LPAR)) 951 + request_irq(ipi, xics_ipi_action_lpar, IRQF_DISABLED, 952 + "IPI", NULL); 953 + else 954 + request_irq(ipi, xics_ipi_action_direct, IRQF_DISABLED, 955 + "IPI", NULL); 956 + } 957 + #endif /* CONFIG_SMP */ 958 + 959 + void xics_teardown_cpu(int secondary) 960 + { 961 + int cpu = smp_processor_id(); 962 + unsigned int ipi; 963 + struct irq_desc *desc; 964 + 965 + xics_set_cpu_priority(cpu, 0); 466 966 467 967 /* 468 968 * we need to EOI the IPI if we got here from kexec down IPI ··· 789 653 * should we be flagging idle loop instead? 790 654 * or creating some task to be scheduled? 791 655 */ 792 - ops->xirr_info_set(cpu, XICS_IPI); 656 + 657 + ipi = irq_find_mapping(xics_host, XICS_IPI); 658 + if (ipi == XICS_IRQ_SPURIOUS) 659 + return; 660 + desc = get_irq_desc(ipi); 661 + if (desc->chip && desc->chip->eoi) 662 + desc->chip->eoi(XICS_IPI); 793 663 794 664 /* 795 665 * Some machines need to have at least one cpu in the GIQ, ··· 803 661 */ 804 662 if (secondary) 805 663 rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, 806 - (1UL << interrupt_server_size) - 1 - 807 - default_distrib_server, 0); 664 + (1UL << interrupt_server_size) - 1 - 665 + default_distrib_server, 0); 808 666 } 809 667 810 668 #ifdef CONFIG_HOTPLUG_CPU ··· 816 674 unsigned int irq, virq, cpu = smp_processor_id(); 817 675 818 676 /* Reject any interrupt that was queued to us... */ 819 - ops->cppr_info(cpu, 0); 820 - iosync(); 677 + xics_set_cpu_priority(cpu, 0); 821 678 822 679 /* remove ourselves from the global interrupt queue */ 823 680 status = rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, ··· 824 683 WARN_ON(status < 0); 825 684 826 685 /* Allow IPIs again... */ 827 - ops->cppr_info(cpu, DEFAULT_PRIORITY); 828 - iosync(); 686 + xics_set_cpu_priority(cpu, DEFAULT_PRIORITY); 829 687 830 688 for_each_irq(virq) { 831 - irq_desc_t *desc; 689 + struct irq_desc *desc; 832 690 int xics_status[2]; 833 691 unsigned long flags; 834 692 835 693 /* We cant set affinity on ISA interrupts */ 836 - if (virq < irq_offset_value()) 694 + if (virq < NUM_ISA_INTERRUPTS) 837 695 continue; 838 - 839 - desc = get_irq_desc(virq); 840 - irq = virt_irq_to_real(irq_offset_down(virq)); 841 - 696 + if (irq_map[virq].host != xics_host) 697 + continue; 698 + irq = (unsigned int)irq_map[virq].hwirq; 842 699 /* We need to get IPIs still. */ 843 - if (irq == XICS_IPI || irq == NO_IRQ) 700 + if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 844 701 continue; 702 + desc = get_irq_desc(virq); 845 703 846 704 /* We only need to migrate enabled IRQS */ 847 705 if (desc == NULL || desc->chip == NULL
+10 -7
arch/powerpc/platforms/pseries/xics.h
··· 14 14 15 15 #include <linux/cache.h> 16 16 17 - void xics_init_IRQ(void); 18 - int xics_get_irq(struct pt_regs *); 19 - void xics_setup_cpu(void); 20 - void xics_teardown_cpu(int secondary); 21 - void xics_cause_IPI(int cpu); 22 - void xics_request_IPIs(void); 23 - void xics_migrate_irqs_away(void); 17 + extern void xics_init_IRQ(void); 18 + extern void xics_setup_cpu(void); 19 + extern void xics_teardown_cpu(int secondary); 20 + extern void xics_cause_IPI(int cpu); 21 + extern void xics_request_IPIs(void); 22 + extern void xics_migrate_irqs_away(void); 24 23 25 24 /* first argument is ignored for now*/ 26 25 void pSeriesLP_cppr_info(int n_cpu, u8 value); ··· 29 30 } ____cacheline_aligned; 30 31 31 32 extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; 33 + 34 + struct irq_desc; 35 + extern void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc, 36 + struct pt_regs *regs); 32 37 33 38 #endif /* _POWERPC_KERNEL_XICS_H */
+4 -1
arch/powerpc/sysdev/Makefile
··· 4 4 5 5 obj-$(CONFIG_MPIC) += mpic.o 6 6 obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o 7 - obj-$(CONFIG_PPC_I8259) += i8259.o 8 7 obj-$(CONFIG_PPC_MPC106) += grackle.o 9 8 obj-$(CONFIG_BOOKE) += dcr.o 10 9 obj-$(CONFIG_40x) += dcr.o ··· 13 14 obj-$(CONFIG_FSL_SOC) += fsl_soc.o 14 15 obj-$(CONFIG_PPC_TODC) += todc.o 15 16 obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 17 + 18 + ifeq ($(CONFIG_PPC_MERGE),y) 19 + obj-$(CONFIG_PPC_I8259) += i8259.o 20 + endif
+118 -45
arch/powerpc/sysdev/i8259.c
··· 6 6 * as published by the Free Software Foundation; either version 7 7 * 2 of the License, or (at your option) any later version. 8 8 */ 9 + #undef DEBUG 10 + 9 11 #include <linux/init.h> 10 12 #include <linux/ioport.h> 11 13 #include <linux/interrupt.h> 14 + #include <linux/kernel.h> 15 + #include <linux/delay.h> 12 16 #include <asm/io.h> 13 17 #include <asm/i8259.h> 18 + #include <asm/prom.h> 14 19 15 20 static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */ 16 21 ··· 25 20 26 21 static DEFINE_SPINLOCK(i8259_lock); 27 22 28 - static int i8259_pic_irq_offset; 23 + static struct device_node *i8259_node; 24 + static struct irq_host *i8259_host; 29 25 30 26 /* 31 27 * Acknowledge the IRQ using either the PCI host bridge's interrupt ··· 34 28 * which is called. It should be noted that polling is broken on some 35 29 * IBM and Motorola PReP boxes so we must use the int-ack feature on them. 36 30 */ 37 - int i8259_irq(struct pt_regs *regs) 31 + unsigned int i8259_irq(struct pt_regs *regs) 38 32 { 39 33 int irq; 40 - 41 - spin_lock(&i8259_lock); 34 + int lock = 0; 42 35 43 36 /* Either int-ack or poll for the IRQ */ 44 37 if (pci_intack) 45 38 irq = readb(pci_intack); 46 39 else { 40 + spin_lock(&i8259_lock); 41 + lock = 1; 42 + 47 43 /* Perform an interrupt acknowledge cycle on controller 1. */ 48 44 outb(0x0C, 0x20); /* prepare for poll */ 49 45 irq = inb(0x20) & 7; ··· 70 62 if (!pci_intack) 71 63 outb(0x0B, 0x20); /* ISR register */ 72 64 if(~inb(0x20) & 0x80) 73 - irq = -1; 74 - } 65 + irq = NO_IRQ; 66 + } else if (irq == 0xff) 67 + irq = NO_IRQ; 75 68 76 - spin_unlock(&i8259_lock); 77 - return irq + i8259_pic_irq_offset; 78 - } 79 - 80 - int i8259_irq_cascade(struct pt_regs *regs, void *unused) 81 - { 82 - return i8259_irq(regs); 69 + if (lock) 70 + spin_unlock(&i8259_lock); 71 + return irq; 83 72 } 84 73 85 74 static void i8259_mask_and_ack_irq(unsigned int irq_nr) ··· 84 79 unsigned long flags; 85 80 86 81 spin_lock_irqsave(&i8259_lock, flags); 87 - irq_nr -= i8259_pic_irq_offset; 88 82 if (irq_nr > 7) { 89 83 cached_A1 |= 1 << (irq_nr-8); 90 84 inb(0xA1); /* DUMMY */ ··· 109 105 { 110 106 unsigned long flags; 111 107 108 + pr_debug("i8259_mask_irq(%d)\n", irq_nr); 109 + 112 110 spin_lock_irqsave(&i8259_lock, flags); 113 - irq_nr -= i8259_pic_irq_offset; 114 111 if (irq_nr < 8) 115 112 cached_21 |= 1 << irq_nr; 116 113 else ··· 124 119 { 125 120 unsigned long flags; 126 121 122 + pr_debug("i8259_unmask_irq(%d)\n", irq_nr); 123 + 127 124 spin_lock_irqsave(&i8259_lock, flags); 128 - irq_nr -= i8259_pic_irq_offset; 129 125 if (irq_nr < 8) 130 126 cached_21 &= ~(1 << irq_nr); 131 127 else ··· 135 129 spin_unlock_irqrestore(&i8259_lock, flags); 136 130 } 137 131 138 - static void i8259_end_irq(unsigned int irq) 139 - { 140 - if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)) 141 - && irq_desc[irq].action) 142 - i8259_unmask_irq(irq); 143 - } 144 - 145 - struct hw_interrupt_type i8259_pic = { 146 - .typename = " i8259 ", 147 - .enable = i8259_unmask_irq, 148 - .disable = i8259_mask_irq, 149 - .ack = i8259_mask_and_ack_irq, 150 - .end = i8259_end_irq, 132 + static struct irq_chip i8259_pic = { 133 + .typename = " i8259 ", 134 + .mask = i8259_mask_irq, 135 + .unmask = i8259_unmask_irq, 136 + .mask_ack = i8259_mask_and_ack_irq, 151 137 }; 152 138 153 139 static struct resource pic1_iores = { ··· 163 165 .flags = IORESOURCE_BUSY, 164 166 }; 165 167 166 - static struct irqaction i8259_irqaction = { 167 - .handler = no_action, 168 - .flags = IRQF_DISABLED, 169 - .mask = CPU_MASK_NONE, 170 - .name = "82c59 secondary cascade", 168 + static int i8259_host_match(struct irq_host *h, struct device_node *node) 169 + { 170 + return i8259_node == NULL || i8259_node == node; 171 + } 172 + 173 + static int i8259_host_map(struct irq_host *h, unsigned int virq, 174 + irq_hw_number_t hw, unsigned int flags) 175 + { 176 + pr_debug("i8259_host_map(%d, 0x%lx)\n", virq, hw); 177 + 178 + /* We block the internal cascade */ 179 + if (hw == 2) 180 + get_irq_desc(virq)->status |= IRQ_NOREQUEST; 181 + 182 + /* We use the level stuff only for now, we might want to 183 + * be more cautious here but that works for now 184 + */ 185 + get_irq_desc(virq)->status |= IRQ_LEVEL; 186 + set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq); 187 + return 0; 188 + } 189 + 190 + static void i8259_host_unmap(struct irq_host *h, unsigned int virq) 191 + { 192 + /* Make sure irq is masked in hardware */ 193 + i8259_mask_irq(virq); 194 + 195 + /* remove chip and handler */ 196 + set_irq_chip_and_handler(virq, NULL, NULL); 197 + 198 + /* Make sure it's completed */ 199 + synchronize_irq(virq); 200 + } 201 + 202 + static int i8259_host_xlate(struct irq_host *h, struct device_node *ct, 203 + u32 *intspec, unsigned int intsize, 204 + irq_hw_number_t *out_hwirq, unsigned int *out_flags) 205 + { 206 + static unsigned char map_isa_senses[4] = { 207 + IRQ_TYPE_LEVEL_LOW, 208 + IRQ_TYPE_LEVEL_HIGH, 209 + IRQ_TYPE_EDGE_FALLING, 210 + IRQ_TYPE_EDGE_RISING, 211 + }; 212 + 213 + *out_hwirq = intspec[0]; 214 + if (intsize > 1 && intspec[1] < 4) 215 + *out_flags = map_isa_senses[intspec[1]]; 216 + else 217 + *out_flags = IRQ_TYPE_NONE; 218 + 219 + return 0; 220 + } 221 + 222 + static struct irq_host_ops i8259_host_ops = { 223 + .match = i8259_host_match, 224 + .map = i8259_host_map, 225 + .unmap = i8259_host_unmap, 226 + .xlate = i8259_host_xlate, 171 227 }; 172 228 173 - /* 174 - * i8259_init() 175 - * intack_addr - PCI interrupt acknowledge (real) address which will return 176 - * the active irq from the 8259 229 + /**** 230 + * i8259_init - Initialize the legacy controller 231 + * @node: device node of the legacy PIC (can be NULL, but then, it will match 232 + * all interrupts, so beware) 233 + * @intack_addr: PCI interrupt acknowledge (real) address which will return 234 + * the active irq from the 8259 177 235 */ 178 - void __init i8259_init(unsigned long intack_addr, int offset) 236 + void i8259_init(struct device_node *node, unsigned long intack_addr) 179 237 { 180 238 unsigned long flags; 181 - int i; 182 239 240 + /* initialize the controller */ 183 241 spin_lock_irqsave(&i8259_lock, flags); 184 - i8259_pic_irq_offset = offset; 242 + 243 + /* Mask all first */ 244 + outb(0xff, 0xA1); 245 + outb(0xff, 0x21); 185 246 186 247 /* init master interrupt controller */ 187 248 outb(0x11, 0x20); /* Start init sequence */ ··· 254 197 outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */ 255 198 outb(0x01, 0xA1); /* Select 8086 mode */ 256 199 200 + /* That thing is slow */ 201 + udelay(100); 202 + 257 203 /* always read ISR */ 258 204 outb(0x0B, 0x20); 259 205 outb(0x0B, 0xA0); 260 206 261 - /* Mask all interrupts */ 207 + /* Unmask the internal cascade */ 208 + cached_21 &= ~(1 << 2); 209 + 210 + /* Set interrupt masks */ 262 211 outb(cached_A1, 0xA1); 263 212 outb(cached_21, 0x21); 264 213 265 214 spin_unlock_irqrestore(&i8259_lock, flags); 266 215 267 - for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) 268 - irq_desc[offset + i].chip = &i8259_pic; 216 + /* create a legacy host */ 217 + if (node) 218 + i8259_node = of_node_get(node); 219 + i8259_host = irq_alloc_host(IRQ_HOST_MAP_LEGACY, 0, &i8259_host_ops, 0); 220 + if (i8259_host == NULL) { 221 + printk(KERN_ERR "i8259: failed to allocate irq host !\n"); 222 + return; 223 + } 269 224 270 225 /* reserve our resources */ 271 - setup_irq(offset + 2, &i8259_irqaction); 226 + /* XXX should we continue doing that ? it seems to cause problems 227 + * with further requesting of PCI IO resources for that range... 228 + * need to look into it. 229 + */ 272 230 request_resource(&ioport_resource, &pic1_iores); 273 231 request_resource(&ioport_resource, &pic2_iores); 274 232 request_resource(&ioport_resource, &pic_edgectrl_iores); ··· 291 219 if (intack_addr != 0) 292 220 pci_intack = ioremap(intack_addr, 1); 293 221 222 + printk(KERN_INFO "i8259 legacy interrupt controller initialized\n"); 294 223 }
+297 -195
arch/powerpc/sysdev/mpic.c
··· 100 100 101 101 if (mpic->flags & MPIC_PRIMARY) 102 102 cpu = hard_smp_processor_id(); 103 - 104 - return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN, mpic->cpuregs[cpu], reg); 103 + return _mpic_read(mpic->flags & MPIC_BIG_ENDIAN, 104 + mpic->cpuregs[cpu], reg); 105 105 } 106 106 107 107 static inline void _mpic_cpu_write(struct mpic *mpic, unsigned int reg, u32 value) ··· 340 340 #endif /* CONFIG_MPIC_BROKEN_U3 */ 341 341 342 342 343 + #define mpic_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) 344 + 343 345 /* Find an mpic associated with a given linux interrupt */ 344 346 static struct mpic *mpic_find(unsigned int irq, unsigned int *is_ipi) 345 347 { 346 - struct mpic *mpic = mpics; 348 + unsigned int src = mpic_irq_to_hw(irq); 347 349 348 - while(mpic) { 349 - /* search IPIs first since they may override the main interrupts */ 350 - if (irq >= mpic->ipi_offset && irq < (mpic->ipi_offset + 4)) { 351 - if (is_ipi) 352 - *is_ipi = 1; 353 - return mpic; 354 - } 355 - if (irq >= mpic->irq_offset && 356 - irq < (mpic->irq_offset + mpic->irq_count)) { 357 - if (is_ipi) 358 - *is_ipi = 0; 359 - return mpic; 360 - } 361 - mpic = mpic -> next; 362 - } 363 - return NULL; 350 + if (irq < NUM_ISA_INTERRUPTS) 351 + return NULL; 352 + if (is_ipi) 353 + *is_ipi = (src >= MPIC_VEC_IPI_0 && src <= MPIC_VEC_IPI_3); 354 + 355 + return irq_desc[irq].chip_data; 364 356 } 365 357 366 358 /* Convert a cpu mask from logical to physical cpu numbers. */ ··· 370 378 /* Get the mpic structure from the IPI number */ 371 379 static inline struct mpic * mpic_from_ipi(unsigned int ipi) 372 380 { 373 - return container_of(irq_desc[ipi].chip, struct mpic, hc_ipi); 381 + return irq_desc[ipi].chip_data; 374 382 } 375 383 #endif 376 384 377 385 /* Get the mpic structure from the irq number */ 378 386 static inline struct mpic * mpic_from_irq(unsigned int irq) 379 387 { 380 - return container_of(irq_desc[irq].chip, struct mpic, hc_irq); 388 + return irq_desc[irq].chip_data; 381 389 } 382 390 383 391 /* Send an EOI */ ··· 390 398 #ifdef CONFIG_SMP 391 399 static irqreturn_t mpic_ipi_action(int irq, void *dev_id, struct pt_regs *regs) 392 400 { 393 - struct mpic *mpic = dev_id; 394 - 395 - smp_message_recv(irq - mpic->ipi_offset, regs); 401 + smp_message_recv(mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0, regs); 396 402 return IRQ_HANDLED; 397 403 } 398 404 #endif /* CONFIG_SMP */ ··· 400 410 */ 401 411 402 412 403 - static void mpic_enable_irq(unsigned int irq) 413 + static void mpic_unmask_irq(unsigned int irq) 404 414 { 405 415 unsigned int loops = 100000; 406 416 struct mpic *mpic = mpic_from_irq(irq); 407 - unsigned int src = irq - mpic->irq_offset; 417 + unsigned int src = mpic_irq_to_hw(irq); 408 418 409 419 DBG("%p: %s: enable_irq: %d (src %d)\n", mpic, mpic->name, irq, src); 410 420 ··· 419 429 break; 420 430 } 421 431 } while(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK); 422 - 423 - #ifdef CONFIG_MPIC_BROKEN_U3 424 - if (mpic->flags & MPIC_BROKEN_U3) { 425 - unsigned int src = irq - mpic->irq_offset; 426 - if (mpic_is_ht_interrupt(mpic, src) && 427 - (irq_desc[irq].status & IRQ_LEVEL)) 428 - mpic_ht_end_irq(mpic, src); 429 - } 430 - #endif /* CONFIG_MPIC_BROKEN_U3 */ 431 432 } 432 433 433 - static unsigned int mpic_startup_irq(unsigned int irq) 434 - { 435 - #ifdef CONFIG_MPIC_BROKEN_U3 436 - struct mpic *mpic = mpic_from_irq(irq); 437 - unsigned int src = irq - mpic->irq_offset; 438 - #endif /* CONFIG_MPIC_BROKEN_U3 */ 439 - 440 - mpic_enable_irq(irq); 441 - 442 - #ifdef CONFIG_MPIC_BROKEN_U3 443 - if (mpic_is_ht_interrupt(mpic, src)) 444 - mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status); 445 - #endif /* CONFIG_MPIC_BROKEN_U3 */ 446 - 447 - return 0; 448 - } 449 - 450 - static void mpic_disable_irq(unsigned int irq) 434 + static void mpic_mask_irq(unsigned int irq) 451 435 { 452 436 unsigned int loops = 100000; 453 437 struct mpic *mpic = mpic_from_irq(irq); 454 - unsigned int src = irq - mpic->irq_offset; 438 + unsigned int src = mpic_irq_to_hw(irq); 455 439 456 440 DBG("%s: disable_irq: %d (src %d)\n", mpic->name, irq, src); 457 441 ··· 442 478 } while(!(mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) & MPIC_VECPRI_MASK)); 443 479 } 444 480 445 - static void mpic_shutdown_irq(unsigned int irq) 446 - { 447 - #ifdef CONFIG_MPIC_BROKEN_U3 448 - struct mpic *mpic = mpic_from_irq(irq); 449 - unsigned int src = irq - mpic->irq_offset; 450 - 451 - if (mpic_is_ht_interrupt(mpic, src)) 452 - mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status); 453 - 454 - #endif /* CONFIG_MPIC_BROKEN_U3 */ 455 - 456 - mpic_disable_irq(irq); 457 - } 458 - 459 481 static void mpic_end_irq(unsigned int irq) 460 482 { 461 483 struct mpic *mpic = mpic_from_irq(irq); ··· 454 504 * latched another edge interrupt coming in anyway 455 505 */ 456 506 457 - #ifdef CONFIG_MPIC_BROKEN_U3 458 - if (mpic->flags & MPIC_BROKEN_U3) { 459 - unsigned int src = irq - mpic->irq_offset; 460 - if (mpic_is_ht_interrupt(mpic, src) && 461 - (irq_desc[irq].status & IRQ_LEVEL)) 462 - mpic_ht_end_irq(mpic, src); 463 - } 464 - #endif /* CONFIG_MPIC_BROKEN_U3 */ 465 - 466 507 mpic_eoi(mpic); 467 508 } 468 509 510 + #ifdef CONFIG_MPIC_BROKEN_U3 511 + 512 + static void mpic_unmask_ht_irq(unsigned int irq) 513 + { 514 + struct mpic *mpic = mpic_from_irq(irq); 515 + unsigned int src = mpic_irq_to_hw(irq); 516 + 517 + mpic_unmask_irq(irq); 518 + 519 + if (irq_desc[irq].status & IRQ_LEVEL) 520 + mpic_ht_end_irq(mpic, src); 521 + } 522 + 523 + static unsigned int mpic_startup_ht_irq(unsigned int irq) 524 + { 525 + struct mpic *mpic = mpic_from_irq(irq); 526 + unsigned int src = mpic_irq_to_hw(irq); 527 + 528 + mpic_unmask_irq(irq); 529 + mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status); 530 + 531 + return 0; 532 + } 533 + 534 + static void mpic_shutdown_ht_irq(unsigned int irq) 535 + { 536 + struct mpic *mpic = mpic_from_irq(irq); 537 + unsigned int src = mpic_irq_to_hw(irq); 538 + 539 + mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status); 540 + mpic_mask_irq(irq); 541 + } 542 + 543 + static void mpic_end_ht_irq(unsigned int irq) 544 + { 545 + struct mpic *mpic = mpic_from_irq(irq); 546 + unsigned int src = mpic_irq_to_hw(irq); 547 + 548 + #ifdef DEBUG_IRQ 549 + DBG("%s: end_irq: %d\n", mpic->name, irq); 550 + #endif 551 + /* We always EOI on end_irq() even for edge interrupts since that 552 + * should only lower the priority, the MPIC should have properly 553 + * latched another edge interrupt coming in anyway 554 + */ 555 + 556 + if (irq_desc[irq].status & IRQ_LEVEL) 557 + mpic_ht_end_irq(mpic, src); 558 + mpic_eoi(mpic); 559 + } 560 + 561 + #endif /* CONFIG_MPIC_BROKEN_U3 */ 562 + 469 563 #ifdef CONFIG_SMP 470 564 471 - static void mpic_enable_ipi(unsigned int irq) 565 + static void mpic_unmask_ipi(unsigned int irq) 472 566 { 473 567 struct mpic *mpic = mpic_from_ipi(irq); 474 - unsigned int src = irq - mpic->ipi_offset; 568 + unsigned int src = mpic_irq_to_hw(irq) - MPIC_VEC_IPI_0; 475 569 476 570 DBG("%s: enable_ipi: %d (ipi %d)\n", mpic->name, irq, src); 477 571 mpic_ipi_write(src, mpic_ipi_read(src) & ~MPIC_VECPRI_MASK); 478 572 } 479 573 480 - static void mpic_disable_ipi(unsigned int irq) 574 + static void mpic_mask_ipi(unsigned int irq) 481 575 { 482 576 /* NEVER disable an IPI... that's just plain wrong! */ 483 577 } ··· 545 551 static void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) 546 552 { 547 553 struct mpic *mpic = mpic_from_irq(irq); 554 + unsigned int src = mpic_irq_to_hw(irq); 548 555 549 556 cpumask_t tmp; 550 557 551 558 cpus_and(tmp, cpumask, cpu_online_map); 552 559 553 - mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_DESTINATION, 560 + mpic_irq_write(src, MPIC_IRQ_DESTINATION, 554 561 mpic_physmask(cpus_addr(tmp)[0])); 555 562 } 556 563 564 + static unsigned int mpic_flags_to_vecpri(unsigned int flags, int *level) 565 + { 566 + unsigned int vecpri; 567 + 568 + /* Now convert sense value */ 569 + switch(flags & IRQ_TYPE_SENSE_MASK) { 570 + case IRQ_TYPE_EDGE_RISING: 571 + vecpri = MPIC_VECPRI_SENSE_EDGE | 572 + MPIC_VECPRI_POLARITY_POSITIVE; 573 + *level = 0; 574 + break; 575 + case IRQ_TYPE_EDGE_FALLING: 576 + vecpri = MPIC_VECPRI_SENSE_EDGE | 577 + MPIC_VECPRI_POLARITY_NEGATIVE; 578 + *level = 0; 579 + break; 580 + case IRQ_TYPE_LEVEL_HIGH: 581 + vecpri = MPIC_VECPRI_SENSE_LEVEL | 582 + MPIC_VECPRI_POLARITY_POSITIVE; 583 + *level = 1; 584 + break; 585 + case IRQ_TYPE_LEVEL_LOW: 586 + default: 587 + vecpri = MPIC_VECPRI_SENSE_LEVEL | 588 + MPIC_VECPRI_POLARITY_NEGATIVE; 589 + *level = 1; 590 + } 591 + return vecpri; 592 + } 593 + 594 + static struct irq_chip mpic_irq_chip = { 595 + .mask = mpic_mask_irq, 596 + .unmask = mpic_unmask_irq, 597 + .eoi = mpic_end_irq, 598 + }; 599 + 600 + #ifdef CONFIG_SMP 601 + static struct irq_chip mpic_ipi_chip = { 602 + .mask = mpic_mask_ipi, 603 + .unmask = mpic_unmask_ipi, 604 + .eoi = mpic_end_ipi, 605 + }; 606 + #endif /* CONFIG_SMP */ 607 + 608 + #ifdef CONFIG_MPIC_BROKEN_U3 609 + static struct irq_chip mpic_irq_ht_chip = { 610 + .startup = mpic_startup_ht_irq, 611 + .shutdown = mpic_shutdown_ht_irq, 612 + .mask = mpic_mask_irq, 613 + .unmask = mpic_unmask_ht_irq, 614 + .eoi = mpic_end_ht_irq, 615 + }; 616 + #endif /* CONFIG_MPIC_BROKEN_U3 */ 617 + 618 + 619 + static int mpic_host_match(struct irq_host *h, struct device_node *node) 620 + { 621 + struct mpic *mpic = h->host_data; 622 + 623 + /* Exact match, unless mpic node is NULL */ 624 + return mpic->of_node == NULL || mpic->of_node == node; 625 + } 626 + 627 + static int mpic_host_map(struct irq_host *h, unsigned int virq, 628 + irq_hw_number_t hw, unsigned int flags) 629 + { 630 + struct irq_desc *desc = get_irq_desc(virq); 631 + struct irq_chip *chip; 632 + struct mpic *mpic = h->host_data; 633 + unsigned int vecpri = MPIC_VECPRI_SENSE_LEVEL | 634 + MPIC_VECPRI_POLARITY_NEGATIVE; 635 + int level; 636 + 637 + pr_debug("mpic: map virq %d, hwirq 0x%lx, flags: 0x%x\n", 638 + virq, hw, flags); 639 + 640 + if (hw == MPIC_VEC_SPURRIOUS) 641 + return -EINVAL; 642 + #ifdef CONFIG_SMP 643 + else if (hw >= MPIC_VEC_IPI_0) { 644 + WARN_ON(!(mpic->flags & MPIC_PRIMARY)); 645 + 646 + pr_debug("mpic: mapping as IPI\n"); 647 + set_irq_chip_data(virq, mpic); 648 + set_irq_chip_and_handler(virq, &mpic->hc_ipi, 649 + handle_percpu_irq); 650 + return 0; 651 + } 652 + #endif /* CONFIG_SMP */ 653 + 654 + if (hw >= mpic->irq_count) 655 + return -EINVAL; 656 + 657 + /* If no sense provided, check default sense array */ 658 + if (((flags & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_NONE) && 659 + mpic->senses && hw < mpic->senses_count) 660 + flags |= mpic->senses[hw]; 661 + 662 + vecpri = mpic_flags_to_vecpri(flags, &level); 663 + if (level) 664 + desc->status |= IRQ_LEVEL; 665 + chip = &mpic->hc_irq; 666 + 667 + #ifdef CONFIG_MPIC_BROKEN_U3 668 + /* Check for HT interrupts, override vecpri */ 669 + if (mpic_is_ht_interrupt(mpic, hw)) { 670 + vecpri &= ~(MPIC_VECPRI_SENSE_MASK | 671 + MPIC_VECPRI_POLARITY_MASK); 672 + vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; 673 + chip = &mpic->hc_ht_irq; 674 + } 675 + #endif 676 + 677 + /* Reconfigure irq */ 678 + vecpri |= MPIC_VECPRI_MASK | hw | (8 << MPIC_VECPRI_PRIORITY_SHIFT); 679 + mpic_irq_write(hw, MPIC_IRQ_VECTOR_PRI, vecpri); 680 + 681 + pr_debug("mpic: mapping as IRQ\n"); 682 + 683 + set_irq_chip_data(virq, mpic); 684 + set_irq_chip_and_handler(virq, chip, handle_fasteoi_irq); 685 + return 0; 686 + } 687 + 688 + static int mpic_host_xlate(struct irq_host *h, struct device_node *ct, 689 + u32 *intspec, unsigned int intsize, 690 + irq_hw_number_t *out_hwirq, unsigned int *out_flags) 691 + 692 + { 693 + static unsigned char map_mpic_senses[4] = { 694 + IRQ_TYPE_EDGE_RISING, 695 + IRQ_TYPE_LEVEL_LOW, 696 + IRQ_TYPE_LEVEL_HIGH, 697 + IRQ_TYPE_EDGE_FALLING, 698 + }; 699 + 700 + *out_hwirq = intspec[0]; 701 + if (intsize > 1 && intspec[1] < 4) 702 + *out_flags = map_mpic_senses[intspec[1]]; 703 + else 704 + *out_flags = IRQ_TYPE_NONE; 705 + 706 + return 0; 707 + } 708 + 709 + static struct irq_host_ops mpic_host_ops = { 710 + .match = mpic_host_match, 711 + .map = mpic_host_map, 712 + .xlate = mpic_host_xlate, 713 + }; 557 714 558 715 /* 559 716 * Exported functions 560 717 */ 561 718 562 - 563 - struct mpic * __init mpic_alloc(unsigned long phys_addr, 719 + struct mpic * __init mpic_alloc(struct device_node *node, 720 + unsigned long phys_addr, 564 721 unsigned int flags, 565 722 unsigned int isu_size, 566 - unsigned int irq_offset, 567 723 unsigned int irq_count, 568 - unsigned int ipi_offset, 569 - unsigned char *senses, 570 - unsigned int senses_count, 571 724 const char *name) 572 725 { 573 726 struct mpic *mpic; ··· 726 585 if (mpic == NULL) 727 586 return NULL; 728 587 729 - 730 588 memset(mpic, 0, sizeof(struct mpic)); 731 589 mpic->name = name; 590 + mpic->of_node = node ? of_node_get(node) : NULL; 732 591 592 + mpic->irqhost = irq_alloc_host(IRQ_HOST_MAP_LINEAR, 256, 593 + &mpic_host_ops, 594 + MPIC_VEC_SPURRIOUS); 595 + if (mpic->irqhost == NULL) { 596 + of_node_put(node); 597 + return NULL; 598 + } 599 + 600 + mpic->irqhost->host_data = mpic; 601 + mpic->hc_irq = mpic_irq_chip; 733 602 mpic->hc_irq.typename = name; 734 - mpic->hc_irq.startup = mpic_startup_irq; 735 - mpic->hc_irq.shutdown = mpic_shutdown_irq; 736 - mpic->hc_irq.enable = mpic_enable_irq; 737 - mpic->hc_irq.disable = mpic_disable_irq; 738 - mpic->hc_irq.end = mpic_end_irq; 739 603 if (flags & MPIC_PRIMARY) 740 604 mpic->hc_irq.set_affinity = mpic_set_affinity; 605 + #ifdef CONFIG_MPIC_BROKEN_U3 606 + mpic->hc_ht_irq = mpic_irq_ht_chip; 607 + mpic->hc_ht_irq.typename = name; 608 + if (flags & MPIC_PRIMARY) 609 + mpic->hc_ht_irq.set_affinity = mpic_set_affinity; 610 + #endif /* CONFIG_MPIC_BROKEN_U3 */ 741 611 #ifdef CONFIG_SMP 612 + mpic->hc_ipi = mpic_ipi_chip; 742 613 mpic->hc_ipi.typename = name; 743 - mpic->hc_ipi.enable = mpic_enable_ipi; 744 - mpic->hc_ipi.disable = mpic_disable_ipi; 745 - mpic->hc_ipi.end = mpic_end_ipi; 746 614 #endif /* CONFIG_SMP */ 747 615 748 616 mpic->flags = flags; 749 617 mpic->isu_size = isu_size; 750 - mpic->irq_offset = irq_offset; 751 618 mpic->irq_count = irq_count; 752 - mpic->ipi_offset = ipi_offset; 753 619 mpic->num_sources = 0; /* so far */ 754 - mpic->senses = senses; 755 - mpic->senses_count = senses_count; 756 620 757 621 /* Map the global registers */ 758 622 mpic->gregs = ioremap(phys_addr + MPIC_GREG_BASE, 0x1000); ··· 825 679 mpic->next = mpics; 826 680 mpics = mpic; 827 681 828 - if (flags & MPIC_PRIMARY) 682 + if (flags & MPIC_PRIMARY) { 829 683 mpic_primary = mpic; 684 + irq_set_default_host(mpic->irqhost); 685 + } 830 686 831 687 return mpic; 832 688 } ··· 845 697 mpic->num_sources = isu_first + mpic->isu_size; 846 698 } 847 699 848 - void __init mpic_setup_cascade(unsigned int irq, mpic_cascade_t handler, 849 - void *data) 700 + void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count) 850 701 { 851 - struct mpic *mpic = mpic_find(irq, NULL); 852 - unsigned long flags; 853 - 854 - /* Synchronization here is a bit dodgy, so don't try to replace cascade 855 - * interrupts on the fly too often ... but normally it's set up at boot. 856 - */ 857 - spin_lock_irqsave(&mpic_lock, flags); 858 - if (mpic->cascade) 859 - mpic_disable_irq(mpic->cascade_vec + mpic->irq_offset); 860 - mpic->cascade = NULL; 861 - wmb(); 862 - mpic->cascade_vec = irq - mpic->irq_offset; 863 - mpic->cascade_data = data; 864 - wmb(); 865 - mpic->cascade = handler; 866 - mpic_enable_irq(irq); 867 - spin_unlock_irqrestore(&mpic_lock, flags); 702 + mpic->senses = senses; 703 + mpic->senses_count = count; 868 704 } 869 705 870 706 void __init mpic_init(struct mpic *mpic) ··· 856 724 int i; 857 725 858 726 BUG_ON(mpic->num_sources == 0); 727 + WARN_ON(mpic->num_sources > MPIC_VEC_IPI_0); 728 + 729 + /* Sanitize source count */ 730 + if (mpic->num_sources > MPIC_VEC_IPI_0) 731 + mpic->num_sources = MPIC_VEC_IPI_0; 859 732 860 733 printk(KERN_INFO "mpic: Initializing for %d sources\n", mpic->num_sources); 861 734 ··· 884 747 MPIC_VECPRI_MASK | 885 748 (10 << MPIC_VECPRI_PRIORITY_SHIFT) | 886 749 (MPIC_VEC_IPI_0 + i)); 887 - #ifdef CONFIG_SMP 888 - if (!(mpic->flags & MPIC_PRIMARY)) 889 - continue; 890 - irq_desc[mpic->ipi_offset+i].status |= IRQ_PER_CPU; 891 - irq_desc[mpic->ipi_offset+i].chip = &mpic->hc_ipi; 892 - #endif /* CONFIG_SMP */ 893 750 } 894 751 895 752 /* Initialize interrupt sources */ ··· 894 763 /* Do the HT PIC fixups on U3 broken mpic */ 895 764 DBG("MPIC flags: %x\n", mpic->flags); 896 765 if ((mpic->flags & MPIC_BROKEN_U3) && (mpic->flags & MPIC_PRIMARY)) 897 - mpic_scan_ht_pics(mpic); 766 + mpic_scan_ht_pics(mpic); 898 767 #endif /* CONFIG_MPIC_BROKEN_U3 */ 899 768 900 769 for (i = 0; i < mpic->num_sources; i++) { 901 770 /* start with vector = source number, and masked */ 902 771 u32 vecpri = MPIC_VECPRI_MASK | i | (8 << MPIC_VECPRI_PRIORITY_SHIFT); 903 - int level = 0; 772 + int level = 1; 904 773 905 - /* if it's an IPI, we skip it */ 906 - if ((mpic->irq_offset + i) >= (mpic->ipi_offset + i) && 907 - (mpic->irq_offset + i) < (mpic->ipi_offset + i + 4)) 908 - continue; 909 - 910 774 /* do senses munging */ 911 - if (mpic->senses && i < mpic->senses_count) { 912 - if (mpic->senses[i] & IRQ_SENSE_LEVEL) 913 - vecpri |= MPIC_VECPRI_SENSE_LEVEL; 914 - if (mpic->senses[i] & IRQ_POLARITY_POSITIVE) 915 - vecpri |= MPIC_VECPRI_POLARITY_POSITIVE; 916 - } else 775 + if (mpic->senses && i < mpic->senses_count) 776 + vecpri = mpic_flags_to_vecpri(mpic->senses[i], 777 + &level); 778 + else 917 779 vecpri |= MPIC_VECPRI_SENSE_LEVEL; 918 - 919 - /* remember if it was a level interrupts */ 920 - level = (vecpri & MPIC_VECPRI_SENSE_LEVEL); 921 780 922 781 /* deal with broken U3 */ 923 782 if (mpic->flags & MPIC_BROKEN_U3) { ··· 929 808 mpic_irq_write(i, MPIC_IRQ_VECTOR_PRI, vecpri); 930 809 mpic_irq_write(i, MPIC_IRQ_DESTINATION, 931 810 1 << hard_smp_processor_id()); 932 - 933 - /* init linux descriptors */ 934 - if (i < mpic->irq_count) { 935 - irq_desc[mpic->irq_offset+i].status = level ? IRQ_LEVEL : 0; 936 - irq_desc[mpic->irq_offset+i].chip = &mpic->hc_irq; 937 - } 938 811 } 939 812 940 813 /* Init spurrious vector */ ··· 969 854 { 970 855 int is_ipi; 971 856 struct mpic *mpic = mpic_find(irq, &is_ipi); 857 + unsigned int src = mpic_irq_to_hw(irq); 972 858 unsigned long flags; 973 859 u32 reg; 974 860 975 861 spin_lock_irqsave(&mpic_lock, flags); 976 862 if (is_ipi) { 977 - reg = mpic_ipi_read(irq - mpic->ipi_offset) & 863 + reg = mpic_ipi_read(src - MPIC_VEC_IPI_0) & 978 864 ~MPIC_VECPRI_PRIORITY_MASK; 979 - mpic_ipi_write(irq - mpic->ipi_offset, 865 + mpic_ipi_write(src - MPIC_VEC_IPI_0, 980 866 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); 981 867 } else { 982 - reg = mpic_irq_read(irq - mpic->irq_offset,MPIC_IRQ_VECTOR_PRI) 868 + reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI) 983 869 & ~MPIC_VECPRI_PRIORITY_MASK; 984 - mpic_irq_write(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI, 870 + mpic_irq_write(src, MPIC_IRQ_VECTOR_PRI, 985 871 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); 986 872 } 987 873 spin_unlock_irqrestore(&mpic_lock, flags); ··· 992 876 { 993 877 int is_ipi; 994 878 struct mpic *mpic = mpic_find(irq, &is_ipi); 879 + unsigned int src = mpic_irq_to_hw(irq); 995 880 unsigned long flags; 996 881 u32 reg; 997 882 998 883 spin_lock_irqsave(&mpic_lock, flags); 999 884 if (is_ipi) 1000 - reg = mpic_ipi_read(irq - mpic->ipi_offset); 885 + reg = mpic_ipi_read(src = MPIC_VEC_IPI_0); 1001 886 else 1002 - reg = mpic_irq_read(irq - mpic->irq_offset, MPIC_IRQ_VECTOR_PRI); 887 + reg = mpic_irq_read(src, MPIC_IRQ_VECTOR_PRI); 1003 888 spin_unlock_irqrestore(&mpic_lock, flags); 1004 889 return (reg & MPIC_VECPRI_PRIORITY_MASK) >> MPIC_VECPRI_PRIORITY_SHIFT; 1005 890 } ··· 1095 978 mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0])); 1096 979 } 1097 980 1098 - int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) 981 + unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs) 1099 982 { 1100 - u32 irq; 983 + u32 src; 1101 984 1102 - irq = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK; 985 + src = mpic_cpu_read(MPIC_CPU_INTACK) & MPIC_VECPRI_VECTOR_MASK; 1103 986 #ifdef DEBUG_LOW 1104 - DBG("%s: get_one_irq(): %d\n", mpic->name, irq); 987 + DBG("%s: get_one_irq(): %d\n", mpic->name, src); 1105 988 #endif 1106 - if (mpic->cascade && irq == mpic->cascade_vec) { 1107 - #ifdef DEBUG_LOW 1108 - DBG("%s: cascading ...\n", mpic->name); 1109 - #endif 1110 - irq = mpic->cascade(regs, mpic->cascade_data); 1111 - mpic_eoi(mpic); 1112 - return irq; 1113 - } 1114 - if (unlikely(irq == MPIC_VEC_SPURRIOUS)) 1115 - return -1; 1116 - if (irq < MPIC_VEC_IPI_0) { 1117 - #ifdef DEBUG_IRQ 1118 - DBG("%s: irq %d\n", mpic->name, irq + mpic->irq_offset); 1119 - #endif 1120 - return irq + mpic->irq_offset; 1121 - } 1122 - #ifdef DEBUG_IPI 1123 - DBG("%s: ipi %d !\n", mpic->name, irq - MPIC_VEC_IPI_0); 1124 - #endif 1125 - return irq - MPIC_VEC_IPI_0 + mpic->ipi_offset; 989 + if (unlikely(src == MPIC_VEC_SPURRIOUS)) 990 + return NO_IRQ; 991 + return irq_linear_revmap(mpic->irqhost, src); 1126 992 } 1127 993 1128 - int mpic_get_irq(struct pt_regs *regs) 994 + unsigned int mpic_get_irq(struct pt_regs *regs) 1129 995 { 1130 996 struct mpic *mpic = mpic_primary; 1131 997 ··· 1122 1022 void mpic_request_ipis(void) 1123 1023 { 1124 1024 struct mpic *mpic = mpic_primary; 1125 - 1025 + int i; 1026 + static char *ipi_names[] = { 1027 + "IPI0 (call function)", 1028 + "IPI1 (reschedule)", 1029 + "IPI2 (unused)", 1030 + "IPI3 (debugger break)", 1031 + }; 1126 1032 BUG_ON(mpic == NULL); 1127 - 1128 - printk("requesting IPIs ... \n"); 1129 1033 1130 - /* 1131 - * IPIs are marked IRQF_DISABLED as they must run with irqs 1132 - * disabled 1133 - */ 1134 - request_irq(mpic->ipi_offset+0, mpic_ipi_action, IRQF_DISABLED, 1135 - "IPI0 (call function)", mpic); 1136 - request_irq(mpic->ipi_offset+1, mpic_ipi_action, IRQF_DISABLED, 1137 - "IPI1 (reschedule)", mpic); 1138 - request_irq(mpic->ipi_offset+2, mpic_ipi_action, IRQF_DISABLED, 1139 - "IPI2 (unused)", mpic); 1140 - request_irq(mpic->ipi_offset+3, mpic_ipi_action, IRQF_DISABLED, 1141 - "IPI3 (debugger break)", mpic); 1034 + printk(KERN_INFO "mpic: requesting IPIs ... \n"); 1142 1035 1143 - printk("IPIs requested... \n"); 1036 + for (i = 0; i < 4; i++) { 1037 + unsigned int vipi = irq_create_mapping(mpic->irqhost, 1038 + MPIC_VEC_IPI_0 + i, 0); 1039 + if (vipi == NO_IRQ) { 1040 + printk(KERN_ERR "Failed to map IPI %d\n", i); 1041 + break; 1042 + } 1043 + request_irq(vipi, mpic_ipi_action, IRQF_DISABLED, 1044 + ipi_names[i], mpic); 1045 + } 1144 1046 } 1145 1047 1146 1048 void smp_mpic_message_pass(int target, int msg)
+2
arch/ppc/syslib/Makefile
··· 104 104 ifeq ($(CONFIG_PPC_MPC52xx),y) 105 105 obj-$(CONFIG_PCI) += mpc52xx_pci.o 106 106 endif 107 + 108 + obj-$(CONFIG_PPC_I8259) += i8259.o
+212
arch/ppc/syslib/i8259.c
··· 1 + /* 2 + * i8259 interrupt controller driver. 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of the GNU General Public License 6 + * as published by the Free Software Foundation; either version 7 + * 2 of the License, or (at your option) any later version. 8 + */ 9 + #include <linux/init.h> 10 + #include <linux/ioport.h> 11 + #include <linux/interrupt.h> 12 + #include <asm/io.h> 13 + #include <asm/i8259.h> 14 + 15 + static volatile void __iomem *pci_intack; /* RO, gives us the irq vector */ 16 + 17 + static unsigned char cached_8259[2] = { 0xff, 0xff }; 18 + #define cached_A1 (cached_8259[0]) 19 + #define cached_21 (cached_8259[1]) 20 + 21 + static DEFINE_SPINLOCK(i8259_lock); 22 + 23 + static int i8259_pic_irq_offset; 24 + 25 + /* 26 + * Acknowledge the IRQ using either the PCI host bridge's interrupt 27 + * acknowledge feature or poll. How i8259_init() is called determines 28 + * which is called. It should be noted that polling is broken on some 29 + * IBM and Motorola PReP boxes so we must use the int-ack feature on them. 30 + */ 31 + int i8259_irq(struct pt_regs *regs) 32 + { 33 + int irq; 34 + 35 + spin_lock(&i8259_lock); 36 + 37 + /* Either int-ack or poll for the IRQ */ 38 + if (pci_intack) 39 + irq = readb(pci_intack); 40 + else { 41 + /* Perform an interrupt acknowledge cycle on controller 1. */ 42 + outb(0x0C, 0x20); /* prepare for poll */ 43 + irq = inb(0x20) & 7; 44 + if (irq == 2 ) { 45 + /* 46 + * Interrupt is cascaded so perform interrupt 47 + * acknowledge on controller 2. 48 + */ 49 + outb(0x0C, 0xA0); /* prepare for poll */ 50 + irq = (inb(0xA0) & 7) + 8; 51 + } 52 + } 53 + 54 + if (irq == 7) { 55 + /* 56 + * This may be a spurious interrupt. 57 + * 58 + * Read the interrupt status register (ISR). If the most 59 + * significant bit is not set then there is no valid 60 + * interrupt. 61 + */ 62 + if (!pci_intack) 63 + outb(0x0B, 0x20); /* ISR register */ 64 + if(~inb(0x20) & 0x80) 65 + irq = -1; 66 + } 67 + 68 + spin_unlock(&i8259_lock); 69 + return irq + i8259_pic_irq_offset; 70 + } 71 + 72 + static void i8259_mask_and_ack_irq(unsigned int irq_nr) 73 + { 74 + unsigned long flags; 75 + 76 + spin_lock_irqsave(&i8259_lock, flags); 77 + irq_nr -= i8259_pic_irq_offset; 78 + if (irq_nr > 7) { 79 + cached_A1 |= 1 << (irq_nr-8); 80 + inb(0xA1); /* DUMMY */ 81 + outb(cached_A1, 0xA1); 82 + outb(0x20, 0xA0); /* Non-specific EOI */ 83 + outb(0x20, 0x20); /* Non-specific EOI to cascade */ 84 + } else { 85 + cached_21 |= 1 << irq_nr; 86 + inb(0x21); /* DUMMY */ 87 + outb(cached_21, 0x21); 88 + outb(0x20, 0x20); /* Non-specific EOI */ 89 + } 90 + spin_unlock_irqrestore(&i8259_lock, flags); 91 + } 92 + 93 + static void i8259_set_irq_mask(int irq_nr) 94 + { 95 + outb(cached_A1,0xA1); 96 + outb(cached_21,0x21); 97 + } 98 + 99 + static void i8259_mask_irq(unsigned int irq_nr) 100 + { 101 + unsigned long flags; 102 + 103 + spin_lock_irqsave(&i8259_lock, flags); 104 + irq_nr -= i8259_pic_irq_offset; 105 + if (irq_nr < 8) 106 + cached_21 |= 1 << irq_nr; 107 + else 108 + cached_A1 |= 1 << (irq_nr-8); 109 + i8259_set_irq_mask(irq_nr); 110 + spin_unlock_irqrestore(&i8259_lock, flags); 111 + } 112 + 113 + static void i8259_unmask_irq(unsigned int irq_nr) 114 + { 115 + unsigned long flags; 116 + 117 + spin_lock_irqsave(&i8259_lock, flags); 118 + irq_nr -= i8259_pic_irq_offset; 119 + if (irq_nr < 8) 120 + cached_21 &= ~(1 << irq_nr); 121 + else 122 + cached_A1 &= ~(1 << (irq_nr-8)); 123 + i8259_set_irq_mask(irq_nr); 124 + spin_unlock_irqrestore(&i8259_lock, flags); 125 + } 126 + 127 + static struct irq_chip i8259_pic = { 128 + .typename = " i8259 ", 129 + .mask = i8259_mask_irq, 130 + .unmask = i8259_unmask_irq, 131 + .mask_ack = i8259_mask_and_ack_irq, 132 + }; 133 + 134 + static struct resource pic1_iores = { 135 + .name = "8259 (master)", 136 + .start = 0x20, 137 + .end = 0x21, 138 + .flags = IORESOURCE_BUSY, 139 + }; 140 + 141 + static struct resource pic2_iores = { 142 + .name = "8259 (slave)", 143 + .start = 0xa0, 144 + .end = 0xa1, 145 + .flags = IORESOURCE_BUSY, 146 + }; 147 + 148 + static struct resource pic_edgectrl_iores = { 149 + .name = "8259 edge control", 150 + .start = 0x4d0, 151 + .end = 0x4d1, 152 + .flags = IORESOURCE_BUSY, 153 + }; 154 + 155 + static struct irqaction i8259_irqaction = { 156 + .handler = no_action, 157 + .flags = SA_INTERRUPT, 158 + .mask = CPU_MASK_NONE, 159 + .name = "82c59 secondary cascade", 160 + }; 161 + 162 + /* 163 + * i8259_init() 164 + * intack_addr - PCI interrupt acknowledge (real) address which will return 165 + * the active irq from the 8259 166 + */ 167 + void __init i8259_init(unsigned long intack_addr, int offset) 168 + { 169 + unsigned long flags; 170 + int i; 171 + 172 + spin_lock_irqsave(&i8259_lock, flags); 173 + i8259_pic_irq_offset = offset; 174 + 175 + /* init master interrupt controller */ 176 + outb(0x11, 0x20); /* Start init sequence */ 177 + outb(0x00, 0x21); /* Vector base */ 178 + outb(0x04, 0x21); /* edge tiggered, Cascade (slave) on IRQ2 */ 179 + outb(0x01, 0x21); /* Select 8086 mode */ 180 + 181 + /* init slave interrupt controller */ 182 + outb(0x11, 0xA0); /* Start init sequence */ 183 + outb(0x08, 0xA1); /* Vector base */ 184 + outb(0x02, 0xA1); /* edge triggered, Cascade (slave) on IRQ2 */ 185 + outb(0x01, 0xA1); /* Select 8086 mode */ 186 + 187 + /* always read ISR */ 188 + outb(0x0B, 0x20); 189 + outb(0x0B, 0xA0); 190 + 191 + /* Mask all interrupts */ 192 + outb(cached_A1, 0xA1); 193 + outb(cached_21, 0x21); 194 + 195 + spin_unlock_irqrestore(&i8259_lock, flags); 196 + 197 + for (i = 0; i < NUM_ISA_INTERRUPTS; ++i) { 198 + set_irq_chip_and_handler(offset + i, &i8259_pic, 199 + handle_level_irq); 200 + irq_desc[offset + i].status |= IRQ_LEVEL; 201 + } 202 + 203 + /* reserve our resources */ 204 + setup_irq(offset + 2, &i8259_irqaction); 205 + request_resource(&ioport_resource, &pic1_iores); 206 + request_resource(&ioport_resource, &pic2_iores); 207 + request_resource(&ioport_resource, &pic_edgectrl_iores); 208 + 209 + if (intack_addr != 0) 210 + pci_intack = ioremap(intack_addr, 1); 211 + 212 + }
+131 -101
drivers/block/swim3.c
··· 250 250 static int floppy_release(struct inode *inode, struct file *filp); 251 251 static int floppy_check_change(struct gendisk *disk); 252 252 static int floppy_revalidate(struct gendisk *disk); 253 - static int swim3_add_device(struct device_node *swims); 254 - int swim3_init(void); 255 253 256 254 #ifndef CONFIG_PMAC_MEDIABAY 257 255 #define check_media_bay(which, what) 1 ··· 1009 1011 .revalidate_disk= floppy_revalidate, 1010 1012 }; 1011 1013 1012 - int swim3_init(void) 1014 + static int swim3_add_device(struct macio_dev *mdev, int index) 1013 1015 { 1014 - struct device_node *swim; 1015 - int err = -ENOMEM; 1016 - int i; 1017 - 1018 - swim = find_devices("floppy"); 1019 - while (swim && (floppy_count < MAX_FLOPPIES)) 1020 - { 1021 - swim3_add_device(swim); 1022 - swim = swim->next; 1023 - } 1024 - 1025 - swim = find_devices("swim3"); 1026 - while (swim && (floppy_count < MAX_FLOPPIES)) 1027 - { 1028 - swim3_add_device(swim); 1029 - swim = swim->next; 1030 - } 1031 - 1032 - if (!floppy_count) 1033 - return -ENODEV; 1034 - 1035 - for (i = 0; i < floppy_count; i++) { 1036 - disks[i] = alloc_disk(1); 1037 - if (!disks[i]) 1038 - goto out; 1039 - } 1040 - 1041 - if (register_blkdev(FLOPPY_MAJOR, "fd")) { 1042 - err = -EBUSY; 1043 - goto out; 1044 - } 1045 - 1046 - swim3_queue = blk_init_queue(do_fd_request, &swim3_lock); 1047 - if (!swim3_queue) { 1048 - err = -ENOMEM; 1049 - goto out_queue; 1050 - } 1051 - 1052 - for (i = 0; i < floppy_count; i++) { 1053 - struct gendisk *disk = disks[i]; 1054 - disk->major = FLOPPY_MAJOR; 1055 - disk->first_minor = i; 1056 - disk->fops = &floppy_fops; 1057 - disk->private_data = &floppy_states[i]; 1058 - disk->queue = swim3_queue; 1059 - disk->flags |= GENHD_FL_REMOVABLE; 1060 - sprintf(disk->disk_name, "fd%d", i); 1061 - set_capacity(disk, 2880); 1062 - add_disk(disk); 1063 - } 1064 - return 0; 1065 - 1066 - out_queue: 1067 - unregister_blkdev(FLOPPY_MAJOR, "fd"); 1068 - out: 1069 - while (i--) 1070 - put_disk(disks[i]); 1071 - /* shouldn't we do something with results of swim_add_device()? */ 1072 - return err; 1073 - } 1074 - 1075 - static int swim3_add_device(struct device_node *swim) 1076 - { 1016 + struct device_node *swim = mdev->ofdev.node; 1077 1017 struct device_node *mediabay; 1078 - struct floppy_state *fs = &floppy_states[floppy_count]; 1079 - struct resource res_reg, res_dma; 1018 + struct floppy_state *fs = &floppy_states[index]; 1019 + int rc = -EBUSY; 1080 1020 1081 - if (of_address_to_resource(swim, 0, &res_reg) || 1082 - of_address_to_resource(swim, 1, &res_dma)) { 1083 - printk(KERN_ERR "swim3: Can't get addresses\n"); 1084 - return -EINVAL; 1021 + /* Check & Request resources */ 1022 + if (macio_resource_count(mdev) < 2) { 1023 + printk(KERN_WARNING "ifd%d: no address for %s\n", 1024 + index, swim->full_name); 1025 + return -ENXIO; 1085 1026 } 1086 - if (request_mem_region(res_reg.start, res_reg.end - res_reg.start + 1, 1087 - " (reg)") == NULL) { 1088 - printk(KERN_ERR "swim3: Can't request register space\n"); 1089 - return -EINVAL; 1027 + if (macio_irq_count(mdev) < 2) { 1028 + printk(KERN_WARNING "fd%d: no intrs for device %s\n", 1029 + index, swim->full_name); 1090 1030 } 1091 - if (request_mem_region(res_dma.start, res_dma.end - res_dma.start + 1, 1092 - " (dma)") == NULL) { 1093 - release_mem_region(res_reg.start, 1094 - res_reg.end - res_reg.start + 1); 1095 - printk(KERN_ERR "swim3: Can't request DMA space\n"); 1096 - return -EINVAL; 1031 + if (macio_request_resource(mdev, 0, "swim3 (mmio)")) { 1032 + printk(KERN_ERR "fd%d: can't request mmio resource for %s\n", 1033 + index, swim->full_name); 1034 + return -EBUSY; 1097 1035 } 1036 + if (macio_request_resource(mdev, 1, "swim3 (dma)")) { 1037 + printk(KERN_ERR "fd%d: can't request dma resource for %s\n", 1038 + index, swim->full_name); 1039 + macio_release_resource(mdev, 0); 1040 + return -EBUSY; 1041 + } 1042 + dev_set_drvdata(&mdev->ofdev.dev, fs); 1098 1043 1099 - if (swim->n_intrs < 2) { 1100 - printk(KERN_INFO "swim3: expecting 2 intrs (n_intrs:%d)\n", 1101 - swim->n_intrs); 1102 - release_mem_region(res_reg.start, 1103 - res_reg.end - res_reg.start + 1); 1104 - release_mem_region(res_dma.start, 1105 - res_dma.end - res_dma.start + 1); 1106 - return -EINVAL; 1107 - } 1108 - 1109 - mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ? swim->parent : NULL; 1044 + mediabay = (strcasecmp(swim->parent->type, "media-bay") == 0) ? 1045 + swim->parent : NULL; 1110 1046 if (mediabay == NULL) 1111 1047 pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 1); 1112 1048 1113 1049 memset(fs, 0, sizeof(*fs)); 1114 1050 spin_lock_init(&fs->lock); 1115 1051 fs->state = idle; 1116 - fs->swim3 = (struct swim3 __iomem *)ioremap(res_reg.start, 0x200); 1117 - fs->dma = (struct dbdma_regs __iomem *)ioremap(res_dma.start, 0x200); 1118 - fs->swim3_intr = swim->intrs[0].line; 1119 - fs->dma_intr = swim->intrs[1].line; 1052 + fs->swim3 = (struct swim3 __iomem *) 1053 + ioremap(macio_resource_start(mdev, 0), 0x200); 1054 + if (fs->swim3 == NULL) { 1055 + printk("fd%d: couldn't map registers for %s\n", 1056 + index, swim->full_name); 1057 + rc = -ENOMEM; 1058 + goto out_release; 1059 + } 1060 + fs->dma = (struct dbdma_regs __iomem *) 1061 + ioremap(macio_resource_start(mdev, 1), 0x200); 1062 + if (fs->dma == NULL) { 1063 + printk("fd%d: couldn't map DMA for %s\n", 1064 + index, swim->full_name); 1065 + iounmap(fs->swim3); 1066 + rc = -ENOMEM; 1067 + goto out_release; 1068 + } 1069 + fs->swim3_intr = macio_irq(mdev, 0); 1070 + fs->dma_intr = macio_irq(mdev, 1);; 1120 1071 fs->cur_cyl = -1; 1121 1072 fs->cur_sector = -1; 1122 1073 fs->secpercyl = 36; ··· 1079 1132 st_le16(&fs->dma_cmd[1].command, DBDMA_STOP); 1080 1133 1081 1134 if (request_irq(fs->swim3_intr, swim3_interrupt, 0, "SWIM3", fs)) { 1082 - printk(KERN_ERR "Couldn't get irq %d for SWIM3\n", fs->swim3_intr); 1135 + printk(KERN_ERR "fd%d: couldn't request irq %d for %s\n", 1136 + index, fs->swim3_intr, swim->full_name); 1083 1137 pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0); 1138 + goto out_unmap; 1084 1139 return -EBUSY; 1085 1140 } 1086 1141 /* 1087 1142 if (request_irq(fs->dma_intr, fd_dma_interrupt, 0, "SWIM3-dma", fs)) { 1088 1143 printk(KERN_ERR "Couldn't get irq %d for SWIM3 DMA", 1089 1144 fs->dma_intr); 1090 - pmac_call_feature(PMAC_FTR_SWIM3_ENABLE, swim, 0, 0); 1091 1145 return -EBUSY; 1092 1146 } 1093 1147 */ ··· 1098 1150 printk(KERN_INFO "fd%d: SWIM3 floppy controller %s\n", floppy_count, 1099 1151 mediabay ? "in media bay" : ""); 1100 1152 1101 - floppy_count++; 1102 - 1153 + return 0; 1154 + 1155 + out_unmap: 1156 + iounmap(fs->dma); 1157 + iounmap(fs->swim3); 1158 + 1159 + out_release: 1160 + macio_release_resource(mdev, 0); 1161 + macio_release_resource(mdev, 1); 1162 + 1163 + return rc; 1164 + } 1165 + 1166 + static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device_id *match) 1167 + { 1168 + int i, rc; 1169 + struct gendisk *disk; 1170 + 1171 + /* Add the drive */ 1172 + rc = swim3_add_device(mdev, floppy_count); 1173 + if (rc) 1174 + return rc; 1175 + 1176 + /* Now create the queue if not there yet */ 1177 + if (swim3_queue == NULL) { 1178 + /* If we failed, there isn't much we can do as the driver is still 1179 + * too dumb to remove the device, just bail out 1180 + */ 1181 + if (register_blkdev(FLOPPY_MAJOR, "fd")) 1182 + return 0; 1183 + swim3_queue = blk_init_queue(do_fd_request, &swim3_lock); 1184 + if (swim3_queue == NULL) { 1185 + unregister_blkdev(FLOPPY_MAJOR, "fd"); 1186 + return 0; 1187 + } 1188 + } 1189 + 1190 + /* Now register that disk. Same comment about failure handling */ 1191 + i = floppy_count++; 1192 + disk = disks[i] = alloc_disk(1); 1193 + if (disk == NULL) 1194 + return 0; 1195 + 1196 + disk->major = FLOPPY_MAJOR; 1197 + disk->first_minor = i; 1198 + disk->fops = &floppy_fops; 1199 + disk->private_data = &floppy_states[i]; 1200 + disk->queue = swim3_queue; 1201 + disk->flags |= GENHD_FL_REMOVABLE; 1202 + sprintf(disk->disk_name, "fd%d", i); 1203 + set_capacity(disk, 2880); 1204 + add_disk(disk); 1205 + 1206 + return 0; 1207 + } 1208 + 1209 + static struct of_device_id swim3_match[] = 1210 + { 1211 + { 1212 + .name = "swim3", 1213 + }, 1214 + { 1215 + .compatible = "ohare-swim3" 1216 + }, 1217 + { 1218 + .compatible = "swim3" 1219 + }, 1220 + }; 1221 + 1222 + static struct macio_driver swim3_driver = 1223 + { 1224 + .name = "swim3", 1225 + .match_table = swim3_match, 1226 + .probe = swim3_attach, 1227 + #if 0 1228 + .suspend = swim3_suspend, 1229 + .resume = swim3_resume, 1230 + #endif 1231 + }; 1232 + 1233 + 1234 + int swim3_init(void) 1235 + { 1236 + macio_register_driver(&swim3_driver); 1103 1237 return 0; 1104 1238 } 1105 1239
+3 -4
drivers/char/hvsi.c
··· 1299 1299 hp->inbuf_end = hp->inbuf; 1300 1300 hp->state = HVSI_CLOSED; 1301 1301 hp->vtermno = *vtermno; 1302 - hp->virq = virt_irq_create_mapping(irq[0]); 1302 + hp->virq = irq_create_mapping(NULL, irq[0], 0); 1303 1303 if (hp->virq == NO_IRQ) { 1304 1304 printk(KERN_ERR "%s: couldn't create irq mapping for 0x%x\n", 1305 - __FUNCTION__, hp->virq); 1305 + __FUNCTION__, irq[0]); 1306 1306 continue; 1307 - } else 1308 - hp->virq = irq_offset_up(hp->virq); 1307 + } 1309 1308 1310 1309 hvsi_count++; 1311 1310 }
+4 -15
drivers/macintosh/macio-adb.c
··· 90 90 { 91 91 struct device_node *adbs; 92 92 struct resource r; 93 + unsigned int irq; 93 94 94 95 adbs = find_compatible_devices("adb", "chrp,adb0"); 95 96 if (adbs == 0) 96 97 return -ENXIO; 97 98 98 - #if 0 99 - { int i = 0; 100 - 101 - printk("macio_adb_init: node = %p, addrs =", adbs->node); 102 - while(!of_address_to_resource(adbs, i, &r)) 103 - printk(" %x(%x)", r.start, r.end - r.start); 104 - printk(", intrs ="); 105 - for (i = 0; i < adbs->n_intrs; ++i) 106 - printk(" %x", adbs->intrs[i].line); 107 - printk("\n"); } 108 - #endif 109 99 if (of_address_to_resource(adbs, 0, &r)) 110 100 return -ENXIO; 111 101 adb = ioremap(r.start, sizeof(struct adb_regs)); ··· 107 117 out_8(&adb->active_lo.r, 0xff); 108 118 out_8(&adb->autopoll.r, APE); 109 119 110 - if (request_irq(adbs->intrs[0].line, macio_adb_interrupt, 111 - 0, "ADB", (void *)0)) { 112 - printk(KERN_ERR "ADB: can't get irq %d\n", 113 - adbs->intrs[0].line); 120 + irq = irq_of_parse_and_map(adbs, 0); 121 + if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { 122 + printk(KERN_ERR "ADB: can't get irq %d\n", irq); 114 123 return -EAGAIN; 115 124 } 116 125 out_8(&adb->intr_enb.r, DFB | TAG);
+100 -46
drivers/macintosh/macio_asic.c
··· 280 280 static int macio_resource_quirks(struct device_node *np, struct resource *res, 281 281 int index) 282 282 { 283 - if (res->flags & IORESOURCE_MEM) { 284 - /* Grand Central has too large resource 0 on some machines */ 285 - if (index == 0 && !strcmp(np->name, "gc")) 286 - res->end = res->start + 0x1ffff; 283 + /* Only quirks for memory resources for now */ 284 + if ((res->flags & IORESOURCE_MEM) == 0) 285 + return 0; 287 286 288 - /* Airport has bogus resource 2 */ 289 - if (index >= 2 && !strcmp(np->name, "radio")) 290 - return 1; 287 + /* Grand Central has too large resource 0 on some machines */ 288 + if (index == 0 && !strcmp(np->name, "gc")) 289 + res->end = res->start + 0x1ffff; 290 + 291 + /* Airport has bogus resource 2 */ 292 + if (index >= 2 && !strcmp(np->name, "radio")) 293 + return 1; 291 294 292 295 #ifndef CONFIG_PPC64 293 - /* DBDMAs may have bogus sizes */ 294 - if ((res->start & 0x0001f000) == 0x00008000) 295 - res->end = res->start + 0xff; 296 + /* DBDMAs may have bogus sizes */ 297 + if ((res->start & 0x0001f000) == 0x00008000) 298 + res->end = res->start + 0xff; 296 299 #endif /* CONFIG_PPC64 */ 297 300 298 - /* ESCC parent eats child resources. We could have added a 299 - * level of hierarchy, but I don't really feel the need 300 - * for it 301 - */ 302 - if (!strcmp(np->name, "escc")) 303 - return 1; 301 + /* ESCC parent eats child resources. We could have added a 302 + * level of hierarchy, but I don't really feel the need 303 + * for it 304 + */ 305 + if (!strcmp(np->name, "escc")) 306 + return 1; 304 307 305 - /* ESCC has bogus resources >= 3 */ 306 - if (index >= 3 && !(strcmp(np->name, "ch-a") && 307 - strcmp(np->name, "ch-b"))) 308 - return 1; 308 + /* ESCC has bogus resources >= 3 */ 309 + if (index >= 3 && !(strcmp(np->name, "ch-a") && 310 + strcmp(np->name, "ch-b"))) 311 + return 1; 309 312 310 - /* Media bay has too many resources, keep only first one */ 311 - if (index > 0 && !strcmp(np->name, "media-bay")) 312 - return 1; 313 + /* Media bay has too many resources, keep only first one */ 314 + if (index > 0 && !strcmp(np->name, "media-bay")) 315 + return 1; 313 316 314 - /* Some older IDE resources have bogus sizes */ 315 - if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && 316 - strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { 317 - if (index == 0 && (res->end - res->start) > 0xfff) 318 - res->end = res->start + 0xfff; 319 - if (index == 1 && (res->end - res->start) > 0xff) 320 - res->end = res->start + 0xff; 321 - } 317 + /* Some older IDE resources have bogus sizes */ 318 + if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && 319 + strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { 320 + if (index == 0 && (res->end - res->start) > 0xfff) 321 + res->end = res->start + 0xfff; 322 + if (index == 1 && (res->end - res->start) > 0xff) 323 + res->end = res->start + 0xff; 322 324 } 323 325 return 0; 324 326 } 325 327 328 + static void macio_create_fixup_irq(struct macio_dev *dev, int index, 329 + unsigned int line) 330 + { 331 + unsigned int irq; 332 + 333 + irq = irq_create_mapping(NULL, line, 0); 334 + if (irq != NO_IRQ) { 335 + dev->interrupt[index].start = irq; 336 + dev->interrupt[index].flags = IORESOURCE_IRQ; 337 + dev->interrupt[index].name = dev->ofdev.dev.bus_id; 338 + } 339 + if (dev->n_interrupts <= index) 340 + dev->n_interrupts = index + 1; 341 + } 342 + 343 + static void macio_add_missing_resources(struct macio_dev *dev) 344 + { 345 + struct device_node *np = dev->ofdev.node; 346 + unsigned int irq_base; 347 + 348 + /* Gatwick has some missing interrupts on child nodes */ 349 + if (dev->bus->chip->type != macio_gatwick) 350 + return; 351 + 352 + /* irq_base is always 64 on gatwick. I have no cleaner way to get 353 + * that value from here at this point 354 + */ 355 + irq_base = 64; 356 + 357 + /* Fix SCC */ 358 + if (strcmp(np->name, "ch-a") == 0) { 359 + macio_create_fixup_irq(dev, 0, 15 + irq_base); 360 + macio_create_fixup_irq(dev, 1, 4 + irq_base); 361 + macio_create_fixup_irq(dev, 2, 5 + irq_base); 362 + printk(KERN_INFO "macio: fixed SCC irqs on gatwick\n"); 363 + } 364 + 365 + /* Fix media-bay */ 366 + if (strcmp(np->name, "media-bay") == 0) { 367 + macio_create_fixup_irq(dev, 0, 29 + irq_base); 368 + printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n"); 369 + } 370 + 371 + /* Fix left media bay childs */ 372 + if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) { 373 + macio_create_fixup_irq(dev, 0, 19 + irq_base); 374 + macio_create_fixup_irq(dev, 1, 1 + irq_base); 375 + printk(KERN_INFO "macio: fixed left floppy irqs\n"); 376 + } 377 + if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) { 378 + macio_create_fixup_irq(dev, 0, 14 + irq_base); 379 + macio_create_fixup_irq(dev, 0, 3 + irq_base); 380 + printk(KERN_INFO "macio: fixed left ide irqs\n"); 381 + } 382 + } 326 383 327 384 static void macio_setup_interrupts(struct macio_dev *dev) 328 385 { 329 386 struct device_node *np = dev->ofdev.node; 330 - int i,j; 387 + unsigned int irq; 388 + int i = 0, j = 0; 331 389 332 - /* For now, we use pre-parsed entries in the device-tree for 333 - * interrupt routing and addresses, but we should change that 334 - * to dynamically parsed entries and so get rid of most of the 335 - * clutter in struct device_node 336 - */ 337 - for (i = j = 0; i < np->n_intrs; i++) { 390 + for (;;) { 338 391 struct resource *res = &dev->interrupt[j]; 339 392 340 393 if (j >= MACIO_DEV_COUNT_IRQS) 341 394 break; 342 - res->start = np->intrs[i].line; 343 - res->flags = IORESOURCE_IO; 344 - if (np->intrs[j].sense) 345 - res->flags |= IORESOURCE_IRQ_LOWLEVEL; 346 - else 347 - res->flags |= IORESOURCE_IRQ_HIGHEDGE; 395 + irq = irq_of_parse_and_map(np, i++); 396 + if (irq == NO_IRQ) 397 + break; 398 + res->start = irq; 399 + res->flags = IORESOURCE_IRQ; 348 400 res->name = dev->ofdev.dev.bus_id; 349 - if (macio_resource_quirks(np, res, i)) 401 + if (macio_resource_quirks(np, res, i - 1)) { 350 402 memset(res, 0, sizeof(struct resource)); 351 - else 403 + continue; 404 + } else 352 405 j++; 353 406 } 354 407 dev->n_interrupts = j; ··· 498 445 /* Setup interrupts & resources */ 499 446 macio_setup_interrupts(dev); 500 447 macio_setup_resources(dev, parent_res); 448 + macio_add_missing_resources(dev); 501 449 502 450 /* Register with core */ 503 451 if (of_device_register(&dev->ofdev) != 0) {
+2 -4
drivers/macintosh/smu.c
··· 497 497 smu->doorbell = *data; 498 498 if (smu->doorbell < 0x50) 499 499 smu->doorbell += 0x50; 500 - if (np->n_intrs > 0) 501 - smu->db_irq = np->intrs[0].line; 500 + smu->db_irq = irq_of_parse_and_map(np, 0); 502 501 503 502 of_node_put(np); 504 503 ··· 514 515 smu->msg = *data; 515 516 if (smu->msg < 0x50) 516 517 smu->msg += 0x50; 517 - if (np->n_intrs > 0) 518 - smu->msg_irq = np->intrs[0].line; 518 + smu->msg_irq = irq_of_parse_and_map(np, 0); 519 519 of_node_put(np); 520 520 } while(0); 521 521
+15 -9
drivers/macintosh/via-cuda.c
··· 34 34 static volatile unsigned char __iomem *via; 35 35 static DEFINE_SPINLOCK(cuda_lock); 36 36 37 - #ifdef CONFIG_MAC 38 - #define CUDA_IRQ IRQ_MAC_ADB 39 - #define eieio() 40 - #else 41 - #define CUDA_IRQ vias->intrs[0].line 42 - #endif 43 - 44 37 /* VIA registers - spaced 0x200 bytes apart */ 45 38 #define RS 0x200 /* skip between registers */ 46 39 #define B 0 /* B-side data */ ··· 182 189 183 190 static int __init via_cuda_start(void) 184 191 { 192 + unsigned int irq; 193 + 185 194 if (via == NULL) 186 195 return -ENODEV; 187 196 188 - if (request_irq(CUDA_IRQ, cuda_interrupt, 0, "ADB", cuda_interrupt)) { 189 - printk(KERN_ERR "cuda_init: can't get irq %d\n", CUDA_IRQ); 197 + #ifdef CONFIG_MAC 198 + irq = IRQ_MAC_ADB; 199 + #else /* CONFIG_MAC */ 200 + irq = irq_of_parse_and_map(vias, 0); 201 + if (irq == NO_IRQ) { 202 + printk(KERN_ERR "via-cuda: can't map interrupts for %s\n", 203 + vias->full_name); 204 + return -ENODEV; 205 + } 206 + #endif /* CONFIG_MAP */ 207 + 208 + if (request_irq(irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) { 209 + printk(KERN_ERR "via-cuda: can't request irq %d\n", irq); 190 210 return -EAGAIN; 191 211 } 192 212
+14 -19
drivers/macintosh/via-pmu.c
··· 64 64 #include <asm/backlight.h> 65 65 #endif 66 66 67 - #ifdef CONFIG_PPC32 68 - #include <asm/open_pic.h> 69 - #endif 70 - 71 67 #include "via-pmu-event.h" 72 68 73 69 /* Some compile options */ ··· 147 151 static int pmu_has_adb; 148 152 static struct device_node *gpio_node; 149 153 static unsigned char __iomem *gpio_reg = NULL; 150 - static int gpio_irq = -1; 154 + static int gpio_irq = NO_IRQ; 151 155 static int gpio_irq_enabled = -1; 152 156 static volatile int pmu_suspended = 0; 153 157 static spinlock_t pmu_lock; ··· 399 403 */ 400 404 static int __init via_pmu_start(void) 401 405 { 406 + unsigned int irq; 407 + 402 408 if (vias == NULL) 403 409 return -ENODEV; 404 410 405 411 batt_req.complete = 1; 406 412 407 - #ifndef CONFIG_PPC_MERGE 408 - if (pmu_kind == PMU_KEYLARGO_BASED) 409 - openpic_set_irq_priority(vias->intrs[0].line, 410 - OPENPIC_PRIORITY_DEFAULT + 1); 411 - #endif 412 - 413 - if (request_irq(vias->intrs[0].line, via_pmu_interrupt, 0, "VIA-PMU", 414 - (void *)0)) { 415 - printk(KERN_ERR "VIA-PMU: can't get irq %d\n", 416 - vias->intrs[0].line); 417 - return -EAGAIN; 413 + irq = irq_of_parse_and_map(vias, 0); 414 + if (irq == NO_IRQ) { 415 + printk(KERN_ERR "via-pmu: can't map interruptn"); 416 + return -ENODEV; 417 + } 418 + if (request_irq(irq, via_pmu_interrupt, 0, "VIA-PMU", (void *)0)) { 419 + printk(KERN_ERR "via-pmu: can't request irq %d\n", irq); 420 + return -ENODEV; 418 421 } 419 422 420 423 if (pmu_kind == PMU_KEYLARGO_BASED) { ··· 421 426 if (gpio_node == NULL) 422 427 gpio_node = of_find_node_by_name(NULL, 423 428 "pmu-interrupt"); 424 - if (gpio_node && gpio_node->n_intrs > 0) 425 - gpio_irq = gpio_node->intrs[0].line; 429 + if (gpio_node) 430 + gpio_irq = irq_of_parse_and_map(gpio_node, 0); 426 431 427 - if (gpio_irq != -1) { 432 + if (gpio_irq != NO_IRQ) { 428 433 if (request_irq(gpio_irq, gpio1_interrupt, 0, 429 434 "GPIO1 ADB", (void *)0)) 430 435 printk(KERN_ERR "pmu: can't get irq %d"
+2 -2
drivers/net/mace.c
··· 242 242 } 243 243 rc = request_irq(mp->tx_dma_intr, mace_txdma_intr, 0, "MACE-txdma", dev); 244 244 if (rc) { 245 - printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[1].line); 245 + printk(KERN_ERR "MACE: can't get irq %d\n", mp->tx_dma_intr); 246 246 goto err_free_irq; 247 247 } 248 248 rc = request_irq(mp->rx_dma_intr, mace_rxdma_intr, 0, "MACE-rxdma", dev); 249 249 if (rc) { 250 - printk(KERN_ERR "MACE: can't get irq %d\n", mace->intrs[2].line); 250 + printk(KERN_ERR "MACE: can't get irq %d\n", mp->rx_dma_intr); 251 251 goto err_free_tx_irq; 252 252 } 253 253
+3 -3
drivers/serial/pmac_zilog.c
··· 1443 1443 uap->flags &= ~PMACZILOG_FLAG_HAS_DMA; 1444 1444 goto no_dma; 1445 1445 } 1446 - uap->tx_dma_irq = np->intrs[1].line; 1447 - uap->rx_dma_irq = np->intrs[2].line; 1446 + uap->tx_dma_irq = irq_of_parse_and_map(np, 1); 1447 + uap->rx_dma_irq = irq_of_parse_and_map(np, 2); 1448 1448 } 1449 1449 no_dma: 1450 1450 ··· 1491 1491 * Init remaining bits of "port" structure 1492 1492 */ 1493 1493 uap->port.iotype = UPIO_MEM; 1494 - uap->port.irq = np->intrs[0].line; 1494 + uap->port.irq = irq_of_parse_and_map(np, 0); 1495 1495 uap->port.uartclk = ZS_CLOCK; 1496 1496 uap->port.fifosize = 1; 1497 1497 uap->port.ops = &pmz_pops;
+114 -162
drivers/video/offb.c
··· 97 97 u_int transp, struct fb_info *info) 98 98 { 99 99 struct offb_par *par = (struct offb_par *) info->par; 100 + int i, depth; 101 + u32 *pal = info->pseudo_palette; 100 102 101 - if (!par->cmap_adr || regno > 255) 103 + depth = info->var.bits_per_pixel; 104 + if (depth == 16) 105 + depth = (info->var.green.length == 5) ? 15 : 16; 106 + 107 + if (regno > 255 || 108 + (depth == 16 && regno > 63) || 109 + (depth == 15 && regno > 31)) 102 110 return 1; 111 + 112 + if (regno < 16) { 113 + switch (depth) { 114 + case 15: 115 + pal[regno] = (regno << 10) | (regno << 5) | regno; 116 + break; 117 + case 16: 118 + pal[regno] = (regno << 11) | (regno << 5) | regno; 119 + break; 120 + case 24: 121 + pal[regno] = (regno << 16) | (regno << 8) | regno; 122 + break; 123 + case 32: 124 + i = (regno << 8) | regno; 125 + pal[regno] = (i << 16) | i; 126 + break; 127 + } 128 + } 103 129 104 130 red >>= 8; 105 131 green >>= 8; 106 132 blue >>= 8; 133 + 134 + if (!par->cmap_adr) 135 + return 0; 107 136 108 137 switch (par->cmap_type) { 109 138 case cmap_m64: ··· 170 141 break; 171 142 } 172 143 173 - if (regno < 16) 174 - switch (info->var.bits_per_pixel) { 175 - case 16: 176 - ((u16 *) (info->pseudo_palette))[regno] = 177 - (regno << 10) | (regno << 5) | regno; 178 - break; 179 - case 32: 180 - { 181 - int i = (regno << 8) | regno; 182 - ((u32 *) (info->pseudo_palette))[regno] = 183 - (i << 16) | i; 184 - break; 185 - } 186 - } 187 144 return 0; 188 145 } 189 146 ··· 238 223 { 239 224 struct device_node *dp = NULL, *boot_disp = NULL; 240 225 241 - #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) 242 - struct device_node *macos_display = NULL; 243 - #endif 244 226 if (fb_get_options("offb", NULL)) 245 227 return -ENODEV; 246 - 247 - #if defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) 248 - /* If we're booted from BootX... */ 249 - if (boot_infos != 0) { 250 - unsigned long addr = 251 - (unsigned long) boot_infos->dispDeviceBase; 252 - u32 *addrp; 253 - u64 daddr, dsize; 254 - unsigned int flags; 255 - 256 - /* find the device node corresponding to the macos display */ 257 - while ((dp = of_find_node_by_type(dp, "display"))) { 258 - int i; 259 - 260 - /* 261 - * Look for an AAPL,address property first. 262 - */ 263 - unsigned int na; 264 - unsigned int *ap = 265 - (unsigned int *)get_property(dp, "AAPL,address", 266 - &na); 267 - if (ap != 0) { 268 - for (na /= sizeof(unsigned int); na > 0; 269 - --na, ++ap) 270 - if (*ap <= addr && 271 - addr < *ap + 0x1000000) { 272 - macos_display = dp; 273 - goto foundit; 274 - } 275 - } 276 - 277 - /* 278 - * See if the display address is in one of the address 279 - * ranges for this display. 280 - */ 281 - i = 0; 282 - for (;;) { 283 - addrp = of_get_address(dp, i++, &dsize, &flags); 284 - if (addrp == NULL) 285 - break; 286 - if (!(flags & IORESOURCE_MEM)) 287 - continue; 288 - daddr = of_translate_address(dp, addrp); 289 - if (daddr == OF_BAD_ADDR) 290 - continue; 291 - if (daddr <= addr && addr < (daddr + dsize)) { 292 - macos_display = dp; 293 - goto foundit; 294 - } 295 - } 296 - foundit: 297 - if (macos_display) { 298 - printk(KERN_INFO "MacOS display is %s\n", 299 - dp->full_name); 300 - break; 301 - } 302 - } 303 - 304 - /* initialize it */ 305 - offb_init_fb(macos_display ? macos_display-> 306 - name : "MacOS display", 307 - macos_display ? macos_display-> 308 - full_name : "MacOS display", 309 - boot_infos->dispDeviceRect[2], 310 - boot_infos->dispDeviceRect[3], 311 - boot_infos->dispDeviceDepth, 312 - boot_infos->dispDeviceRowBytes, addr, NULL); 313 - } 314 - #endif /* defined(CONFIG_BOOTX_TEXT) && defined(CONFIG_PPC32) */ 315 228 316 229 for (dp = NULL; (dp = of_find_node_by_type(dp, "display"));) { 317 230 if (get_property(dp, "linux,opened", NULL) && ··· 260 317 261 318 static void __init offb_init_nodriver(struct device_node *dp) 262 319 { 263 - int *pp, i; 264 320 unsigned int len; 265 - int width = 640, height = 480, depth = 8, pitch; 266 - unsigned int flags, rsize, *up; 267 - u64 address = OF_BAD_ADDR; 268 - u32 *addrp; 321 + int i, width = 640, height = 480, depth = 8, pitch = 640; 322 + unsigned int flags, rsize, addr_prop = 0; 323 + unsigned long max_size = 0; 324 + u64 rstart, address = OF_BAD_ADDR; 325 + u32 *pp, *addrp, *up; 269 326 u64 asize; 270 327 271 - if ((pp = (int *) get_property(dp, "depth", &len)) != NULL 272 - && len == sizeof(int)) 328 + pp = (u32 *)get_property(dp, "linux,bootx-depth", &len); 329 + if (pp == NULL) 330 + pp = (u32 *)get_property(dp, "depth", &len); 331 + if (pp && len == sizeof(u32)) 273 332 depth = *pp; 274 - if ((pp = (int *) get_property(dp, "width", &len)) != NULL 275 - && len == sizeof(int)) 333 + 334 + pp = (u32 *)get_property(dp, "linux,bootx-width", &len); 335 + if (pp == NULL) 336 + pp = (u32 *)get_property(dp, "width", &len); 337 + if (pp && len == sizeof(u32)) 276 338 width = *pp; 277 - if ((pp = (int *) get_property(dp, "height", &len)) != NULL 278 - && len == sizeof(int)) 339 + 340 + pp = (u32 *)get_property(dp, "linux,bootx-height", &len); 341 + if (pp == NULL) 342 + pp = (u32 *)get_property(dp, "height", &len); 343 + if (pp && len == sizeof(u32)) 279 344 height = *pp; 280 - if ((pp = (int *) get_property(dp, "linebytes", &len)) != NULL 281 - && len == sizeof(int)) { 345 + 346 + pp = (u32 *)get_property(dp, "linux,bootx-linebytes", &len); 347 + if (pp == NULL) 348 + pp = (u32 *)get_property(dp, "linebytes", &len); 349 + if (pp && len == sizeof(u32)) 282 350 pitch = *pp; 283 - if (pitch == 1) 284 - pitch = 0x1000; 285 - } else 286 - pitch = width; 351 + else 352 + pitch = width * ((depth + 7) / 8); 287 353 288 - rsize = (unsigned long)pitch * (unsigned long)height * 289 - (unsigned long)(depth / 8); 354 + rsize = (unsigned long)pitch * (unsigned long)height; 290 355 291 - /* Try to match device to a PCI device in order to get a properly 292 - * translated address rather then trying to decode the open firmware 293 - * stuff in various incorrect ways 294 - */ 295 - #ifdef CONFIG_PCI 296 - /* First try to locate the PCI device if any */ 297 - { 298 - struct pci_dev *pdev = NULL; 356 + /* Ok, now we try to figure out the address of the framebuffer. 357 + * 358 + * Unfortunately, Open Firmware doesn't provide a standard way to do 359 + * so. All we can do is a dodgy heuristic that happens to work in 360 + * practice. On most machines, the "address" property contains what 361 + * we need, though not on Matrox cards found in IBM machines. What I've 362 + * found that appears to give good results is to go through the PCI 363 + * ranges and pick one that is both big enough and if possible encloses 364 + * the "address" property. If none match, we pick the biggest 365 + */ 366 + up = (u32 *)get_property(dp, "linux,bootx-addr", &len); 367 + if (up == NULL) 368 + up = (u32 *)get_property(dp, "address", &len); 369 + if (up && len == sizeof(u32)) 370 + addr_prop = *up; 299 371 300 - for_each_pci_dev(pdev) { 301 - if (dp == pci_device_to_OF_node(pdev)) 302 - break; 303 - } 304 - if (pdev) { 305 - for (i = 0; i < 6 && address == OF_BAD_ADDR; i++) { 306 - if ((pci_resource_flags(pdev, i) & 307 - IORESOURCE_MEM) && 308 - (pci_resource_len(pdev, i) >= rsize)) 309 - address = pci_resource_start(pdev, i); 310 - } 311 - pci_dev_put(pdev); 312 - } 313 - } 314 - #endif /* CONFIG_PCI */ 372 + for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags)) 373 + != NULL; i++) { 374 + int match_addrp = 0; 315 375 316 - /* This one is dodgy, we may drop it ... */ 317 - if (address == OF_BAD_ADDR && 318 - (up = (unsigned *) get_property(dp, "address", &len)) != NULL && 319 - len == sizeof(unsigned int)) 320 - address = (u64) * up; 321 - 322 - if (address == OF_BAD_ADDR) { 323 - for (i = 0; (addrp = of_get_address(dp, i, &asize, &flags)) 324 - != NULL; i++) { 325 - if (!(flags & IORESOURCE_MEM)) 326 - continue; 327 - if (asize >= pitch * height * depth / 8) 328 - break; 329 - } 330 - if (addrp == NULL) { 331 - printk(KERN_ERR 332 - "no framebuffer address found for %s\n", 333 - dp->full_name); 334 - return; 376 + if (!(flags & IORESOURCE_MEM)) 377 + continue; 378 + if (asize < rsize) 379 + continue; 380 + rstart = of_translate_address(dp, addrp); 381 + if (rstart == OF_BAD_ADDR) 382 + continue; 383 + if (addr_prop && (rstart <= addr_prop) && 384 + ((rstart + asize) >= (addr_prop + rsize))) 385 + match_addrp = 1; 386 + if (match_addrp) { 387 + address = addr_prop; 388 + break; 335 389 } 336 - address = of_translate_address(dp, addrp); 337 - if (address == OF_BAD_ADDR) { 338 - printk(KERN_ERR 339 - "can't translate framebuffer address for %s\n", 340 - dp->full_name); 341 - return; 342 - } 390 + if (rsize > max_size) { 391 + max_size = rsize; 392 + address = OF_BAD_ADDR; 393 + } 343 394 395 + if (address == OF_BAD_ADDR) 396 + address = rstart; 397 + } 398 + if (address == OF_BAD_ADDR && addr_prop) 399 + address = (u64)addr_prop; 400 + if (address != OF_BAD_ADDR) { 344 401 /* kludge for valkyrie */ 345 402 if (strcmp(dp->name, "valkyrie") == 0) 346 403 address += 0x1000; 404 + offb_init_fb(dp->name, dp->full_name, width, height, depth, 405 + pitch, address, dp); 347 406 } 348 - offb_init_fb(dp->name, dp->full_name, width, height, depth, 349 - pitch, address, dp); 350 - 351 407 } 352 408 353 409 static void __init offb_init_fb(const char *name, const char *full_name, ··· 354 412 int pitch, unsigned long address, 355 413 struct device_node *dp) 356 414 { 357 - unsigned long res_size = pitch * height * depth / 8; 415 + unsigned long res_size = pitch * height * (depth + 7) / 8; 358 416 struct offb_par *par = &default_par; 359 417 unsigned long res_start = address; 360 418 struct fb_fix_screeninfo *fix; ··· 368 426 printk(KERN_INFO 369 427 "Using unsupported %dx%d %s at %lx, depth=%d, pitch=%d\n", 370 428 width, height, name, address, depth, pitch); 371 - if (depth != 8 && depth != 16 && depth != 32) { 429 + if (depth != 8 && depth != 15 && depth != 16 && depth != 32) { 372 430 printk(KERN_ERR "%s: can't use depth = %d\n", full_name, 373 431 depth); 374 432 release_mem_region(res_start, res_size); ··· 444 502 : */ FB_VISUAL_TRUECOLOR; 445 503 446 504 var->xoffset = var->yoffset = 0; 447 - var->bits_per_pixel = depth; 448 505 switch (depth) { 449 506 case 8: 450 507 var->bits_per_pixel = 8; ··· 456 515 var->transp.offset = 0; 457 516 var->transp.length = 0; 458 517 break; 459 - case 16: /* RGB 555 */ 518 + case 15: /* RGB 555 */ 460 519 var->bits_per_pixel = 16; 461 520 var->red.offset = 10; 462 521 var->red.length = 5; 463 522 var->green.offset = 5; 464 523 var->green.length = 5; 524 + var->blue.offset = 0; 525 + var->blue.length = 5; 526 + var->transp.offset = 0; 527 + var->transp.length = 0; 528 + break; 529 + case 16: /* RGB 565 */ 530 + var->bits_per_pixel = 16; 531 + var->red.offset = 11; 532 + var->red.length = 5; 533 + var->green.offset = 5; 534 + var->green.length = 6; 465 535 var->blue.offset = 0; 466 536 var->blue.length = 5; 467 537 var->transp.offset = 0;
+5 -3
include/asm-powerpc/i8259.h
··· 4 4 5 5 #include <linux/irq.h> 6 6 7 - extern struct hw_interrupt_type i8259_pic; 8 - 7 + #ifdef CONFIG_PPC_MERGE 8 + extern void i8259_init(struct device_node *node, unsigned long intack_addr); 9 + extern unsigned int i8259_irq(struct pt_regs *regs); 10 + #else 9 11 extern void i8259_init(unsigned long intack_addr, int offset); 10 12 extern int i8259_irq(struct pt_regs *regs); 11 - extern int i8259_irq_cascade(struct pt_regs *regs, void *unused); 13 + #endif 12 14 13 15 #endif /* __KERNEL__ */ 14 16 #endif /* _ASM_POWERPC_I8259_H */
+318 -60
include/asm-powerpc/irq.h
··· 9 9 * 2 of the License, or (at your option) any later version. 10 10 */ 11 11 12 + #include <linux/config.h> 12 13 #include <linux/threads.h> 14 + #include <linux/list.h> 15 + #include <linux/radix-tree.h> 13 16 14 17 #include <asm/types.h> 15 18 #include <asm/atomic.h> 16 19 17 - /* this number is used when no interrupt has been assigned */ 20 + 21 + #define get_irq_desc(irq) (&irq_desc[(irq)]) 22 + 23 + /* Define a way to iterate across irqs. */ 24 + #define for_each_irq(i) \ 25 + for ((i) = 0; (i) < NR_IRQS; ++(i)) 26 + 27 + extern atomic_t ppc_n_lost_interrupts; 28 + 29 + #ifdef CONFIG_PPC_MERGE 30 + 31 + /* This number is used when no interrupt has been assigned */ 32 + #define NO_IRQ (0) 33 + 34 + /* This is a special irq number to return from get_irq() to tell that 35 + * no interrupt happened _and_ ignore it (don't count it as bad). Some 36 + * platforms like iSeries rely on that. 37 + */ 38 + #define NO_IRQ_IGNORE ((unsigned int)-1) 39 + 40 + /* Total number of virq in the platform (make it a CONFIG_* option ? */ 41 + #define NR_IRQS 512 42 + 43 + /* Number of irqs reserved for the legacy controller */ 44 + #define NUM_ISA_INTERRUPTS 16 45 + 46 + /* This type is the placeholder for a hardware interrupt number. It has to 47 + * be big enough to enclose whatever representation is used by a given 48 + * platform. 49 + */ 50 + typedef unsigned long irq_hw_number_t; 51 + 52 + /* Interrupt controller "host" data structure. This could be defined as a 53 + * irq domain controller. That is, it handles the mapping between hardware 54 + * and virtual interrupt numbers for a given interrupt domain. The host 55 + * structure is generally created by the PIC code for a given PIC instance 56 + * (though a host can cover more than one PIC if they have a flat number 57 + * model). It's the host callbacks that are responsible for setting the 58 + * irq_chip on a given irq_desc after it's been mapped. 59 + * 60 + * The host code and data structures are fairly agnostic to the fact that 61 + * we use an open firmware device-tree. We do have references to struct 62 + * device_node in two places: in irq_find_host() to find the host matching 63 + * a given interrupt controller node, and of course as an argument to its 64 + * counterpart host->ops->match() callback. However, those are treated as 65 + * generic pointers by the core and the fact that it's actually a device-node 66 + * pointer is purely a convention between callers and implementation. This 67 + * code could thus be used on other architectures by replacing those two 68 + * by some sort of arch-specific void * "token" used to identify interrupt 69 + * controllers. 70 + */ 71 + struct irq_host; 72 + struct radix_tree_root; 73 + 74 + /* Functions below are provided by the host and called whenever a new mapping 75 + * is created or an old mapping is disposed. The host can then proceed to 76 + * whatever internal data structures management is required. It also needs 77 + * to setup the irq_desc when returning from map(). 78 + */ 79 + struct irq_host_ops { 80 + /* Match an interrupt controller device node to a host, returns 81 + * 1 on a match 82 + */ 83 + int (*match)(struct irq_host *h, struct device_node *node); 84 + 85 + /* Create or update a mapping between a virtual irq number and a hw 86 + * irq number. This can be called several times for the same mapping 87 + * but with different flags, though unmap shall always be called 88 + * before the virq->hw mapping is changed. 89 + */ 90 + int (*map)(struct irq_host *h, unsigned int virq, 91 + irq_hw_number_t hw, unsigned int flags); 92 + 93 + /* Dispose of such a mapping */ 94 + void (*unmap)(struct irq_host *h, unsigned int virq); 95 + 96 + /* Translate device-tree interrupt specifier from raw format coming 97 + * from the firmware to a irq_hw_number_t (interrupt line number) and 98 + * trigger flags that can be passed to irq_create_mapping(). 99 + * If no translation is provided, raw format is assumed to be one cell 100 + * for interrupt line and default sense. 101 + */ 102 + int (*xlate)(struct irq_host *h, struct device_node *ctrler, 103 + u32 *intspec, unsigned int intsize, 104 + irq_hw_number_t *out_hwirq, unsigned int *out_flags); 105 + }; 106 + 107 + struct irq_host { 108 + struct list_head link; 109 + 110 + /* type of reverse mapping technique */ 111 + unsigned int revmap_type; 112 + #define IRQ_HOST_MAP_LEGACY 0 /* legacy 8259, gets irqs 1..15 */ 113 + #define IRQ_HOST_MAP_NOMAP 1 /* no fast reverse mapping */ 114 + #define IRQ_HOST_MAP_LINEAR 2 /* linear map of interrupts */ 115 + #define IRQ_HOST_MAP_TREE 3 /* radix tree */ 116 + union { 117 + struct { 118 + unsigned int size; 119 + unsigned int *revmap; 120 + } linear; 121 + struct radix_tree_root tree; 122 + } revmap_data; 123 + struct irq_host_ops *ops; 124 + void *host_data; 125 + irq_hw_number_t inval_irq; 126 + }; 127 + 128 + /* The main irq map itself is an array of NR_IRQ entries containing the 129 + * associate host and irq number. An entry with a host of NULL is free. 130 + * An entry can be allocated if it's free, the allocator always then sets 131 + * hwirq first to the host's invalid irq number and then fills ops. 132 + */ 133 + struct irq_map_entry { 134 + irq_hw_number_t hwirq; 135 + struct irq_host *host; 136 + }; 137 + 138 + extern struct irq_map_entry irq_map[NR_IRQS]; 139 + 140 + 141 + /*** 142 + * irq_alloc_host - Allocate a new irq_host data structure 143 + * @node: device-tree node of the interrupt controller 144 + * @revmap_type: type of reverse mapping to use 145 + * @revmap_arg: for IRQ_HOST_MAP_LINEAR linear only: size of the map 146 + * @ops: map/unmap host callbacks 147 + * @inval_irq: provide a hw number in that host space that is always invalid 148 + * 149 + * Allocates and initialize and irq_host structure. Note that in the case of 150 + * IRQ_HOST_MAP_LEGACY, the map() callback will be called before this returns 151 + * for all legacy interrupts except 0 (which is always the invalid irq for 152 + * a legacy controller). For a IRQ_HOST_MAP_LINEAR, the map is allocated by 153 + * this call as well. For a IRQ_HOST_MAP_TREE, the radix tree will be allocated 154 + * later during boot automatically (the reverse mapping will use the slow path 155 + * until that happens). 156 + */ 157 + extern struct irq_host *irq_alloc_host(unsigned int revmap_type, 158 + unsigned int revmap_arg, 159 + struct irq_host_ops *ops, 160 + irq_hw_number_t inval_irq); 161 + 162 + 163 + /*** 164 + * irq_find_host - Locates a host for a given device node 165 + * @node: device-tree node of the interrupt controller 166 + */ 167 + extern struct irq_host *irq_find_host(struct device_node *node); 168 + 169 + 170 + /*** 171 + * irq_set_default_host - Set a "default" host 172 + * @host: default host pointer 173 + * 174 + * For convenience, it's possible to set a "default" host that will be used 175 + * whenever NULL is passed to irq_create_mapping(). It makes life easier for 176 + * platforms that want to manipulate a few hard coded interrupt numbers that 177 + * aren't properly represented in the device-tree. 178 + */ 179 + extern void irq_set_default_host(struct irq_host *host); 180 + 181 + 182 + /*** 183 + * irq_set_virq_count - Set the maximum number of virt irqs 184 + * @count: number of linux virtual irqs, capped with NR_IRQS 185 + * 186 + * This is mainly for use by platforms like iSeries who want to program 187 + * the virtual irq number in the controller to avoid the reverse mapping 188 + */ 189 + extern void irq_set_virq_count(unsigned int count); 190 + 191 + 192 + /*** 193 + * irq_create_mapping - Map a hardware interrupt into linux virq space 194 + * @host: host owning this hardware interrupt or NULL for default host 195 + * @hwirq: hardware irq number in that host space 196 + * @flags: flags passed to the controller. contains the trigger type among 197 + * others. Use IRQ_TYPE_* defined in include/linux/irq.h 198 + * 199 + * Only one mapping per hardware interrupt is permitted. Returns a linux 200 + * virq number. The flags can be used to provide sense information to the 201 + * controller (typically extracted from the device-tree). If no information 202 + * is passed, the controller defaults will apply (for example, xics can only 203 + * do edge so flags are irrelevant for some pseries specific irqs). 204 + * 205 + * The device-tree generally contains the trigger info in an encoding that is 206 + * specific to a given type of controller. In that case, you can directly use 207 + * host->ops->trigger_xlate() to translate that. 208 + * 209 + * It is recommended that new PICs that don't have existing OF bindings chose 210 + * to use a representation of triggers identical to linux. 211 + */ 212 + extern unsigned int irq_create_mapping(struct irq_host *host, 213 + irq_hw_number_t hwirq, 214 + unsigned int flags); 215 + 216 + 217 + /*** 218 + * irq_dispose_mapping - Unmap an interrupt 219 + * @virq: linux virq number of the interrupt to unmap 220 + */ 221 + extern void irq_dispose_mapping(unsigned int virq); 222 + 223 + /*** 224 + * irq_find_mapping - Find a linux virq from an hw irq number. 225 + * @host: host owning this hardware interrupt 226 + * @hwirq: hardware irq number in that host space 227 + * 228 + * This is a slow path, for use by generic code. It's expected that an 229 + * irq controller implementation directly calls the appropriate low level 230 + * mapping function. 231 + */ 232 + extern unsigned int irq_find_mapping(struct irq_host *host, 233 + irq_hw_number_t hwirq); 234 + 235 + 236 + /*** 237 + * irq_radix_revmap - Find a linux virq from a hw irq number. 238 + * @host: host owning this hardware interrupt 239 + * @hwirq: hardware irq number in that host space 240 + * 241 + * This is a fast path, for use by irq controller code that uses radix tree 242 + * revmaps 243 + */ 244 + extern unsigned int irq_radix_revmap(struct irq_host *host, 245 + irq_hw_number_t hwirq); 246 + 247 + /*** 248 + * irq_linear_revmap - Find a linux virq from a hw irq number. 249 + * @host: host owning this hardware interrupt 250 + * @hwirq: hardware irq number in that host space 251 + * 252 + * This is a fast path, for use by irq controller code that uses linear 253 + * revmaps. It does fallback to the slow path if the revmap doesn't exist 254 + * yet and will create the revmap entry with appropriate locking 255 + */ 256 + 257 + extern unsigned int irq_linear_revmap(struct irq_host *host, 258 + irq_hw_number_t hwirq); 259 + 260 + 261 + 262 + /*** 263 + * irq_alloc_virt - Allocate virtual irq numbers 264 + * @host: host owning these new virtual irqs 265 + * @count: number of consecutive numbers to allocate 266 + * @hint: pass a hint number, the allocator will try to use a 1:1 mapping 267 + * 268 + * This is a low level function that is used internally by irq_create_mapping() 269 + * and that can be used by some irq controllers implementations for things 270 + * like allocating ranges of numbers for MSIs. The revmaps are left untouched. 271 + */ 272 + extern unsigned int irq_alloc_virt(struct irq_host *host, 273 + unsigned int count, 274 + unsigned int hint); 275 + 276 + /*** 277 + * irq_free_virt - Free virtual irq numbers 278 + * @virq: virtual irq number of the first interrupt to free 279 + * @count: number of interrupts to free 280 + * 281 + * This function is the opposite of irq_alloc_virt. It will not clear reverse 282 + * maps, this should be done previously by unmap'ing the interrupt. In fact, 283 + * all interrupts covered by the range being freed should have been unmapped 284 + * prior to calling this. 285 + */ 286 + extern void irq_free_virt(unsigned int virq, unsigned int count); 287 + 288 + 289 + /* -- OF helpers -- */ 290 + 291 + /* irq_create_of_mapping - Map a hardware interrupt into linux virq space 292 + * @controller: Device node of the interrupt controller 293 + * @inspec: Interrupt specifier from the device-tree 294 + * @intsize: Size of the interrupt specifier from the device-tree 295 + * 296 + * This function is identical to irq_create_mapping except that it takes 297 + * as input informations straight from the device-tree (typically the results 298 + * of the of_irq_map_*() functions 299 + */ 300 + extern unsigned int irq_create_of_mapping(struct device_node *controller, 301 + u32 *intspec, unsigned int intsize); 302 + 303 + 304 + /* irq_of_parse_and_map - Parse nad Map an interrupt into linux virq space 305 + * @device: Device node of the device whose interrupt is to be mapped 306 + * @index: Index of the interrupt to map 307 + * 308 + * This function is a wrapper that chains of_irq_map_one() and 309 + * irq_create_of_mapping() to make things easier to callers 310 + */ 311 + extern unsigned int irq_of_parse_and_map(struct device_node *dev, int index); 312 + 313 + /* -- End OF helpers -- */ 314 + 315 + /*** 316 + * irq_early_init - Init irq remapping subsystem 317 + */ 318 + extern void irq_early_init(void); 319 + 320 + static __inline__ int irq_canonicalize(int irq) 321 + { 322 + return irq; 323 + } 324 + 325 + 326 + #else /* CONFIG_PPC_MERGE */ 327 + 328 + /* This number is used when no interrupt has been assigned */ 18 329 #define NO_IRQ (-1) 330 + #define NO_IRQ_IGNORE (-2) 331 + 19 332 20 333 /* 21 334 * These constants are used for passing information about interrupt ··· 343 30 #define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ 344 31 #define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ 345 32 346 - #define get_irq_desc(irq) (&irq_desc[(irq)]) 347 - 348 - /* Define a way to iterate across irqs. */ 349 - #define for_each_irq(i) \ 350 - for ((i) = 0; (i) < NR_IRQS; ++(i)) 351 - 352 - #ifdef CONFIG_PPC64 353 - 354 - /* 355 - * Maximum number of interrupt sources that we can handle. 356 - */ 357 - #define NR_IRQS 512 358 - 359 - /* Interrupt numbers are virtual in case they are sparsely 360 - * distributed by the hardware. 361 - */ 362 - extern unsigned int virt_irq_to_real_map[NR_IRQS]; 363 - 364 - /* The maximum virtual IRQ number that we support. This 365 - * can be set by the platform and will be reduced by the 366 - * value of __irq_offset_value. It defaults to and is 367 - * capped by (NR_IRQS - 1). 368 - */ 369 - extern unsigned int virt_irq_max; 370 - 371 - /* Create a mapping for a real_irq if it doesn't already exist. 372 - * Return the virtual irq as a convenience. 373 - */ 374 - int virt_irq_create_mapping(unsigned int real_irq); 375 - void virt_irq_init(void); 376 - 377 - static inline unsigned int virt_irq_to_real(unsigned int virt_irq) 378 - { 379 - return virt_irq_to_real_map[virt_irq]; 380 - } 381 - 382 - extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq); 383 - 384 - /* 385 - * List of interrupt controllers. 386 - */ 387 - #define IC_INVALID 0 388 - #define IC_OPEN_PIC 1 389 - #define IC_PPC_XIC 2 390 - #define IC_CELL_PIC 3 391 - #define IC_ISERIES 4 392 - 393 - extern u64 ppc64_interrupt_controller; 394 - 395 - #else /* 32-bit */ 396 33 397 34 #if defined(CONFIG_40x) 398 35 #include <asm/ibm4xx.h> ··· 775 512 776 513 #endif /* CONFIG_8260 */ 777 514 778 - #endif 515 + #endif /* Whatever way too big #ifdef */ 779 516 780 517 #define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 781 518 /* pedantic: these are long because they are used with set_bit --RR */ 782 519 extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 783 - extern atomic_t ppc_n_lost_interrupts; 784 - 785 - #define virt_irq_create_mapping(x) (x) 786 - 787 - #endif 788 520 789 521 /* 790 522 * Because many systems have two overlapping names spaces for ··· 818 560 irq = 9; 819 561 return irq; 820 562 } 563 + #endif /* CONFIG_PPC_MERGE */ 821 564 822 565 extern int distribute_irqs; 823 566 ··· 838 579 839 580 extern void irq_ctx_init(void); 840 581 extern void call_do_softirq(struct thread_info *tp); 841 - extern int call___do_IRQ(int irq, struct pt_regs *regs, 842 - struct thread_info *tp); 843 - 582 + extern int call_handle_irq(int irq, void *p1, void *p2, 583 + struct thread_info *tp, void *func); 844 584 #else 845 585 #define irq_ctx_init() 846 586
+1 -1
include/asm-powerpc/machdep.h
··· 97 97 void (*show_percpuinfo)(struct seq_file *m, int i); 98 98 99 99 void (*init_IRQ)(void); 100 - int (*get_irq)(struct pt_regs *); 100 + unsigned int (*get_irq)(struct pt_regs *); 101 101 #ifdef CONFIG_KEXEC 102 102 void (*kexec_cpu_down)(int crash_shutdown, int secondary); 103 103 #endif
+32 -35
include/asm-powerpc/mpic.h
··· 114 114 #define MPIC_VEC_TIMER_1 248 115 115 #define MPIC_VEC_TIMER_0 247 116 116 117 - /* Type definition of the cascade handler */ 118 - typedef int (*mpic_cascade_t)(struct pt_regs *regs, void *data); 119 - 120 117 #ifdef CONFIG_MPIC_BROKEN_U3 121 118 /* Fixup table entry */ 122 119 struct mpic_irq_fixup ··· 129 132 /* The instance data of a given MPIC */ 130 133 struct mpic 131 134 { 135 + /* The device node of the interrupt controller */ 136 + struct device_node *of_node; 137 + 138 + /* The remapper for this MPIC */ 139 + struct irq_host *irqhost; 140 + 132 141 /* The "linux" controller struct */ 133 - hw_irq_controller hc_irq; 142 + struct irq_chip hc_irq; 143 + #ifdef CONFIG_MPIC_BROKEN_U3 144 + struct irq_chip hc_ht_irq; 145 + #endif 134 146 #ifdef CONFIG_SMP 135 - hw_irq_controller hc_ipi; 147 + struct irq_chip hc_ipi; 136 148 #endif 137 149 const char *name; 138 150 /* Flags */ ··· 150 144 unsigned int isu_size; 151 145 unsigned int isu_shift; 152 146 unsigned int isu_mask; 153 - /* Offset of irq vector numbers */ 154 - unsigned int irq_offset; 155 147 unsigned int irq_count; 156 - /* Offset of ipi vector numbers */ 157 - unsigned int ipi_offset; 158 148 /* Number of sources */ 159 149 unsigned int num_sources; 160 150 /* Number of CPUs */ 161 151 unsigned int num_cpus; 162 - /* cascade handler */ 163 - mpic_cascade_t cascade; 164 - void *cascade_data; 165 - unsigned int cascade_vec; 166 - /* senses array */ 152 + /* default senses array */ 167 153 unsigned char *senses; 168 154 unsigned int senses_count; 169 155 ··· 211 213 * The values in the array start at the first source of the MPIC, 212 214 * that is senses[0] correspond to linux irq "irq_offset". 213 215 */ 214 - extern struct mpic *mpic_alloc(unsigned long phys_addr, 216 + extern struct mpic *mpic_alloc(struct device_node *node, 217 + unsigned long phys_addr, 215 218 unsigned int flags, 216 219 unsigned int isu_size, 217 - unsigned int irq_offset, 218 220 unsigned int irq_count, 219 - unsigned int ipi_offset, 220 - unsigned char *senses, 221 - unsigned int senses_num, 222 221 const char *name); 223 222 224 223 /* Assign ISUs, to call before mpic_init() ··· 227 232 extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, 228 233 unsigned long phys_addr); 229 234 235 + /* Set default sense codes 236 + * 237 + * @mpic: controller 238 + * @senses: array of sense codes 239 + * @count: size of above array 240 + * 241 + * Optionally provide an array (indexed on hardware interrupt numbers 242 + * for this MPIC) of default sense codes for the chip. Those are linux 243 + * sense codes IRQ_TYPE_* 244 + * 245 + * The driver gets ownership of the pointer, don't dispose of it or 246 + * anything like that. __init only. 247 + */ 248 + extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count); 249 + 250 + 230 251 /* Initialize the controller. After this has been called, none of the above 231 252 * should be called again for this mpic 232 253 */ 233 254 extern void mpic_init(struct mpic *mpic); 234 - 235 - /* Setup a cascade. Currently, only one cascade is supported this 236 - * way, though you can always do a normal request_irq() and add 237 - * other cascades this way. You should call this _after_ having 238 - * added all the ISUs 239 - * 240 - * @irq_no: "linux" irq number of the cascade (that is offset'ed vector) 241 - * @handler: cascade handler function 242 - */ 243 - extern void mpic_setup_cascade(unsigned int irq_no, mpic_cascade_t hanlder, 244 - void *data); 245 255 246 256 /* 247 257 * All of the following functions must only be used after the ··· 284 284 void smp_mpic_message_pass(int target, int msg); 285 285 286 286 /* Fetch interrupt from a given mpic */ 287 - extern int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); 287 + extern unsigned int mpic_get_one_irq(struct mpic *mpic, struct pt_regs *regs); 288 288 /* This one gets to the primary mpic */ 289 - extern int mpic_get_irq(struct pt_regs *regs); 289 + extern unsigned int mpic_get_irq(struct pt_regs *regs); 290 290 291 291 /* Set the EPIC clock ratio */ 292 292 void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio); 293 293 294 294 /* Enable/Disable EPIC serial interrupt mode */ 295 295 void mpic_set_serial_int(struct mpic *mpic, int enable); 296 - 297 - /* global mpic for pSeries */ 298 - extern struct mpic *pSeries_mpic; 299 296 300 297 #endif /* __KERNEL__ */ 301 298 #endif /* _ASM_POWERPC_MPIC_H */
+89 -9
include/asm-powerpc/prom.h
··· 64 64 typedef u32 phandle; 65 65 typedef u32 ihandle; 66 66 67 - struct interrupt_info { 68 - int line; 69 - int sense; /* +ve/-ve logic, edge or level, etc. */ 70 - }; 71 - 72 67 struct property { 73 68 char *name; 74 69 int length; ··· 76 81 char *type; 77 82 phandle node; 78 83 phandle linux_phandle; 79 - int n_intrs; 80 - struct interrupt_info *intrs; 81 84 char *full_name; 82 85 83 86 struct property *properties; ··· 160 167 extern void early_init_devtree(void *); 161 168 extern int device_is_compatible(struct device_node *device, const char *); 162 169 extern int machine_is_compatible(const char *compat); 163 - extern unsigned char *get_property(struct device_node *node, const char *name, 164 - int *lenp); 170 + extern void *get_property(struct device_node *node, const char *name, 171 + int *lenp); 165 172 extern void print_properties(struct device_node *node); 166 173 extern int prom_n_addr_cells(struct device_node* np); 167 174 extern int prom_n_size_cells(struct device_node* np); ··· 196 203 * OF address retreival & translation 197 204 */ 198 205 206 + 207 + /* Helper to read a big number */ 208 + static inline u64 of_read_number(u32 *cell, int size) 209 + { 210 + u64 r = 0; 211 + while (size--) 212 + r = (r << 32) | *(cell++); 213 + return r; 214 + } 199 215 200 216 /* Translate an OF address block into a CPU physical address 201 217 */ ··· 241 239 242 240 /* CPU OF node matching */ 243 241 struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); 242 + 243 + 244 + /* 245 + * OF interrupt mapping 246 + */ 247 + 248 + /* This structure is returned when an interrupt is mapped. The controller 249 + * field needs to be put() after use 250 + */ 251 + 252 + #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ 253 + 254 + struct of_irq { 255 + struct device_node *controller; /* Interrupt controller node */ 256 + u32 size; /* Specifier size */ 257 + u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ 258 + }; 259 + 260 + /*** 261 + * of_irq_map_init - Initialize the irq remapper 262 + * @flags: flags defining workarounds to enable 263 + * 264 + * Some machines have bugs in the device-tree which require certain workarounds 265 + * to be applied. Call this before any interrupt mapping attempts to enable 266 + * those workarounds. 267 + */ 268 + #define OF_IMAP_OLDWORLD_MAC 0x00000001 269 + #define OF_IMAP_NO_PHANDLE 0x00000002 270 + 271 + extern void of_irq_map_init(unsigned int flags); 272 + 273 + /*** 274 + * of_irq_map_raw - Low level interrupt tree parsing 275 + * @parent: the device interrupt parent 276 + * @intspec: interrupt specifier ("interrupts" property of the device) 277 + * @addr: address specifier (start of "reg" property of the device) 278 + * @out_irq: structure of_irq filled by this function 279 + * 280 + * Returns 0 on success and a negative number on error 281 + * 282 + * This function is a low-level interrupt tree walking function. It 283 + * can be used to do a partial walk with synthetized reg and interrupts 284 + * properties, for example when resolving PCI interrupts when no device 285 + * node exist for the parent. 286 + * 287 + */ 288 + 289 + extern int of_irq_map_raw(struct device_node *parent, u32 *intspec, u32 *addr, 290 + struct of_irq *out_irq); 291 + 292 + 293 + /*** 294 + * of_irq_map_one - Resolve an interrupt for a device 295 + * @device: the device whose interrupt is to be resolved 296 + * @index: index of the interrupt to resolve 297 + * @out_irq: structure of_irq filled by this function 298 + * 299 + * This function resolves an interrupt, walking the tree, for a given 300 + * device-tree node. It's the high level pendant to of_irq_map_raw(). 301 + * It also implements the workarounds for OldWolrd Macs. 302 + */ 303 + extern int of_irq_map_one(struct device_node *device, int index, 304 + struct of_irq *out_irq); 305 + 306 + /*** 307 + * of_irq_map_pci - Resolve the interrupt for a PCI device 308 + * @pdev: the device whose interrupt is to be resolved 309 + * @out_irq: structure of_irq filled by this function 310 + * 311 + * This function resolves the PCI interrupt for a given PCI device. If a 312 + * device-node exists for a given pci_dev, it will use normal OF tree 313 + * walking. If not, it will implement standard swizzling and walk up the 314 + * PCI tree until an device-node is found, at which point it will finish 315 + * resolving using the OF tree walking. 316 + */ 317 + struct pci_dev; 318 + extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 319 + 244 320 245 321 #endif /* __KERNEL__ */ 246 322 #endif /* _POWERPC_PROM_H */
+1
include/asm-powerpc/spu.h
··· 117 117 struct list_head sched_list; 118 118 int number; 119 119 int nid; 120 + unsigned int irqs[3]; 120 121 u32 isrc; 121 122 u32 node; 122 123 u64 flags;
+4 -1
kernel/irq/chip.c
··· 261 261 * keep it masked and get out of here 262 262 */ 263 263 action = desc->action; 264 - if (unlikely(!action || (desc->status & IRQ_DISABLED))) 264 + if (unlikely(!action || (desc->status & IRQ_DISABLED))) { 265 + desc->status |= IRQ_PENDING; 265 266 goto out; 267 + } 266 268 267 269 desc->status |= IRQ_INPROGRESS; 270 + desc->status &= ~IRQ_PENDING; 268 271 spin_unlock(&desc->lock); 269 272 270 273 action_ret = handle_IRQ_event(irq, regs, action);
+1 -6
sound/aoa/core/snd-aoa-gpio-feature.c
··· 112 112 113 113 static void get_irq(struct device_node * np, int *irqptr) 114 114 { 115 - *irqptr = -1; 116 - if (!np) 117 - return; 118 - if (np->n_intrs != 1) 119 - return; 120 - *irqptr = np->intrs[0].line; 115 + *irqptr = irq_of_parse_and_map(np, 0); 121 116 } 122 117 123 118 /* 0x4 is outenable, 0x1 is out, thus 4 or 5 */
+4 -3
sound/aoa/soundbus/i2sbus/i2sbus-core.c
··· 129 129 if (strncmp(np->name, "i2s-", 4)) 130 130 return 0; 131 131 132 - if (np->n_intrs != 3) 132 + if (macio_irq_count(macio) != 3) 133 133 return 0; 134 134 135 135 dev = kzalloc(sizeof(struct i2sbus_dev), GFP_KERNEL); ··· 183 183 snprintf(dev->rnames[i], sizeof(dev->rnames[i]), rnames[i], np->name); 184 184 } 185 185 for (i=0;i<3;i++) { 186 - if (request_irq(np->intrs[i].line, ints[i], 0, dev->rnames[i], dev)) 186 + if (request_irq(macio_irq(macio, i), ints[i], 0, 187 + dev->rnames[i], dev)) 187 188 goto err; 188 - dev->interrupts[i] = np->intrs[i].line; 189 + dev->interrupts[i] = macio_irq(macio, i); 189 190 } 190 191 191 192 for (i=0;i<3;i++) {
+6 -10
sound/oss/dmasound/dmasound_awacs.c
··· 374 374 *gpio_pol = *pp; 375 375 else 376 376 *gpio_pol = 1; 377 - if (np->n_intrs > 0) 378 - return np->intrs[0].line; 379 - 380 - return 0; 377 + return irq_of_parse_and_map(np, 0); 381 378 } 382 379 383 380 static inline void ··· 2861 2864 * other info if necessary (early AWACS we want to read chip ids) 2862 2865 */ 2863 2866 2864 - if (of_get_address(io, 2, NULL, NULL) == NULL || io->n_intrs < 3) { 2867 + if (of_get_address(io, 2, NULL, NULL) == NULL) { 2865 2868 /* OK - maybe we need to use the 'awacs' node (on earlier 2866 2869 * machines). 2867 2870 */ 2868 2871 if (awacs_node) { 2869 2872 io = awacs_node ; 2870 - if (of_get_address(io, 2, NULL, NULL) == NULL || 2871 - io->n_intrs < 3) { 2873 + if (of_get_address(io, 2, NULL, NULL) == NULL) { 2872 2874 printk("dmasound_pmac: can't use %s\n", 2873 2875 io->full_name); 2874 2876 return -ENODEV; ··· 2936 2940 if (awacs_revision == AWACS_SCREAMER && awacs) 2937 2941 awacs_recalibrate(); 2938 2942 2939 - awacs_irq = io->intrs[0].line; 2940 - awacs_tx_irq = io->intrs[1].line; 2941 - awacs_rx_irq = io->intrs[2].line; 2943 + awacs_irq = irq_of_parse_and_map(io, 0); 2944 + awacs_tx_irq = irq_of_parse_and_map(io, 1); 2945 + awacs_rx_irq = irq_of_parse_and_map(io, 2); 2942 2946 2943 2947 /* Hack for legacy crap that will be killed someday */ 2944 2948 awacs_node = io;
+14 -19
sound/ppc/pmac.c
··· 1120 1120 struct snd_pmac *chip; 1121 1121 struct device_node *np; 1122 1122 int i, err; 1123 + unsigned int irq; 1123 1124 unsigned long ctrl_addr, txdma_addr, rxdma_addr; 1124 1125 static struct snd_device_ops ops = { 1125 1126 .dev_free = snd_pmac_dev_free, ··· 1154 1153 if (chip->is_k2) { 1155 1154 static char *rnames[] = { 1156 1155 "Sound Control", "Sound DMA" }; 1157 - if (np->n_intrs < 3) { 1158 - err = -ENODEV; 1159 - goto __error; 1160 - } 1161 1156 for (i = 0; i < 2; i ++) { 1162 1157 if (of_address_to_resource(np->parent, i, 1163 1158 &chip->rsrc[i])) { ··· 1182 1185 } else { 1183 1186 static char *rnames[] = { 1184 1187 "Sound Control", "Sound Tx DMA", "Sound Rx DMA" }; 1185 - if (np->n_intrs < 3) { 1186 - err = -ENODEV; 1187 - goto __error; 1188 - } 1189 1188 for (i = 0; i < 3; i ++) { 1190 1189 if (of_address_to_resource(np, i, 1191 1190 &chip->rsrc[i])) { ··· 1213 1220 chip->playback.dma = ioremap(txdma_addr, 0x100); 1214 1221 chip->capture.dma = ioremap(rxdma_addr, 0x100); 1215 1222 if (chip->model <= PMAC_BURGUNDY) { 1216 - if (request_irq(np->intrs[0].line, snd_pmac_ctrl_intr, 0, 1223 + irq = irq_of_parse_and_map(np, 0); 1224 + if (request_irq(irq, snd_pmac_ctrl_intr, 0, 1217 1225 "PMac", (void*)chip)) { 1218 - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[0].line); 1226 + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", 1227 + irq); 1219 1228 err = -EBUSY; 1220 1229 goto __error; 1221 1230 } 1222 - chip->irq = np->intrs[0].line; 1231 + chip->irq = irq; 1223 1232 } 1224 - if (request_irq(np->intrs[1].line, snd_pmac_tx_intr, 0, 1225 - "PMac Output", (void*)chip)) { 1226 - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[1].line); 1233 + irq = irq_of_parse_and_map(np, 1); 1234 + if (request_irq(irq, snd_pmac_tx_intr, 0, "PMac Output", (void*)chip)){ 1235 + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq); 1227 1236 err = -EBUSY; 1228 1237 goto __error; 1229 1238 } 1230 - chip->tx_irq = np->intrs[1].line; 1231 - if (request_irq(np->intrs[2].line, snd_pmac_rx_intr, 0, 1232 - "PMac Input", (void*)chip)) { 1233 - snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", np->intrs[2].line); 1239 + chip->tx_irq = irq; 1240 + irq = irq_of_parse_and_map(np, 2); 1241 + if (request_irq(irq, snd_pmac_rx_intr, 0, "PMac Input", (void*)chip)) { 1242 + snd_printk(KERN_ERR "pmac: unable to grab IRQ %d\n", irq); 1234 1243 err = -EBUSY; 1235 1244 goto __error; 1236 1245 } 1237 - chip->rx_irq = np->intrs[2].line; 1246 + chip->rx_irq = irq; 1238 1247 1239 1248 snd_pmac_sound_feature(chip, 1); 1240 1249
+4 -4
sound/ppc/tumbler.c
··· 1121 1121 DBG("(I) GPIO device %s found, offset: %x, active state: %d !\n", 1122 1122 device, gp->addr, gp->active_state); 1123 1123 1124 - return (node->n_intrs > 0) ? node->intrs[0].line : 0; 1124 + return irq_of_parse_and_map(node, 0); 1125 1125 } 1126 1126 1127 1127 /* reset audio */ ··· 1264 1264 &mix->line_mute, 1); 1265 1265 irq = tumbler_find_device("headphone-detect", 1266 1266 NULL, &mix->hp_detect, 0); 1267 - if (irq < 0) 1267 + if (irq <= NO_IRQ) 1268 1268 irq = tumbler_find_device("headphone-detect", 1269 1269 NULL, &mix->hp_detect, 1); 1270 - if (irq < 0) 1270 + if (irq <= NO_IRQ) 1271 1271 irq = tumbler_find_device("keywest-gpio15", 1272 1272 NULL, &mix->hp_detect, 1); 1273 1273 mix->headphone_irq = irq; 1274 1274 irq = tumbler_find_device("line-output-detect", 1275 1275 NULL, &mix->line_detect, 0); 1276 - if (irq < 0) 1276 + if (irq <= NO_IRQ) 1277 1277 irq = tumbler_find_device("line-output-detect", 1278 1278 NULL, &mix->line_detect, 1); 1279 1279 mix->lineout_irq = irq;